| Server IP : 77.37.53.228 / 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/models/ |
Upload File : |
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class Login_model extends CI_Model
{
/**
* This function used to check the login credentials of the user
* @param string $email : This is email of the user
* @param string $password : This is encrypted password of the user
*/
function authenticate($email, $password)
{
$this->db->select('tbl_users.email, tbl_users.password, tbl_users.fullname');
$this->db->from('tbl_users');
$this->db->where('tbl_users.email', $email);
$query = $this->db->get();
$user = $query->result();
if(!empty($user)){
if(verifyHashedPassword($password, $user[0]->password)){
return $user;
} else {
return array();
}
} else {
return array();
}
}
/**
* This function used to check email exists or not
* @param {string} $email : This is users email id
* @return {boolean} $result : TRUE/FALSE
*/
function checkEmailExist($email)
{
$this->db->select('email');
$this->db->where('email', $email);
$this->db->where('isDeleted', 0);
$query = $this->db->get('tbl_users');
if ($query->num_rows() > 0){
return true;
} else {
return false;
}
}
/**
* This function used to insert reset password data
* @param {array} $data : This is reset password data
* @return {boolean} $result : TRUE/FALSE
*/
function resetPasswordUser($data)
{
$result = $this->db->insert('tbl_reset_password', $data);
if($result) {
return TRUE;
} else {
return FALSE;
}
}
/**
* This function used to check correct activation deatails for forget password.
* @param string $email : Email id of user
* @param string $activation_id : This is activation string
*/
function checkActivationDetails($email, $activation_id)
{
$this->db->select('id');
$this->db->from('tbl_reset_password');
$this->db->where('email', $email);
$this->db->where('activation_id', $activation_id);
$query = $this->db->get();
return $query->num_rows;
}
// This function used to create new password by reset link
function createPasswordUser($email, $password)
{
$this->db->where('email', $email);
$this->db->where('isDeleted', 0);
$this->db->update('tbl_users', array('password'=>getHashedPassword($password)));
$this->db->delete('tbl_reset_password', array('email'=>$email));
}
}
?>
Anon7 - 2022
AnonSec Team
