本文整理匯總了PHP中sfGuardUser::setIsSuperAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfGuardUser::setIsSuperAdmin方法的具體用法?PHP sfGuardUser::setIsSuperAdmin怎麽用?PHP sfGuardUser::setIsSuperAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfGuardUser
的用法示例。
在下文中一共展示了sfGuardUser::setIsSuperAdmin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* @see sfTask
*/
protected function execute($arguments = array(), $options = array())
{
$databaseManager = new sfDatabaseManager($this->configuration);
$user = new sfGuardUser();
$user->setUsername($arguments['username']);
$user->setPassword($arguments['password']);
$user->setIsActive(true);
$user->setIsSuperAdmin(true);
$user->save();
$this->logSection('guard', sprintf('Create user "%s"', $arguments['username']));
}
示例2: execute
/**
* @see sfTask
*/
protected function execute($arguments = array(), $options = array())
{
$databaseManager = new sfDatabaseManager($this->configuration);
$user = new sfGuardUser();
$user->setEmailAddress($arguments['email_address']);
$user->setUsername($arguments['username']);
$user->setPassword($arguments['password']);
$user->setFirstName($arguments['first_name']);
$user->setLastName($arguments['last_name']);
$user->setIsActive(true);
$user->setIsSuperAdmin($options['is-super-admin']);
$user->save();
$this->logSection('guard', sprintf('Create user "%s"', $arguments['username']));
}
示例3: getTaskUser
/**
* DOCUMENT ME
* @return mixed
*/
public static function getTaskUser()
{
$user = Doctrine::getTable('sfGuardUser')->findOneByUsername('ataskuser');
if (!$user) {
$user = new sfGuardUser();
$user->setUsername('ataskuser');
// Set a good unique password just in case someone cluelessly sets the active flag.
// This further ensures that no one can ever log in with this account
$user->setPassword(aGuid::generate());
// Prevents normal login
$user->setIsActive(false);
$user->setIsSuperAdmin(true);
$user->save();
}
return $user;
}