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


PHP users::edit方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     if (!template_session::is_admin() and !template_session::is_editor()) {
         if (get('ajax')) {
             exit(RUDE_AJAX_ACCESS_VIOLATION);
         }
         return false;
     }
     switch (get('task')) {
         case 'remove':
             $status = users::remove(get('id'));
             break;
         case 'edit':
             $status = users::edit(get('id'), get('name'), get('role_id'));
             break;
         default:
             $status = false;
             break;
     }
     if (get('ajax')) {
         if ($status) {
             exit(RUDE_AJAX_OK);
         } else {
             exit(RUDE_AJAX_ERROR);
         }
     }
     return true;
 }
開發者ID:ThisNameWasFree,項目名稱:rude-univ,代碼行數:28,代碼來源:rude-template-users.php

示例2: refresh

// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
$cms = new users();
if (isset($_POST['edit'])) {
    $adminEdit = true;
    if (isset($personalEdit)) {
        $adminEdit = false;
    }
    $status = $cms->edit($_GET['id'], $adminEdit);
    if ($status !== true) {
        abr('error', $status);
    } else {
        if (isset($personalEdit)) {
            refresh("?m=" . $_GET['m'] . "&c=edit&id=" . $_GET['id'], $langArray['edit_complete']);
        } else {
            refresh("?m=" . $_GET['m'] . "&c=list", $langArray['edit_complete']);
        }
    }
} else {
    //獨家設置
    if (isset($_POST['exclusive_false'])) {
        $usersClass = new users();
        $usersClass->editExclusiveAuthor('false', $_GET['id']);
    } elseif (isset($_POST['exclusive_true'])) {
開發者ID:yunsite,項目名稱:demila,代碼行數:31,代碼來源:edit.php

示例3: settings

 public function settings($arguments)
 {
     // Update
     if (!Session::isLoggedIn()) {
         return Error::set('You are not logged in!');
     }
     $user = new users(ConnectionFactory::get('mongo'));
     $this->view['valid'] = true;
     $this->view['user'] = $user->get(Session::getVar('username'));
     $this->view['secure'] = !empty($_SERVER['SSL_CLIENT_RAW_CERT']) ? true : false;
     if ($this->view['secure']) {
         $this->view['clientSSLKey'] = certs::getKey($_SERVER['SSL_CLIENT_RAW_CERT']);
     }
     if (!empty($arguments[0]) && $arguments[0] == 'save') {
         if (!empty($_POST['oldpassword']) && !empty($_POST['password'])) {
             $old = $user->hash($_POST['oldpassword'], $this->view['user']['username']);
             if ($old != $this->view['user']['password']) {
                 return Error::set('Previous password is invalid.');
             }
         }
         $username = !empty($_POST['username']) ? $_POST['username'] : null;
         $password = !empty($_POST['password']) ? $_POST['password'] : null;
         $email = !empty($_POST['email']) ? $_POST['email'] : null;
         $hideEmail = !empty($_POST['hideEmail']) ? true : false;
         $lockToIp = !empty($_POST['lockToIp']) ? true : false;
         $error = $user->edit(Session::getVar('_id'), $username, $password, $email, $hideEmail, null, $lockToIp);
         if (is_string($error)) {
             return Error::set($error);
         }
         $this->view['user'] = $user->get(Session::getVar('username'));
         Session::setBatchVars($this->view['user']);
         Error::set('User profile saved.', true);
     }
     if (!empty($arguments[0]) && $arguments[0] == 'saveAuth') {
         $password = !empty($_POST['passwordAuth']) ? true : false;
         $certificate = !empty($_POST['certificateAuth']) ? true : false;
         $certAndPass = !empty($_POST['certAndPassAuth']) ? true : false;
         $autoauth = !empty($_POST['autoAuth']) ? true : false;
         $return = $user->changeAuth(Session::getVar('_id'), $password, $certificate, $certAndPass, $autoauth);
         if (is_string($return)) {
             return Error::set($return);
         }
         $this->view['user'] = $user->get(Session::getVar('username'));
     }
     Layout::set('title', 'Settings');
 }
開發者ID:Zandemmer,項目名稱:HackThisSite-Old,代碼行數:46,代碼來源:user.php


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