• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getUser函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getUser函数的典型用法代码示例。如果您正苦于以下问题:PHP getUser函数的具体用法?PHP getUser怎么用?PHP getUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getUser函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: processLoad

/**
 * Process the query
 * @param $user the user to look for
 * @param $password the user password
 * @param $id the id in the hatting table
 */
function processLoad($user, $password, $id)
{
    // Connect to the database
    $pdo = pdo_connect();
    getUser($pdo, $user, $password);
    $idQ = $pdo->quote($id);
    $query = "SELECT name, uri, type, x, y, rotation, scale, color, feather from hatting where id={$idQ}";
    $rows = $pdo->query($query);
    if ($row = $rows->fetch()) {
        // We found the record in the database
        echo "<hatter status=\"yes\">";
        $uri = $row['uri'];
        $x = $row['x'];
        $y = $row['y'];
        $angle = $row['rotation'];
        $scale = $row['scale'];
        $color = $row['color'];
        $hat = $row['type'];
        $feather = $row['feather'] == 1 ? "yes" : "no";
        echo "<hatting uri=\"{$uri}\" x=\"{$x}\" y=\"{$y}\" angle=\"{$angle}\" scale=\"{$scale}\" color=\"{$color}\" type=\"{$hat}\" feather=\"{$feather}\" />\r\n";
        echo "</hatter>";
        exit;
    }
    echo '<hatter status="no" msg="image" />';
}
开发者ID:Jallal,项目名称:iOS-IndoorMaps,代码行数:31,代码来源:hatter-load.php


