本文整理汇总了PHP中UserClass类的典型用法代码示例。如果您正苦于以下问题:PHP UserClass类的具体用法?PHP UserClass怎么用?PHP UserClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: handler
function handler()
{
$messages = parent::handler();
$_USER = UserClass::getById($this->_FORMDATA["id"]);
if ($messages["status"] == "success" && !empty($this->_FORMDATA)) {
foreach ($this->_FORMDATA as $name => $value) {
if ($name == "email" && $value != $_USER->getProperty("email")) {
$user = UserClass::getByEmail($value);
if ($user !== false) {
$error_message[] = "Пользователь с таким email уже зарегистрирован";
}
} else {
if ($name == "login" && $value != $_USER->getProperty("login")) {
$user = UserClass::getByLogin($value);
if ($user !== false) {
$error_message[] = "Пользователь с таким логином уже зарегистрирован";
}
}
}
}
if ($error_message) {
$messages["status"] = "error";
$messages["error"] = $error_message;
unset($messages["success"]);
} else {
$arFields = array("id" => $this->_FORMDATA["id"], "login" => $this->_FORMDATA["login"], "email" => $this->_FORMDATA["email"], "full_name" => $this->_FORMDATA["full_name"], "pass" => $this->_FORMDATA["pass"], "active" => 1);
UserClass::updateUser($arFields);
$messages["success"] = "Информация обновлена.";
}
}
return $messages;
}
开发者ID:Nimoto,项目名称:rss-reader,代码行数:32,代码来源:UpdateFormController.php
示例2: handler
function handler()
{
$messages = parent::handler();
if ($messages["status"] == "success" && !empty($this->_FORMDATA)) {
foreach ($this->_FORMDATA as $name => $value) {
if ($name == "email") {
$user = UserClass::getByEmail($value);
if ($user !== false) {
$error_message[] = "Пользователь с таким email уже зарегистрирован";
}
} else {
if ($name == "login") {
$user = UserClass::getByLogin($value);
if ($user !== false) {
$error_message[] = "Пользователь с таким логином уже зарегистрирован";
}
}
}
}
if ($error_message) {
$messages["status"] = "error";
$messages["error"] = $error_message;
unset($messages["success"]);
} else {
$arFields = array("login" => $this->_FORMDATA["login"], "email" => $this->_FORMDATA["email"], "full_name" => $this->_FORMDATA["full_name"], "pass" => $this->_FORMDATA["pass"], "active" => false, "code" => md5(date("Y-m-d H:i:s")));
UserClass::createUser($arFields);
$messages["success"] = "Спасибо за регистрацию. На Ваш email выслано письмо для активации аккаунта.";
MailController::RegisterMail($this->_FORMDATA["email"], $arFields["code"]);
}
}
return $messages;
}
开发者ID:Nimoto,项目名称:rss-reader,代码行数:32,代码来源:RegisterFormController.php
示例3: index
function index()
{
require_once '../../Model/UserClass.php';
global $connection;
global $navegador;
global $navegadorAdmin;
$titulo = 'Titulo';
$description = 'description';
$palabrasClaves = 'palabrasClaves';
// Obtener type user
$user = new UserClass($connection);
$user->fetch($_SESSION['idRow']);
$userType = $user->roll;
// $userType = 'user';
if ($userType == '0') {
require_once '../../View/Back/home.php';
} elseif ($userType == '1') {
$navegador = $navegadorAdmin;
require_once '../../View/Back/homeAdmin.php';
}
}
开发者ID:DavidAgueda,项目名称:ProyectoCurso,代码行数:21,代码来源:controller.php
示例4: get_comments
public function get_comments($act_id)
{
$query_str = "select * from cs_activity_comment where act_id={$act_id} order by create_at desc;";
$result = $this->dbObj->query($query_str);
$array = array();
if (is_object($result)) {
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$array[] = $row;
}
}
}
$userObj = new UserClass();
foreach ($array as $key => $item) {
$author_id = $item['author_id'];
$query_str = "select name from cs_user where uid={$author_id};";
$user = $this->dbObj->query($query_str)->fetch_assoc();
$array[$key]['author_name'] = $user['name'];
$array[$key]['author_avatar'] = $userObj->get_avatar($author_id);
$array[$key]['create_at'] = $this->encode_time($item['create_at']);
}
return $array;
}
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:23,代码来源:activity.class.php
示例5: handler
function handler()
{
$messages = parent::handler();
if ($messages["status"] == "success" && !empty($this->_FORMDATA)) {
$user = UserClass::auth($this->_FORMDATA["login"], md5($this->_FORMDATA["pass"]));
if (!$user) {
$messages["status"] = "error";
$messages["error"][] = "Неправильный логин или пароль";
unset($messages["success"]);
} else {
if ($user->getProperty("active") == false) {
$messages["status"] = "error";
$messages["error"][] = "Аккаунт неактивен";
unset($messages["success"]);
} else {
$messages["success"] = "Вы авторизованы.";
$this->redirect();
}
}
}
return $messages;
}
开发者ID:Nimoto,项目名称:rss-reader,代码行数:22,代码来源:AuthFormController.php
示例6: createUser
/**
* 建立用户
*/
public function createUser()
{
if ($this->getR('pwd') != $this->getR('pwd1')) {
return array('status' => -1, 'info' => '密码不一致', 'data' => null);
}
$this->_modelUser = $this->getGlobal('model/User', 'Model_User');
if ($this->_modelUser->findByUser($this->getR('user'))) {
return array('status' => -1, 'info' => '此账号已存在', 'data' => null);
}
$userArr = array('user' => $this->getR('user'), 'vuser' => $this->getR('vuser'), 'pwd' => $this->convertPwd($this->getR('pwd')));
if ($this->_modelUser->insert($userArr)) {
$userArr['id'] = $this->_modelUser->getLastInsertId();
import('object/UserClass');
$userClass = new UserClass();
$userClass->create($userArr);
$userClass->setUpdate(true);
$userClass = null;
unset($userClass);
return array('status' => 1, 'info' => '创建用户成功', 'data' => null);
} else {
return array('status' => -2, 'info' => '创建用户失败', 'data' => null);
}
}
开发者ID:BGCX261,项目名称:zlskytakeorder-svn-to-git,代码行数:26,代码来源:UserSession.class.php
示例7: config
<?php
include '../config.php';
include '../webappClass/UserClass.php';
$configobj = new config();
$conn = $configobj->getConnection();
$userobj = new UserClass();
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$loginid = $request->loginid;
$password = $request->password;
echo json_encode($userobj->userLogin($conn, $loginid, $password));
开发者ID:ragav-hari,项目名称:Bharat,代码行数:12,代码来源:loginUser.php
示例8: UserClass
//echo $msg;
}
else
{
$msg="Please enter CLIENT-ID.";
}
}
$objUser1=new UserClass($db);
$objUser1->id=$_SESSION['login'];
$arrUser1=$objUser1->SearchUser();
$objCoustodyAC=new Custody_ACClass($db);
$objCoustodyAC->id_client=$arrUser1[0]['id'];
$arrCustodyAC=$objCoustodyAC->SearchCustody_AC();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:sub-client.php
示例9: getCode
{
if ($sName === "Breves" && $sPassword === "123") {
$this->sName = $sName;
$this->iCode = 1;
$this->sEmail = "[email protected]";
}
/* if ( $sName === "Breves" && $sPassword === "123" ) */
}
/* private function login( $sName, $sPassword ) */
function getCode()
{
return $this->iCode;
}
/* function getCode() */
function getName()
{
return $this->sName;
}
/* function getName() */
function getEmail()
{
return $this->sEmail;
}
}
/* class UserClass */
/* ********************************************************* */
$usrUser = new UserClass("Breves", "123");
echo $usrUser->getCode() . "<br />";
echo $usrUser->getName() . "<br />";
echo $usrUser->getEmail() . "<br />";
var_dump($usrUser);
开发者ID:evandrolacerda,项目名称:PHP_8860,代码行数:31,代码来源:UserClass.php
示例10: BuyFixed
public static function BuyFixed($auctionId, $qty)
{
global $config, $user;
// validate args
$auctionId = (int) $auctionId;
$qty = (int) $qty;
if ($auctionId < 1) {
$_SESSION['error'][] = 'Invalid auction id!';
return FALSE;
}
if ($qty < 1) {
$_SESSION['error'][] = 'Invalid qty!';
return FALSE;
}
// has canBuy permissions
if (!$user->hasPerms('canBuy')) {
$_SESSION['error'][] = 'You don\'t have permission to buy.';
return FALSE;
}
// query auction
$auction = QueryAuctions::QuerySingle($auctionId);
if (!$auction) {
$_SESSION['error'][] = 'Auction not found!';
return FALSE;
}
$Item = $auction->getItemCopy();
// // is item allowed
// if (!itemAllowed($item->name, $item->damage)){
// $_SESSION['error'][] = $item->fullname.' is not allowed to be sold.';
// header("Location: ../myauctions.php");
// }
// buying validation
if ($auction->getSellerId() == $user->getId()) {
$_SESSION['error'][] = 'Can\'t buy from yourself!';
return FALSE;
}
if ($qty > $Item->getItemQty()) {
$_SESSION['error'][] = 'Not that many for sale!';
return FALSE;
}
$maxSellPrice = SettingsClass::getDouble('Max Sell Price');
$sellPrice = $auction->getPrice();
$priceTotal = $sellPrice * (double) $qty;
if ($maxSellPrice > 0.0 && $sellPrice > $maxSellPrice) {
$_SESSION['error'][] = 'Over max sell price of ' . SettingsClass::getBoolean('Currency Prefix') . $maxSellPrice . SettingsClass::getBoolean('Currency Prefix') . ' !';
return FALSE;
}
if ($priceTotal > $user->getMoney()) {
$_SESSION['error'][] = 'You don\'t have enough money!';
return FALSE;
}
// make payment from buyer to seller
UserClass::MakePayment($user->getName(), $user->getUUID(), $auction->getSeller(), $auction->getSellerUUID(), $priceTotal, 'Bought auction ' . (int) $auction->getTableRowId() . ' ' . $Item->getItemTitle() . ' x' . (int) $Item->getItemQty());
// remove auction
if (!self::RemoveAuction($auctionId, $qty < $Item->getItemQty() ? $qty : -1)) {
echo '<p style="color: red;">Error removing/updating auction!</p>';
exit;
}
// add to inventory
$Item->setItemQty($qty);
$tableRowId = ItemFuncs::AddCreateItem($user->getId(), $Item);
if (!$tableRowId) {
echo '<p style="color: red;">Error adding item to your inventory!</p>';
exit;
}
// add sale log
LogSales::addLog(LogSales::LOG_SALE, LogSales::SALE_BUYNOW, $auction->getSellerId(), $user->getId(), $Item, $sellPrice, FALSE, '', TRUE);
return TRUE;
}
开发者ID:GRANTSWIM4,项目名称:WebAuctionPlus-1.2,代码行数:69,代码来源:auction.functions.php
示例11: var_dump
var_dump($Cats);
/* Lesson 11*/
$MyVar = 1;
echo "outside: {$MyVar} ";
example();
function example()
{
global $MyVar;
echo "inside: {$MyVar} ";
}
var_dump($GLOBALS);
/* Lesson 14*/
class UserClass
{
public $firstname;
function __construct($firstname)
{
$this->firstname = $firstname;
}
function GetName()
{
return $this->firstname;
}
function __destruct()
{
// TODO: Implement __destruct() method.
echo "DESCRUCTOR";
}
}
$User = new UserClass('BBB');
echo "CLASS" . $User->GetName();
开发者ID:mbshin,项目名称:study,代码行数:31,代码来源:php.php
示例12: trim
$uid = $_POST['uid'];
$phone = $_POST['phone'];
$mail = $_POST['mail'];
$workplace = $_POST['workplace'];
$job = $_POST['job'];
$grade = $_POST['grade'];
$major = $_POST['major'];
$qq = $_POST['qq'];
$wechat = $_POST['wechat'];
$blog = $_POST['blog'];
$github = $_POST['github'];
//$native = "西安";
$native = null;
$grade = trim($grade);
$workplace = trim($workplace);
$userObj = new UserClass();
print $userObj->update_userinfo($uid, $phone, $mail, $qq, $wechat, $blog, $github, $native, $major, $workplace, $job);
exit;
case 'refresh_activity':
$mid = $_POST['mid'];
$uid = $_POST['uid'];
$result = "";
for ($i = 0; $i < 5; ++$i) {
$b = get_message($uid, $mid, $i);
if ($b == 'false') {
if ($result == "") {
$result = 'false';
}
break;
}
$result .= $b;
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:31,代码来源:profile.server.php
示例13: array
require "settings.php";
include CONTROLLER_PATH . "manager/DataBaseController.php";
$_DB = DataBaseController::init();
include VIEW_PATH;
include MODEL_PATH . "forms/MainFormClass.php";
include MODEL_PATH . "forms/FieldClass.php";
include MODEL_PATH . "user/UserClass.php";
include MODEL_PATH . "rss/RssClass.php";
include MODEL_PATH . "paginator/PaginatorClass.php";
include CONTROLLER_PATH . "manager/MainRouter.php";
include CONTROLLER_PATH . "manager/MailController.php";
include CONTROLLER_PATH . "form/MainFormController.php";
include CONTROLLER_PATH . "form/RegisterFormController.php";
include CONTROLLER_PATH . "form/AuthFormController.php";
include CONTROLLER_PATH . "form/UpdateFormController.php";
include CONTROLLER_PATH . "form/RssFormController.php";
include CONTROLLER_PATH . "form/ValidatorController.php";
include CONTROLLER_PATH . "rss/RssController.php";
include CONTROLLER_PATH . "rss/RssItemsController.php";
include CONTROLLER_PATH . "paginator/PaginatorController.php";
$_ADDRESS = $_SERVER["REQUEST_URI"];
$pages = array("/" => "index.php");
$_ROUTER = MainRouter::createRouter($pages);
global $_USER;
if ($_COOKIE["login"]) {
$_USER = UserClass::getByLogin($_COOKIE["login"]);
if ($_USER->getProperty("active") == false) {
unset($_COOKIE["login"]);
unset($_USER);
}
}
开发者ID:Nimoto,项目名称:rss-reader,代码行数:31,代码来源:prolog.php
示例14: setcookie
setcookie("userID", "", 0, "/");
setcookie("firstName", "", 0, "/");
setcookie("lastName", "", 0, "/");
setcookie("email", "", 0, "/");
unset($_COOKIE['userID']);
unset($_COOKIE['checkedLogin']);
unset($_COOKIE['firstName']);
unset($_COOKIE['lastName']);
unset($_COOKIE['email']);
if ($useSGU) {
/*
se estiver usando SGU e estiver no portal regional (Scielo.org), chama o logout do SGU
*/
if ($ini['this']['url'] == $ini['scielo_org_urls']['home']) {
require_once dirname(__FILE__) . "/../users/UserClassWS.php";
$usr = new UserClass();
$usr->setToken($_COOKIE['userToken']);
$usr->logout();
}
setcookie("userToken", "", 0, "/");
setcookie("tokenVisit", "", 0, "/");
unset($_COOKIE['userToken']);
}
ob_start();
?>
<html>
<body>
<p>Logout</p>
</body>
</html>
开发者ID:Ethennoob,项目名称:Web,代码行数:30,代码来源:logout.php
示例15:
<td>Modified By</td>
<td>Last Modified</td>
<td colspan="2">
<form action="adminPortal.php" method="post">
<input type="text" name="addPage" value="addPage" hidden />
<input type="Submit" id="addUser" name="addUser" value="Add User" />
</form>
</td>
</tr>
</thead>
<tbody>
<?php
require "../Business/UserClass.php";
$arrayOfPages = UserClass::retrieveUsers();
foreach ($arrayOfPages as $page) {
?>
<tr>
<td><?php
echo $page->getID();
?>
</td>
<td><?php
echo $page->getUsername();
?>
</td>
<td><?php
echo $page->getFistName();
?>
</td>
开发者ID:JeremyIM,项目名称:PhPCMS_Project,代码行数:31,代码来源:userMgmt.php
示例16: error_reporting
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
require_once 'init.php';
require_once 'includes/activity.class.php';
$login_uid = $_COOKIE['uid'];
if (isset($_GET['uid'])) {
$info_uid = $_GET["uid"];
} else {
$info_uid = $login_uid;
}
$userObj = new UserClass();
$json = $userObj->get_userinfo($info_uid);
$result = json_decode($json, true);
$user_info = $result[0];
$user_info["issame"] = $info_uid == $login_uid;
$user_info['uid'] = $info_uid;
$user_info['avatar'] = $userObj->get_avatar($info_uid);
$activityObj = new ActivityClass();
for ($i = 0; $i < 10; ++$i) {
$tmp = $activityObj->get_activity('uid', $info_uid, $i);
if ($tmp == false) {
break;
}
$activity_list[] = $tmp;
}
$sql = "SELECT uid, password FROM cs_user WHERE uid=" . $info_uid . ";";
$dbObj = new DBClass();
$result = $dbObj->query($sql);
$result_info = $result->fetch_assoc();
$temp_time = (string) (time() + 24 * 3600);
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:31,代码来源:profile.php
示例17: config
<?php
include '../config.php';
include '../webappClass/UserClass.php';
$configobj = new config();
$conn = $configobj->getConnection();
$userobj = new UserClass();
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$user_id = $request->user_id;
$old_password = $request->old_password;
$new_password = $request->new_password;
echo json_encode($userobj->changepassword($conn, $user_id, $old_password, $new_password));
开发者ID:ragav-hari,项目名称:Bharat,代码行数:13,代码来源:changepassword.php
示例18: stripslashes
<body>
<?php
//grab login info passed in
$login = $_POST['login'];
$pw = $_POST['pw'];
//safety first
$login = stripslashes($login);
$pw = stripslashes($pw);
//TODO: move to DataAccess
//$login = mysqli_real_escape_string($db, $login);
//$pw = mysqli_real_escape_string($db, $pw);
//hash passwords TODO: change to meet REQ-008
//$hashedPw = hash("sha1", $pw);
//build sql + get result TODO: move to DataAccess via /Business/UserClass.php once created
$userObj = UserClass::checkLoginInfo($login, $pw);
/*
$sql = "SELECT * FROM WebUsers WHERE login='$login' AND pw='$hashedPw'";
$result = mysqli_query($db, $sql);
$count = mysqli_num_rows($result);
mysqli_close('$db');
*/
if ($userObj) {
//set session variables
$_SESSION['login'] = $login;
$_SESSION['pw'] = $pw;
if ($userObj->getUsername() == "editor") {
header("location:editorPortal.php");
开发者ID:JeremyIM,项目名称:PhPCMS_Project,代码行数:31,代码来源:checkLogin.php
示例19:
<h1>Активация аккаунта</h1>
<?php
$activate = UserClass::activate($_GET["email"], $_GET["code"]);
if ($activate) {
?>
<div class="rss-wrapper alert alert-info" role="alert">
Ваш аккаунт активирован. Пожалуйста, авторизуйтесь.
</div>
<?php
} else {
?>
<div class="rss-wrapper alert alert-danger" role="alert">
Код активации уже использован.
</div>
<?php
}
开发者ID:Nimoto,项目名称:rss-reader,代码行数:16,代码来源:activate.php
示例20: elseif
<!-- vajadzetu parbadit un saldizinat vai password sakriit
/*
{
$pass1 = $_POST['password'];
$pass2 = $_POST['passcheck'];
echo '<h1>Ievaditas paroles nesakrit!</h1>' ;
echo '<script language="javascript">';
echo 'alert("Ievaditas paroles nesakrit!")';
echo '</script>';
if ($pass1 != $pass2) {
}
}
-->
<?php
if (isset($_POST['submitBtn'])) {
if (strlen(trim($_POST['login'])) == 0 || strlen(trim($_POST['email'])) == 0 || strlen(trim($_POST['password'])) == 0 || strlen(trim($_POST['passcheck'])) == 0 || !isset($_POST['gender'])) {
echo '<h1>Lai reģistrētos obligāti jāaizpilda visi lauki!</h1>';
} elseif (strcmp($_POST['password'], $_POST['passcheck']) != 0) {
echo '<h1>Ievadītās paroles nesakrita</h1>';
} else {
$user = new UserClass();
$user->addUser($_POST['login'], $_POST['email'], $_POST['password'], $_POST['gender'], $_POST['camera'], isset($_POST['landscape']), isset($_POST['portrait']), isset($_POST['bird']), isset($_POST['sport']));
echo '<h1>Jūs tagad esat reģistrēts!</h1>';
}
}
?>
</body>
</html>
开发者ID:AlpacaXP,项目名称:AlpacaXP.github.io,代码行数:31,代码来源:registracija.php
注:本文中的UserClass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论