* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3 * @package SWDB */ require_once(PATH::PAGE . "Page.php"); /** * Landing (login) page model. * * @category Page */ class Landing_Page extends Page{ /** * @var bool Indicates if the user has been redirected to this page after an error. */ private $is_error = false; /** * @var string Error message to show when login was unsuccesfull and * the user is back in the login page */ private $error_message = ""; /** * Constructor. * * Retrieves the data and initializes the variables. */ public function __construct(){ $this->view = PATH::VIEW . "landing.php"; $this->title = "Login - SWDB"; $this->description = "Login to SWDB"; $this->canonical = URL::BASE . "landing/"; if (http_response_code() == 401){ $this->is_error = true; $this->error_message = "Invalid credentials"; } } /** * Checks if a error has redirected the user to shis page. * * @return bool True if there was an error, false otherwise */ public function is_error(){ return $this->is_error; } /** * Retrieves the error message to show. * * @return string Error message. */ public function get_error_message(){ return $this->error_message; } }