本文整理汇总了PHP中UserController::createUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::createUser方法的具体用法?PHP UserController::createUser怎么用?PHP UserController::createUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::createUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process()
{
if ($this->_input->post("Login")) {
$userName = $this->_input->post('user_name');
$passwd = md5($this->_input->post('passwd'));
$this->_template->set_var("user_name", $userName);
$checkArray = array('user_name' => 'Username', 'passwd' => 'Password');
if ($this->_jScript->checkFilds($checkArray)) {
$userCtrl = new UserController();
$userEnt = $userCtrl->loginUser($userName, $passwd);
if (is_object($userEnt)) {
$userObj = $userCtrl->createUser($userEnt);
$_SESSION['REGI_userObject'] = serialize($userObj);
$sessionObj = unserialize($_SESSION['REGI_userObject']);
if (is_object($sessionObj)) {
if ($sessionObj->getActive() == 0) {
$this->redirect('UserActivate');
} else {
$this->redirect('Radio');
}
}
} else {
$this->_jScript->alert("Ingevoerde gebruikersnaam en/of wachtwoord is/zijn niet correct!");
}
}
}
$this->_template->parse($this->_outputName, $this->_mainBlock);
}
示例2: UserController
* Rather than including all my application code and logic
* here i moved my functions to separate php classes and routed
* to them using the switch() statement in this file
*/
// verifies that the action post variable is set and then choses
// which function to fire based on the POST['action'] value
if (isset($_POST['action'])) {
// instantiate classes to call functions from
$UserController = new UserController();
$ProjectController = new ProjectController();
$PageController = new PageController();
// handle which function to call
switch ($_POST['action']) {
// User Methods
case "createUser":
$UserController->createUser();
break;
case "deleteUser":
$UserController->deleteUser();
break;
case "getUser":
$UserController->getUser();
break;
case "checkLoggedIn":
$UserController->checkLoggedIn();
break;
case "isAdmin":
$UserController->isAdmin();
break;
case "login":
$UserController->login();
示例3: checkAdminLoggedIn
checkAdminLoggedIn();
}
include_once SP_CTRLPATH . "/user.ctrl.php";
include_once SP_CTRLPATH . "/website.ctrl.php";
include_once SP_CTRLPATH . "/keyword.ctrl.php";
$controller = new UserController();
$controller->view->menu = 'users';
$controller->layout = 'ajax';
$controller->spTextPanel = $controller->getLanguageTexts('panel', $_SESSION['lang_code']);
$controller->set('spTextPanel', $controller->spTextPanel);
$controller->spTextUser = $controller->getLanguageTexts('user', $_SESSION['lang_code']);
$controller->set('spTextUser', $controller->spTextUser);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
switch ($_POST['sec']) {
case "create":
$controller->createUser($_POST);
break;
case "update":
$controller->updateUser($_POST);
break;
case "updatemyprofile":
$controller->updateMyProfile($_POST);
break;
case "activateall":
if (!empty($_POST['ids'])) {
foreach ($_POST['ids'] as $id) {
$controller->__changeStatus($id, 1);
}
}
$controller->listUsers($_POST);
break;
示例4: UserController
<?php
/**
* Created by PhpStorm.
* User: Francois
* Date: 30/04/15
* Time: 15:05
*/
include_once '../controller/ImageController.php';
include_once '../controller/UserController.php';
$user = new UserController();
$image = new ImageController();
$lines = file('../dataset/pseudoDataset.txt');
$stack_pseudo = array();
foreach ($lines as $line_num => $line) {
array_push($stack_pseudo, $line);
}
$lines = file('../dataset/imageDataset.txt');
$stack_image = array();
foreach ($lines as $line_num => $line) {
array_push($stack_image, $line);
/*
$get = substr($line, 0, strlen($line) - 1);
$imageString = file_get_contents($get);
$save = file_put_contents('../dataset/image_download/' . basename($get), $imageString);
*/
}
foreach ($stack_pseudo as $pseudo) {
$user->createUser(substr($pseudo, 0, strlen($pseudo) - 1), 'testAccount');
}
示例5: UserController
<?php
include_once '../controller/UserController.php';
$reg = new UserController();
$error = "OK";
$user_created = false;
if (isset($_POST["login"]) && isset($_POST["pass"])) {
$error = $reg->createUser($_POST["login"], $_POST["pass"]);
if ($error == "OK") {
$user_created = true;
}
}
echo '<div id="login">
<h1>Registration</h1>';
if (!$user_created && !isset($_SESSION["user"])) {
echo '<form name="registration" method="post" action="layout.php?selected=register">
<input type="text" placeholder="Login" name="login"/>
<input type="password" placeholder="Password" name="pass"/>';
if ($error != "OK") {
echo '<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>' . $error . '</div>';
}
echo '
<input type="submit" value="Register"/>
</form>';
} else {
echo '<div class="alert alert-success" role="alert"> <b>Registration success !</b></br> Welcome ' . $_SESSION["user"] . '</div>';
}
echo '</div>';