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


PHP ldap_realname_from_username函数代码示例

本文整理汇总了PHP中ldap_realname_from_username函数的典型用法代码示例。如果您正苦于以下问题:PHP ldap_realname_from_username函数的具体用法?PHP ldap_realname_from_username怎么用?PHP ldap_realname_from_username使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: access_ensure_global_level

if ($f_send_email_notification) {
    $t_old_realname = $t_user['realname'];
    $t_old_email = $t_user['email'];
    $t_old_access_level = $t_user['access_level'];
}
# Ensure that the account to be updated is of equal or lower access to the
# current user.
access_ensure_global_level($t_user['access_level']);
# check that the username is unique
if (0 != strcasecmp($t_old_username, $f_username) && false == user_is_name_unique($f_username)) {
    trigger_error(ERROR_USER_NAME_NOT_UNIQUE, ERROR);
}
user_ensure_name_valid($f_username);
$t_ldap = LDAP == config_get('login_method');
if ($t_ldap && config_get('use_ldap_realname')) {
    $t_realname = ldap_realname_from_username($f_username);
} else {
    # strip extra space from real name
    $t_realname = string_normalize($f_realname);
    user_ensure_realname_unique($t_old_username, $t_realname);
}
if ($t_ldap && config_get('use_ldap_email')) {
    $t_email = ldap_email($f_user_id);
} else {
    $t_email = email_append_domain(trim($f_email));
    email_ensure_valid($t_email);
    email_ensure_not_disposable($t_email);
}
$c_email = $t_email;
$c_username = $f_username;
$c_realname = $t_realname;
开发者ID:nextgens,项目名称:mantisbt,代码行数:31,代码来源:manage_user_update.php

示例2: prepare_realname

 private function prepare_realname($p_user_info, $p_username)
 {
     switch ($this->_mail_preferred_realname) {
         case 'email_address':
             $t_realname = $p_user_info['email'];
             break;
         case 'email_no_domain':
             if (preg_match(email_regex_simple(), $p_user_info['email'], $t_check)) {
                 $t_local = $t_check[1];
                 $t_domain = $t_check[2];
                 $t_realname = $t_local;
             }
             break;
         case 'from_ldap':
             $t_realname = ldap_realname_from_username($p_username);
             break;
         case 'full_from':
             $t_realname = str_replace(array('<', '>'), array('(', ')'), $p_user_info['From']);
             break;
         case 'name':
         default:
             $t_realname = $p_user_info['name'];
     }
     $t_realname = string_normalize($t_realname);
     if (utf8_strlen($t_realname) > DB_FIELD_SIZE_REALNAME) {
         $t_realname = utf8_substr($t_realname, 0, DB_FIELD_SIZE_REALNAME);
     }
     if (user_is_realname_valid($t_realname) && user_is_realname_unique($p_username, $t_realname)) {
         return $t_realname;
     }
     return FALSE;
 }
开发者ID:JeromyK,项目名称:EmailReporting,代码行数:32,代码来源:mail_api.php

示例3: helper_alternate_class

	<!-- Realname -->
	<tr <?php 
echo helper_alternate_class();
?>
 valign="top">
		<td class="category">
			<?php 
echo lang_get('realname');
?>
		</td>
		<td>
		<?php 
// With LDAP
if ($t_ldap && ON == config_get('use_ldap_realname')) {
    echo string_display_line(ldap_realname_from_username($u_username));
} else {
    $t_show_update_button = true;
    ?>
			<input type="text" size="32" maxlength="<?php 
    echo DB_FIELD_SIZE_REALNAME;
    ?>
" name="realname" value="<?php 
    echo string_attribute($u_realname);
    ?>
" required/>
		<?php 
}
?>
		</td>
	</tr>
开发者ID:khinT,项目名称:mantisbt-master,代码行数:30,代码来源:account_page.php

示例4: ldap_realname

/**
 * Gets a user's real name (common name) given the id.
 *
 * @param int $p_user_id  The user id.
 * @return string real name.
 */
function ldap_realname($p_user_id)
{
    $t_username = user_get_field($p_user_id, 'username');
    return ldap_realname_from_username($t_username);
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:11,代码来源:ldap_api.php


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