示例#1
0
 /**
  * Writes current values for user back to the database.
  *
  * @return bool true on success or false on failure
  *
  * @access private
  */
 function _updateUserData()
 {
     if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) {
         return true;
     }
     $query = 'UPDATE ' . $this->prefix . $this->alias['users'] . '
              SET ' . $this->alias['lastlogin'] . '=' . $this->dbc->getValue($this->fields['lastlogin'], MDB_Date::unix2Mdbstamp($this->currentLogin)) . '
              WHERE ' . $this->alias['auth_user_id'] . '=' . $this->dbc->getValue($this->fields['auth_user_id'], $this->propertyValues['auth_user_id']);
     $result = $this->dbc->query($query);
     if (PEAR::isError($result)) {
         $this->stack->push(LIVEUSER_ERROR, 'exception', array('reason' => $result->getMessage() . '-' . $result->getUserInfo()));
         return false;
     }
     return true;
 }
示例#2
0
 /**
  * Writes current values for user back to the database.
  * This method does nothing in the base class and is supposed to
  * be overridden in subclasses according to the supported backend.
  *
  * @access private
  * @return mixed true or an MDB error object
  */
 function _updateUserData()
 {
     if (!$this->init_ok) {
         return false;
     }
     if (isset($this->authTableCols['optional']['lastlogin'])) {
         $sql = 'UPDATE ' . $this->authTable . '
                  SET ' . $this->authTableCols['optional']['lastlogin']['name'] . '=' . $this->dbc->getValue($this->authTableCols['optional']['lastlogin']['type'], MDB_Date::unix2Mdbstamp($this->currentLogin)) . '
                  WHERE ' . $this->authTableCols['required']['auth_user_id']['name'] . '=' . $this->dbc->getValue($this->authTableCols['required']['auth_user_id']['type'], $this->authUserId);
         $res = $this->dbc->query($sql);
         return $res;
     } else {
         return false;
     }
 }
示例#3
0
 /**
  * convert a date into a MDB timestamp
  *
  * @param integer $hour hour of the date
  * @param integer $minute minute of the date
  * @param integer $second second of the date
  * @param integer $month month of the date
  * @param integer $day day of the date
  * @param integer $year year of the date
  * @return string a valid MDB timestamp
  * @access public
  */
 function date2Mdbstamp($hour = NULL, $minute = NULL, $second = NULL, $month = NULL, $day = NULL, $year = NULL)
 {
     return MDB_Date::unix2Mdbstamp(mktime($hour, $minute, $second, $month, $day, $year));
 }