function User() { global $sql; $this->cookie_expire = time() + 60 * 60 * 24 * 30; //Will expire in 30 days parent::__construct("User"); if (isset($_SESSION['user_id']) and isset($_SESSION['user_name'])) { $this->setCurrentUser($_SESSION['user_id'], $_SESSION['user_name']); return; //User logged in already. } //This is a User who have enabled the 'Remember me' Option - so there is a cookie in the users system if (isset($_COOKIE['username']) and $_COOKIE['username'] and isset($_COOKIE['password_hash'])) { $user_details = $sql->getAssoc("SELECT id,name FROM User WHERE email='{$_COOKIE['username']}' AND MD5(CONCAT(password,'#c*2u!'))='{$_COOKIE['password_hash']}'"); if ($user_details) { //If it is valid, store it in session $this->setCurrentUser($user_details['id'], $_COOKIE['username'], $user_details['name']); } else { //The user details in the cookie is invalid - force a logout to clear cookie $this->logout(); } } else { unset($_SESSION['user_id']); unset($_SESSION['user_name']); } }
function __construct($user_id = 0) { global $sql; parent::__construct('users'); if ($user_id) { $this->user = $this->find($user_id); if ($this->user) { $this->user['name'] = $this->user['first_name'] . ' ' . $this->user['last_name']; } else { $this->_error("Can't find user with ID {$user_id}."); } } }
function __construct($profile, $use_sqlsrv = false) { parent::__construct($this->use_sqlsrv); $this->profile = $profile; $this->use_sqlsrv = $use_sqlsrv; if (!$this->use_sqlsrv) { $db = DBMysql::getInstance(); $db->setQuery('SET NAMES "utf8"'); } else { $db = DBSqlsrv::getInstance(); $db->setQuery('SET NAMES "utf8"'); } $db->query(); }
function __construct() { parent::__construct(); $this->_tablename = 'post_reply'; }
function __construct() { parent::__construct(); $this->_tablename = 'teacher'; }
function __construct() { parent::__construct(); $this->_tablename = 'file'; }
function __construct() { global $config; parent::__construct($config['db_prefix'] . "Task"); }
public function __construct(DbAdapter $zendDb, $tableName = null, $identityColumn = null, $credentialColumn = null) { parent::__construct($zendDb, $tableName, $identityColumn, $credentialColumn); }
function __construct() { parent::__construct('donations'); }
function __construct() { parent::__construct(); $this->_tablename = 'task_submit'; }
function __construct() { parent::__construct(); $this->_tablename = 'materials'; }
function __construct() { global $config; parent::__construct($config['db_prefix'] . "Reminder"); }
function __construct() { parent::__construct(); $this->_tablename = 'student'; }
/** * Constructor * Arguments : None */ function __construct() { parent::__construct("Comic"); }
/** * Constructor * Arguments : None */ function __construct() { parent::__construct("Task"); }