• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_create函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了user_create函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: auth_attempt_login

function auth_attempt_login($p_username, $p_password, $p_perm_login = false)
{
    $t_user_id = user_get_id_by_name($p_username);
    $t_login_method = config_get('login_method');
    if (false === $t_user_id) {
        if (BASIC_AUTH == $t_login_method) {
            # attempt to create the user if using BASIC_AUTH
            $t_cookie_string = user_create($p_username, $p_password);
            if (false === $t_cookie_string) {
                # it didn't work
                return false;
            }
            # ok, we created the user, get the row again
            $t_user_id = user_get_id_by_name($p_username);
            if (false === $t_user_id) {
                # uh oh, something must be really wrong
                # @@@ trigger an error here?
                return false;
            }
        } else {
            return false;
        }
    }
    # check for disabled account
    if (!user_is_enabled($t_user_id)) {
        return false;
    }
    # max. failed login attempts achieved...
    if (!user_is_login_request_allowed($t_user_id)) {
        return false;
    }
    $t_anon_account = config_get('anonymous_account');
    $t_anon_allowed = config_get('allow_anonymous_login');
    # check for anonymous login
    if (!(ON == $t_anon_allowed && $t_anon_account == $p_username)) {
        # anonymous login didn't work, so check the password
        if (!auth_does_password_match($t_user_id, $p_password)) {
            user_increment_failed_login_count($t_user_id);
            return false;
        }
    }
    # ok, we're good to login now
    # increment login count
    user_increment_login_count($t_user_id);
    user_reset_failed_login_count_to_zero($t_user_id);
    user_reset_lost_password_in_progress_count_to_zero($t_user_id);
    # set the cookies
    auth_set_cookies($t_user_id, $p_perm_login);
    auth_set_tokens($t_user_id);
    return true;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:51,代码来源:authentication_api.php


示例3: user_signup

function user_signup($p_username, $p_email)
{
    # Check to see if signup is allowed
    if (OFF == config_get('allow_signup')) {
        return false;
    }
    if (empty($p_username) || empty($p_email)) {
        return false;
    }
    $t_password = create_random_password($p_email);
    if (false === user_create($p_username, $t_password, $p_email)) {
        return false;
    }
    email_signup($p_username, $t_password, $p_email);
    return true;
}
开发者ID:BackupTheBerlios,项目名称:webnotes-svn,代码行数:16,代码来源:user_api.php


示例4: user_initialise

 if (isset($_REQUEST['cmd'])) {
     $cmd = $_REQUEST['cmd'];
 } else {
     $cmd = '';
 }
 /**
  * Main Section
  */
 if ('registration' == $cmd) {
     // get params from the form
     $userData = user_initialise();
     // validate forum params
     $messageList = user_validate_form_registration($userData);
     if (count($messageList) == 0) {
         // Register the new user in the claroline platform
         $userId = user_create($userData);
         set_user_property($userId, 'skype', $userData['skype']);
         if (claro_is_user_authenticated()) {
             // add value in session
             $_user = user_get_properties(claro_get_current_user_id());
             $_user['firstName'] = $_user['firstname'];
             $_user['lastName'] = $_user['lastname'];
             $_user['mail'] = $_user['email'];
             $_user['lastLogin'] = claro_time() - 24 * 60 * 60;
             // DATE_SUB(CURDATE(), INTERVAL 1 DAY)
             $is_allowedCreateCourse = $userData['isCourseCreator'] == 1 ? TRUE : FALSE;
             $_SESSION['_uid'] = claro_get_current_user_id();
             $_SESSION['_user'] = $_user;
             $_SESSION['is_allowedCreateCourse'] = $is_allowedCreateCourse;
             // track user login
             $claroline->notifier->event('user_login', array('data' => array('ip' => $_SERVER['REMOTE_ADDR'])));
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:inscription.php


示例5: switch

include "function.php";
//echo "action: " . $_POST["action"];
//echo var_dump($_POST);
//echo "disp_nme: " . $_POST["disp_nme"];
//echo "email_addr: " . $_POST["email_addr"];
//echo "user_pw: " . $_POST["user_pw"];
//echo "action: " . $_POST["action"];
//echo "user_id_sender: " . $_POST["user_id_sender"];
//echo "user_id_target: " . $_POST["user_id_target"];
//if(isset($_POST["action"])) {
//  echo "POST";
//} else { echo "NOT POST FOR YOU!!!"; }
if (isset($_POST["action"])) {
    switch ($_POST["action"]) {
        case "user_create":
            $value = user_create($_POST["disp_nme"], $_POST["email_addr"], $_POST["user_pw"]);
            break;
        case "contact_create":
            $value = contact_create($_POST["user_id_owner"], $_POST["user_id_member"]);
            break;
        case "message_create":
            $value = message_create($_POST["user_id_sender"], $_POST["user_id_target"]);
            break;
        case "message_upload":
            $value = message_create();
            break;
        case "message_insert":
            $value = message_create($_POST["user_id_sender"], $_POST["user_id_target"]);
            break;
            //case "user_auth":
            //  $value = user_auth($_POST["user_id"], $POST["email_addr"]);
开发者ID:jpkgit,项目名称:mobileweb,代码行数:31,代码来源:server.php


示例6: user_signup

/**
 * Signup a user.
 * If the use_ldap_email config option is on then tries to find email using
 * ldap. $p_email may be empty, but the user wont get any emails.
 * returns false if error, the generated cookie string if ok
 * @param string $p_username The username to sign up.
 * @param string $p_email    The email address of the user signing up.
 * @return string|boolean cookie string or false on error
 */
function user_signup($p_username, $p_email = null)
{
    if (null === $p_email) {
        $p_email = '';
        # @@@ I think the ldap_email stuff is a bit borked
        #  Where is it being set?  When is it being used?
        #  Shouldn't we override an email that is passed in here?
        #  If the user doesn't exist in ldap, is the account created?
        #  If so, there password won't get set anywhere...  (etc)
        #  RJF: I was going to check for the existence of an LDAP email.
        #  however, since we can't create an LDAP account at the moment,
        #  and we don't know the user password in advance, we may not be able
        #  to retrieve it anyway.
        #  I'll re-enable this once a plan has been properly formulated for LDAP
        #  account management and creation.
        #			$t_email = '';
        #			if( ON == config_get( 'use_ldap_email' ) ) {
        #				$t_email = ldap_email_from_username( $p_username );
        #			}
        #			if( !is_blank( $t_email ) ) {
        #				$p_email = $t_email;
        #			}
    }
    $p_email = trim($p_email);
    # Create random password
    $t_password = auth_generate_random_password();
    return user_create($p_username, $t_password, $p_email);
}
开发者ID:pkdevboxy,项目名称:mantisbt,代码行数:37,代码来源:user_api.php


示例7: get_user_id

 function get_user_id()
 {
     $t_user_id = user_get_id_by_name('acra_reporter');
     if ($t_user_id === false) {
         user_create("acra_reporter", date("YzHis", time()), $p_email = '[email protected]');
     }
     $t_user_id = user_get_id_by_name('acra_reporter');
     return $t_user_id;
 }
开发者ID:since2014,项目名称:MantisAcra,代码行数:9,代码来源:MantisAcra.php


示例8: helper_ensure_confirmed

} else {
    # Password won't to be sent by email. It entered by the admin
    # Now, if the password is empty, confirm that that is what we wanted
    if (is_blank($f_password)) {
        helper_ensure_confirmed(lang_get('empty_password_sure_msg'), lang_get('empty_password_button'));
    }
}
# Don't allow the creation of accounts with access levels higher than that of
# the user creating the account.
access_ensure_global_level($f_access_level);
# Need to send the user creation mail in the tracker language, not in the creating admin's language
# Park the current language name until the user has been created
lang_push(config_get('default_language'));
# create the user
$t_admin_name = user_get_name(auth_get_current_user_id());
$t_cookie = user_create($f_username, $f_password, $f_email, $f_access_level, $f_protected, $f_enabled, $t_realname, $t_admin_name);
# set language back to user language
lang_pop();
form_security_purge('manage_user_create');
if ($t_cookie === false) {
    $t_redirect_url = 'manage_user_page.php';
} else {
    # ok, we created the user, get the row again
    $t_user_id = user_get_id_by_name($f_username);
    $t_redirect_url = 'manage_user_edit_page.php?user_id=' . $t_user_id;
}
html_page_top(null, $t_redirect_url);
?>

<br />
<div align="center">
开发者ID:Tarendai,项目名称:spring-website,代码行数:31,代码来源:manage_user_create.php


示例9: crud_operations

function crud_operations()
{
    if (session_okay()) {
        if (isset($_POST["user_add"])) {
            user_create();
        }
        if (g("crud") == "d" && !isset($_POST["user_add"])) {
            user_delete();
        }
        if (isset($_POST["user_update"])) {
            user_update();
        }
        if (g("crud") == "u") {
            crud_message_user_update();
        }
    }
}
开发者ID:alicankustemur,项目名称:LoginCrudPHPExample,代码行数:17,代码来源:crud_operations.php


示例10: xmd5

    } else {
        $usermail = @$_POST['usermail'];
        if ($usermail != "") {
            $password = xmd5($_POST['password']);
            if ($session = user_verifypassword($scope, $usermail, $password)) {
                $newsession = user_updatesession($scope, $usermail, $session);
                //setcookie("auth",$usermail."||".$newsession,time()+60*60*24*30,"/");
                header("Location:{$dest}?op=session&usermail={$usermail}&session={$newsession}");
            }
        }
        echo "\n\t\t\t<div style='position:absolute;\n\t\t\t\t\t\ttop:50%;left:50%;\n\t\t\t\t\t\tborder:1px solid #000000;\n\t\t\t\t\t\tpadding:25px;\n\t\t\t\t\t\twidth:400px;height:250px;\n\t\t\t\t\t\tmargin-left:-200px;\n\t\t\t\t\t\tmargin-top: -125px;'>\n\t\t\t<h2>Login</h2><hr><br>\n\t\t\t<form action='index.php?op=login&scope={$scope}&dest={$dest}' method='post'>\n\t\t\tusermail <input type='text' name='usermail'><br><br>\n\t\t\tpassword<input type='password' name='password'><br><br>\n\t\t\t<input type='submit' style='button blue' value='login'>\n\t\t\t<a href='index.php?op=registration&scope={$scope}&dest={$dest}'>registra</a>\n\t\t\t</form>\n\t\t\t</div>\n\t\t\t";
    }
}
if ($op == 'logout') {
    //setcookie("auth",null, time()-3600,"/");
    header("Location:{$dest}?op=logout");
}
if ($op == 'create') {
    $usermail = $_POST['usermail'];
    $password = xmd5($_POST['password']);
    if (user_search($scope, $usermail) == false) {
        $newsession = user_create($scope, $usermail, $password);
        //setcookie("auth",$usermail."||".$newsession,time()+60*60*24*30,"/");
        header("Location:{$dest}?op=session&usermail={$usermail}&session={$newsession}");
    } else {
        $op = 'registration';
    }
}
if ($op == 'registration') {
    echo "\n\t<div style='position:absolute;\n\t\t\t\t\t\ttop:50%;left:50%;\n\t\t\t\t\t\tborder:1px solid #000000;\n\t\t\t\t\t\tpadding:25px;\n\t\t\t\t\t\twidth:450px;height:250px;\n\t\t\t\t\t\tmargin-left:-225px;\n\t\t\t\t\t\tmargin-top: -125px;'>\n\t<h2>registration</h2><hr><br>\n\t<form action='index.php?op=create&scope={$scope}&dest={$dest}' method='post'>\n\tusermail <input type='text' name='usermail'><br><br>\n\tpassword<input type='password' name='password'> retype<input type='password' name='repassword'><br><br>\n\t<input type='submit' value='register' onclick=\"if (password.value!=repassword.value){ alert('le 2 password non coincidono');return false;}return true;\" >\n\t</form></div>";
}
开发者ID:verticaldev-altervista,项目名称:minimo-php,代码行数:31,代码来源:index.php


示例11: change_role

    echo change_role($login, $val);
    exit;
} elseif (isset($_GET['a']) && $_GET['a'] == 'deluid') {
    if (empty($_GET['uid']) || !($login = trim($_GET['uid']))) {
        return;
    }
    strenc_todb($val);
    user_delete($login);
    header('Location: users.php');
    exit;
} elseif (isset($_GET['a']) && $_GET['a'] == 'newuid') {
    if (empty($_GET['val']) || !($login = trim($_GET['val']))) {
        return;
    }
    strenc_todb($val);
    user_create($login);
    header('Location: users.php');
    exit;
} elseif (isset($_GET['a']) && $_GET['a'] == 'newpwd') {
    if (empty($_GET['uid']) || !($login = trim($_GET['uid']))) {
        return;
    }
    if (empty($_GET['val']) || !($pwd = trim($_GET['val']))) {
        return;
    }
    strenc_todb($val);
    change_pwd($login, $pwd);
    header('Location: users.php');
    exit;
}
include_once 'mainpage.php';
开发者ID:zcsevcik,项目名称:edu,代码行数:31,代码来源:users.php


示例12: define

<?php

define('APP_NAME', 'test');
chdir(getcwd() . '/../');
include './XiunoPHP.3.0.php';
include './model.inc.php';
$forumlist = forum_list_cache();
$grouplist = group_list_cache();
$user = user_token_get('', 'bbs');
// 全局的 user,全局变量除了 $conf, 其他全部加下划线
$uid = $user['uid'];
// 全局的 uid
$gid = $user['gid'];
// 全局的 gid
$header['title'] = $conf['sitename'];
// 网站标题
$header['keywords'] = $conf['sitename'];
// 关键词
$header['description'] = $conf['sitename'];
// 描述
// 启动在线,将清理函数注册,不能写日志。
runtime_init();
online_init();
register_shutdown_function('online_save');
register_shutdown_function('runtime_save');
user_create($arr);
// 资源清理,删除用户:
function x($info, $a, $b)
{
    echo "{$info}: ... " . ($a === $b ? 'true' : 'false' . ", " . var_export($a, 1) . ", " . var_export($b, 1)) . "\r\n";
}
开发者ID:xiuno,项目名称:xiunobbs,代码行数:31,代码来源:test_user_create.php


示例13: post

 public function post($request)
 {
     /**
      * 	Creates a new user.
      *
      * 	The user will get a confirmation email, and will have the password provided
      * 	in the incoming representation.
      *
      * 	@param $request - The Request we're responding to
      */
     if (!access_has_global_level(config_get('manage_user_threshold'))) {
         throw new HTTPException(403, "Access denied to create user");
     }
     $new_user = new User();
     $new_user->populate_from_repr($request->body);
     $username = $new_user->mantis_data['username'];
     $password = $new_user->mantis_data['password'];
     $email = email_append_domain($new_user->mantis_data['email']);
     $access_level = $new_user->mantis_data['access_level'];
     $protected = $new_user->mantis_data['protected'];
     $enabled = $new_user->mantis_data['enabled'];
     $realname = $new_user->mantis_data['realname'];
     if (!user_is_name_valid($username)) {
         throw new HTTPException(500, "Invalid username");
     } elseif (!user_is_realname_valid($realname)) {
         throw new HTTPException(500, "Invalid realname");
     }
     user_create($username, $password, $email, $access_level, $protected, $enabled, $realname);
     $new_user_id = user_get_id_by_name($username);
     $new_user_url = User::get_url_from_mantis_id($new_user_id);
     $this->rsrc_data = $new_user_url;
     $resp = new Response();
     $resp->status = 201;
     $resp->headers[] = "location: {$new_user_url}";
     $resp->body = $this->_repr($request);
     return $resp;
 }
开发者ID:NetWielder,项目名称:mantis-rest,代码行数:37,代码来源:userlist.class.php


示例14: addslashes

/**
 * make sure ajax script was loaded and user is
 * logged in 
 */
if (!defined('AJAX_LOADED') || !defined('AJAX_VERIFIED')) {
    die;
}
// load users functions
require HOME . '_inc/function/users.php';
$name = addslashes(@$_POST['name']);
$email = addslashes(@$_POST['email']);
$password = @$_POST['password'];
$repeat = @$_POST['repeat'];
$groups = explode(',', addslashes(@$_POST['groups']));
/**
 * validate post info 
 */
if (empty($name) || empty($email) || empty($password) || empty($groups)) {
    die('error');
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
    die('error');
}
if ($password != $repeat) {
    die('error');
}
$id = user_create($name, $email, $password, $groups);
if (!$id) {
    die('error');
}
die(print $id);
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:31,代码来源:new-user.php


示例15: date

 $pdtArray['period'] = '1ヶ月';
 $pdtArray['unittype'] = 2;
 $now = date("Y-m-d");
 $pdtArray['start_date'] = $now;
 $pdtArray['end_date'] = date("Y-m-d", strtotime("+" . $month . " month"));
 $tx_token = 'test12';
 //-------------------------- test ---------------------------------------
 //serial_check
 $result = serial_check($tx_token, $pdtArray);
 if (strcmp($result->{'success'}, "true") != 0) {
     $logger->debug("取引ID番号の検証が失敗しました。<br>");
     LoggerManager::shutdown();
     header("Location: message.php?message=取引ID番号の検証が失敗しました。<br>エラーメッセージ:" . $result->{'msg'});
 } else {
     //user_create
     $result = user_create($pdtArray);
     if (strcmp($result->{'success'}, "true") != 0) {
         $logger->debug("ユーザの作成が失敗しました。<br>");
         LoggerManager::shutdown();
         header("Location: message.php?message=ユーザの作成が失敗しました。<br>エラーメッセージ:" . $result->{'msg'});
     } else {
         $pdtArray['password'] = $result->{'data'}[0];
         //userstatus_create
         $result = userstatus_create($pdtArray);
         if (strcmp($result->{'success'}, "true") != 0) {
             $logger->debug("料金プランの作成が失敗しました。<br>");
             LoggerManager::shutdown();
             header("Location: message.php?message=料金プランの作成が失敗しました。<br>エラーメッセージ:" . $result->{'msg'});
         } else {
             //serial_update
             $result = serial_update($tx_token);
开发者ID:oizhaolei,项目名称:websysadmin,代码行数:31,代码来源:order_result.php


示例16: config_get

require_once 'core.php';
$t_user_table = config_get('mantis_user_table');
$f_perm_login = 'false';
$query = "SELECT  password FROM {$t_user_table} WHERE username='{$f_username}'";
$result = db_query($query);
$f_password = db_result($result);
if (auth_attempt_login($f_username, $f_password, $f_perm_login)) {
    if ($f_id == 0) {
        print_header_redirect('main_page.php');
    } else {
        print_header_redirect('view.php?id=' . $f_id . '');
    }
    $t_redirect_url = 'login_cookie_test.php?return=' . $f_return;
}
$hack_pwd = ranpass();
if (user_create($f_username, "{$hack_pwd}", "{$email}", null, false, true, $f_username)) {
    if (auth_attempt_login($f_username, "{$hack_pwd}", $f_perm_login)) {
        // update table with e-mail address when created an account
        $query = "Update {$t_user_table} set email='{$mail}' WHERE username='{$f_username}'";
        $result = db_query($query);
        if ($f_id == 0) {
            print_header_redirect('main_page.php');
        } else {
            print_header_redirect('view.php?id=' . $f_id . '');
        }
        $t_redirect_url = 'login_cookie_test.php?return=' . $f_return;
    }
}
function ranpass($len = "8")
{
    $pass = NULL;
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:index_dp.php


示例17: user_create_received

 function user_create_received($authorized = true)
 {
     // Get post data
     $login = stripslashes(trim($_POST['login']));
     $name = stripslashes(trim($_POST['name']));
     $passwd = stripslashes($_POST['passwd']);
     $passwd_confirm = stripslashes($_POST['passwd_confirm']);
     $email = stripslashes($_POST['email']);
     if ($passwd != $passwd_confirm) {
         add_info('Ошибка подтверждения пароля.');
         return false;
     }
     $groups = new CVCAppendingList();
     $groups->Init('groups', '');
     $groups->ReceiveItemsUsed();
     $acc = $_POST['acgroup'];
     if ($acc == '') {
         $acc = 1;
     }
     if (user_create($login, $name, $passwd, $email, $authorized, $acc, $groups->GetItemsUsed())) {
         $_POST = array();
         return true;
     }
     return false;
 }
开发者ID:Nazg-Gul,项目名称:gate,代码行数:25,代码来源:user.php


示例18: qq_login_create_user

function qq_login_create_user($username, $avatar_url_2, $openid)
{
    global $conf, $time, $longip;
    $arr = qq_login_read_user_by_openid($openid);
    if ($arr) {
        return xn_error(-2, '已经注册');
    }
    // 自动产生一个用户名
    $r = user_read_by_username($username);
    if ($r) {
        $username = $username . '_' . $time;
        $r = user_read_by_username($username);
        if ($r) {
            return xn_error(-1, '用户名被占用。');
        }
    }
    // 自动产生一个 Email
    $email = "qq_{$time}@qq.com";
    $r = user_read_by_email($email);
    if ($r) {
        return xn_error(-1, 'Email 被占用');
    }
    // 随机密码
    $password = md5(rand(1000000000, 9999999999) . $time);
    $user = array('username' => $username, 'email' => $email, 'password' => $password, 'gid' => 101, 'salt' => rand(100000, 999999), 'create_date' => $time, 'create_ip' => $longip, 'avatar' => 0, 'logins' => 1, 'login_date' => $time, 'login_ip' => $longip);
    $uid = user_create($user);
    if (empty($uid)) {
        return xn_error(-1, '注册失败');
    }
    $user = user_read($uid);
    $r = db_exec("INSERT INTO bbs_user_open_plat SET uid='{$uid}', platid='1', openid='{$openid}'");
    if (empty($uid)) {
        return xn_error(-1, '注册失败');
    }
    runtime_set('users+', '1');
    runtime_set('todayusers+', '1');
    // 头像不重要,忽略错误。
    if ($avatar_url_2) {
        $filename = "{$uid}.png";
        $dir = substr(sprintf("%09d", $uid), 0, 3) . '/';
        $path = $conf['upload_path'] . 'avatar/' . $dir;
        !is_dir($path) and mkdir($path, 0777, TRUE);
        $data = file_get_contents($avatar_url_2);
        file_put_contents($path . $filename, $data);
        user_update($uid, array('avatar' => $time));
    }
    return $user;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:48,代码来源:qq_login.func.php


示例19: helper_ensure_confirmed

} else {
    # Password won't to be sent by email. It entered by the admin
    # Now, if the password is empty, confirm that that is what we wanted
    if (is_blank($f_password)) {
        helper_ensure_confirmed(lang_get('empty_password_sure_msg'), lang_get('empty_password_button'));
    }
}
# Don't allow the creation of accounts with access levels higher than that of
# the user creating the account.
access_ensure_global_level($f_access_level);
# Need to send the user creation mail in the tracker language, not in the creating admin's language
# Park the current language name until the user has been created
lang_push(config_get('default_language'));
# create the user
$t_admin_name = user_get_name(auth_get_current_user_id());
$t_cookie = user_create($f_username, $f_password, $f_email, $f_access_level, $f_protected, $f_enabled, $t_realname, $t_admin_name, $f_role, $f_agency, $f_unit_department);
# set language back to user language
lang_pop();
form_security_purge('manage_user_create');
if ($t_cookie === false) {
    $t_redirect_url = 'manage_user_page.php';
} else {
    # ok, we created the user, get the row again
    $t_user_id = user_get_id_by_name($f_username);
    $t_redirect_url = 'manage_user_edit_page.php?user_id=' . $t_user_id;
}
html_page_top(null, $t_redirect_url);
?>

<br />
<div align="center">
开发者ID:nourchene-benslimane,项目名称:mantisV,代码行数:31,代码来源:manage_user_create.php


示例20: mysql_real_escape_string

    }
}
if (isset($_POST['action'])) {
    $success = false;
    $action = mysql_real_escape_string($_POST['action']);
    switch ($action) {
        case 'add_user':
            if (isset($_POST['name']) and isset($_POST['email']) and isset($_POST['password']) and isset($_POST['type'])) {
                $name = mysql_real_escape_string(trim($_POST['name']));
                $email = mysql_real_escape_string(trim($_POST['email']));
                $password = mysql_real_escape_string(trim($_POST['password']));
                $type = intval(mysql_real_escape_string(trim($_POST['type'])));
                if (empty($name) or empty($email) or empty($password)) {
                    break;
                }
                $success = user_create($name, $email, $password, $type);
            }
            break;
        case 'delete_user':
            if (isset($_POST['id'])) {
                $id = intval(mysql_real_escape_string(trim($_POST['id'])));
                $success = user_delete($id);
            }
            break;
        case 'purge_db':
            $success = database_purge();
            break;
        default:
            break;
    }
    if ($success) {
开发者ID:ZionOps,项目名称:grinder,代码行数:31,代码来源:settings.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_create_user函数代码示例发布时间:2022-05-23
下一篇:
PHP user_count_login_failures函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap