本文整理汇总了PHP中user_is_name_unique函数的典型用法代码示例。如果您正苦于以下问题:PHP user_is_name_unique函数的具体用法?PHP user_is_name_unique怎么用?PHP user_is_name_unique使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_is_name_unique函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: newProductBacklog
function newProductBacklog()
{
global $agilemantis_au;
// Check if team-user name fits into MantisBT regulations
if (!(utf8_strlen($this->name) < 22 && user_is_name_valid($this->name) && user_is_name_unique($this->name))) {
return null;
}
$p_username = $this->generateTeamUser($this->name);
$p_email = $this->email;
$p_email = trim($p_email);
$t_seed = $p_email . $p_username;
$t_password = auth_generate_random_password($t_seed);
if (user_is_name_unique($p_username) === true) {
user_create($p_username, $t_password, $p_email, 55, false, true, 'Team-User-' . $_POST['pbl_name']);
} else {
$t_user_id = $this->getUserIdByName($p_username);
user_set_field($t_user_id, 'email', $p_email);
}
$user_id = $this->getLatestUser();
$agilemantis_au->setAgileMantisUserRights($user_id, 1, 0, 0);
if ($this->team == 0) {
$this->team = $this->getLatestUser();
}
$t_sql = "INSERT INTO gadiv_productbacklogs (name, description, user_id) VALUES ( " . db_param(0) . ", " . db_param(1) . ", " . db_param(2) . ") ";
$t_params = array($this->name, $this->description, $user_id);
db_query_bound($t_sql, $t_params);
$this->id = db_insert_id("gadiv_productbacklogs");
$this->user_id = $user_id;
return $this->id;
}
开发者ID:CarlosPinedaT,项目名称:agileMantis,代码行数:30,代码来源:class_product_backlog.php
示例2: user_ensure_name_unique
/**
* Check if the username is unique and trigger an ERROR if it isn't
* @param string $p_username The username to check.
* @return void
*/
function user_ensure_name_unique($p_username)
{
if (!user_is_name_unique($p_username)) {
trigger_error(ERROR_USER_NAME_NOT_UNIQUE, ERROR);
}
}
开发者ID:pkdevboxy,项目名称:mantisbt,代码行数:11,代码来源:user_api.php
示例3: config_get
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'email_api.php';
access_ensure_global_level(config_get('manage_user_threshold'));
$f_protected = gpc_get_bool('protected');
$f_enabled = gpc_get_bool('enabled');
$f_email = gpc_get_string('email', '');
$f_username = gpc_get_string('username', '');
$f_realname = gpc_get_string('realname', '');
$f_access_level = gpc_get_int('access_level');
$f_user_id = gpc_get_int('user_id');
$f_email = trim($f_email);
$f_username = trim($f_username);
$t_old_username = user_get_field($f_user_id, 'username');
# 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);
user_ensure_realname_valid($f_realname);
user_ensure_realname_unique($f_username, $f_realname);
$f_email = email_append_domain($f_email);
email_ensure_valid($f_email);
$c_email = db_prepare_string($f_email);
$c_username = db_prepare_string($f_username);
$c_realname = db_prepare_string($f_realname);
$c_protected = db_prepare_bool($f_protected);
$c_enabled = db_prepare_bool($f_enabled);
$c_user_id = db_prepare_int($f_user_id);
$c_access_level = db_prepare_int($f_access_level);
$t_user_table = config_get('mantis_user_table');
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:manage_user_update.php
示例4: validate_username
private function validate_username($p_username, $p_rand = '')
{
$t_username = $p_username;
if (utf8_strlen($t_username . $p_rand) > DB_FIELD_SIZE_USERNAME) {
$t_username = utf8_substr($t_username, 0, DB_FIELD_SIZE_USERNAME - strlen($p_rand));
}
$t_username = $t_username . $p_rand;
if (user_is_name_valid($t_username) && user_is_name_unique($t_username)) {
return $t_username;
}
return FALSE;
}
开发者ID:JeromyK,项目名称:EmailReporting,代码行数:12,代码来源:mail_api.php
示例5: access_ensure_global_level
$t_old_username = $t_user['username'];
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 );
}
开发者ID:01-Scripts,项目名称:mantisbt,代码行数:29,代码来源:manage_user_update.php
注:本文中的user_is_name_unique函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论