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

PHP newUser函数代码示例

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

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



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

示例1: loginAsNormalUser

 protected function loginAsNormalUser()
 {
     $un = 'user-' . uniqid();
     $u = newUser($email = $un . '@example.com', $username = $un, $password = 'abc123');
     $this->login($un, $password);
     $this->user = $u;
     return $u;
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:8,代码来源:harness.php


示例2: getUser

function getUser($email = '[email protected]')
{
    if (DB\countRows('users', "email = ?", array($email)) == 0) {
        return newUser($email, 'big-joe-' . time(), 'something');
    } else {
        return User::loadFromEmailAddr($email);
    }
}
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:8,代码来源:test.php


示例3: testOneEmailAddressMayNotBeAssociatedWithMultipleAccounts

 function testOneEmailAddressMayNotBeAssociatedWithMultipleAccounts()
 {
     newUser($email = '[email protected]', $username = 'joshers', $password = 'abc123');
     $this->get('/account/signup');
     $this->submitFormExpectingErrors($this->getForm(), array('username' => 'bigkid', 'email' => '[email protected]', 'password1' => 't0pS33cret', 'password2' => 't0pS33cret'));
     $this->assertContains("//div[contains(., 'already have an account')]");
     assertEqual(1, DB\countRows('users', 'email = ?', array('[email protected]')));
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:8,代码来源:signup.php


示例4: testUsersOverviewScreen

 function testUsersOverviewScreen()
 {
     newUser('[email protected]', 'some-user', 'abc');
     $u2 = newUser('[email protected]', 'other-user', 'def');
     DB\updateByID('users', $u2->id, array('created_at' => new \DateTime('now')));
     newUser('[email protected]', 'chris', 'secret!');
     $this->login('chris', 'secret!');
     $this->get('/admin/users/');
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:9,代码来源:basics.php


示例5: testUpdatePassword

function testUpdatePassword()
{
    clearDB();
    $u1 = newUser('[email protected]', 'a', 'mysecretpass');
    $u2 = newUser('[email protected]', 'b', 'sumthingsecret');
    $u1->updatePassword('newpass');
    $rows = DB\selectAllRows('users');
    assertNotEqual($rows[0]['password'], $rows[1]['password']);
}
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:9,代码来源:test-update-password.php


示例6: signUp

function signUp($db)
{
    if (!empty($_POST['username'])) {
        $myusername = mysqli_real_escape_string($db, $_POST['username']);
        $mypassword = mysqli_real_escape_string($db, $_POST['password']);
        $sql = "SELECT user_id FROM user WHERE username = '{$myusername}' and password = '{$mypassword}'";
        $result = mysqli_query($db, $sql);
        if (!$result) {
            die('Invalid query: ' . mysqli_error($db));
        }
        $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
        $count = mysqli_num_rows($result);
        if ($count == 1) {
            echo "Sorry you are already a registered user";
            echo "</br></br>This page will redirect in 5 seconds";
            header("refresh:5;url=../views/register-form.php");
        } else {
            newUser($db);
        }
    }
}
开发者ID:theonastos,项目名称:CD-Genius,代码行数:21,代码来源:register.php


示例7: get_client_ip

<?php

include './functions/user_logic.php';
include './functions/photo_logic.php';
$ip = get_client_ip();
$nick = $_POST['nick'];
$password = $_POST['password'];
$email = $_POST['email'];
$name = $_POST['name'];
$surname = $_POST['surname'];
$age = $_POST['age'];
$gender = $_POST['gender'];
$avatar = $_FILES['avatar'];
if (newUser($ip, $nick, $password, $email, $name, $surname, $age, $gender)) {
    echo "Usuario registrado.<br/>";
    $path = "data/user.png";
    if (isset($_FILES['avatar'])) {
        if (acceptImage($avatar)) {
            echo "Imagen aceptada.<br/>";
            $path = "data/" . $nick;
            if (!file_exists("../" . $path) and !is_dir("../" . $path)) {
                mkdir("../" . $path, 0777, true);
                // 0777 default for folder, rather than 0755
            }
            $path = $path . "/" . $avatar["name"];
            $error = uploadPhoto($ip, $avatar, $nick, $email, $path, "Fotos de Perfil");
            if ($error != '0') {
                $path = "data/user.png";
                switch ($error) {
                    case '1':
                        echo "No se ha podido crear el álbum de fotos.";
开发者ID:jagumiel,项目名称:bigou-Album,代码行数:31,代码来源:register_bl.php


示例8: dataBase

$con = dataBase();
//Подключение разных языков!!!
if (!isset($_SESSION['lang']) and $_SESSION['lang'] == NULL) {
    $_SESSION['lang'] = "ru";
}
if (isset($_POST['lang'])) {
    $_SESSION['lang'] = $_POST['lang'];
}
$lang = getLang($_SESSION['lang'], $con);
//Конец подключения разных языков!!!
if (isset($_POST['register']) and isset($_POST['login']) and isset($_POST['email']) and isset($_POST['password']) and isset($_POST['repassword'])) {
    $login = $_POST['login'];
    $email = $_POST['email'];
    $pass = $_POST['password'];
    $repass = $_POST['repassword'];
    $newUser = newUser($login, $email, $pass, $repass, $con);
    if ($newUser == "true") {
        header("Location: ../index.php?registration=success");
        exit;
    } else {
        $error = $newUser;
    }
}
?>

<!DOCTYPE html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
开发者ID:Creeone,项目名称:QuickTalks,代码行数:31,代码来源:about.php


示例9: __isset

    $o->{1} = $first_name;
    $o->{2} = $last_name;
    return $o;
}
class Something
{
    public function __isset($name)
    {
        return $name == 'first_name';
    }
    public function __get($name)
    {
        return new User(4, 'Jack', 'Sparrow');
    }
}
$records = array(newUser(1, 'John', 'Doe'), newUser(2, 'Sally', 'Smith'), newUser(3, 'Jane', 'Jones'), new User(1, 'John', 'Doe'), new User(2, 'Sally', 'Smith'), new User(3, 'Jane', 'Jones'), new Something());
echo "*** Testing array_column() : object property fetching (numeric property names) ***\n";
echo "-- first_name column from recordset --\n";
var_dump(array_column($records, 1));
echo "-- id column from recordset --\n";
var_dump(array_column($records, 0));
echo "-- last_name column from recordset, keyed by value from id column --\n";
var_dump(array_column($records, 2, 0));
echo "-- last_name column from recordset, keyed by value from first_name column --\n";
var_dump(array_column($records, 2, 1));
echo "*** Testing array_column() : object property fetching (string property names) ***\n";
echo "-- first_name column from recordset --\n";
var_dump(array_column($records, 'first_name'));
echo "-- id column from recordset --\n";
var_dump(array_column($records, 'id'));
echo "-- last_name column from recordset, keyed by value from id column --\n";
开发者ID:gleamingthecube,项目名称:php,代码行数:31,代码来源:ext_standard_tests_array_array_column_variant_objects.php


示例10: InputFilter

<?php

//  $query = $coll->findOne(array('login' => $_POST['login']));
require_once 'seguridad/class.inputfilter.php';
$filtro = new InputFilter();
$_POST = $filtro->process($_POST);
$usuario = $_POST['login'];
$password = $_POST['password'];
///////////////////////////////////////
include_once "config.php";
if (newUser($usuario, $password)) {
    header("Refresh: 0;url=confirmar.php?mensaje=1");
} else {
    header("Refresh: 0;url=confirmar.php?mensaje=2");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Crear usuario</title>
</head>
<body>
	
</body>
</html>
开发者ID:esneyder,项目名称:sitemongodbphp,代码行数:26,代码来源:crearuser.php


示例11: session_start

<?php 
session_start();
//подключение конфигов
include "../include/stack.php";
$con = dataBase();
if (isset($_POST['register']) and isset($_POST['login']) and isset($_POST['email']) and isset($_POST['password']) and isset($_POST['repassword'])) {
    $login = $_POST['login'];
    $email = $_POST['email'];
    $pass = $_POST['password'];
    $repass = $_POST['repassword'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $newUser = newUser($login, $email, $pass, $repass, "registration", $firstname, $lastname, "", $con);
    if ($newUser == "true") {
        header("Location: ../index.php?registration=success");
        exit;
    } else {
        $error = $newUser;
    }
}
?>

<!DOCTYPE html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Cake Group | Регистрация</title>
开发者ID:Creeone,项目名称:QuickTalks,代码行数:30,代码来源:register.php


示例12: USERS2

        return false;
    }
    $stmnt2->close();
    $stmnt = $conn->prepare("INSERT INTO USERS2(USER_UID,USER_PWDHSH,USER_PWDSALT,USER_FNAME,USER_LNAME, USER_EMAIL, VERIFYED) VALUES(?,?,?,?,?,?,1)");
    $salt = file_get_contents('/dev/urandom', false, null, 0, 64);
    $options = array('salt' => $salt);
    $phash = crypt($password, $salt);
    $stmnt->bind_param('ssssss', $username, $phash, $salt, $fname, $lname, $email);
    $stmnt->execute();
    $stmnt->close();
    $conn->close();
    return true;
}
$fail = false;
session_start();
if (newUser($_POST["USERNAME"], $_POST["PASSWORD"], $_POST["PASSWORD2"], $_POST["FNAME"], $_POST["LNAME"], $_POST["EMAIL"])) {
    echo "True";
    //make folder for every new user
    $dir = "/var/www/html/facePics/" . $_POST["USERNAME"];
    mkdir($dir);
    //make csv file
    $file = $dir . "/csv";
    touch($file);
    $mail = $_POST["EMAIL"];
    $name = $_POST["USERNAME"];
    $subject = "Welcome to the Who R U";
    $message = "141.210.25.46/email.php?USERNAME={$name}";
    $headers = "";
    $from = "-f [email protected]";
    if (mail($mail, $subject, $message)) {
        //		echo "Mail worked";
开发者ID:Alzheimers480,项目名称:docker,代码行数:31,代码来源:newuser.php


示例13: array

    $result = false;
    $params = array('client_id' => $client_id, 'redirect_uri' => $redirect_uri, 'client_secret' => $client_secret, 'code' => $_GET['code']);
    $url = 'https://graph.facebook.com/oauth/access_token';
}
//Для того чтобы распарсить данный ответ, воспользуемся функцией parse_str, а результат (в виде массива) запишем в переменную $tokenInfo:
$tokenInfo = null;
parse_str(file_get_contents($url . '?' . http_build_query($params)), $tokenInfo);
//Получение информации о пользователе
if (count($tokenInfo) > 0 && isset($tokenInfo['access_token'])) {
    $params = array('access_token' => $tokenInfo['access_token']);
    $userInfo = json_decode(file_get_contents('https://graph.facebook.com/me' . '?' . urldecode(http_build_query($params))), true);
    if (isset($userInfo['id'])) {
        $userInfo = $userInfo;
        $result = true;
    }
}
//Показ данных пользователя
if ($result) {
    $login = formChars($userInfo['id']);
    $pass = formChars($userInfo['id']);
    $repass = formChars($userInfo['id']);
    $id = userLogin($login, $pass, $con);
    if ($id == false) {
        newUser($login, "", $pass, $repass, "facebook", $userInfo['name'], "", "http://graph.facebook.com/" . $userInfo['id'] . "/picture?type=large", $con);
    }
    $id = userLogin($login, $pass, $con);
    usersLog($id, "Пользователь успешно авторизовался и вошел в сеть", $con);
    $_SESSION['idUser'] = $id;
    header("Location: ../pages/profile.php");
    exit;
}
开发者ID:Creeone,项目名称:QuickTalks,代码行数:31,代码来源:facebook.php


示例14: participantSearch

		echo participantSearch($_GET['search']);
	}
	
	if(isset($_GET['confirm'])){
		participantConfirm($_GET['confirm']);
	}
	
	if(isset($_GET['participantevent'])){
		echo participantEvents($_GET['participantevent']);
	}
	
	if(isset($_GET['participantinfo'])){
		echo participantInfo($_GET['participantinfo']);
	}
	
	if(isset($_POST['pname'])&&
		isset($_POST['pemail'])&&
		isset($_POST['pclg'])&&
		isset($_POST['pcntct'])&&
		isset($_POST['pstate'])&&
		isset($_POST['pgender'])&&
		isset($_POST['preq'])){
		header("Location: ../details.php?tid=".newUser($_POST['pname'],$_POST['pemail'],$_POST['pclg'],$_POST['pcntct'],$_POST['pstate'],$_POST['pgender'],$_POST['preq']));
	}

	if(isset($_POST['pid']) && isset($_POST['pname']) && isset($_POST['pemail']) && isset($_POST['pclg']) && isset($_POST['pcntct']) && isset($_POST['pstate']) && isset($_POST['preq']) && isset($_POST['pnitc'])){
		echo updateParticipantInfo($_POST['pid'], $_POST['pname'],$_POST['pemail'],$_POST['pclg'],$_POST['pcntct'],$_POST['pstate'],$_POST['preq'],$_POST['pnitc']);
		}
	
?>
开发者ID:nitcalicut,项目名称:Sockmonkey,代码行数:30,代码来源:response.participant.php


示例15: trigger_error

        trigger_error($result->getMessage(), E_USER_ERROR);
    }
    // Find the max cust_id
    $result = $connection->query("SELECT max(cust_id) FROM customer");
    if (DB::isError($result)) {
        trigger_error($result->getMessage(), E_USER_ERROR);
    }
    $row = $result->fetchRow(DB_FETCHMODE_ASSOC);
    // Work out the next available ID
    $cust_id = $row["max(cust_id)"] + 1;
    // Insert the new customer
    $query = "INSERT INTO customer VALUES ({$cust_id}, \n            '{$_SESSION["custFormVars"]["surname"]}', \n            '{$_SESSION["custFormVars"]["firstname"]}',  \n            '{$_SESSION["custFormVars"]["initial"]}', \n            {$_SESSION["custFormVars"]["title_id"]}, \n            '{$_SESSION["custFormVars"]["address"]}', \n            '{$_SESSION["custFormVars"]["city"]}', \n            '{$_SESSION["custFormVars"]["state"]}', \n            '{$_SESSION["custFormVars"]["zipcode"]}', \n            {$_SESSION["custFormVars"]["country_id"]}, \n            '{$_SESSION["custFormVars"]["phone"]}', \n            '{$_SESSION["custFormVars"]["birth_date"]}')";
    $result = $connection->query($query);
    if (DB::isError($result)) {
        trigger_error($result->getMessage(), E_USER_ERROR);
    }
    // Unlock the customer table
    $result = $connection->query("UNLOCK TABLES");
    if (DB::isError($result)) {
        trigger_error($result->getMessage(), E_USER_ERROR);
    }
    // As this was an INSERT, we need to INSERT into the users table too
    newUser($_SESSION["custFormVars"]["loginUsername"], $_SESSION["custFormVars"]["loginPassword"], $cust_id, $connection);
    // Log the user into their new account
    registerLogin($_SESSION["custFormVars"]["loginUsername"]);
}
// Clear the custFormVars so a future form is blank
unset($_SESSION["custFormVars"]);
unset($_SESSION["custErrors"]);
// Now show the customer receipt
header("Location: " . S_CUSTRECEIPT);
开发者ID:awashValley,项目名称:PhP_MySQL_Lab,代码行数:31,代码来源:validate.php


示例16: signUp

function signUp()
{
    global $db;
    // refer to the global variable 'db'
    $userID = $_POST['user'];
    $userpass = $_POST['pass'];
    if (!empty($userID)) {
        $query = "SELECT * FROM USER WHERE user_id='" . $userID . "' AND hashed_password ='" . $userpass . "' LIMIT 1";
        $res = $db->query($query);
        if (!$res) {
            exit("There is a MySQL error, exiting this script");
        }
        if (!($row = mysqli_fetch_row($res))) {
            newUser();
        } else {
            echo "SORRY...YOU ARE ALREADY REGISTERED USER";
        }
    }
}
开发者ID:a0099654,项目名称:a0099654.github.io,代码行数:19,代码来源:signup.php


示例17: filter_input

}
$answer = "[\"Error. No function executed\"]";
$method = filter_input(INPUT_POST, "method");
if ($method) {
    $id = $mysqli->real_escape_string(filter_input(INPUT_POST, "id"));
    $firstname = $mysqli->real_escape_string(filter_input(INPUT_POST, "firstname"));
    $lastname = $mysqli->real_escape_string(filter_input(INPUT_POST, "lastname"));
    $nickname = $mysqli->real_escape_string(filter_input(INPUT_POST, "nickname"));
    $sex = $mysqli->real_escape_string(filter_input(INPUT_POST, "sex"));
    $birthday = $mysqli->real_escape_string(filter_input(INPUT_POST, "birthday"));
    $lefteye_x = $mysqli->real_escape_string(filter_input(INPUT_POST, "lefteyeX"));
    $lefteye_y = $mysqli->real_escape_string(filter_input(INPUT_POST, "lefteyeY"));
    $righteye_x = $mysqli->real_escape_string(filter_input(INPUT_POST, "righteyeX"));
    $righteye_y = $mysqli->real_escape_string(filter_input(INPUT_POST, "righteyeY"));
    if ($method == "newuser") {
        $answer = newUser($firstname, $lastname, $nickname, $sex, $birthday);
    } elseif ($method == "getallusers") {
        $answer = getAllUsers();
    } elseif ($method == "getuserdata") {
        $answer = getUserData($id);
    } elseif ($method == "updateuser") {
        $answer = updateUser($id, $firstname, $lastname, $nickname, $sex, $birthday);
    } elseif ($method == "deleteuser") {
        $answer = deleteuser($id);
    } elseif ($method == "getuserimageids") {
        $answer = getUserImageIds($id);
    } elseif ($method == "newphoto") {
        $answer = uploadNewPhoto($id);
    } elseif ($method == "deletephoto") {
        $answer = deletePhoto($id);
    } elseif ($method == "updateeyes") {
开发者ID:SirLemyDanger,项目名称:magicmirror,代码行数:31,代码来源:db.php


示例18: main

function main($usercount, $groupcount, $noticeavg, $subsavg, $joinsavg, $tagmax)
{
    global $config;
    $config['site']['dupelimit'] = -1;
    $n = 0;
    $g = 0;
    // Make users first
    $preuser = min($usercount, 5);
    for ($j = 0; $j < $preuser; $j++) {
        printfv("{$i} Creating user {$n}\n");
        newUser($n);
        $n++;
    }
    $pregroup = min($groupcount, 3);
    for ($k = 0; $k < $pregroup; $k++) {
        printfv("{$i} Creating group {$g}\n");
        newGroup($g, $n);
        $g++;
    }
    // # registrations + # notices + # subs
    $events = $usercount + $groupcount + $usercount * ($noticeavg + $subsavg + $joinsavg);
    $events -= $preuser;
    $events -= $pregroup;
    $ut = $usercount;
    $gt = $ut + $groupcount;
    $nt = $gt + $usercount * $noticeavg;
    $st = $nt + $usercount * $subsavg;
    $jt = $st + $usercount * $joinsavg;
    printfv("{$events} events ({$ut}, {$gt}, {$nt}, {$st}, {$jt})\n");
    for ($i = 0; $i < $events; $i++) {
        $e = rand(0, $events);
        if ($e >= 0 && $e <= $ut) {
            printfv("{$i} Creating user {$n}\n");
            newUser($n);
            $n++;
        } else {
            if ($e > $ut && $e <= $gt) {
                printfv("{$i} Creating group {$g}\n");
                newGroup($g, $n);
                $g++;
            } else {
                if ($e > $gt && $e <= $nt) {
                    printfv("{$i} Making a new notice\n");
                    newNotice($n, $tagmax);
                } else {
                    if ($e > $nt && $e <= $st) {
                        printfv("{$i} Making a new subscription\n");
                        newSub($n);
                    } else {
                        if ($e > $st && $e <= $jt) {
                            printfv("{$i} Making a new group join\n");
                            newJoin($n, $g);
                        } else {
                            printfv("No event for {$i}!");
                        }
                    }
                }
            }
        }
    }
}
开发者ID:harriewang,项目名称:InnertieWebsite,代码行数:61,代码来源:createsim.php


示例19: newArticle

     newArticle();
     break;
 case 'editArticle':
     editArticle();
     break;
 case 'deleteArticle':
     deleteArticle();
     break;
 case 'viewArticle':
     viewArticle();
     break;
 case 'archive':
     archive();
     break;
 case 'newUser':
     newUser();
     break;
 case 'editUser':
     editUser();
     break;
 case 'deleteUser':
     deleteUser();
     break;
 case 'viewUser':
     viewUser();
     break;
 case 'users':
     users();
     break;
 default:
     homepage();
开发者ID:Nex-Otaku,项目名称:combo-cms,代码行数:31,代码来源:index.php


示例20: session_start

 * Auteur : Romain Maillard
 * Date   : 28.09.2015
 * But: Création d'un nouvel utilisateur
 */
session_start();
//  Inclusion fichier de fonction.
require_once "include/fonction.php";
//  V?rifie si l'utilisateur est d?j? connect? sinon le redirige vers signin.php.
if (!isConnected()) {
    header('Location: signout.php');
}
if ($_SESSION['role'] != 2) {
    header('Location: index.php');
}
if (isset($_POST['ok'])) {
    if (!newUser($_POST['username'], $_POST['password'], $_POST['passwordretape'], $_POST['role'], $_POST['active'])) {
        echo "<script>alert('Add failed');</script>";
    } else {
        header('Location: admin.php');
    }
}
//  ***************************************************************************
?>
 
<!DOCTYPE html> 
<html lang="fr"> 
    <head> 
        <meta charset="utf-8">         
        <meta http-equiv="X-UA-Compatible" content="IE=edge">         
        <meta name="viewport" content="width=device-width, initial-scale=1">         
        <meta name="description" content="">         
开发者ID:marom17,项目名称:STI-labo02,代码行数:31,代码来源:newuser.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP new_addslashes函数代码示例发布时间:2022-05-15
下一篇:
PHP newStoryFor函数代码示例发布时间: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