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

PHP is_auth函数代码示例

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

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



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

示例1: show_signin

function show_signin()
{
    if (is_auth()) {
        redirect("home");
    }
    render("signin");
}
开发者ID:thuraucsy,项目名称:holiday,代码行数:7,代码来源:user2.php


示例2: show_home

function show_home()
{
    if (!is_auth()) {
        redirect("user/signin");
    }
    render("home");
}
开发者ID:thuraucsy,项目名称:holiday,代码行数:7,代码来源:home.php


示例3: __construct

 /**
  * Responsable for auto load the model
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     if (!is_auth()) {
         redirect('admin/login');
     }
 }
开发者ID:liemnv,项目名称:Groupon-Clone-On-Magento,代码行数:11,代码来源:admin_vouchers.php


示例4: pageBody

function pageBody($mode)
{
    $isAuth = is_auth();
    $res = "";
    if (!$isAuth) {
        $res = auth_form();
    } else {
        $res = main_form() . get_orders_table($mode);
    }
    return $res;
}
开发者ID:xent1986,项目名称:ychebgit,代码行数:11,代码来源:admin.php


示例5: __construct

 function __construct()
 {
     parent::__construct();
     // Check Auth Login
     if (!is_login('Administrator')) {
         redirect('users/admin/auth');
     }
     if (!is_auth()) {
         redirect('users/admin/auth/fail');
     }
     $this->template->set_theme('admin');
     // Set layout
     $this->template->set_layout('layout');
     // Load Langauge
     $this->lang->load('admin');
     // Set js
     $this->template->append_metadata(js_notify());
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:18,代码来源:Admin_Controller.php


示例6: include_css

echo include_css("bootstrap-wysihtml5.css");
?>
	<?php 
echo include_css("style.css");
?>

	<?php 
echo "<script>var PATH = '{$config["path"]}';</script>";
?>
</head>
<body>
	<div class="container-narrow">

		<div class="masthead">
			<?php 
if (is_auth()) {
    ?>
			<ul class="nav nav-pills pull-right">
				<li class="<?php 
    echo $controller == "home" ? "active" : "";
    ?>
">
					<?php 
    echo link_to("home", "Home");
    ?>
				</li>
				<li class="<?php 
    echo $controller == "user" ? "active" : "";
    ?>
">
					<?php 
开发者ID:thuraucsy,项目名称:holiday,代码行数:31,代码来源:index.php


示例7: _before

 /**
  * Этот метод будет запущен перед выполнением
  * любого экшена
  */
 public function _before()
 {
     if (!is_auth()) {
         redirect(['controller' => 'index']);
     }
 }
开发者ID:cruide,项目名称:wasp,代码行数:10,代码来源:users.php


示例8: invoke_controller

/**
 *	invoke a controller based on the query arguments given
 *
 *	this function does not return in case of an error.
 *	@param array $args query-arguments array
 *	@return mixed return value of controller that was called
 */
function invoke_controller($args)
{
    global $controllers;
    // change query-arguments so that we always have a arg0 and arg1
    if (!isset($args[0])) {
        $args[0] = array('', '');
    } elseif (is_string($args[0])) {
        $args[0] = array($args[0], '');
    }
    // load all modules
    // TODO (later): fastpath for serving cached pages or files (the latter one
    // is only doable when we store in the object file which module to load)
    load_modules();
    $match = false;
    if (isset($controllers[$args[0][0] . '-' . $args[0][1]])) {
        // foo/bar would match controller for "foo/bar"
        $match = $controllers[$args[0][0] . '-' . $args[0][1]];
        $reason = $args[0][0] . '/' . $args[0][1];
    } elseif (isset($controllers[$args[0][0] . '-*'])) {
        // foo/bar would match "foo/*"
        $match = $controllers[$args[0][0] . '-*'];
        $reason = $args[0][0] . '/*';
    } elseif (isset($controllers['*-' . $args[0][1]])) {
        // foo/bar would match "*/bar"
        $match = $controllers['*-' . $args[0][1]];
        $reason = '*/' . $args[0][1];
    } elseif (isset($controllers['*-*'])) {
        // foo/bar would match "*/*"
        $match = $controllers['*-*'];
        $reason = '*/*';
    }
    if ($match !== false) {
        // check authentication for those controllers that require it
        if (isset($match['auth']) && $match['auth']) {
            if (!is_auth()) {
                prompt_auth();
            }
            // also check the referer to prevent against cross site request
            // forgery (xsrf)
            // this is not really optimal, since proxies can filter the referer
            // header, but as a first step..
            if (!empty($_SERVER['HTTP_REFERER'])) {
                $bu = base_url();
                if (substr($_SERVER['HTTP_REFERER'], 0, strlen($bu)) != $bu) {
                    log_msg('warn', 'controller: possible xsrf detected, referer is ' . quot($_SERVER['HTTP_REFERER']) . ', arguments ' . var_dump_inl($args));
                    hotglue_error(400);
                }
            }
        }
        log_msg('info', 'controller: invoking controller ' . quot($reason) . ' => ' . $match['func']);
        return $match['func']($args);
    } else {
        // normally we won't reach this as some default (*/*) controller will
        // be present
        log_msg('warn', 'controller: no match for ' . quot($args[0][0] . '/' . $args[0][1]));
        hotglue_error(400);
    }
}
开发者ID:QbpNogCYUGmaGPzD,项目名称:hotglue2,代码行数:65,代码来源:controller.inc.php


