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


PHP checkAuth函数代码示例

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


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

示例1: index

 function index()
 {
     $this->load->helper('gfx');
     if (!checkAuth(false, false, 'flashdata')) {
         header('Location: ' . base_url());
         return;
     }
     $user = $this->db->query('SELECT * FROM users WHERE `id` = ' . $this->session->userdata('id') . ' LIMIT 1');
     if ($user->num_rows() === 0) {
         //Rare cases where session exists but got deleted.
         session_data_unset(false);
         flashdata_message('no_such_user');
         header('Location: ' . base_url());
         return;
     }
     $U = $user->row_array();
     $user->free_result();
     $F = array();
     for ($i = 0; $i < 3; $i++) {
         $feature = $this->db->query('SELECT name, title, description FROM features ' . 'WHERE `id` = ' . $U['feature_' . $i] . ';');
         $F[] = $feature->row_array();
         $feature->free_result();
     }
     unset($feature);
     if ($U['ready'] !== 'Y') {
         flashdata_message('sticker_nopage');
         header('Location: ' . site_url('editor'));
         return;
     }
     $data = array('meta' => $this->load->view('sticker/meta.php', $U, true), 'content' => $this->load->view('sticker/content.php', array_merge($U, array('features' => $F)), true), 'db' => 'content ');
     $this->load->library('parser');
     $this->parser->page($data, $this->session->userdata('id'), $U);
 }
开发者ID:hSATAC,项目名称:gfx.tw,代码行数:33,代码来源:sticker.php

示例2: getAccount

function getAccount()
{
    if (checkAuth()) {
        return $_SESSION["auth_account_id"];
    }
    return null;
}
开发者ID:CMP-Studio,项目名称:EmuObjectMover,代码行数:7,代码来源:auth.php

示例3: checkLogin

function checkLogin(&$USERLOGGEDIN)
{
    require_once "auth.lib.php";
    $userid = checkAuth();
    if ($userid != 0) {
        setAuth($userid);
        updateUserLogin($userid);
        $USERLOGGEDIN = true;
    }
}
开发者ID:nobelium,项目名称:digitalfortress,代码行数:10,代码来源:login.lib.php

示例4: route_deposit

function route_deposit()
{
    global $PMC;
    $member = checkAuth();
    set('member', $member);
    set('deposit', $PMC->get("dep{$member['id']}"));
    global $page;
    ob_start();
    include 'templates/deposit.php';
    set('content', ob_get_clean());
    include 'templates/_layout.php';
}
开发者ID:enikesha,项目名称:v_order,代码行数:12,代码来源:index.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->helper('form');
     $this->load->helper('html_helper');
     $this->load->helper('url_helper');
     $this->load->library('session');
     $this->load->model('auth_model');
     $this->load->helper('cookie');
     checkAuth();
     $this->checkRemember();
 }
开发者ID:vslala,项目名称:cg,代码行数:12,代码来源:Welcome.php

示例6: checkAdminAuth

function checkAdminAuth()
{
    if (!checkAuth()) {
        return false;
    }
    global $session, $app;
    if ('admin' !== $session->getUserType()) {
        Helpers::sendJson(array('error' => array('error_code' => 'forbidden', 'error_msg' => 'Доступ мають лише адміністратори')));
        return false;
    }
    return true;
}
开发者ID:berejant,项目名称:spkneu-mbti,代码行数:12,代码来源:index.php

示例7: delete

 function delete()
 {
     $this->load->config('gfx');
     $this->load->helper('gfx');
     if (!checkAuth(true, true, 'flashdata')) {
         header('Location: ' . site_url('about'));
         return;
     }
     $this->load->database();
     $this->db->delete('aboutpages', array('id' => $this->input->post('id')));
     flashdata_message('about_deleted', 'highlight', 'info');
     header('Location: ' . site_url('about'));
 }
开发者ID:hSATAC,项目名称:gfx.tw,代码行数:13,代码来源:about.php

示例8: getChild

function getChild($data, $pid)
{
    $child = array();
    foreach ($data as $key => $vo) {
        if ($vo['pid'] == $pid) {
            $url = $vo['m'] . "/" . $vo['c'] . "/" . $vo['a'];
            $vo['url'] = U($url);
            $vo['auth'] = checkAuth($url);
            //echo $url."<br>";
            $child[] = $vo;
        }
    }
    return $child;
}
开发者ID:quguo,项目名称:wxpt,代码行数:14,代码来源:function.php

示例9: piRequest

