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

PHP create_account函数代码示例

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

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



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

示例1: register

 public function register($member_group_id = 2, $username = null, $password = null, $email = null, $mobile = null)
 {
     if (IS_POST) {
         $data = array('member_group_id' => $member_group_id, 'username' => $username, 'password' => $password, 'email' => $email, 'mobile' => $mobile, 'account' => create_account(), 'create_time' => NOW_TIME, 'update_time' => NOW_TIME);
         //验证手机
         //if(empty($data['mobile'])) unset($data['mobile']);
         $user = D('Member');
         /* 添加用户 */
         if ($user->create($data)) {
             $user->password = ainiku_ucenter_md5($user->password);
             $user->member_group_id = $member_group_id;
             $result = $user->add();
             //return $this->$uid ? '注册成功' : '注册失败'; //0-未知错误,大于0-注册成功
             if (0 < $result) {
                 $this->success('注册成功', U('login'));
             } else {
                 $this->error('注册失败');
             }
         } else {
             return $this->error($user->getError());
         }
     } else {
         if (IS_AJAX) {
             $this->display('ajaxregister');
         } else {
             $this->display();
         }
     }
 }
开发者ID:735579768,项目名称:Ainiku,代码行数:29,代码来源:PublicController.class.php


示例2: ldapauth_hook_authenticate

function ldapauth_hook_authenticate($a, &$b)
{
    $mail = '';
    if (ldapauth_authenticate($b['username'], $b['password'], $mail)) {
        $results = q("SELECT * FROM account where account_email = '%s' OR account_email = '%s'  AND account_flags in (0,1) limit 1", dbesc($b['username']), dbesc($mail));
        if (!$results && $mail && intval(get_config('ldapauth', 'create_account')) == 1) {
            require_once 'include/account.php';
            $acct = create_account(array('email' => $mail, 'password' => random_string()));
            if ($acct['success']) {
                logger('ldapauth: Created account for ' . $b['username'] . ' using ' . $mail);
                info(t('An account has been created for you.'));
                $b['user_record'] = $acct['account'];
                $b['authenticated'] = 1;
            }
        } elseif (intval(get_config('ldapauth', 'create_account')) != 1 && !$results) {
            logger('ldapauth: User ' . $b['username'] . ' authenticated but no db-record and. Rejecting auth.');
            notice(t('Authentication successful but rejected: account creation is disabled.'));
            return;
        }
        if ($results) {
            logger('ldapauth: Login success for ' . $b['username']);
            $b['user_record'] = $results[0];
            $b['authenticated'] = 1;
        }
    }
    return;
}
开发者ID:royalterra,项目名称:hubzilla-addons,代码行数:27,代码来源:ldapauth.php


示例3: QQregister

 public function QQregister($openid)
 {
     $qqinfo = session('qqinfo');
     $data['openid'] = $openid;
     $data['member_group_id'] = 2;
     //$data['account']         = create_account();
     $data['nickname'] = $qqinfo['nickname'];
     $mem = M('Member');
     $re = $mem->where("openid='{$openid}'")->find();
     if (!empty($re)) {
         $data['member_id'] = $re['member_id'];
         if ($mem->create($data)) {
             //保存或更新qq的信息到数据库
             $mem->save();
         }
         //已经是登陆用户
         return $re['member_id'];
     } else {
         /* 添加用户 */
         $data['last_login_ip'] = get_client_ip();
         $data['account'] = create_account();
         $data['username'] = $data['account'];
         //生成用户名
         $uid = $mem->add($data);
         return $uid ? $uid : 0;
         //0-未知错误,大于0-注册成功
     }
 }
开发者ID:735579768,项目名称:Ainiku,代码行数:28,代码来源:QloginPlugin.class.php


示例4: add

 public function add($member_group_id = '', $username = '', $password = '', $repassword = '', $email = '')
 {
     if (IS_POST) {
         /* 检测密码 */
         if ($password != $repassword) {
             $this->error('密码和重复密码不一致!');
         }
         $data = array('member_group_id' => $member_group_id, 'username' => $username, 'password' => $password, 'email' => $email, 'mobile' => $mobile, 'create_time' => NOW_TIME, 'update_time' => NOW_TIME, 'account' => create_account());
         //自动判断用户名是哪个字段
         $data[get_account_type($username)] = $username;
         $mem = D('Member');
         /* 添加用户 */
         if ($mem->create($data)) {
             $mem->password = ainiku_ucenter_md5($mem->password);
             $uid = $mem->add();
             return $uid > 0 ? $this->success('添加成功') : $this->error('添加失败');
             //0-未知错误,大于0-注册成功
         } else {
             return $this->error($mem->getError());
             //错误详情见自动验证注释
         }
     } else {
         $field = get_model_attr('member');
         $this->assign('fieldarr', $field);
         $this->meta_title = '新增用户';
         $this->display('edit');
     }
 }
