本文整理汇总了PHP中PFUser::getLdapId方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::getLdapId方法的具体用法?PHP PFUser::getLdapId怎么用?PHP PFUser::getLdapId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::getLdapId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportUser
public function exportUser(PFUser $user, SimpleXMLElement $members_node, $child_name)
{
if ($user->getLdapId()) {
$member_node = $members_node->addChild($child_name, $user->getLdapId());
$member_node->addAttribute('format', 'ldap');
} else {
$member_node = $members_node->addChild($child_name, $user->getUserName());
$member_node->addAttribute('format', 'username');
}
}
示例2: getLdapFromUser
/**
* Get LDAPResult object corresponding to a User object
*
* @param PFUser $user
* @return LDAPResult
*/
function getLdapFromUser($user)
{
if ($user && !$user->isAnonymous()) {
return $this->getLdapFromLdapId($user->getLdapId());
} else {
return false;
}
}
示例3: createAccount
/**
* Create new account
*
* @param PFUser $user
*
* @return PFUser
*/
function createAccount($user)
{
$dao = $this->getDao();
$user_id = $dao->create($user->getUserName(), $user->getEmail(), $user->getPassword(), $user->getRealName(), $user->getRegisterPurpose(), $user->getStatus(), $user->getShell(), $user->getUnixStatus(), $user->getUnixUid(), $user->getUnixBox(), $user->getLdapId(), $_SERVER['REQUEST_TIME'], $user->getConfirmHash(), $user->getMailSiteUpdates(), $user->getMailVA(), $user->getStickyLogin(), $user->getAuthorizedKeys(), $user->getNewMail(), $user->getTimeZone(), $user->getTheme(), $user->getLanguageID(), $user->getExpiryDate(), $_SERVER['REQUEST_TIME']);
if (!$user_id) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_exit', 'error'));
return 0;
} else {
$user->setId($user_id);
$this->assignNextUnixUid($user);
$em = $this->_getEventManager();
$em->processEvent(Event::USER_MANAGER_CREATE_ACCOUNT, array('user' => $user));
// Create the first layout for the user and add some initial widgets
$lm = $this->_getWidgetLayoutManager();
$lm->createDefaultLayoutForUser($user_id);
switch ($user->getStatus()) {
case PFUser::STATUS_PENDING:
if (ForgeConfig::get('sys_user_approval')) {
$this->pending_user_notifier->notifyAdministrator($user);
}
break;
case PFUser::STATUS_ACTIVE:
case PFUser::STATUS_RESTRICTED:
$em->processEvent('project_admin_activate_user', array('user_id' => $user_id));
break;
}
return $user;
}
}