| Server IP : 91.108.98.166 / Your IP :
216.73.216.109 [
Web Server : LiteSpeed System : Linux nl-srv-web1124.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u964240598 ( 964240598) PHP Version : 8.4.19 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u964240598/domains/hofam.org/public_html/churchapp/application/controllers/ |
Upload File : |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends CI_Controller {
/**
* Index Page for this controller.
*/
public function index()
{
$this->load->library('session');
$this->load->helper('url_helper');
$isLoggedIn = $this->session->userdata('isLoggedIn');
if(!isset($isLoggedIn) || $isLoggedIn != TRUE)
{
$this->load->view('login');
}
else
{
header('location:dashboard');
}
}
/**
* This function used to logged in user
*/
public function authenticate()
{
$this->load->model('login_model');
$this->load->library('session');
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required|trim');
$this->form_validation->set_rules('password', 'Password', 'required|max_length[32]');
if($this->form_validation->run() == FALSE)
{
$this->index();
}
else
{
$email = $this->input->post('email');
$password = $this->input->post('password');
$result = $this->login_model->authenticate($email, $password);
if(count((array)$result) > 0)
{
foreach ($result as $res)
{
$sessionArray = array(
'userId' => $res->email,
'isLoggedIn' => TRUE
);
$this->session->set_userdata($sessionArray);
redirect('/dashboard');
}
}
else
{
$this->session->set_flashdata('error', 'Email or password mismatch');
redirect('/login');
}
}
}
}
Anon7 - 2022
AnonSec Team