开发者ID:735579768,项目名称:Ainiku,代码行数:28,代码来源:MemberController.class.php


示例5: register

 /**
 	/**
 * 注册一个新用户
 * @param  string $username 用户名
 * @param  string $password 用户密码
 * @param  string $email    用户邮箱
 * @param  string $mobile   用户手机号码
 * @return integer          注册成功-用户信息,注册失败-错误编号
 */
 public function register($member_group_id, $username, $password, $email, $mobile)
 {
     $data = array('member_group_id' => $member_group_id, 'username' => $username, 'password' => $password, 'email' => $email, 'mobile' => $mobile, 'create_time' => NOW_TIME, 'update_time' => NOW_TIME, 'account' => create_account());
     //验证手机
     if (empty($data['mobile'])) {
         unset($data['mobile']);
     }
     /* 添加用户 */
     if ($this->create($data)) {
         $this->data['password'] = ainiku_ucenter_md5($this->data['password']);
         $uid = $this->add();
         return $uid ? $uid : 0;
         //0-未知错误,大于0-注册成功
     } else {
         return $this->getError();
         //错误详情见自动验证注释
     }
 }
开发者ID:735579768,项目名称:Ainiku,代码行数:27,代码来源:MemberModel.class.php


示例6: main

function main()
{
    if (!empty($_POST["type"]) && !empty($_POST["email"]) && !empty($_POST["password"])) {
        $email = $_POST["email"];
        $password = $_POST["password"];
        $type = $_POST["type"];
        if ($type == "create" && !empty($_POST["username"])) {
            $username = $_POST["username"];
            create_account($email, $password, $username);
        } else {
            if ($type == "login") {
                login($email, $password);
            } else {
                redirect("index", "Oops! Post information wasn't passed.");
            }
        }
    }
}
开发者ID:R1413,项目名称:CryptoGear,代码行数:18,代码来源:friends.php


示例7: check_account_exists

function check_account_exists()
{
    $username = strtolower(trim($_POST['username']));
    $command = "show account {$username}\r\n";
    $sock = fsockopen("127.0.0.1", 9996, $errornumber, $errorstring, 30);
    if (!$sock) {
        die("Error {$errornumber}: {$errorstring}");
    }
    fputs($sock, $command);
    sleep(1);
    $result = fread($sock, 1000);
    fclose($sock);
    if (strpos($result, "Cannot find account")) {
        create_account();
    } else {
        echo "<B><font color=red>That account name is taken, please try again.</font></B><BR>";
        display_form();
    }
}
开发者ID:Chronovore,项目名称:Meridian59,代码行数:19,代码来源:acctcreate.php


示例8: array

 * success or error page if the form has been submitted.
 */
require_once 'panel-config.php';
require_once 'lib/utility.php';
// Render the account form if all required fields were not filled out
if (!was_submitted('create_account') || !isset($_POST['netid']) || !isset($_POST['password']) || !isset($_POST['aup']) || $_POST['aup'] != 'yes') {
    $errors = array();
    // Give error messages if the form was submitted
    if (was_submitted('create_account')) {
        if (!isset($_POST['netid']) || trim($_POST['netid']) == '') {
            $errors[] = "Please enter your NetID.";
        }
        if (!isset($_POST['password']) || trim($_POST['password']) == '') {
            $errors[] = "Please enter your NetID password.";
        }
        if (!isset($_POST['aup']) || $_POST['aup'] != 'yes') {
            $errors[] = "You need to read and accept our Acceptable Use Policy.";
        }
    }
    echo $twig->render('join.html', array('form_fields' => array('netid' => isset($_POST['netid']) ? $_POST['netid'] : '', 'lcc' => isset($_POST['lcc']) ? $_POST['lcc'] : '', 'aup' => isset($_POST['aup']) && $_POST['aup'] == 'yes'), 'error_messages' => $errors, 'show_subfooter' => false));
} else {
    require_once 'lib/create-account.php';
    $result = create_account($_POST['netid'], $_POST['password'], $_POST['lcc']);
    if ($result['status'] == STATUS_AUTH_ERROR) {
        // Password or NetID were incorrect, render the creation form again
        echo $twig->render('join.html', array('form_fields' => array('netid' => $_POST['netid'], 'lcc' => $_POST['lcc'], 'aup' => true), 'error_messages' => array($result['message']), 'show_subfooter' => false));
    } else {
        // Render the account creation result
        echo $twig->render('account-created.html', array('status' => $result['status'], 'message' => $result['message'], 'info' => isset($result['info']) ? $result['info'] : null, 'show_subfooter' => $result['status'] == STATUS_OK));
    }
}
开发者ID:CIF-Rochester,项目名称:Panel,代码行数:31,代码来源:join.php