function piRequest($code, $method)
{
    global $verbose;
    // Requires auth
    checkAuth();
    $code["function"] = "/" . str_replace(".", "/", $code["function"]);
    if ($verbose) {
        echo $code["function"] . "\n";
    }
    $endpoint = endpointWith($code["function"], $method);
    if ($endpoint === false) {
        return json_encode(sendRequest($method, defaultHeader(), $code["arguments"], $code["function"]));
        //return false;
    }
    if ($method != "GET") {
        $data = formattedParametersWithData($endpoint, $data);
    }
    $newPath = fillEndpointPathWithRequirements($endpoint, $code["arguments"]);
    $code["arguments"] = cleanEndpointRequirementsFromData($endpoint, $code["arguments"]);
    return json_encode(sendRequest($method, defaultHeader(), $code["arguments"], $newPath));
}
开发者ID:saurabhsrb,项目名称:pipress,代码行数:21,代码来源:piProcessing.php

示例10: gotDTMF

                    $text = $ev->GetValue("text");
                    for ($i = 0; $i < strlen($text); $i++) {
                        gotDTMF($text[$i]);
                    }
                    $ev->handled = true;
                    break;
            }
            /* This is extremely important.
               We MUST let messages return, handled or not */
            if ($ev) {
                $ev->Acknowledge();
            }
            break;
        case "answer":
            // Yate::Debug("PHP Answered: " . $ev->name . " id: " . $ev->id);
            if ($ev->name == "user.auth") {
                checkAuth($ev->retval);
            }
            break;
        case "installed":
            // Yate::Debug("PHP Installed: " . $ev->name);
            break;
        case "uninstalled":
            // Yate::Debug("PHP Uninstalled: " . $ev->name);
            break;
        default:
            // Yate::Output("PHP Event: " . $ev->type);
    }
}
Yate::Output("PHP: bye!");
/* vi: set ts=8 sw=4 sts=4 noet: */
开发者ID:andreikabeliy,项目名称:yate,代码行数:31,代码来源:voicemail.php

示例11: update

 function update()
 {
     $this->load->config('gfx');
     $this->load->helper('gfx');
     if (!checkAuth(true, true, 'json')) {
         return;
     }
     /* Feature name cannot collide function name */
     if (in_array($this->input->post('name'), array('update', 'delete'))) {
         json_message('error_feature_name');
         return;
     }
     /* Check whether name already used */
     $data = $this->db->query('SELECT `name` FROM `features` WHERE `id` != ' . $this->input->post('id') . ' AND `name` = ' . $this->db->escape($this->input->post('name')) . ';');
     if ($data->num_rows() !== 0) {
         json_message('dup_feature_name');
         return;
     }
     $data->free_result();
     /* Update stickers*/
     $this->_update_feature_images($this->input->post('title'), $this->input->post('name'));
     /* Update data */
     $this->db->update('features', array('title' => $this->input->post('title'), 'name' => $this->input->post('name'), 'order' => $this->input->post('order'), 'description' => $this->input->post('description'), 'content' => $this->input->post('content')), array('id' => $this->input->post('id')));
     $this->load->library('cache');
     $this->cache->remove($this->input->post('name'), 'feature-inframe');
     $this->cache->remove($this->input->post('name'), 'feature');
     json_message('feature_updated', 'highlight', 'info');
 }
开发者ID:hSATAC,项目名称:gfx.tw,代码行数:28,代码来源:feature.php

示例12: checkAuth

<?php

include "_header.php";
?>

<?php 
checkAuth('http://web.engr.oregonstate.edu/~dicarloj/Nakama/invalid_key.php', 1);
?>

<?php 
if (isset($_POST["password"])) {
    ///rerrorcheck password and password2
    $password = $_POST["password"];
    /*	&userID = $_SESSION["userID"];
    	if($result = $mysqli->query("select userName,password from Users wheren userID = '$userID'")){//////////dont need this use email
    		$obj = $result->fetch_object();
    		$username = $obj->userName;
    		$hashedPassword = base64_encode(hash('sha256',$password . $username));
    	///set password to hashpassword in Users where userID = $user ID 
    		echo 'Your password has been changed';
    		$result->close();
    	}*/
}
echo 'hi';
?>

<?php 
include "_footer.php";
开发者ID:DiCarloJonathan,项目名称:Nakama,代码行数:28,代码来源:new_pass_go.php

示例13: checkAuth

<?php

require_once "../pos-dbc.php";
require_once "../functions.php";
checkAuth(120);
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED);
?>

