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

PHP authenticated函数代码示例

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

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



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

示例1: lock

/**
 * Locks a specific script for unauthenticated requests.
 */
function lock()
{
    if (!authenticated()) {
        header('Location: ' . R . 'auth/?referer=' . $_SERVER['REQUEST_URI']);
        exit;
    }
}
开发者ID:rogerdudler,项目名称:application-template,代码行数:10,代码来源:core.php


示例2: autherized

function autherized($userid, $pageauth)
{
    if (!isset($pageauth)) {
        return 1;
    }
    if (authenticated()) {
        return 1;
    }
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:odp-svn,代码行数:10,代码来源:libaaa.php


示例3: isset

?>
    </div>
    <!-- end Authentication status -->
    <br clear="all" />
    <?php 
// if $_GET['status'] is populated then we have a response
// about a syndicated upload from YouTube's servers
if (isset($_GET['status'])) {
    isset($_GET['code']) ? $code = $_GET['code'] : ($code = null);
    isset($_GET['id']) ? $id = $_GET['id'] : ($id = null);
    print '<div id="generalStatus">' . uploadStatus($_GET['status'], $code, $id) . '<div id="detailedUploadStatus"></div></div>';
}
?>
    <!-- General status -->
    <?php 
if (authenticated()) {
    printAuthenticatedActions();
}
?>
    <!-- end General status -->
    <br clear="all" />
    <div id="searchResults">
      <div id="searchResultsListColumn">
        <div id="searchResultsVideoList"></div>
        <div id="searchResultsNavigation">
          <form id="navigationForm" action="javascript:void();">
            <input type="button" id="previousPageButton" onclick="ytVideoApp.listVideos(ytVideoApp.previousQueryType, ytVideoApp.previousSearchTerm, ytVideoApp.previousPage);" value="Back" style="display: none;" />
            <input type="button" id="nextPageButton" onclick="ytVideoApp.listVideos(ytVideoApp.previousQueryType, ytVideoApp.previousSearchTerm, ytVideoApp.nextPage);" value="Next" style="display: none;" />
          </form>
        </div>
      </div>
开发者ID:natureday1,项目名称:Life,代码行数:31,代码来源:index.php


示例4: function

});
$app->get('/friends', function () use($app) {
    authenticated();
    $query = 'SELECT * FROM relations WHERE one = ? OR another = ? ORDER BY created_at DESC';
    $friends = array();
    $stmt = db_execute($query, array(current_user()['id'], current_user()['id']));
    while ($rel = $stmt->fetch()) {
        $key = $rel['one'] == current_user()['id'] ? 'another' : 'one';
        if (isset($friends[$rel[$key]])) {
            $friends[$rel[$key]] = $rel['created_at'];
        }
    }
    $app->render('friends.php', array('friends' => $friends));
});
$app->post('/friends/:account_name', function ($account_name) use($app) {
    authenticated();
    if (!is_friend_account($account_name)) {
        $user = user_from_account($account_name);
        if (!$user) {
            abort_content_not_found();
        }
        db_execute('INSERT INTO relations (one, another) VALUES (?,?), (?,?)', array(current_user()['id'], $user['id'], $user['id'], current_user()['id']));
        $app->redirect('/friends');
    }
});
$app->get('/initialize', function () use($app) {
    db_execute("DELETE FROM relations WHERE id > 500000");
    db_execute("DELETE FROM footprints WHERE id > 500000");
    db_execute("DELETE FROM entries WHERE id > 500000");
    db_execute("DELETE FROM comments WHERE id > 1500000");
});
开发者ID:kstm-su,项目名称:ISUCON5,代码行数:31,代码来源:index.php