示例9: get_database_connections

}
// == Check DB connections first! == //
$connect = get_database_connections(false);
$DB = $connect['plexis'];
$Realm = $connect['realm'];
// == Include emulator file == //
include ROOT . DS . 'emulators' . DS . $_POST['emulator'] . '.php';
// Fetch posted account name
$account = fetch_account($_POST['account']);
if ($account != FALSE) {
    $array = array('id' => $account['id'], 'username' => $account['username'], 'email' => $account['email'], 'registration_ip' => $_SERVER['REMOTE_ADDR'], 'activated' => 1, 'group_id' => 4);
    $mode = 1;
    $success = $DB->insert('pcms_accounts', $array, true) != false ? true : false;
} else {
    // No such account, creating one, in this case pwd is needed, so checking whether it's provided...
    $result = create_account($_POST['account'], $_POST['pass']);
    if ($result != FALSE) {
        // Get the account ID
        $accountid = $Realm->last_insert_id();
        // Connect to the Plexis DB
        $ac = array('id' => $accountid, 'username' => $_POST['account'], 'activated' => 1, 'registration_ip' => $_SERVER['REMOTE_ADDR'], 'group_id' => 4);
        $success = $DB->insert('pcms_accounts', $ac, true) != false ? true : false;
        $mode = 2;
    } else {
        $success = false;
        $mode = 0;
    }
}
// Lock the installer on success
if ($success == true || $mode > 0) {
    $file = fopen("install.lock", "w+");
开发者ID:Kheros,项目名称:Plexis,代码行数:31,代码来源:step5.php


示例10: register_post

function register_post(&$a)
{
    $max_dailies = intval(get_config('system', 'max_daily_registrations'));
    if ($max_dailies) {
        $r = q("select count(account_id) as total from account where account_created > UTC_TIMESTAMP() - INTERVAL 1 day");
        if ($r && $r[0]['total'] >= $max_dailies) {
            notice(t('Maximum daily site registrations exceeded. Please try again tomorrow.') . EOL);
            return;
        }
    }
    if (!x($_POST, 'tos')) {
        notice(t('Please indicate acceptance of the Terms of Service. Registration failed.') . EOL);
        return;
    }
    $policy = get_config('system', 'register_policy');
    $email_verify = get_config('system', 'verify_email');
    switch ($policy) {
        case REGISTER_OPEN:
            $flags = ACCOUNT_OK;
            break;
        case REGISTER_APPROVE:
            $flags = ACCOUNT_BLOCKED | ACCOUNT_PENDING;
            break;
        default:
        case REGISTER_CLOSED:
            if (!is_site_admin()) {
                notice(t('Permission denied.') . EOL);
                return;
            }
            $flags = ACCOUNT_BLOCKED;
            break;
    }
    if ($email_verify && $policy == REGISTER_OPEN) {
        $flags = $flags | ACCOUNT_UNVERIFIED;
    }
    if (!$_POST['password'] || $_POST['password'] !== $_POST['password2']) {
        notice(t('Passwords do not match.') . EOL);
        return;
    }
    $arr = $_POST;
    $arr['account_flags'] = $flags;
    $result = create_account($arr);
    if (!$result['success']) {
        notice($result['message']);
        return;
    }
    require_once 'include/security.php';
    $using_invites = intval(get_config('system', 'invitation_only'));
    $num_invites = intval(get_config('system', 'number_invites'));
    $invite_code = x($_POST, 'invite_code') ? notags(trim($_POST['invite_code'])) : '';
    if ($using_invites && $invite_code) {
        q("delete * from register where hash = '%s' limit 1", dbesc($invite_code));
        set_pconfig($result['account']['account_id'], 'system', 'invites_remaining', $num_invites);
    }
    if ($policy == REGISTER_OPEN) {
        if ($email_verify) {
            $res = verify_email_address($result);
        } else {
            $res = send_verification_email($result['email'], $result['password']);
        }
        if ($res) {
            info(t('Registration successful. Please check your email for validation instructions.') . EOL);
        }
    } elseif ($policy == REGISTER_APPROVE) {
        $res = send_reg_approval_email($result);
        if ($res) {
            info(t('Your registration is pending approval by the site owner.') . EOL);
        } else {
            notice(t('Your registration can not be processed.') . EOL);
        }
        goaway(z_root());
    }
    if ($email_verify) {
        goaway(z_root());
    }
    authenticate_success($result['account'], true, false, true);
    if (!strlen($next_page = get_config('system', 'workflow_register_next'))) {
        $next_page = 'new_channel';
    }
    $_SESSION['workflow'] = true;
    goaway(z_root() . '/' . $next_page);
}
开发者ID:Mauru,项目名称:red,代码行数:82,代码来源:register.php


示例11: createCustomerAccount

 function createCustomerAccount()
 {
     global $currencies, $customer_id, $onepage, $customer_default_address_id, $customer_first_name, $customer_country_id, $customer_zone_id, $languages_id, $sendto, $billto, $user, $auth, $cart, $customer_id, $_SERVER, $messageStack;
     $this->checkCartValidity();
     if ($onepage['createAccount'] === true && $this->checkEmailAddress($onepage['customer']['email_address'])) {
         require_once 'includes/functions/account.php';
         $data = array('firstname' => $onepage['billing']['firstname'], 'lastname' => $onepage['billing']['lastname'], 'email_address' => $onepage['customer']['email_address'], 'telephone' => $onepage['customer']['telephone'], 'fax' => $onepage['customer']['fax'], 'password' => $onepage['customer']['password'], 'confirmation' => $onepage['customer']['password'], 'street_address' => $onepage['billing']['street_address'], 'postcode' => $onepage['billing']['postcode'], 'city' => $onepage['billing']['city'], 'country' => $onepage['billing']['country_id'], 'forum_username' => '', 'TermsAgree' => '1');
         if (ACCOUNT_GENDER == 'true') {
             $data['gender'] = $onepage['billing']['gender'];
         }
         if (ACCOUNT_DOB == 'true') {
             $data['dob'] = tep_date_raw($onepage['customer']['dob']);
         }
         if (ACCOUNT_COMPANY == 'true') {
             $data['company'] = $onepage['billing']['company'];
         }
         if (ACCOUNT_COMPANY == 'true') {
             $data['btwnr'] = $onepage['billing']['btwnr'];
         }
         if (ACCOUNT_SUBURB == 'true') {
             $data['entry_suburb'] = $onepage['billing']['suburb'];
         }
         if (ACCOUNT_STATE == 'true') {
             $state = $onepage['billing']['state'];
             $zone_name = '';
             $zone_id = 0;
             $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int) $onepage['billing']['country_id'] . "'");
             $check = tep_db_fetch_array($check_query);
             $entry_state_has_zones = $check['total'] > 0;
             if ($entry_state_has_zones == true) {
                 $zone_query = tep_db_query("select distinct zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $onepage['billing']['country_id'] . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");
                 if (tep_db_num_rows($zone_query) == 1) {
                     $zone = tep_db_fetch_array($zone_query);
                     $zone_id = $zone['zone_id'];
                     $zone_name = $zone['zone_name'];
                 }
             }
             if ($zone_id > 0) {
                 $data['zone_id'] = $zone_id;
                 $data['state'] = '';
             } else {
                 $data['zone_id'] = '0';
                 $data['state'] = $state;
             }
         }
         if (count($onepage['customer']['newsletters']) > 0) {
             foreach ($onepage['customer']['newsletters'] as $newsletter) {
                 $data['newsletters_' . $newsletter] = '1';
             }
         }
         create_account($data);
         if (isset($_POST['diffShipping'])) {
             $sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $onepage['delivery']['firstname'], 'entry_lastname' => $onepage['delivery']['lastname'], 'entry_street_address' => $onepage['delivery']['street_address'], 'entry_postcode' => $onepage['delivery']['postcode'], 'entry_city' => $onepage['delivery']['city'], 'entry_country_id' => $onepage['delivery']['country_id']);
             if (ACCOUNT_GENDER == 'true') {
                 $sql_data_array['entry_gender'] = $onepage['delivery']['gender'];
             }
             if (ACCOUNT_COMPANY == 'true') {
                 $sql_data_array['entry_company'] = $onepage['delivery']['company'];
             }
             if (ACCOUNT_SUBURB == 'true') {
                 $sql_data_array['entry_suburb'] = $onepage['delivery']['suburb'];
             }
             if (ACCOUNT_STATE == 'true') {
                 $state = $onepage['delivery']['state'];
                 $zone_name = '';
                 $zone_id = 0;
                 $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int) $onepage['delivery']['country_id'] . "'");
                 $check = tep_db_fetch_array($check_query);
                 $entry_state_has_zones = $check['total'] > 0;
                 if ($entry_state_has_zones == true) {
                     $zone_query = tep_db_query("select distinct zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $onepage['delivery']['country_id'] . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");
                     if (tep_db_num_rows($zone_query) == 1) {
                         $zone = tep_db_fetch_array($zone_query);
                         $zone_id = $zone['zone_id'];
                         $zone_name = $zone['zone_name'];
                     }
                 }
                 if ($zone_id > 0) {
                     $sql_data_array['entry_zone_id'] = $zone_id;
                     $sql_data_array['entry_state'] = '';
                 } else {
                     $sql_data_array['entry_zone_id'] = '0';
                     $sql_data_array['entry_state'] = $state;
                 }
             }
             tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
         }
         if (isset($onepage['info']['order_id'])) {
             tep_db_query('update ' . TABLE_ORDERS . ' set customers_id = "' . $customer_id . '" where orders_id = "' . $onepage['info']['order_id'] . '"');
             unset($onepage['info']['order_id']);
         }
         if (!tep_session_is_registered('customer_id')) {
             tep_session_register('customer_id');
         }
         if (!tep_session_is_registered('sendto')) {
             tep_session_register('sendto');
         }
         if (!tep_session_is_registered('billto')) {
             tep_session_register('billto');
         }
