本文整理汇总了PHP中CUser::overrideDatabase方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::overrideDatabase方法的具体用法?PHP CUser::overrideDatabase怎么用?PHP CUser::overrideDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::overrideDatabase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_preUpdate
protected function hook_preUpdate()
{
$this->perm_func = 'updateLogin';
$tmpUser = new CUser();
$tmpUser->overrideDatabase($this->_query);
$tmpUser->load($this->user_id);
if ('' == trim($this->user_password)) {
$this->user_password = $tmpUser->user_password;
} elseif ($tmpUser->user_password != $this->authenticator->hashPassword($this->user_password)) {
$this->user_password = $this->authenticator->hashPassword($this->user_password);
} else {
$this->user_password = $tmpUser->user_password;
}
parent::hook_preUpdate();
}
示例2: notifyOwner
public function notifyOwner($isNotNew)
{
$user = new CUser();
$user->overrideDatabase($this->_query);
$user->loadFull($this->project_owner);
$subject = intval($isNotNew) ? $this->_AppUI->_('Project updated') . ': ' . $this->project_name : $this->_AppUI->_('Project submitted') . ': ' . $this->project_name;
$emailManager = new w2p_Output_EmailManager($this->_AppUI);
$body = $emailManager->getProjectNotify($this, $isNotNew);
$mail = new w2p_Utilities_Mail();
$mail->To($user->user_email, true);
$mail->Subject($subject);
$mail->Body($body, isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : '');
$mail->Send();
}