Ejemplo n.º 1
0
 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']);
     }
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 4
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'post_reply';
 }
Ejemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'teacher';
 }
Ejemplo n.º 6
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'file';
 }
Ejemplo n.º 7
0
 function __construct()
 {
     global $config;
     parent::__construct($config['db_prefix'] . "Task");
 }
Ejemplo n.º 8
0
 public function __construct(DbAdapter $zendDb, $tableName = null, $identityColumn = null, $credentialColumn = null)
 {
     parent::__construct($zendDb, $tableName, $identityColumn, $credentialColumn);
 }
Ejemplo n.º 9
0
 function __construct()
 {
     parent::__construct('donations');
 }
Ejemplo n.º 10
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'task_submit';
 }
Ejemplo n.º 11
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'materials';
 }
Ejemplo n.º 12
0
 function __construct()
 {
     global $config;
     parent::__construct($config['db_prefix'] . "Reminder");
 }
Ejemplo n.º 13
0
 function __construct()
 {
     parent::__construct();
     $this->_tablename = 'student';
 }
Ejemplo n.º 14
0
 /**
  * Constructor
  * Arguments : None
  */
 function __construct()
 {
     parent::__construct("Comic");
 }
Ejemplo n.º 15
0
 /**
  * Constructor
  * Arguments : None
  */
 function __construct()
 {
     parent::__construct("Task");
 }