<link rel="stylesheet" type="text/css" href="../style.css" />
<link rel="stylesheet" type="text/css" href="../invoice.css" />
<link rel="stylesheet" type="text/css" href="../js/jquery.ui.datepicker.css" />
<script type="text/javascript" src="../js/jquery-lastest.js"></script>
<script type="text/javascript" src="../js/jquery.ui.datepicker.js"></script>
<script>
	jQuery(document).ready(function($) {
		$('#date1').datepicker({
			changeYear: true, 
			dateFormat: "dd/mm/yy",
			onSelect: function (selectedDateTime){
				var start = $(this).datepicker('getDate');
				$('#date2').datepicker('option', 'minDate', new Date(start.getTime()));
				var next = new Date(start.getFullYear(),start.getMonth()+1,start.getDate()+6)
				var day = next.getDate();
					day = day<10? '0'+day : day;
				var mon = next.getMonth();
					mon = mon<10? '0'+mon : mon;
				$('#date2').val(day+'/'+mon+'/'+next.getFullYear());
				document.location.href = reloc_href();
			}
		});
		$('#date2').datepicker({
开发者ID:anjijava16,项目名称:mis_Imp,代码行数:31,代码来源:employee-rost.php

示例14: define

<?php

define('SU_RUN', 0);
include_once '../config.php';
include_once '../constant.php';
include_once '../dbconn.php';
include_once '../function.php';
define('UID', checkAuth());
if (!(getUserFlag() & SU_USER_OPS)) {
    header('HTTP/1.1 403 Forbidden');
    header('location: ' . SU_BASE_URL);
    return;
}
$opLevel = getUserFlag() & SU_USER_OPS;
?>
<!DOCTYPE html>
<html>
    <head>
        <title>URL Shorterner</title>
        <link rel="stylesheet" href="includes/jquery-ui.css">
        <script type="text/javascript" src="includes/jquery-2.0.3.js"></script>
        <script type="text/javascript" src="includes/jquery-ui.js"></script>
    </head>
    <body>
        <a href="<?php 
echo SU_BASE_URL;
?>
">Return to main user interface</a>
        <h1>Select Admin Function</h1>
        <ul>
            <?php 
开发者ID:lyhiving,项目名称:shortURL-1,代码行数:31,代码来源:index.php

示例15: mysql_query

} else {
    $page = 1;
}
$start_from = ($page - 1) * $num_rec_per_page;
$query = "SELECT articles.title, articles.url, articles.user_id, articles.id, articles.category_id,\n                articles.midichlorians, users.username, categories.name, articles.time_submitted\n                FROM articles, users, categories\n                WHERE articles.user_id = users.id AND articles.category_id = categories.id AND users.username = '{$onidid}'\n                ORDER BY articles.time_submitted DESC\n                LIMIT {$start_from}, {$num_rec_per_page}";
$articles = mysql_query($query);
while ($row = mysql_fetch_array($articles)) {
    //Sanatize outputs from html/javascript injection
    $id = htmlspecialchars($row["id"]);
    $url = htmlspecialchars($row["url"]);
    $title = htmlspecialchars($row["title"]);
    $midichlorians = htmlspecialchars($row["midichlorians"]);
    $username = htmlspecialchars($row["username"]);
    $name = htmlspecialchars($row["name"]);
    echo "\n           <a class='list-group-item' id='article" . $id . "' href='" . $url . "'>\n              <h6 class='list-group-item-heading'><b>" . $title . " </b></h6>" . "<p class='list-group-item-text'>User: " . $username . "<br>Category: " . $name . "</p><p class='list-group-item-text'>Midichlorians: <span class='badge'>" . $midichlorians . "</span></p></a>\n              ";
    if (checkAuth(false) != "") {
        echo "\n              <div class='form-group'>\n                <button class='btn btn-default' type='upvote' onclick='upvote(" . $id . ");' name='upvote' style='color:green; font-weight:bold'> + </button>\n                <button class='btn btn-default' type='downvote' onclick='downvote(" . $id . ");' name='downvote' style='color:red; font-weight:bold'> - </button>\n              </div>\n                ";
    } else {
        echo "Log in to vote on this article.\n                ";
    }
}
?>
		</div>
</div><!-- / main list group -->
    <div class="row">
    <nav>
        <ul class = "pagination">
<?php 
$num_rec_per_page = 5;
$mysql_handle = mysql_connect($dbhost, $dbuser, $dbpass) or die("Error connecting to database server");
mysql_select_db($dbname, $mysql_handle) or die("Error selecting database: {$dbname}");
开发者ID:matthewrsj,项目名称:jedi-temple,代码行数:31,代码来源:profile.php


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