当前位置: 首页>>代码示例>>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;未经允许,请勿转载。