当前位置: 首页>>代码示例>>PHP>>正文


PHP Cookie::val方法代码示例

本文整理汇总了PHP中Cookie::val方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::val方法的具体用法?PHP Cookie::val怎么用?PHP Cookie::val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cookie的用法示例。


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

示例1: define

<?php

/*
    This script is the AJAX callback that deletes a user's saved search
*/
define('IN_FS', true);
require_once '../../header.php';
$baseurl = dirname(dirname($baseurl)) . '/';
if (Cookie::has('flyspray_userid') && Cookie::has('flyspray_passhash')) {
    $user = new User(Cookie::val('flyspray_userid'));
    $user->check_account_ok();
    $db->Query('DELETE FROM {searches} WHERE id = ? AND user_id = ?', array(Get::num('id'), $user->id));
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:13,代码来源:deletesearches.php

示例2: array

box-shadow: 0 1px 1px #ddd;
color: #565656;
cursor: pointer;
display: inline-block;
font-family: sans-serif;
font-size: 100%;
font-weight: bold;
line-height: 130%;
padding: 8px 13px 8px 10px;
text-decoration: none;
">Remove the folder ' . DIRECTORY_SEPARATOR . 'setup</a> before you start using Flyspray</p>
');
}
// Any "do" mode that accepts a task_id or id field should be added here.
if (in_array(Req::val('do'), array('details', 'depends', 'editcomment'))) {
    if (Req::num('task_id')) {
        $result = $db->Query('SELECT  project_id
                                FROM  {tasks} WHERE task_id = ?', array(Req::num('task_id')));
        $project_id = $db->FetchOne($result);
    }
}
if (!isset($project_id)) {
    // Determine which project we want to see
    if (($project_id = Cookie::val('flyspray_project')) == '') {
        $project_id = $fs->prefs['default_project'];
    }
    $project_id = Req::val('project', Req::val('project_id', $project_id));
}
$proj = new Project($project_id);
# no more project cookie!
#$proj->setCookie();
开发者ID:korusdipl,项目名称:flyspray,代码行数:31,代码来源:header.php

示例3: elseif

} elseif (Req::has('show') || Req::has('switch') && $do == 'details' || $do == 'newtask' && Req::val('project') == '0') {
    $do = 'index';
} elseif (Req::has('code')) {
    $_SESSION['oauth_provider'] = 'microsoft';
    $do = 'oauth';
} elseif (Req::has('do') && Req::val('do') == 'tasklist') {
    $do = 'index';
}
// supertask_id for add new sub-task
$supertask_id = 0;
if (Req::has('supertask')) {
    $supertask_id = Req::val('supertask');
}
/* permission stuff */
if (Cookie::has('flyspray_userid') && Cookie::has('flyspray_passhash')) {
    $user = new User(Cookie::val('flyspray_userid'), $proj);
    $user->check_account_ok();
    $user->save_search($do);
} else {
    $user = new User(0, $proj);
}
if (Get::val('getfile')) {
    // If a file was requested, deliver it
    $result = $db->Query("SELECT  t.project_id,\n                                  a.orig_name, a.file_name, a.file_type, t.*\n                            FROM  {attachments} a\n                      INNER JOIN  {tasks}       t ON a.task_id = t.task_id\n                           WHERE  attachment_id = ?", array(Get::val('getfile')));
    $task = $db->FetchRow($result);
    list($proj_id, $orig_name, $file_name, $file_type) = $task;
    // Check if file exists, and user permission to access it!
    if (!is_file(BASEDIR . "/attachments/{$file_name}")) {
        header('HTTP/1.1 410 Gone');
        echo 'File does not exist anymore.';
        exit;
开发者ID:kandran,项目名称:flyspray,代码行数:31,代码来源:index.php

示例4: check_account_ok

 public function check_account_ok()
 {
     global $conf, $baseurl;
     // Anon users are always OK
     if ($this->isAnon()) {
         return;
     }
     $saltedpass = crypt($this->infos['user_pass'], $conf['general']['cookiesalt']);
     if (Cookie::val('flyspray_passhash') !== $saltedpass || !$this->infos['account_enabled'] || !$this->perms('group_open', 0)) {
         $this->logout();
         Flyspray::Redirect($baseurl);
     }
 }
开发者ID:canneverbe,项目名称:flyspray,代码行数:13,代码来源:class.user.php

示例5: Project

    $project_id = Req::val('project', Req::val('project_id', $project_id));
}
$proj = new Project($project_id);
// reset do for default project level entry page
if (!in_array($do, $modes)) {
    $do = $do ? Req::enum('do', $modes, $proj->prefs['default_entry']) : $proj->prefs['default_entry'];
}
$proj->setCookie();
$user = new User($uid = 0);
// verify and initiate user
$auth = new FlysprayAuth();
if (Post::val('user_name') && Post::has('password')) {
    $uid = $auth->checkLogin(Post::val('user_name'), Post::val('password'));
    if (is_array($uid)) {
        FlysprayDo::error($uid);
    }
} else {
    if (Cookie::val('flyspray_userid') && $auth->checkCookie(Cookie::val('flyspray_userid'), Cookie::val('flyspray_passhash'))) {
        $uid = Cookie::val('flyspray_userid');
    }
}
$user = new User($uid);
// Load translations
load_translations();
function debuglog($str)
{
    $file = fopen("debug.log", "a+");
    fwrite($file, $str . "\n");
    fflush($file);
    fclose($file);
}
开发者ID:heptalium,项目名称:flyspray,代码行数:31,代码来源:header.php


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