當前位置: 首頁>>代碼示例>>PHP>>正文


PHP users::addUser方法代碼示例

本文整理匯總了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');
     }
 }
開發者ID:DevelopIdeas,項目名稱:leantime,代碼行數:32,代碼來源:class.convertToUser.php

示例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 '{}';
        }
    }
}
開發者ID:Wainaina3,項目名稱:pos,代碼行數:16,代碼來源:userManipulation.php

示例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>
			';
    }
開發者ID:homer4hire247,項目名稱:is218-midterm,代碼行數:37,代碼來源:page.php

示例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>
開發者ID:webkickstart,項目名稱:memberships,代碼行數:12,代碼來源:register.php

示例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);
開發者ID:nnarbone,項目名稱:OOP,代碼行數:13,代碼來源:index.php


注:本文中的users::addUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。