Example #1
0
 public function __construct()
 {
     parent::__construct();
     chk_admin();
     /**
      * set headers to prevent back after logout
      */
     $this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:i:s') . 'GMT');
     $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
     $this->output->set_header('Cache-Control: post-check=0, pre-check=0', false);
     $this->output->set_header('Pragma: no-cache');
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     chk_admin();
     $this->load->model('organizations_model');
     /**
      * set headers to prevent back after logout
      */
     $this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:i:s') . 'GMT');
     $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
     $this->output->set_header('Cache-Control: post-check=0, pre-check=0', false);
     $this->output->set_header('Pragma: no-cache');
     //flashdata to redirect to the same page
     $this->session->set_flashdata('redirectToCurrent', current_url());
 }
		$row=mysql_fetch_array($result);
		if($row['studpassword']==$pass)
		{
			$_SESSION['cuser']=$user;
			$_SESSION['role']=$category;
 			$_SESSION['sem']=$row['studsemester'];
			login_log($user);
			header("location: ./student/home.php");			
		}
		else
		{
			header("location: ./index.php?msg=Invalid Username or Password");
		}
	}
	else
	{
		$result=mysql_query("select * from staff where staffloginid='$user'");
		$row=mysql_fetch_array($result);
		if($row['staffpassword']==$pass)
		{
			$_SESSION['cuser']=$user;
			chk_admin($user);
			login_log($user);
			header("location: ./staff/home.php");			
		}
		else
		{
			header("location: ./index.php?msg=Invalid Username or Password");
		}
	}
?>