当前位置: 首页>>代码示例>>PHP>>正文


PHP PFUser::setLanguageID方法代码示例

本文整理汇总了PHP中PFUser::setLanguageID方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::setLanguageID方法的具体用法?PHP PFUser::setLanguageID怎么用?PHP PFUser::setLanguageID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PFUser的用法示例。


在下文中一共展示了PFUser::setLanguageID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createAccount

 /**
  * Create user account based on LDAP info.
  *
  * @param  String $eduid
  * @param  String $uid
  * @param  String $cn
  * @param  String $email
  * @return PFUser
  */
 function createAccount($eduid, $uid, $cn, $email)
 {
     if (trim($uid) == '' || trim($eduid) == '') {
         return false;
     }
     $user = new PFUser();
     $user->setUserName($this->generateLogin($uid));
     $user->setLdapId($eduid);
     $user->setRealName($cn);
     $user->setEmail($email);
     $mail_confirm_code_generator = new MailConfirmationCodeGenerator($this->getUserManager(), new RandomNumberGenerator());
     $mail_confirm_code = $mail_confirm_code_generator->getConfirmationCode();
     $user->setConfirmHash($mail_confirm_code);
     // Default LDAP
     $user->setStatus($this->getLdap()->getLDAPParam('default_user_status'));
     $user->setRegisterPurpose('LDAP');
     $user->setUnixStatus('S');
     $user->setTimezone('GMT');
     $user->setLanguageID($GLOBALS['Language']->getText('conf', 'language_id'));
     $um = $this->getUserManager();
     $u = $um->createAccount($user);
     if ($u) {
         $u = $um->getUserById($user->getId());
         // Create an entry in the ldap user db
         $ldapUserDao = $this->getDao();
         $ldapUserDao->createLdapUser($u->getId(), 0, $uid);
         return $u;
     }
     return false;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:39,代码来源:LDAP_UserManager.class.php

示例2: createAccount

 /**
  * Create user account based on LDAP info.
  *
  * @param  String $eduid
  * @param  String $uid
  * @param  String $cn
  * @param  String $email
  * @return PFUser
  */
 function createAccount($eduid, $uid, $cn, $email)
 {
     if (trim($uid) == '' || trim($eduid) == '') {
         return false;
     }
     $user = new PFUser();
     $user->setUserName($this->generateLogin($uid));
     $user->setLdapId($eduid);
     $user->setRealName($cn);
     $user->setEmail($email);
     // Generates a pseudo-random password. Its not full secure but its
     // better than nothing.
     $user->setPassword(md5((string) mt_rand(10000, 999999) . time()));
     // Default LDAP
     $user->setStatus($this->getLdap()->getLDAPParam('default_user_status'));
     $user->setRegisterPurpose('LDAP');
     $user->setUnixStatus('S');
     $user->setTimezone('GMT');
     $user->setLanguageID($GLOBALS['Language']->getText('conf', 'language_id'));
     $um = $this->getUserManager();
     $u = $um->createAccount($user);
     if ($u) {
         $u = $um->getUserById($user->getId());
         // Create an entry in the ldap user db
         $ldapUserDao = $this->getDao();
         $ldapUserDao->createLdapUser($u->getId(), 0, $uid);
         return $u;
     }
     return false;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:39,代码来源:LDAP_UserManager.class.php

示例3: account_create

function account_create($loginname = '', $pw = '', $ldap_id = '', $realname = '', $register_purpose = '', $email = '', $status = 'P', $confirm_hash = '', $mail_site = 0, $mail_va = 0, $timezone = 'GMT', $lang_id = 'en_US', $unix_status = 'N', $expiry_date = 0)
{
    $um = UserManager::instance();
    $user = new PFUser();
    $user->setUserName($loginname);
    $user->setRealName($realname);
    $user->setPassword($pw);
    $user->setLdapId($ldap_id);
    $user->setRegisterPurpose($register_purpose);
    $user->setEmail($email);
    $user->setStatus($status);
    $user->setConfirmHash($confirm_hash);
    $user->setMailSiteUpdates($mail_site);
    $user->setMailVA($mail_va);
    $user->setTimezone($timezone);
    $user->setLanguageID($lang_id);
    $user->setUnixStatus($unix_status);
    $user->setExpiryDate($expiry_date);
    $u = $um->createAccount($user);
    if ($u) {
        return $u->getId();
    } else {
        return $u;
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:25,代码来源:account.php


注:本文中的PFUser::setLanguageID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。