本文整理汇总了PHP中add_user函数的典型用法代码示例。如果您正苦于以下问题:PHP add_user函数的具体用法?PHP add_user怎么用?PHP add_user使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform_operation
function perform_operation($op)
{
if ($op == 'login') {
validate_user($_POST["useremail"], $_POST["userpassword"]);
} else {
if ($op == 'getyaks') {
get_yaks($_POST["longitude"], $_POST["latitude"]);
} else {
if ($op == 'post_yak') {
post_yak($_POST["postedyak"], $_POST["latitude"], $_POST["longitude"]);
} else {
if ($op == 'banned_user') {
banned_user($_POST["useremail"]);
} else {
if ($op == 'add_user') {
add_user($_POST["useremail"], $_POST["userpassword"]);
} else {
if ($op == 'send_email') {
send_email($_POST["email"]);
} else {
if ($op == 'getHot_yaks') {
getHot_yaks();
} else {
if ($op == 'getCold_yaks') {
getCold_yaks();
} else {
if ($op == 'upvote') {
upvote($_POST["id"]);
} else {
if ($op == 'downvote') {
downvote($_POST["id"]);
}
}
}
}
}
}
}
}
}
}
}
示例2: attempt_register
function attempt_register($username, $password1, $password2)
{
$pass1 = trim($password1);
$pass2 = trim($password2);
if ($username != "" && $pass1 != "" && $pass2 != "") {
$user = find_username($username);
if (!$user) {
if ($pass1 === $pass2) {
$encryptedPass = password_encrypt($pass1);
add_user($username, $encryptedPass);
return true;
} else {
echo "<div id=\"error\">";
echo "passwords do not match";
echo "</div>";
}
} else {
echo "<div id=\"error\">";
echo " this user name has been taken";
echo "</div>";
}
} else {
echo "<div id=\"error\">";
echo "please enter all feilds";
echo "</div>";
}
}
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
global $fossology_testconfig;
global $scheduler_path;
global $cp2foss_path;
global $PG_CONN;
$fossology_testconfig = getenv('FOSSOLOGY_TESTCONFIG');
/** set default config dir as /etc/fossology/ */
if (empty($fossology_testconfig)) {
$fossology_testconfig = "/usr/local/etc/fossology/";
}
fwrite(STDOUT, __METHOD__ . " got fossology_testconfig = '{$fossology_testconfig}'\n");
$cp2foss_path = "cp2foss";
/* locate the scheduler binary */
$scheduler_path = $fossology_testconfig . "/mods-enabled/scheduler/agent/fo_scheduler";
if (!is_executable($scheduler_path)) {
print "Error: Scheduler path '{$scheduler_path}' is not executable!\n";
exit(1);
}
/* invoke the scheduler */
$scheduler_cmd = "{$scheduler_path} --daemon --reset --verbose=952 -c {$fossology_testconfig}";
print "DEBUG: Starting scheduler with '{$scheduler_cmd}'\n";
exec($scheduler_cmd, $output, $return_var);
//print_r($output);
if ($return_var != 0) {
print "Error: Could not start scheduler '{$scheduler_path}'\n";
print "{$output}\n";
exit(1);
}
$PG_CONN = connect_to_DB($fossology_testconfig);
// connect db
add_user("fossy", "fossy");
// add account fossy/fossy
print "\nStarting functional test for cp2foss. \n";
}
示例4: olpay_end
function olpay_end($numcode)
{
global $db, $pre, $webdb, $banktype, $pay_code, $lfjuid;
$pay_code = str_replace('QIBO', '=', $pay_code);
//这个符号“=”容易出问题
if (!$pay_code) {
showerr("数据有误!!");
}
list($type, $atc_moeny, $atc_numcode, $mid, $shopmoney) = explode("\t", mymd5($pay_code, 'DE'));
if ($atc_numcode != intval($numcode)) {
showerr("数据被修改过!!");
}
//主要是针对支付宝不能单纯一位数字的问题,inc/olpay/alipay.php,文件中做了修改
$numcode = str_replace("code", "", $numcode);
//万能表单订单
if ($type == 'form') {
$rt = $db->get_one("SELECT * FROM {$pre}olpay WHERE numcode='{$numcode}' AND `formid`='{$mid}'");
//商城订单
} elseif ($type == 'module') {
$rt = $db->get_one("SELECT * FROM {$pre}olpay WHERE numcode='{$numcode}' AND `moduleid`='{$mid}'");
$db->query("UPDATE {$pre}shoporderuser SET ifpay='1' WHERE id='{$atc_numcode}'");
//奖励积分
if ($shopmoney) {
add_user($lfjuid, $shopmoney, '购买商品得分');
}
}
if (!$rt) {
showerr('系统中没有您的订单,无法完成支付!');
}
if ($rt['ifpay'] == 1) {
showerr('该订单已经支付成功!');
}
$db->query("UPDATE {$pre}olpay SET ifpay='1' WHERE id='{$rt['id']}'");
refreshto("{$webdb['www_url']}/", "恭喜你支付成功", 60);
}
示例5: try_add_user
function try_add_user($login, $pass, $pass2, $realname, $session, $is_admin, $antispam)
{
$return_val = false;
// Help prevent robot registrations
if (!check_antispam($antispam)) {
display_error("Invalid security code");
} else {
if ($session != md5(session_id() . $_SERVER['REMOTE_ADDR'])) {
display_error("Invalid session.");
} else {
if ($pass != $pass2) {
display_warning("Password mismatch");
} else {
if ($realname == '' || $pass == '' || $pass2 == '' || $login == '') {
display_warning("Please fill out all fields");
} else {
if (get_user_id($login) > 0) {
display_error("The user <strong>{$login}</strong> already exists.");
} else {
add_user($login, $realname, $pass, $is_admin);
$return_val = display_success("<strong>{$login}</strong> has been successfully created");
}
}
}
}
}
return $return_val;
}
示例6: user_add
function user_add()
{
$code = _post('code');
if ($_SESSION['code'] == $code) {
if (add_user(trim(@mysql_real_escape_string(_post('username'))), @mysql_real_escape_string(_post('email')), md5(@mysql_real_escape_string(_post('password'))), '') > 0) {
return ajax_echo('注册成功');
}
} else {
return ajax_echo('验证码错误');
}
}
示例7: setUp
public function setUp()
{
$this->genre = "Bouncing";
$this->the_title = "My First DVD Title";
add_genre($this->genre, "A description of {$genre}");
$values = array($this->the_title, "2005", "Bob Jangles", "18", $this->genre);
add_dvd($values);
$this->testusername = "TestUser";
$this->testpassword = "TestPassword";
add_user($this->testusername, $this->testpassword);
// store in object so we can use them later on.
}
示例8: olpay_end
function olpay_end($numcode)
{
global $db, $pre, $webdb, $banktype;
$rt = $db->get_one("SELECT * FROM {$pre}olpay WHERE numcode='{$numcode}' AND `paytype`=1");
if (!$rt) {
showerr('系统中没有您的充值订单,无法完成充值!');
}
if ($rt['ifpay'] == 1) {
showerr('该订单已经充值成功!');
}
$db->query("UPDATE {$pre}olpay SET ifpay='1' WHERE id='{$rt['id']}'");
$num = $rt[money] * $webdb[alipay_scale];
add_user($rt[uid], $num, '在线充值');
refreshto("{$webdb['www_url']}/", "恭喜你充值成功", 10);
}
示例9: do_wefact_auth
function do_wefact_auth($u, $p)
{
$wefact = new WeFactApi();
$r = $wefact->sendRequest('debtor', 'show', array('DebtorCode' => $u));
if (isset($r['status']) && $r['status'] == 'success') {
$r = $wefact->sendRequest('debtor', 'checklogin', array('Username' => $u, 'Password' => $p));
if (isset($r['status']) && $r['status'] == 'success') {
if (get_user_info($u) == FALSE) {
add_user($u);
}
return TRUE;
}
return FALSE;
} else {
return -1;
}
}
示例10: get_allInfo
function get_allInfo($value, $type = 'id')
{
global $webdb;
$array1 = $this->get_passport($value, $type);
if (!$array1) {
return;
}
$array2 = $this->get_info($value, $type);
if ($array2) {
$array1 = $array2 + $array1;
} else {
$array = array('uid' => $array1[uid], 'username' => $array1[username], 'email' => $array1[email], 'yz' => $webdb[RegYz]);
$this->register_data($array);
add_user($array1[uid], $webdb[regmoney], '注册得分');
$array1[yz] = $webdb[RegYz];
}
return $array1;
}
示例11: test_add_user
/**
* Tests the controller function that expects slashed data
*
*/
function test_add_user()
{
$_POST = $_GET = $_REQUEST = array();
$_POST['user_login'] = 'slash_example_user_1';
$_POST['pass1'] = 'password';
$_POST['pass2'] = 'password';
$_POST['role'] = 'subscriber';
$_POST['email'] = 'user1@example.com';
$_POST['first_name'] = $this->slash_1;
$_POST['last_name'] = $this->slash_3;
$_POST['nickname'] = $this->slash_5;
$_POST['display_name'] = $this->slash_7;
$_POST['description'] = $this->slash_3;
$_POST = add_magic_quotes($_POST);
// the edit_post() function will strip slashes
$id = add_user();
$user = get_user_to_edit($id);
$this->assertEquals($this->slash_1, $user->first_name);
$this->assertEquals($this->slash_3, $user->last_name);
$this->assertEquals($this->slash_5, $user->nickname);
$this->assertEquals($this->slash_7, $user->display_name);
$this->assertEquals($this->slash_3, $user->description);
$_POST = $_GET = $_REQUEST = array();
$_POST['user_login'] = 'slash_example_user_2';
$_POST['pass1'] = 'password';
$_POST['pass2'] = 'password';
$_POST['role'] = 'subscriber';
$_POST['email'] = 'user2@example.com';
$_POST['first_name'] = $this->slash_2;
$_POST['last_name'] = $this->slash_4;
$_POST['nickname'] = $this->slash_6;
$_POST['display_name'] = $this->slash_2;
$_POST['description'] = $this->slash_4;
$_POST = add_magic_quotes($_POST);
// the edit_post() function will strip slashes
$id = add_user();
$user = get_user_to_edit($id);
$this->assertEquals($this->slash_2, $user->first_name);
$this->assertEquals($this->slash_4, $user->last_name);
$this->assertEquals($this->slash_6, $user->nickname);
$this->assertEquals($this->slash_2, $user->display_name);
$this->assertEquals($this->slash_4, $user->description);
}
示例12: get_content
function get_content($page)
{
if (!isset($page)) {
$page = "";
}
switch ($page) {
case 'add_user':
add_user();
break;
case 'get_fed_balance':
get_fed_balance();
break;
case 'change_fed_pin':
change_fed_pin();
break;
case 'change_fed_password':
change_fed_password();
break;
case 'transfer_to_bank':
transfer_to_bank();
break;
case 'transfer_internal_funds':
transfer_internal_funds();
break;
case 'view_account_funds':
view_account_funds();
break;
case 'view_transactions':
view_transactions();
break;
case 'pay_bill':
pay_bill();
break;
case 'change_local_password':
change_local_password();
break;
case 'change_page':
change_page();
break;
default:
echo "Please Select Choice.";
}
}
示例13: register
function register($username, $password, $confirm)
{
if (empty($username)) {
return error_message(E_REGISTER, E_NO_USERNAME);
}
if (empty($password)) {
return error_message(E_REGISTER, E_NO_PASSWORD);
}
if (empty($confirm)) {
return error_message(E_REGISTER, E_NO_CONFIRM);
}
if ($password !== $confirm) {
return error_message(E_REGISTER, 'Mismatch');
}
// $user = look_up_key_value($username, USER_ACCOUNT_FILE);
$user = lookup_user($username);
if (!empty($user)) {
return error_message(E_REGISTER, E_ACCOUNT_EXISTS);
}
// add_key_value($username, [$username, password_hash($password, PASSWORD_DEFAULT)], USER_ACCOUNT_FILE);
add_user($username, password_hash($password, PASSWORD_DEFAULT));
set_user($username);
return '';
}
示例14: proceed
public function proceed()
{
if (Input::get('currStep') == "1") {
$lang = Input::get('language');
Config::set('app.locale', $lang);
$this->data['currStep'] = "2";
}
if (Input::get('currStep') == "2") {
$title = isset($_POST['title']) ? $_POST['title'] : 'Shopvel';
$username = $_POST['username'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$email = $_POST['email'];
$url = $_POST['url'];
$this->data['currStep'] = "3";
if (empty($username) || empty($password) || empty($email) || $password !== $password2) {
if (empty($username) || empty($password) || empty($email)) {
$this->data['installErrors'][] = "Please fill in all required(*) fields.";
}
if ($password !== $password2) {
$this->data['installErrors'][] = "Password fields are not identical.";
}
$this->data['currStep'] = "2";
} else {
add_user($username, $email, $password, 'admin', '', 1);
add_option('sitename', $title);
add_option('sitedescription', '');
add_option('adminurl', $url);
add_option('theme', 'default');
add_option('loginurl', 'login');
add_option('registerurl', 'register');
$this->data['currStep'] = "3";
}
}
return View::make('install', $this->data);
}
示例15: load_hook
if (isset($_POST['submit'])) {
// did they fall for the honeypot?
if ($_POST['username']) {
$error = "bot.";
} else {
load_hook('registration_check');
if (!$error) {
// If they want to validate age then ok!
if ($config['age_validation']) {
// Age conversion
$age = "{$_POST['month']}/{$_POST['day']}/{$_POST['year']}";
} else {
$age = false;
}
// The results
$result = add_user($_POST['blatent'], $_POST['password'], $_POST['pagain'], $_POST['email'], $age);
// Check the results?
if (is_string($result)) {
// String is instant error.
$error = $result;
} else {
if ($result === false) {
$error = lang('error_unknown');
} else {
if (is_numeric($result)) {
switch ($result) {
case 1:
header('location: index.php');
break;
case 904:
$success = lang_parse('success_reg_email_msg', array($_POST['email']));