本文整理汇总了PHP中PFUser::getAuthorizedKeysRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::getAuthorizedKeysRaw方法的具体用法?PHP PFUser::getAuthorizedKeysRaw怎么用?PHP PFUser::getAuthorizedKeysRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::getAuthorizedKeysRaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(PFUser $owner, $id, $url, $hostname, $name)
{
$this->id = $id;
$this->url = $url;
$this->hostname = $hostname;
$this->owner = $owner;
$this->name = $name;
$this->ssh_key = $owner->getAuthorizedKeysRaw() ? $owner->getAuthorizedKeysRaw() : '';
$this->owner_name = $owner->getName();
$this->owner_id = $owner->getId();
}
示例2: updateUserSSHKeys
/**
* Update ssh keys for a user
*
* Should probably be merged with updateDb but I don't know the impact of
* validating keys each time we update a user
*
* @param PFUser $user
* @param String $keys
*/
public function updateUserSSHKeys(PFUser $user, array $keys)
{
$original_authorised_keys = $user->getAuthorizedKeysRaw();
$user->setAuthorizedKeys(implode(PFUser::SSH_KEY_SEPARATOR, $keys));
if ($this->updateDb($user)) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('account_editsshkeys', 'update_filesystem'));
$event_parameters = array('user_id' => $user->getId(), 'original_keys' => $original_authorised_keys);
$this->_getEventManager()->processEvent(Event::EDIT_SSH_KEYS, $event_parameters);
}
}