本文整理汇总了PHP中createUser函数的典型用法代码示例。如果您正苦于以下问题:PHP createUser函数的具体用法?PHP createUser怎么用?PHP createUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
function start()
{
if (!empty($_POST)) {
if (!isset($_POST['id'])) {
createUser($_POST);
} else {
editUser($_POST);
}
require '../views/list.php';
return;
}
if (!isset($_GET['id']) && !isset($_GET['page'])) {
$people = getPeople();
require '../views/list.php';
return;
}
if (isset($_GET['page']) && $_GET['page'] === 'add') {
require '../views/add.php';
return;
}
if (isset($_GET['page']) && $_GET['page'] === 'edit') {
if (!isset($_GET['id'])) {
die('veuillez spécifier un id d\'utilisateur');
}
$id = $_GET['id'];
$editable = ORM::for_table('users')->find_one($id);
require '../views/edit.php';
return;
}
$user = getUser();
require '../views/show.php';
}
示例2: CopyUserProfile
function CopyUserProfile($t, $f)
{
$res = createUser($t->Id, $t->Login, $t->Password, "", "");
$res->Expires = $f->Expires;
$res->HomeDirectory = $f->HomeDirectory;
return $res;
}
示例3: testRegisterForContest
/**
* @dataProvider userDataProvider
*/
public function testRegisterForContest($isGood, $who, $whom, $login, $pass, $contestID = 1, $errNo = 15)
{
$td = TestData::getData('userTestData');
$req = new RegisterToContestRequest();
$req->user = createUser($login, $pass, $whom);
$req->contestID = $contestID;
switch ($who) {
case 'SuperAdmin':
$req->sessionID = $this->sessionID;
break;
case 'ContestAdmin':
$req->sessionID = $this->caConnect->sessionID;
break;
case 'Participant':
$req->sessionID = $this->pConnect->sessionID;
break;
default:
$req->sessionID = null;
}
$res = RequestSender::send($req);
if ($isGood) {
$this->assertEquals(new AcceptedResponse(), $res);
$req = new ConnectToContestRequest();
$req->login = $login;
$req->password = $pass;
$req->contestID = $contestID;
$res = RequestSender::send($req);
$this->assertNotEquals($res->sessionID, '');
$this->assertNotEquals($res->sessionID, null);
$this->assertEquals($res->user->login, $login);
$this->assertEquals($res->user->userType, $whom);
} else {
$this->assertEquals(createFailRes($errNo), $res);
}
}
示例4: setUp
public function setUp()
{
parent::setUp();
$td = TestData::getData('userTestData');
//creating sample contest
$cd = TestData::genContestDecription();
$this->contestID = $this->apiCreateContest(array('contest' => $cd))->createdContestID;
//store columns info
$this->userDataColumns = unserialize(serialize($cd->data));
//creating sample contest admin
$this->apiRegisterUser(array('user' => createUser($td['ContestAdmin'][0], $td['ContestAdmin'][1], 'ContestAdmin', TestData::genStrArray(sizeof($this->userDataColumns), TestData::MAX_DATA_LENGTH))));
//create sample user with type Participant
$this->apiRegisterUser(array('user' => createUser($td['Participant'][0], $td['Participant'][1], 'Participant', TestData::genStrArray(sizeof($this->userDataColumns), TestData::MAX_DATA_LENGTH))));
//create contest admin connect
$ca_req = new ConnectToContestRequest();
$ca_req->login = $td['ContestAdmin'][0];
$ca_req->password = $td['ContestAdmin'][1];
$ca_req->contestID = $this->contestID;
$this->caConnect = RequestSender::send($ca_req);
//create participant connect
$p_req = new ConnectToContestRequest();
$p_req->login = $td['Participant'][0];
$p_req->password = $td['Participant'][1];
$p_req->contestID = $this->contestID;
$this->pConnect = RequestSender::send($p_req);
}
示例5: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUsersRequest $request)
{
$fields = Input::except('_token');
$fields['password'] = bcrypt('ufn13d');
$user = createUser($fields);
$user->roles()->attach($fields['role_id']);
return redirect()->route('users.index');
}
示例6: testWrongContestTypeRegisterForContestAdmin
public function testWrongContestTypeRegisterForContestAdmin()
{
$req = new RegisterToContestRequest();
$req->sessionID = $this->connect->sessionID;
$req->contestID = 0;
$req->user = createUser('admin', 'superpassword');
$this->assertEquals(createFailRes(16), RequestSender::send($req));
}
示例7: deleteUsers
function deleteUsers($link)
{
$flag = "<sansurBOYLEkotuBISIiste>";
$user = "<sansurBOYLEkotuBISIiste>";
$sql = "DELETE FROM web500_users;";
$res = mysql_query($sql, $link);
createUser($user, $flag, $link, false);
}
示例8: process
function process($form_data)
{
include "Helper.php";
//pretty_print_array($form_data);
$a = session_id();
include "connect.php";
$conn = init($_SESSION["permission_type"]);
$result = array();
if (isset($form_data["country---relation"])) {
$result = createCountry($form_data, $conn);
} else {
if (isset($form_data["product---relation"])) {
$result = createProduct($form_data, $conn);
} else {
if (isset($form_data["transportcompany---relation"])) {
$result = createTransportCountry($form_data, $conn);
} else {
if (isset($form_data["flavour---relation"])) {
$result = createTaste($form_data, $conn);
} else {
if (isset($form_data["storagetype---relation"])) {
$result = createStoragetype($form_data, $conn);
} else {
if (isset($form_data["immigrants---relation"])) {
$result = createImigrants($form_data, $conn);
} else {
if (isset($form_data["market---relation"])) {
$result = createMarket($form_data, $conn);
} else {
if (isset($form_data["contract---relation"])) {
$result = createContract($form_data, $conn);
} else {
if (isset($form_data["transportoffer---relation"])) {
$result = createTransportOffer($form_data, $conn);
} else {
if (isset($form_data["user---relation"])) {
$result = createUser($form_data, $conn);
}
}
}
}
}
}
}
}
}
}
if ($result["error"] == "") {
$returnedData = $conn->query($result["data"]);
}
if ($conn->error) {
$result["error"] = $conn->error;
}
$result["data"] = "";
echo json_encode($result);
}
示例9: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(PanelistsStoreRequest $request, $userId)
{
$fields = $request->input();
$fields['password'] = bcrypt('ufn13d');
$user = createUser($fields);
$panelist = new Panelist();
$panelist->customer_id = $userId;
$panelist->user_id = $user->id;
$panelist->save();
return redirect()->back()->with('status', 'Panelist has been created successfully');
}
示例10: addResult
function addResult()
{
$request = Slim::getInstance()->request();
$result = json_decode($request->getBody());
/*If the user already exist then only score is updated if not then user is saved to data base*/
if (userExist($result->email)) {
updateScore($result->email, $result->score);
} else {
createUser($result);
}
/* get the users list for calculating the your position */
$scores = Model::factory('User')->distinct()->select('score')->order_by_desc('score')->find_many();
/* Prepare the response */
$arr = array("topScorer" => getTop(), "yourranking" => getYourRanking($scores, $result->score));
echo json_encode($arr);
}
示例11: synlogin
function synlogin($get, $post)
{
!API_SYNLOGIN && exit(API_RETURN_FORBIDDEN);
$ID = intval($get['uid']);
for ($i = 0; $i < 2; $i++) {
$user = get_user_by('id', $ID);
if ($user) {
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
wp_set_auth_cookie($ID, true, '');
return API_RETURN_SUCCEED;
}
$query = uc_get_user($ID, 1);
createUser($ID, $get['username'], $get['password'], $query[2]);
}
exit(API_RETURN_SUCCEED);
}
示例12: commandRouter
function commandRouter($action)
{
switch ($action) {
case 'login':
loginUser();
break;
case 'createUser':
createUser();
break;
case 'getUser':
getUser();
break;
case 'deleteUser':
deleteUser();
break;
case 'updateUser':
updateUser();
break;
case 'addTab':
addTab();
break;
case 'delTab':
delTab();
break;
case 'editTab':
editTab();
break;
case 'getTabs':
getTabs();
break;
case 'addNote':
addNote();
break;
case 'delNote':
delNote();
break;
case 'editNote':
editNote();
break;
case 'getNotes':
getNotes();
break;
default:
break;
}
}
示例13: initUser
/**
* Create user, bind it to the app and return username
*/
function initUser($displayName)
{
$create_result = createUser($displayName);
if ($create_result['api_result']['result'] == 1) {
$bind_result = bindUser($create_result['username']);
if ($bind_result['api_result']['result'] == 1) {
echo json_encode(array("result" => "SUCCESS", "username" => $bind_result["username"]));
exit;
} else {
echo json_encode(array("result" => "ERROR"));
exit;
}
} else {
echo json_encode(array("result" => "ERROR"));
exit;
}
}
示例14: commandRouter
function commandRouter($action)
{
switch ($action) {
case 'login':
loginUser();
break;
case 'createUser':
createUser();
break;
case 'getUser':
getUser();
break;
case 'deleteUser':
deleteUser();
break;
case 'updateUser':
updateUser();
break;
case 'addInv':
addToInv();
break;
case 'subInv':
subFromInv();
break;
case 'getInv':
getInventory();
break;
case 'getDecks':
getDecks();
break;
case 'createDeck':
createDeck();
break;
case 'updateDeck':
updateDeck();
break;
case 'deleteDeck':
deleteDeck();
break;
default:
break;
}
}
示例15: register
function register()
{
$check = checkUserID($_POST['email']);
if (!$check) {
$user_id = $_REQUEST['email'];
$previlage = getConfig("USER_REGISTER_PRIVILEGE");
$access = getConfig("USER_REGISTER_ACCESS");
$password = $_REQUEST['password'];
unset($_POST['password']);
$createUser = createUser($user_id, $previlage, $access, $password, $_POST);
if ($createUser) {
return $createUser;
} else {
return $createUser;
}
} else {
return "You Are Already Registered With Us";
}
}