//.........这里部分代码省略.........
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:101,代码来源:onepage_checkout.php


示例12: create_account

<?php

$title = 'Create new account';
require 'inc_header.php';
?>

	<?php 
$attempted_account_creation = false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $attempted_account_creation = true;
    $account_creation_error = create_account();
}
?>

	<?php 
if ($attempted_account_creation) {
    ?>
		<div class="span8 offset2">
			<?php 
    if (isset($account_creation_error)) {
        ?>
				<h2>Account creation error</h2>
				<p><?php 
        echo $account_creation_error;
        ?>
</p>
				<p><a href="<?php 
        echo BASE_URL;
        ?>
create-account.php">Return to account creation page</a></p>
开发者ID:srcclr-test-projects,项目名称:login-seamless-checkout-demo,代码行数:30,代码来源:create-account.php


示例13: create_account_and_ninja

function create_account_and_ninja($send_name, $params = array())
{
    $send_email = $params['send_email'];
    $send_pass = $params['send_pass'];
    $class_identity = $params['send_class'];
    $confirm = (int) $params['confirm'];
    $error = false;
    $data['ip'] = isset($params['ip']) ? $params['ip'] : null;
    $ninja_id = create_ninja($send_name, $params);
    $account_id = create_account($ninja_id, $send_email, $send_pass, $confirm, $type = 0, $active = 1, $data);
    if ($account_id) {
        $sent = send_signup_email($account_id, $send_email, $send_name, $confirm, $class_identity);
        if (!$sent && !DEBUG) {
            $error = 'There was a problem sending your signup to that email address.';
        }
    }
    return $error;
}
开发者ID:reillo,项目名称:ninjawars,代码行数:18,代码来源:lib_accounts.php


示例14: start_order_transaction

function start_order_transaction($mid, $amount)
{
    // Ensure 'order' account
    if (get_balance("ORD", $mid, null) == 'NO_ACCOUNT') {
        if (!create_account("ORD", $mid, null, $mid, ip2long(getRealIpAddr()), null, null, '')) {
            return FALSE;
        }
    }
    $date = time();
    $temp = mt_rand() + 1;
    $res = create_temp_transaction($temp, array(k_transaction_party("ORD", $mid, 1, $amount, $temp, $date, null), k_transaction_party("USR", $mid, 1, -$amount, $temp, $date, null)), ip2long(getRealIpAddr()), $date, '');
    if ($res < 1) {
        return FALSE;
    }
    $res = lock_transaction($temp);
    return $res == "2" ? $temp : FALSE;
}
开发者ID:enikesha,项目名称:v_order,代码行数:17,代码来源:utils.php


示例15: die

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>REST/OAuth Example</title>
    </head>
    <body>
        <tt>
            <?php 
$access_token = $_SESSION['access_token'];
$instance_url = $_SESSION['instance_url'];
if (!isset($access_token) || $access_token == "") {
    die("Error - access token missing from session!");
}
if (!isset($instance_url) || $instance_url == "") {
    die("Error - instance URL missing from session!");
}
show_accounts($instance_url, $access_token);
$id = create_account("My New Org", $instance_url, $access_token);
show_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
update_account($id, "My New Org, Inc", "San Francisco", $instance_url, $access_token);
show_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
delete_account($id, $instance_url, $access_token);
show_accounts($instance_url, $access_token);
?>
        </tt>
    </body>
</html>
开发者ID:rushyendra1,项目名称:cportalWP,代码行数:30,代码来源:demo_rest.php


示例16: signup

function signup($dirty_email)
{
    create_account($dirty_email);
}
开发者ID:andrewdownie,项目名称:projectportfolio.io,代码行数:4,代码来源:auth.php


示例17: login

        login($email, $password);
        return true;
    }
}
function is_password_match($password, $repeat)
{
    return strcmp($password, $repeat) == 0 ? true : false;
}
if (isset($_POST['create_account'])) {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $password = $_POST['password'];
    $repeat_password = $_POST['repeat_password'];
    $is_valid_password = is_password_match($password, $repeat_password);
    if ($is_valid_password) {
        $result = create_account($email, $password, $name);
        if ($result) {
            $success = "New account created successfully! Welcome" . $name;
        } else {
            $error = "A user with that email already exists. Have you forgotten your password?";
        }
    } else {
        $error = "Please check that your passwords match!";
    }
}
?>
<!DOCTYPE html>
<html lang="en">
 
