本文整理汇总了PHP中UserDao::searchSSHKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::searchSSHKeys方法的具体用法?PHP UserDao::searchSSHKeys怎么用?PHP UserDao::searchSSHKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDao
的用法示例。
在下文中一共展示了UserDao::searchSSHKeys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dumpSSHKeys
/**
* Dump ssh keys into gitolite conf
*/
public function dumpSSHKeys(User $user = null)
{
if (is_dir($this->getAdminPath())) {
if ($user) {
$this->initUserKeys($user);
$commit_msg = 'Update ' . $user->getUserName() . ' (Id: ' . $user->getId() . ') SSH keys';
} else {
$userdao = new UserDao();
foreach ($userdao->searchSSHKeys() as $row) {
$user = new User($row);
$this->initUserKeys($user);
}
$commit_msg = 'SystemEvent update all user keys';
}
$this->gitExec->add('keydir');
$this->gitExec->commit($commit_msg);
return $this->push();
}
return false;
}
示例2: dumpSSHKeys
/**
* dumps SSH authorized_keys into all users homedirs
*
* @return boolean always true
*/
public function dumpSSHKeys()
{
$user_dao = new UserDao();
$user_manager = $this->getUserManager();
foreach ($user_dao->searchSSHKeys() as $row) {
$this->writeSSHKeys($user_manager->getUserInstanceFromRow($row));
}
EventManager::instance()->processEvent(Event::DUMP_SSH_KEYS, null);
return true;
}