示例2: checkState

 public static function checkState()
 {
     if (session_status() != PHP_SESSION_ACTIVE) {
         session_start();
     }
     if (!isset($_SESSION[userNo])) {
         return false;
     }
     $_userNo = $_SESSION[userNo];
     if ($_userNo == 'null') {
         return false;
     }
     $row = getUser($_userNo);
     if (isset($row[adminNo])) {
         return true;
     }
     $query = "SELECT " . loginSession . " FROM " . " User " . "WHERE " . userNo . " = '" . $_userNo . "'";
     $result = DB::query($query);
     if (!$result) {
         return false;
     }
     $row = $result->fetch_array();
     if (isset($row[0]) && $row[0] == $_COOKIE["PHPSESSID"]) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:ahmanxdd,项目名称:WebProject,代码行数:28,代码来源:UserControl.php


示例3: saveHelpStatus

 protected function saveHelpStatus()
 {
     $user = getUser();
     $config = PageConfigs::where('page', $this->id)->where('user_id', $user['id'])->first();
     $config->help = !$config->help;
     $config->save();
 }
开发者ID:koyeo,项目名称:bichon,代码行数:7,代码来源:Input.php


示例4: testResettingPassword

 function testResettingPassword()
 {
     $email = '[email protected]';
     $u = getUser($email);
     $this->followRedirects(false);
     # XXX: Hack to avoid being redirected to homepage upon logout.
     $this->logout();
     $this->followRedirects();
     $this->get('/account/signin');
     $this->clickLink("//a[contains(text(), 'Forget your password')]");
     # We specify the address using different cAsINg to make sure things aren't case-sensitive.
     $this->submitForm($this->getForm('lost-pass'), array('email' => '[email protected]'));
     /*
     TODO: Make this test more comprehensive -- but first we need a properly "stubbed-out"
           email for test framework...
     $sentEmails = $this->getSentEmails();
     assertTrue(count($sentEmails) == 1);
     $matches = array();
     preg_match('@https?://[-.a-z]+(/[^\\s]+)@', $sentEmails[0]->message, $matches);
     $relativeURI = $matches[1];
     $this->get($relativeURI);
     $this->submitForm($this->getForm(),
       array('password' => 'nu3vo', 'confirmPassword' => 'nu3vo'));
     $this->logout();
     $this->assertNotLoggedIn();
     $this->login($email, 'nu3vo');
     $this->assertLoggedIn($u->email);
     */
     $row = DB\selectExactlyOne('confirmation_codes', 'user_id = ?', array($u->id));
     $this->get('/account/pass-reset?c=' . $row['code']);
     $this->submitForm($this->getForm('change-password-form'), array('password' => 'n00p@ss', 'confirm-password' => 'n00p@ss'));
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:32,代码来源:reset-password.php


示例5: login

function login()
{
    $app = \Slim\Slim::getInstance();
    $json = decodeJsonOrFail($app->request->getBody());
    $user = User::where('username', '=', $json['username'])->where('password', '=', $json['password'])->firstOrFail();
    getUser($user->id);
}
开发者ID:MathiasBrandt,项目名称:spcl-e2014-project,代码行数:7,代码来源:users.php


示例6: getPermissions

 function getPermissions(&$record)
 {
     if (getUser()) {
         return Dataface_PermissionsTool::ALL();
     }
     return null;
 }
开发者ID:rudolphm,项目名称:xataface-school,代码行数:7,代码来源:dashboard.php


示例7: CheckAuthentication

/**
 * This function must check the user session to be sure that he/she is
 * authorized to upload and access files in the File Browser.
 *
 * @return boolean
 */
function CheckAuthentication()
{
    // WARNING : DO NOT simply return "true". By doing so, you are allowing
    // "anyone" to upload and list the files in your server. You must implement
    // some kind of session validation here. Even something very simple as...
    // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
    // ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
    // user logs in your system. To be able to use session variables don't
    // forget to add session_start() at the top of this file.
    if (!class_exists("User")) {
        //Check if Orongo was loaded
        require "../../startOrongo.php";
        startOrongo();
    }
    //ORONGOCMS AUTHENTICATION:
    if (!function_exists('getUser')) {
        return false;
    }
    if (getUser() == null) {
        return false;
    }
    if (getUser()->getRank() < RANK_WRITER) {
        return false;
    }
    return true;
}
开发者ID:JacoRuit,项目名称:orongocms,代码行数:32,代码来源:config.php


示例8: newTempDir

 protected static function newTempDir()
 {
     $tmp['tok'] = getUser() . time() . rand(5, 20);
     $tmp['dir'] = addslash(self::$config['tempdir']) . '.rutorrent/.fman/' . $tmp['tok'] . '/';
     Filesystem::get()->mkdir($tmp['dir'], true, 777);
     return $tmp;
 }
开发者ID:stroebs,项目名称:rutorrent-thirdparty-plugins,代码行数:7,代码来源:Helper.php


示例9: getUserRank

/**
 * Returns the rank of the currently logged in user.
 *
 * @return string
 */
function getUserRank()
{
    if (getUser()->id === 1) {
        return 'admin';
    }
    return 'user';
}
开发者ID:minitauros,项目名称:fit2,代码行数:12,代码来源:custom_functions.php


示例10: __set

 public function __set($name, $value)
 {
     if (getUser()->data->id != $this->data->owner && getUser()->data->access_level != 0) {
         return;
     }
     switch ($name) {
         case 'name':
         case 'mime':
             getDB()->query('setFile', array('id' => $this->fid, 'field' => $name, 'value' => $value));
             $this->data->{$name} = $value;
             break;
         case 'list':
             getDB()->query('setFile', array('id' => $this->fid, 'field' => $name, 'value' => $value));
             $this->data = getDB()->query('refreshData', array('pid' => $this->pid));
             $this->data = $this->data->dataObj;
             break;
         case 'file':
             if (!is_file(SYS_TMP . $file)) {
                 $this->throwError('$value isn`t a file', $value);
             }
             getRAR()->execute('moveFile', array('source' => SYS_TMP . $value, 'destination' => SYS_SHARE_PROJECTS . $this->fid));
             break;
         default:
             return;
     }
 }
开发者ID:nksarea,项目名称:nksarea,代码行数:26,代码来源:file.class.php


示例11: checkLogin

 function checkLogin()
 {
     global $database;
     /* Check if user has been remembered */
     if (isset($_SESSION['usertype']) && isset($_SESSION['userID']) && $_SESSION['usertype'] == 1) {
         if ($database->confirmUserID($_SESSION['userID']) != 0) {
             unset($_SESSION['userID']);
             unset($_SESSION['username']);
             unset($_SESSION['classID']);
             unset($_SESSION['userBranchID']);
             unset($_SESSION['usertype']);
             unset($_SESSION['databasename']);
             unset($_SESSION['permissions']);
             return false;
         }
         $temp = getUser($_SESSION['userID']);
         $this->userID = $temp->getID();
         $this->username = $temp->getUsername();
         $this->classID = $temp->getClassID();
         $this->userBranchID = $temp->getUserBranchID();
         $this->name = $temp->getName();
         $this->userlevel = $temp->getLevel();
         $this->databasename = $temp->getInstituteObj()->getDatabaseName();
         $this->usertype = 1;
         $this->permissions = $temp->getPermissions();
         // unsetDatabaseName();
         // setDatabaseName($this->databasename,$this->classID);
         return true;
     } else {
         return false;
     }
 }
开发者ID:harshselani,项目名称:My-Class,代码行数:32,代码来源:sessioncheck.php


示例12: get

function get($lastmodified, $api)
{
    $sync = new Sync();
    $output = array();
    if ($lastmodified < $sync->get(Sync::USER)) {
        $output[Sync::USER] = getUser($api);
    }
    if ($lastmodified < $sync->get(Sync::SCENARIOS)) {
        $output[Sync::SCENARIOS] = getScenarios();
    }
    if ($lastmodified < $sync->get(Sync::LIGHTS)) {
        $output[Sync::LIGHTS] = getLights();
    }
    if ($lastmodified < $sync->get(Sync::ROOMS)) {
        $output[Sync::ROOMS] = getRooms();
    }
    if ($lastmodified < $sync->get(Sync::PLANTS)) {
        $output[Sync::PLANTS] = getPlants();
    }
    if ($lastmodified < $sync->get(Sync::DEVICES)) {
        $output[Sync::DEVICES] = getDevices();
    }
    if ($lastmodified < $sync->get(Sync::SENSORS)) {
        $output[Sync::SENSORS] = getSensors();
    }
    if ($lastmodified < $sync->get(Sync::EAN)) {
        $output[Sync::EAN] = getEan();
    }
    return $output;
}
开发者ID:nawrasg,项目名称:Atlantis,代码行数:30,代码来源:at_sync.php


示例13: actionEmployeeSchedulle

 public function actionEmployeeSchedulle()
 {
     header('Content-type: application/json');
     $schedulles = AttendanceSchedulles::model()->findAllByAttributes(array('employee_id' => getUser()->id));
     $data = array();
     foreach ($schedulles as $schedulle) {
         for ($i = 1; $i <= 31; $i++) {
             if (strlen($i) == 1) {
                 $date = 'date_0' . $i;
             } else {
                 $date = 'date_' . $i;
             }
             $day = $schedulle->year . '-' . $schedulle->month . '-' . $i;
             $day = strtotime($day) + 2678400;
             $day = date('Y-m-d', $day);
             if ($schedulle->{$date} != '') {
                 $shift = ReferenceAttendanceShifts::model()->findByPk($schedulle->{$date})->name;
                 $data[] = array('title' => $shift, 'start' => $day, 'allDay' => true);
             }
         }
     }
     // $c = new CDbCriteria();
     // $c->compare('employee_id', getUser()->id);
     // $schedulles = AttendanceSchedulle::model()->findAll($c);
     // $data 		= array();
     // foreach($schedulles as $schedulle)
     // {
     // 	$data[] = array('title'=>$schedulle->shift->name, 'start'=>$schedulle->schedulle_date, 'allDay'=>true);
     // }
     echo CJSON::encode($data);
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:31,代码来源:SchedulleController.php


示例14: sendUserLogsViaMail

function sendUserLogsViaMail($classID)
{
    $conn = getMainConnection();
    $query = "SELECT * FROM info WHERE ID = '" . $classID . "'";
    $result = mysql_query($query);
    $numrows = mysql_affected_rows();
    if ($numrows == 1) {
        $member = mysql_fetch_array($result);
        if ($member['activeflag'] != 0) {
            getTemporaryConnection($member['databasename']);
        }
    }
    $query = "SELECT * FROM login_logs WHERE lastlogin <= '" . time() . "' AND lastlogin >= '" . (time() - 86400) . "'";
    $result = mysql_query($query);
    $mail_string = '';
    while ($member = mysql_fetch_array($result)) {
        $time = date("F j, Y, g:i a", $member['lastlogin']);
        $user = getUser($member['userID'])->getName();
        $mail_string .= $user . ' logged in at ' . $time . ' from the ip ' . $member['ip'] . '<br />';
    }
    //echo $mail_string;
    $toEmail = '[email protected]';
    $toName = 'Ace Chemistry';
    $fromEmail = '[email protected]';
    $fromName = 'My Class - Knowledge Portal';
    $subject = 'Staff Login Logs : ' . date("d-m-Y");
    $body = 'Staff Login Logs <hr /><br />' . $mail_string;
    $flag = sendEmail($toEmail, $toName, $fromEmail, $fromName, $subject, $body, '');
    return $flag;
}
开发者ID:harshselani,项目名称:My-Class,代码行数:30,代码来源:emailfunctions.php


示例15: start

function start()
{
    if (!empty($_POST)) {
        if (!isset($_POST['id'])) {
            createUser($_POST);
        } else {
            editUser($_POST);
        }
        require '../views/list.php';
        return;
    }
    if (!isset($_GET['id']) && !isset($_GET['page'])) {
        $people = getPeople();
        require '../views/list.php';
        return;
    }
    if (isset($_GET['page']) && $_GET['page'] === 'add') {
        require '../views/add.php';
        return;
    }
    if (isset($_GET['page']) && $_GET['page'] === 'edit') {
        if (!isset($_GET['id'])) {
            die('veuillez spécifier un id d\'utilisateur');
        }
        $id = $_GET['id'];
        $editable = ORM::for_table('users')->find_one($id);
        require '../views/edit.php';
        return;
    }
    $user = getUser();
    require '../views/show.php';
}
开发者ID:nemo75,项目名称:MiniCRM,代码行数:32,代码来源:functions.php


示例16: loadByOwner

function loadByOwner($user_id, $sound_id)
{
    $db = new SoundPlayData();
    $ajaxServ = new AjaxServerBase();
    $userTable = new Users();
    $user = getUser();
    //ユーザーチェック
    $res = $userTable->loadFromUserId($user_id);
    if ($res === false || is_null($res)) {
        $ajaxServ->sendErrorJson(DBERROR_USER_NOTFOUND, 'user_id invalid');
        return;
    }
    //オーナーチェックチェック(なければ普通のロード)
    if ($user_id !== @$user['user_id']) {
        $db->loadFromId($sound_id);
        // $ajaxServ->sendErrorJson(DBERROR_USER_ID_INVALID, 'user logout');
        return;
    }
    $user_id = @$user['user_id'];
    $res = $db->loadFromUserIdSoundId($user_id, $sound_id);
    if ($res === false || is_null($res)) {
        $ajaxServ->sendErrorJson(DBERROR_USER_PERMISSION, 'user_id invalid');
        return;
    }
    $ajaxServ->sendJson($res);
}
开发者ID:bitchunk,项目名称:bitchunk_aws,代码行数:26,代码来源:fileload.php


示例17: __construct

 /** Erstellt ein nneues Projekt
  *
  * @param integer $pid Project ID
  * @author Lorze Widmer
  */
 public function __construct($pid)
 {
     $this->pid = $pid;
     //Daten werden aus der Datenbank geladen
     $this->data = getDB()->query('refreshDataP', array('pid' => $this->pid));
     if ($this->data === null) {
         $this->throwError('No project with given pid exists', $this->pid);
     }
     $this->data = $this->data->dataObj;
     //Infos werden aus der Datenbank geladen und in einen assoziativen Array geladen InfoKey => InfoValue
     $temp = getDB()->query('refreshDataProjectInfo', array('pid' => $this->pid));
     $this->info = $temp;
     if ($temp !== null) {
         $this->info = array();
         do {
             $this->info[$temp->dataObj->key] = $temp->dataObj->value;
         } while ($temp->next());
     }
     //Infos werden aus der Datenbank geladen und in einen assoziativen Array geladen InfoKey => InfoValue
     $fail = ($this->data->access_level == 0 || $this->data->access_level == 1 && getUser()->access_level == 1 || $this->data->access_level <= 2 && $this->data->class == getUser()->class && getUser()->access_level == 2 || $this->data->access_level <= 2 && getUser()->access_level == null) && $this->data->owner != getUser()->id && getUser()->access_level != 0;
     //Ist der Benutzer berechtigt das Projekt zu bearbeiten wird $this->editable auf true gesetzt
     $this->editable = getUser()->data->id == $this->data->owner || getUser()->data->access_level == 0;
     //Im Fehlerfall wird das Skript abgebrochen und ein Fehler ausgegeben
     if ($fail) {
         $this->throwError('$user has no access to the project');
     }
     if (getUser() === false && $this->data->access_level < 3) {
         $this->throwError('You aren`t logged in');
     }
 }
开发者ID:nksarea,项目名称:nksarea,代码行数:35,代码来源:project.class.php


示例18: exec

 public function exec()
 {
     if ($this->ci->ion_auth->logged_in()) {
         $user = $this->ci->ion_auth->user()->row();
         setUser('username', $user->username);
         setUser('id', $user->id);
         setUser('email', $user->email);
         setUser('admin', $this->ci->ion_auth->is_admin());
         setUser('logged', true);
         $groupUser = $this->ci->ion_auth->get_users_groups(getUser('id'))->result();
         $group = array();
         foreach ($groupUser as $tmp) {
             $group[] = $tmp->id;
         }
         setUser('groups', $group);
     } else {
         setUser('logged', false);
     }
     if ($this->ci->uri->segment(1) != "auth") {
         if (!$this->ci->acl->isAllow()) {
             $this->ci->session->set_flashdata('message', "Vous n'avez pas acces à cette page");
             redirect("auth/login/redirect");
         }
     }
 }
开发者ID:ngangchill,项目名称:CI-ACL,代码行数:25,代码来源:AclHook.php


示例19: __invoke

 public function __invoke($args)
 {
     if (getUser() == null) {
         throw new Exception("No user logged in!");
     }
     return new OrongoVariable(getUser()->getID());
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:7,代码来源:orongopackage_Session.php


示例20: getManager

 public function getManager(Request $request)
 {
     $user = getUser();
     $data['insert'] = $request->input('insert', false);
     $data['from'] = $request->input('from', false);
     $data['access_token'] = $user['access_token'];
     return view('admin.files', $data);
 }
开发者ID:koyeo,项目名称:bichon,代码行数:8,代码来源:FileController.php



注:本文中的getUser函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getUserAttributeValues函数代码示例发布时间:2022-05-15
下一篇:
PHP getUrlData函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap