本文整理汇总了PHP中users::restoreAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP users::restoreAccount方法的具体用法?PHP users::restoreAccount怎么用?PHP users::restoreAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::restoreAccount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
if (users::getAttr('user_type') != User::TYPE_SYSTEM_ADMIN) {
message::set('You are not authorized to add an account!');
$this->returnQtipAjaxForm(NULL);
url::redirect(Router::$controller);
} else {
users::restoreAccount();
}
parent::create();
}
示例2: cleanup
public static function cleanup()
{
if (users::isAuthentic('account_id')) {
return;
}
if (!users::isAuthentic('user_id')) {
return;
}
$baseController = Session::instance()->get('ajax.base_controller', '');
if (strcasecmp($baseController, 'accountmanager')) {
kohana::log('debug', 'Account manager is restoring the account masquerade');
users::restoreAccount();
}
}
示例3: account
public function account($account_id = NULL, $redirect = TRUE)
{
if ($account_id && users::masqueradeAccount($account_id)) {
$masquerade_account = TRUE;
}
$loadedModels = Doctrine::getLoadedModels();
$driver = Telephony::getDriver();
$driverName = get_class($driver);
if (!$driver) {
message::set('Can not rebuild configuration, no telephony driver active');
} else {
try {
foreach ($loadedModels as $model) {
$modelDriverName = $driverName . '_' . $model . '_Driver';
if (!class_exists($modelDriverName, TRUE)) {
continue;
}
$outputRows = Doctrine::getTable($model)->findAll();
foreach ($outputRows as $outputRow) {
Telephony::set($outputRow, $outputRow->identifier());
}
}
Telephony::save();
Telephony::commit();
$account = Doctrine::getTable('Account')->find(users::getAttr('account_id'));
parent::save_succeeded($account);
message::set(users::getAttr('Account', 'name') . ' configuration rebuild complete!', 'success');
} catch (Exception $e) {
message::set($e->getMessage());
}
}
if (!empty($masquerade_account)) {
users::restoreAccount();
}
$this->returnQtipAjaxForm();
if ($redirect) {
url::redirect(Router_Core::$controller);
}
}