當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UsersPeer::getUserId方法代碼示例

本文整理匯總了PHP中UsersPeer::getUserId方法的典型用法代碼示例。如果您正苦於以下問題:PHP UsersPeer::getUserId方法的具體用法?PHP UsersPeer::getUserId怎麽用?PHP UsersPeer::getUserId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UsersPeer的用法示例。


在下文中一共展示了UsersPeer::getUserId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     parent::init();
     // Verify we're on the correct database
     //print_r(coreConfig::get('database_connection'));exit;
     $connectionInfo = coreConfig::get('database_connection');
     $this->verbose("Using database: %s", $connectionInfo['database']);
     $username = trim($this->getOption('u'));
     $raw_password = trim($this->getOption('p'));
     if (empty($username) || empty($raw_password)) {
         $this->throwError('Username or password is empty.');
     }
     $userid = UsersPeer::getUserId($username);
     if (false === $userid) {
         $this->throwError('User named "%s" not found.', $username);
     }
     $this->verbose("Userid: %s", $userid);
     $this->verbose("Set password to: %s", $raw_password);
     $this->updateUser($userid, array('raw_password' => $raw_password));
     // only with linked PunBB forum
     if ($this->args->flag('forum')) {
         if (coreConfig::get('app_path_to_punbb') !== null) {
             PunBBUsersPeer::setPassword($username, $raw_password);
         } else {
             $this->throwError('Forum password: "app_path_to_punbb" is not defined in environment "%s"', CORE_ENVIRONMENT);
         }
     }
     $this->verbose('Success!');
 }
開發者ID:nikitakit,項目名稱:RevTK,代碼行數:29,代碼來源:setpassword.php

示例2: changePassword

 /**
  * Update the user password in the main site and forum databases.
  * 
  * @param string $user
  * @param string $raw_password
  */
 public function changePassword($username, $raw_password)
 {
     $user_id = UsersPeer::getUserId($username);
     $columns = array('raw_password' => $raw_password);
     UsersPeer::updateUser($user_id, $columns);
     // set new password on forum account (not in staging)
     if (coreContext::getInstance()->getConfiguration()->getEnvironment() !== 'staging') {
         // only with linked PunBB forum
         if (coreConfig::get('app_path_to_punbb') !== null) {
             PunBBUsersPeer::updateUser($username, $columns);
         }
     }
 }
開發者ID:krisodb,項目名稱:RevTK,代碼行數:19,代碼來源:rtkUser.php

示例3: changePassword

 /**
  * Update the user password in the main site and forum databases.
  * 
  * @param object $user
  * @param object $raw_password
  */
 public function changePassword($username, $raw_password)
 {
     // hash password for database
     $hashedPassword = $this->getSaltyHashedPassword($raw_password);
     // set new user password
     $user_id = UsersPeer::getUserId($username);
     UsersPeer::setPassword($user_id, $hashedPassword);
     // set new password on forum account (not in staging)
     if (coreContext::getInstance()->getConfiguration()->getEnvironment() !== 'staging') {
         // only with linked PunBB forum
         if (coreConfig::get('app_path_to_punbb') !== null) {
             PunBBUsersPeer::setPassword($username, $raw_password);
         }
     }
 }
開發者ID:nikitakit,項目名稱:RevTK,代碼行數:21,代碼來源:rtkUser.php


注:本文中的UsersPeer::getUserId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。