本文整理汇总了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;
}