本文整理汇总了PHP中users::addUser方法的典型用法代码示例。如果您正苦于以下问题:PHP users::addUser方法的具体用法?PHP users::addUser怎么用?PHP users::addUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::addUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$tpl = new template();
$id = (int) $_GET['id'];
$users = new users();
$clients = new clients();
if ($id && $id > 0) {
$lead = $this->getLead($id);
$contact = $this->getLeadContact($id);
$values = array('user' => $contact['email'], 'password' => '', 'firstname' => '', 'lastname' => '', 'phone' => $contact['phone'], 'role' => 3, 'clientId' => $lead['clientId']);
if (isset($_POST['save'])) {
if (isset($_POST['user']) && isset($_POST['firstname']) && isset($_POST['lastname'])) {
$hasher = new PasswordHash(8, TRUE);
$values = array('user' => $_POST['user'], 'password' => $hasher->HashPassword($_POST['password']), 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'phone' => $_POST['phone'], 'role' => $_POST['role'], 'clientId' => $_POST['clientId']);
if ($users->usernameExist($values['user']) !== true) {
$users->addUser($values);
$tpl->setNotification('USER_CREATED', 'success');
} else {
$tpl->setNotification('USERNAME_EXISTS', 'error');
}
} else {
$tpl->setNotification('MISSING_FIELDS', 'error');
}
}
$tpl->assign('values', $values);
$tpl->assign('clients', $clients->getAll());
$tpl->assign('roles', $users->getRoles());
$tpl->display('leads.convertToUser');
} else {
$tpl->display('general.error');
}
}
示例2: addUser
function addUser($user_name, $user_id, $user_pass, $user_type)
{
include_once "users.php";
$user = new users();
if (isset($_REQUEST['user_name']) && isset($_REQUEST['user_id']) && isset($_REQUEST['user_pass']) && isset($_REQUEST['user_type'])) {
$name = $_REQUEST['user_name'];
$id = $_REQUEST['user_id'];
$type = $_REQUEST['user_type'];
$pass = $_REQUEST['user_pass'];
if ($user->addUser($name, $id, $pass, $type)) {
echo '{"result":0, "message": "User succesfully added"}';
} else {
echo '{}';
}
}
}
示例3: get
public function get()
{
$newUser = new users();
$saveUser = new users();
$deleteUser = new users();
$userTables = new users();
if (isset($_GET["firstname"]) && $_GET["firstname"] != '' && isset($_GET["lastname"]) && $_GET["lastname"] != '' && isset($_GET["email"]) && $_GET["email"] != '') {
$newUser->addUser($_GET["firstname"], $_GET["lastname"], $_GET["email"]);
}
if ($_GET["save"] === "true") {
$saveUser->updateUser($_GET["email"], $_GET["firstname"], $_GET["lastname"]);
} elseif ($_GET["delete"] === "true") {
$deleteUser->deleteUser($_GET["email"]);
}
echo ' <head>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 15px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<td>Firstname</td>
<td>Lastname</td>
<td>Email</td>
</tr>';
$userTables->userTable();
echo ' </table>
</body>
';
}
示例4: users
<?php
include "../models/class.config.php";
include "../models/class.users.php";
$user_email = filter_input(INPUT_POST, 'user_email');
$user_password = filter_input(INPUT_POST, 'user_password');
$confirm_password = filter_input(INPUT_POST, 'user_confirm');
#Starts The New User Functions
$users = new users();
$users->addUser($user_email, $user_password);
?>
<script type="text/javascript">window.location.assign('../index.php');</script>
示例5: users
<?php
require_once 'libs/settings/config.php';
$vars = ["name" => 'Beanzo', "email" => "nick@beanz.com"];
$user = new users($db);
$user2 = new users($secondary_db);
echo $user->addUser($vars);
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo $user2->addUser($vars);
//$redirect = new redirect();
//$redirect->redirect(2);