示例9: Section

    $timetable["Manage Timetable"]["View Timetable"]["For a Branch"] = "student_select.php";
    $timetable["Manage Timetable"]["View Timetable"]["For a Section (Firstyear)"] = "section_select.php";
} else {
    if (is_auth("stu") || is_auth("ft")) {
        $timetable["Manage Timetable"]["View Timetable"] = array();
        if (is_auth("stu")) {
            $timetable["Manage Timetable"]["View Timetable"]["For You"] = "student.php";
        } else {
            $timetable["Manage Timetable"]["View Timetable"]["For Firstyears"] = "view_firstyr_faculty.php";
            $timetable["Manage Timetable"]["View Timetable"]["For Secondyear onwards"] = "view_faculty.php";
        }
        $timetable["Manage Timetable"]["View Timetable"]["For a Classroom"] = "classroom_select.php";
        $timetable["Manage Timetable"]["View Timetable"]["For a Branch"] = "student_select.php";
        $timetable["Manage Timetable"]["View Timetable"]["For a Section (firstyear)"] = "section_select.php";
    } else {
        if (is_auth("deo")) {
            $timetable["Manage Timetable"]["View Timetable"] = array();
            $timetable["Manage Timetable"]["View Timetable"]["For a Classroom"] = "classroom_select.php";
            $timetable["Manage Timetable"]["View Timetable"]["For a Branch"] = "student_select.php";
            $timetable["Manage Timetable"]["View Timetable"]["For a Section (firstyear)"] = "section_select.php";
            $timetable["Manage Timetable"]["Enter Timetable for a Section (firstyear)"] = "dataoperator_enter_timetable.php";
            $timetable["Manage Timetable"]["Assign Classroom to Class"] = array();
            $timetable["Manage Timetable"]["Assign Classroom to Class"]["For Firstyears"] = "assign_classroom_firstyear.php";
            $timetable["Manage Timetable"]["Assign Classroom to Class"]["For Secondyear onwards"] = "assign_classroom.php";
            $timetable["Manage Timetable"]["Assign Subject to Faculty"] = "assign_subject.php";
            //$timetable["Manage Timetable"]["Set Timelength to Period"]="set_time.php";
            $timetable["Manage Timetable"]["Manage Classrooms"] = array();
            $timetable["Manage Timetable"]["Manage Classrooms"]["Add classrooms"] = "adding_classrooms.php";
            $timetable["Manage Timetable"]["Manage Classrooms"]["Block classrooms"] = array();
            $timetable["Manage Timetable"]["Manage Classrooms"]["Block classrooms"]["Block Building"] = "block_building.php";
            $timetable["Manage Timetable"]["Manage Classrooms"]["Block classrooms"]["Block Room"] = "block_room.php";
开发者ID:ShivanshuGoyal,项目名称:Timetable,代码行数:31,代码来源:AccountFunctions.php


示例10: gettoken

function gettoken()
{
    if (is_auth() && isset($_SESSION["token"])) {
        echo $_SESSION["token"];
        return;
    }
    login("token");
}
开发者ID:yatishextreme,项目名称:Sprinklers-PHP,代码行数:8,代码来源:main.php


示例11:

<?php 
if (false === ($user = is_auth())) {
    ?>
<a href="/registration/">Регистрация</a><br />
<a href="/authorization/">Вход</a>
<?php 
} else {
    ?>
Привет, <?php 
    echo $user['login'];
    ?>
<br />
<a href="/cabinet/">Кабинет</a><br />
<a href="/out/">Выход</a>
<?php 
}
开发者ID:keovken,项目名称:www,代码行数:16,代码来源:index.php


示例12: elseif

    } elseif (!$direct) {
        $lnk .= 'source/campaign-ads';
    }
    echo $lnk;
    exit;
}
if ($_REQUEST['ajax_act'] == 'sync_slaves') {
    dmp(cache_rules_update());
    dmp(cache_links_update());
    exit;
}
// Страницы, на которые можно войти без авторизации
$open_pages = array('login', 'lostpassword', 'resetpassword');
// Authentification
if (!in_array($_REQUEST['page'], $open_pages)) {
    $auth_info = is_auth();
    if ($auth_info[0] == false) {
        switch ($auth_info[1]) {
            case 'register_new':
                if ($_REQUEST['page'] != 'register') {
                    header('Location: ' . _HTML_ROOT_PATH . "/?page=register");
                }
                break;
            default:
                header('Location: ' . _HTML_ROOT_PATH . "/?page=login");
                break;
        }
    }
}
if (isset($_REQUEST['csrfkey']) && $_REQUEST['csrfkey'] == CSRF_KEY) {
    switch ($_REQUEST['ajax_act']) {
开发者ID:conversionstudio,项目名称:cpatracker,代码行数:31,代码来源:index.php


示例13: download_serve_resource

function download_serve_resource($args)
{
    $obj = $args['obj'];
    if (!isset($obj['type']) || $obj['type'] != 'download') {
        return false;
    }
    $a = expl('.', $obj['name']);
    // serve the resource only when it's public or we're logged in (i.e. editing)
    if (isset($obj['download-public']) && $obj['download-public'] == 'public' || is_auth()) {
        serve_file(CONTENT_DIR . '/' . $a[0] . '/shared/' . $obj['download-file'], $args['dl'], $obj['download-file-mime']);
    } else {
        if (!is_auth()) {
            prompt_auth(true);
        }
    }
}
开发者ID:danielfogarty,项目名称:damp,代码行数:16,代码来源:module_download.inc.php


示例14: drawHeader

require_once "../Includes/ConfigSQL.php";
//to draw header drawHeader() is calling
drawHeader("TimeTable Info System");
//initialize the session if it is not initialized
if (!isset($_SESSION)) {
    session_start();
}
//to redirect to logout.php page if user is not logged in
if (!isset($_SESSION['id'])) {
    header("Location:../Logout.php");
}
if (isset($_GET['notification'])) {
    drawNotification($_GET['notification'], $_GET['content'], $_GET['type']);
}
if (is_auth("stu")) {
    header("Location:student.php");
} else {
    if (is_auth("deo")) {
        header("Location:dataoperator_timetable.php");
    } else {
        if (is_auth("ft") || is_auth("hod")) {
            header("Location:view_faculty.php");
        } else {
            drawNotification("Error", "Sorry you are not allowed to access the page.", "error");
        }
    }
}
drawFooter();
?>
</body>
</html>
开发者ID:ShivanshuGoyal,项目名称:Timetable,代码行数:31,代码来源:index.php


示例15: session_start

<?php

if (!defined('Sprinklers')) {
    #Start session
    if (!isset($_SESSION)) {
        session_start();
    }
    #Tell main we are calling it
    define('Sprinklers', TRUE);
    #Required files
    require_once "main.php";
}
#Redirect if not authenticated or grabbing page directly
if (!is_auth() || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') {
    header('Location: ' . $base_url);
    exit;
}
#Get controller settings
$_SESSION["data"] = start_data();
#Include the main javascript file
echo "<script>";
include_once "js/main.js.php";
echo "</script>";
?>

<div data-role="page" id="sprinklers">
    <div data-theme="b" data-role="header" data-position="fixed" data-tap-toggle="false">
        <a data-icon="bars" data-iconpos="notext" href="#sprinklers-settings"></a>
        <a data-icon="gear" data-iconpos="notext" href="#settings"><?php 
echo _("Settings");
?>
开发者ID:yatishextreme,项目名称:Sprinklers-PHP,代码行数:31,代码来源:sprinklers.php


示例16: get_draft_json

function get_draft_json($draft_id)
{
    // getting drafts requires an authenticated user
    $AUTH_CODE = 1;
    $auth = is_auth($_SESSION, $AUTH_CODE);
    if (!$auth['authed']) {
        echo 'false';
        exit(0);
    }
    $con = connect_db('uedwardn_droll');
    $query = "SELECT * FROM drafts WHERE draft_id={$draft_id};";
    $result = mysqli_query($con, $query);
    $err = mysqli_error($con);
    if ($err) {
        echo $err;
        exit(0);
    }
    return result2json($result);
}
开发者ID:enewe101,项目名称:droll,代码行数:19,代码来源:app_lib.php


示例17: session_start

<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/common/php/db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/common/php/auth_lib.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/droll/php/get_post.php';
$auth = is_auth($_SESSION, 1);
// Provided 'draft_id' not supplied in $_GET or $_POST,
// default behavior gets the latest post
$post_id = get_var('draft_id');
if (is_null($post_id)) {
    $show_type = 'post';
    $post_id = get_cur_post_id();
    // post_id from $_GET or latest post
    // but if draft_id is set, we'll show that draft
} else {
    $post_id = (int) $post_id;
    $show_type = 'draft';
}
?>
<!DOCTYPE html>
<html>
	<head>
		<script type='text/javascript' src='../../common/js/deparam.js'>
		</script>
		<script type='text/javascript' src='../../common/js/jquery.js'>
		</script>
		<script type='text/javascript' src='../../common/js/utils.js'>
		</script>
		<script type='text/javascript' src='js/app_lib.js'></script>
开发者ID:enewe101,项目名称:droll,代码行数:30,代码来源:index.php


示例18: is_auth

<!doctype html>
<html>
<head>
    <title>Наш блог</title>
	<link rel="stylesheet" href="v/style.css">
</head>
<body>
	<h1>Статьи нашего блога</h1>
	<div>
		<?php 
$is_auth = is_auth();
$is_admin = is_admin($link);
foreach ($fullmessages as $id) {
    ?>
				<div>
					Статья: "<strong><?php 
    echo $id['name'];
    ?>
</strong>"  Автор: <?php 
    echo $id['login'];
    ?>
<br><br>
					<?php 
    echo "<a href=c/post.php?id={$id['id_new']}>Просмотр</a>";
    if ($is_auth) {
        if ($is_admin) {
            echo "<a href=c/edit.php?id={$id['id_new']}>Редактирование</a>";
            echo "<a href=c/edit.php?id={$id['id_new']}>Удалить</a>";
        } else {
            for ($i = 0; $i < 1; $i++) {
                if ($messagesById[$i]['id_user'] == $id['id_user']) {
开发者ID:kristina19,项目名称:BlogByPHP,代码行数:31,代码来源:v_index.php


示例19: _before

 public function _before()
 {
     if (is_auth() && $this->router->getMethodName() != 'Signout') {
         redirect();
     }
 }
开发者ID:cruide,项目名称:wasp,代码行数:6,代码来源:auth.php


示例20: session_start

<?php

include '../m/bd.php';
include '../m/news.php';
session_start();
if (!is_auth()) {
    header('Location: login.php');
    exit;
}
$link = connect();
if (!$link) {
    echo "Не удалось подключиться: " . mysqli_connect_error();
    exit;
}
$id = (int) $_GET['id'];
if ($id != '') {
    $content = get_content($link, $id);
    $content = $content['content'];
    $messages = get_messages($link);
    for ($i = 0; $i < count($messages); $i++) {
        if ($messages[$i]['id_new'] == $id) {
            $title = $messages[$i]['name'];
        }
    }
} else {
    $content = 'Ошибка 404 - такой статьи нет!';
}
if (isset($_POST['Delete'])) {
    delete_new($link, $id);
    header('Location: ../index.php');
    exit;
开发者ID:kristina19,项目名称:BlogByPHP,代码行数:31,代码来源:edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP is_author函数代码示例发布时间:2022-05-15
下一篇:
PHP is_attachment函数代码示例发布时间: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