示例5: catch

}
// load objects from configuration
if (!$err) {
    try {
        $moviemasher_client =& MovieMasher::fromConfig('MovieMasher.xml', 'Client');
        $moviemasher_file =& MovieMasher::fromConfig('MovieMasher.xml', 'File');
    } catch (Exception $ex) {
        $err = xml_safe($ex->getMessage());
    }
}
// load utilities
if (!$err && !@(include_once 'MovieMasher/lib/authutils.php')) {
    $err = 'Problem loading utility script';
}
// see if the user is autheticated (will NOT exit)
if (!$err && !authenticated()) {
    $err = 'Unauthenticated access';
}
// check to make sure required parameters have been sent
if (!$err) {
    $job = empty($_REQUEST['job']) ? '' : $_REQUEST['job'];
    $id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
    if (!($job && $id)) {
        $err = 'Parameters job, id required';
    }
}
// make sure required configuration options have been set
if (!$err) {
    $uploads_locally = $moviemasher_file->uploadsLocally();
    $renders_locally = $moviemasher_client->rendersLocally();
    $path_media = $moviemasher_client->getOption('PathMedia');
开发者ID:ronniebrito,项目名称:moodle_moviemasher,代码行数:31,代码来源:encoding.php


示例6: catch

}
// load objects from configuration
if (!$err) {
    try {
        $moviemasher_client =& MovieMasher::fromConfig('MovieMasher.xml', 'Client');
        $moviemasher_file =& MovieMasher::fromConfig('MovieMasher.xml', 'File');
    } catch (Exception $ex) {
        $err = xml_safe($ex->getMessage());
    }
}
// load utilities
if (!$err && !@(include_once 'MovieMasher/lib/authutils.php')) {
    $err = 'Problem loading utility script';
}
// see if the user is autheticated (will NOT exit)
if (!$err && !authenticated($moviemasher_client)) {
    $err = 'Unauthenticated access';
}
// check to make sure required parameters have been sent
if (!$err) {
    $id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
    if (!$id) {
        $err = 'Parameter id required';
    }
}
if (!$err) {
    // set $err for log entry
    $progress = @file_get_contents('php://input');
    if (!$progress) {
        $err = 'No request body provided';
    }
开发者ID:ronniebrito,项目名称:moodle_moviemasher,代码行数:31,代码来源:progress.php


示例7:

<?php

if (!authenticated()) {
    echo "echo Authentication failed!\n";
    echo "sleep 3\n";
    echo "chain --replace --autofree {$url}boot.php\n";
    exit;
}
开发者ID:almdandi,项目名称:ipxe-phpmenu,代码行数:8,代码来源:auth.php


示例8: array

        $response = User::getUsersByName($search, $user_id);
    } else {
        $result = (object) array('status' => -1, 'status_explanation' => 'Insufficient data provided.');
    }
    header('Content-Type: application/json');
    echo json_encode($response, JSON_PRETTY_PRINT);
}, $f3->get('route_ttl'));
/**
 * Route: Get user information by ID
 *
 * @example /user/@id
 */
$f3->route('POST /user/@id', function ($f3, $params) use($db) {
    $id = $f3->get('PARAMS.id');
    // If user sending request is authenticated
    if ($sender_id = authenticated()) {
        $user = new User(null, $id);
        if ($user_info = $user->getInfo(false)) {
            $response = (object) array('status' => 1, 'status_explanation' => 'Success.', 'handle' => $user_info->handle, 'first_name' => $user_info->first_name, 'last_name' => $user_info->last_name, 'image' => $user_info->image);
        } else {
            $response = (object) array('status' => -2, 'status_explanation' => 'Couldn\'t fetch user information from database.');
        }
    } else {
        $response = (object) array('status' => -1, 'status_explanation' => 'Insufficient data provided.');
    }
    header('Content-Type: application/json');
    echo json_encode($response, JSON_PRETTY_PRINT);
}, $f3->get('route_ttl'));
/**
 * Route: Retrieve all achievements
 * @todo the achievement system needs to be finished. Right now it just returns a list of available achievements. Nothing more.
开发者ID:phillmill,项目名称:social-app-api,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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