ria/app/Controllers/Error.php
2024-09-11 08:54:25 +05:30

48 lines
946 B
PHP
Executable File

<?php
namespace App\Controllers;
use App\Controllers\BaseController;
/**
* Module : Error
* Error class to control to All type of Error.
* @author : Kishor
* @version : 1.1
* @since : 15 November 2016
* @example : Revised at 15th april 2024
*/
class Error extends BaseController
{
protected $session;
/**
* This is default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->session = session();
}
/**
* Index Page for this controller.
*/
public function index()
{
$this->isLoggedIn();
}
/**
* This function used to check the user is logged in or not
*/
function isLoggedIn()
{
$isLoggedIn = $this->session->get('isLoggedIn');
if (!isset($isLoggedIn) || $isLoggedIn != TRUE) {
view('login');
} else {
redirect('pageNotFound');
}
}
}