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


PHP UserClass::updateUser方法代碼示例

本文整理匯總了PHP中UserClass::updateUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserClass::updateUser方法的具體用法?PHP UserClass::updateUser怎麽用?PHP UserClass::updateUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserClass的用法示例。


在下文中一共展示了UserClass::updateUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: json_encode

<?php

/*****************************
Update user privileges
*****************************/
#start session
session_start();
#require required files
require '../../constants.php';
require '../../dbinfo.inc.php';
require '../../tools.php';
require '../../user.php';
$user_id = $_POST['user_id'];
$user_level = $_POST['user_level'];
$json_out = array();
$UserObject = new UserClass($user_id);
$UserObject->setLevel($user_level);
$json_out['update'] = $UserObject->updateUser();
#if no json yet (thus no error) -> succes!
if (is_null($json_out['update'])) {
    $json_out = array('succes' => 'User privilege updated for ' . $UserObject->getUsername() . '.');
}
#output json
print json_encode($json_out);
開發者ID:bingneef,項目名稱:spot,代碼行數:24,代碼來源:update_privileges.php

示例3: UserClass

<?php

require '../Business/UserClass.php';
//build new article business object
$newUser = new UserClass($_POST['uUsername']);
$newUser->setId($_POST['editUserId']);
$newUser->setUsername($_POST['uUsername']);
$newUser->setFistName($_POST['uFirstname']);
$newUser->setLastName($_POST['uLastname']);
$newUser->setWordPass($_POST['uWordpass']);
$result = $newUser->updateUser();
//report success/failure
echo $result;
開發者ID:JeremyIM,項目名稱:PhPCMS_Project,代碼行數:13,代碼來源:editUser.php


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