<head>
	<meta charset="utf-8">
开发者ID:thejerrytan,项目名称:crowdsourcer,代码行数:31,代码来源:create_account.php


示例18: print_account_form

 */
include "lib/LibMooege.php";
$email = '';
$password = '';
// See if request contains email & password.
if (array_key_exists('email', $_REQUEST)) {
    $email = $_REQUEST['email'];
}
if (array_key_exists('password', $_REQUEST)) {
    $password = $_REQUEST['password'];
}
if (empty($email) || empty($password)) {
    // if email or password is empty.
    print_account_form();
} else {
    create_account($email, $password);
}
// try loging using given credentals.
function create_account($email, $password)
{
    $mooege = new LibMooege("http://localhost", 9000);
    // change this line to match your configuration.
    if (!$mooege->connected) {
        // check if we have a succesfull connection there.
        die("Can not connect to mooege!");
    }
    $exists = $mooege->AccountExists($email);
    if ($exists) {
        die("An account already exists for email address: {$email}!");
    }
    $created = $mooege->CreateAccount($email, $password);
开发者ID:wow4all,项目名称:mooege,代码行数:31,代码来源:register.php


示例19: post

 function post()
 {
     $max_dailies = intval(get_config('system', 'max_daily_registrations'));
     if ($max_dailies) {
         $r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s", db_utcnow(), db_quoteinterval('1 day'));
         if ($r && $r[0]['total'] >= $max_dailies) {
             notice(t('Maximum daily site registrations exceeded. Please try again tomorrow.') . EOL);
             return;
         }
     }
     if (!x($_POST, 'tos')) {
         notice(t('Please indicate acceptance of the Terms of Service. Registration failed.') . EOL);
         return;
     }
     $policy = get_config('system', 'register_policy');
     $email_verify = get_config('system', 'verify_email');
     switch ($policy) {
         case REGISTER_OPEN:
             $flags = ACCOUNT_OK;
             break;
         case REGISTER_APPROVE:
             $flags = ACCOUNT_BLOCKED | ACCOUNT_PENDING;
             break;
         default:
         case REGISTER_CLOSED:
             if (!is_site_admin()) {
                 notice(t('Permission denied.') . EOL);
                 return;
             }
             $flags = ACCOUNT_BLOCKED;
             break;
     }
     if ($email_verify && $policy == REGISTER_OPEN) {
         $flags = $flags | ACCOUNT_UNVERIFIED;
     }
     if (!$_POST['password'] || $_POST['password'] !== $_POST['password2']) {
         notice(t('Passwords do not match.') . EOL);
         return;
     }
     $arr = $_POST;
     $arr['account_flags'] = $flags;
     $result = create_account($arr);
     if (!$result['success']) {
         notice($result['message']);
         return;
     }
     require_once 'include/security.php';
     if ($_REQUEST['name']) {
         set_aconfig($result['account']['account_id'], 'register', 'channel_name', $_REQUEST['name']);
     }
     if ($_REQUEST['nickname']) {
         set_aconfig($result['account']['account_id'], 'register', 'channel_address', $_REQUEST['nickname']);
     }
     if ($_REQUEST['permissions_role']) {
         set_aconfig($result['account']['account_id'], 'register', 'permissions_role', $_REQUEST['permissions_role']);
     }
     $using_invites = intval(get_config('system', 'invitation_only'));
     $num_invites = intval(get_config('system', 'number_invites'));
     $invite_code = x($_POST, 'invite_code') ? notags(trim($_POST['invite_code'])) : '';
     if ($using_invites && $invite_code) {
         q("delete * from register where hash = '%s'", dbesc($invite_code));
         // @FIXME - this also needs to be considered when using 'invites_remaining' in mod/invite.php
         set_aconfig($result['account']['account_id'], 'system', 'invites_remaining', $num_invites);
     }
     if ($policy == REGISTER_OPEN) {
         if ($email_verify) {
             $res = verify_email_address($result);
         } else {
             $res = send_register_success_email($result['email'], $result['password']);
         }
         if ($res) {
             info(t('Registration successful. Please check your email for validation instructions.') . EOL);
         }
     } elseif ($policy == REGISTER_APPROVE) {
         $res = send_reg_approval_email($result);
         if ($res) {
             info(t('Your registration is pending approval by the site owner.') . EOL);
         } else {
             notice(t('Your registration can not be processed.') . EOL);
         }
         goaway(z_root());
     }
     if ($email_verify) {
         goaway(z_root());
     }
     authenticate_success($result['account'], null, true, false, true);
     $new_channel = false;
     $next_page = 'new_channel';
     if (get_config('system', 'auto_channel_create') || UNO) {
         $new_channel = auto_channel_create($result['account']['account_id']);
         if ($new_channel['success']) {
             $channel_id = $new_channel['channel']['channel_id'];
             change_channel($channel_id);
             $next_page = '~';
         } else {
             $new_channel = false;
         }
     }
     $x = get_config('system', 'workflow_register_next');
     if ($x) {
//.........这里部分代码省略.........
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:101,代码来源:Register.php


示例20: array_push

    $_POST = "";
}
// $_SESSION['panier'] = "";
if (in_array($_POST['nom'], $_SESSION['panier'], TRUE)) {
    $_SESSION['message_panier'] = "Déja dans ton panier tricheur !";
} else {
    array_push($_SESSION['panier'], $_POST['nom']);
}
$_SESSION['message'] = "";
if ($_POST['aff'] != 0) {
    $_SESSION['aff'] = $_POST['aff'];
} else {
    $_SESSION['aff'] = 0;
}
$_SESSION['message'] = $_SESSION['aff'];
if (create_account($_POST['login_reg'], $_POST['passwd_reg'], $_POST['submit_reg']) === TRUE) {
    $_POST['inscription'] = "";
    $_POST['login_reg'] = "";
    $_POST['passwd_reg'] = "";
    $_POST['submit_reg'] = "";
    $_SESSION['message'] = "Votre compte a été crée avec succès !";
}
if ($_POST['delete'] === 'Supprimer mon compte' && $_SESSION['login'] != "") {
    del_account($_SESSION['login']);
    $_POST['delete'] = "";
    $_POST['submit'] = 'Déconnexion';
}
if ($_POST['submit'] === 'Déconnexion') {
    $_SESSION['login'] = "";
    $_SESSION['admin'] = "";
    $_POST['login'] = "";
开发者ID:ptitmax,项目名称:42,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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