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


PHP checkAccess函数代码示例

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


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

示例1: b_wfs_new_show

function b_wfs_new_show($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT articleid, title, published, expired, counter, groupid FROM " . $xoopsDB->prefix("wfs_article") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") AND noshowart = 0 AND offline = 0 ORDER BY " . $options[0] . " DESC";
    $result = $xoopsDB->query($sql, $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (checkAccess($myrow["groupid"])) {
            $wfs = array();
            $title = $myts->makeTboxData4Show($myrow["title"]);
            if (!XOOPS_USE_MULTIBYTES) {
                if (strlen($myrow['title']) >= $options[2]) {
                    $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $options[2] - 1)) . "...";
                }
            }
            $wfs['title'] = $title;
            $wfs['id'] = $myrow['articleid'];
            if ($options[0] == "published") {
                $wfs['new'] = formatTimestamp($myrow['published'], "s");
            } elseif ($options[0] == "counter") {
                $wfs['new'] = $myrow['counter'];
            }
            $block['new'][] = $wfs;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:wfs_new.php

示例2: b_wfs_down_show

function b_wfs_down_show($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT fileid, filerealname, filetext ,articleid, fileshowname, date, ext, minetype, downloadname, counter, filedescript, groupid FROM " . $xoopsDB->prefix("wfs_files") . " ORDER BY " . $options[0] . " DESC";
    $result = $xoopsDB->query($sql, $options[1], 0);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (checkAccess($myrow["groupid"])) {
            $wfsd = array();
            $title = $myts->makeTboxData4Show($myrow["fileshowname"]);
            if (!XOOPS_USE_MULTIBYTES) {
                if (strlen($myrow['fileshowname']) >= $options[2]) {
                    $title = $myts->makeTboxData4Show(substr($myrow['fileshowname'], 0, $options[2] - 1)) . "...";
                }
            }
            $wfsd['titledown'] = $title;
            $wfsd['iddown'] = $myrow['articleid'];
            if ($options[0] == "date") {
                $wfsd['date'] = formatTimestamp($myrow['date'], "s");
            } elseif ($options[0] == "counter") {
                $wfsd['date'] = $myrow['counter'];
            }
            $block['download'][] = $wfsd;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:28,代码来源:wfs_newdown.php

示例3: __construct

 function __construct()
 {
     parent::__construct();
     checkAccess();
     $this->load->helper('posts_helper');
     $this->load->library('m_security');
     $this->nocat();
     date_default_timezone_set('Asia/Jakarta');
 }
开发者ID:urangawak,项目名称:minangcms,代码行数:9,代码来源:Pages.php

示例4: form_newusr_post

function form_newusr_post($raw,$data) {
	checkAccess();
	if ($data['f1']!=$data['f2']) return LocalError(WGSL("perr","Password error"));
	$x = WGCreateUser($data['login'],$data['f1'],$data['group']);
	if ($x) {
	        WGToast(WGSL("nus","User created"));
	        updateUserList();
	        WGSetActivity('main');
		} else LocalError(WGSL("nusc","User not created"));
	}
开发者ID:epto,项目名称:webgui8,代码行数:10,代码来源:event.php

示例5: init

 public function init()
 {
     // Login required
     if (Yii::app()->getController()->id != 'login') {
         $returnUrl = Yii::app()->request->getUrl();
         if (strpos($returnUrl, '/admin') === false) {
             $returnUrl = array('/admin');
         }
         Yii::app()->user->setReturnUrl($returnUrl);
     }
     // Make sure we have access
     if (!Yii::app()->user->id || !checkAccess('admin')) {
         // Do we need to login
         if (!Yii::app()->user->id && Yii::app()->getController()->id != 'login') {
             $this->redirect(array('/admin/login'));
         }
         // Make sure we are not in login page
         if (Yii::app()->getController()->id != 'login') {
             throw new CHttpException(at('Sorry, You are not allowed to enter this section.'));
         }
     }
     // Make sure we have a valid admin user record
     if (Yii::app()->getController()->id != 'login' && Yii::app()->user->id && !AdminUser::model()->exists('userid=:id', array(':id' => Yii::app()->user->id))) {
         Yii::app()->user->logout();
         ferror(at('Your session expired. Please login.'));
         $this->redirect(array('/admin/login'));
     }
     // Check if we haven't clicked more then X amount of time
     $maxIdleTime = 60 * 60 * getParam('admin_logged_in_time', 5);
     // 5 hour default
     // Were we using an old session
     if (Yii::app()->getController()->id != 'login' && time() - $maxIdleTime > Yii::app()->session['admin_clicked']) {
         // Loguser out and redirect to login
         AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
         Yii::app()->user->logout();
         ferror(at('Your session expired. Please login.'));
         $this->redirect(array('/admin/login'));
     }
     // Delete old records
     AdminUser::model()->deleteAll('lastclick_time < :time', array(':time' => time() - $maxIdleTime));
     // Update only if this is not an ajax request
     if (!request()->isAjaxRequest) {
         // Update record info
         Yii::app()->session['admin_clicked'] = time();
         AdminUser::model()->updateAll(array('lastclick_time' => time(), 'location' => Yii::app()->getController()->id), 'userid=:id', array(':id' => Yii::app()->user->id));
     }
     // Add Breadcrumb
     $this->addBreadCrumb(at('Dashboard'), array('index/index'));
     parent::init();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:50,代码来源:AdminController.php

示例6: startSession

function startSession($privileged = false)
{
    if (session_id() === '') {
        $secure = true;
        $httponly = true;
        $path = APP_PATH;
        $domain = APP_DOMAIN;
        session_set_cookie_params(600, $path, $domain, $secure, $httponly);
        session_start();
        checkSessionActivity();
    }
    if ($privileged) {
        checkAccess();
    }
}
开发者ID:efdalustaoglu,项目名称:secure-coding,代码行数:15,代码来源:user.php

示例7: validate_form

function validate_form()
{
    require_once 'fonctions.php';
    $_login = htmlspecialchars($_POST['log']);
    //    clean POST data
    $_passwd = htmlspecialchars($_POST['pwd']);
    //    clean POST data
    if (checkAccess($_login, $_passwd) === true) {
        return array('login' => $_login, 'connected' => '1');
    }
    if (basename($_SESSION['parentURL']) == 'admin.php') {
        $message = "Les informations de connexion ne sont pas correctes ou vous n'êtes pas autorisé à gérer les utilisateurs, veuillez réessayer !";
    } else {
        $message = "Les informations de connexion ne sont pas correctes, veuillez réessayer !";
    }
    return $message;
}
开发者ID:beemoon,项目名称:signage,代码行数:17,代码来源:login.php

示例8: delete

function delete($bookmarkID)
{
    $result = false;
    if ($bookmarkID != "") {
        include '../access.php';
        $access = checkAccess('n', 't');
        if ($access) {
            $user = new User();
            $username = $user->getUsername();
            include "../includes/bookmarks.php";
            if (b_belongs_to($bookmarkID, $username, "../")) {
                $result = delete_bookmark($bookmarkID, "../");
            }
        }
    }
    return $result;
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:17,代码来源:deletebook.php

示例9: delete

function delete($folderID)
{
    $result = false;
    if ($folderID != "") {
        include '../access.php';
        $access = checkAccess('n', 't');
        if ($access) {
            $user = new User();
            $username = $user->getUsername();
            include "../includes/bookmarks.php";
            if (f_belongs_to($folderID, $username, "../")) {
                $resultArr = delete_folder($folderID, $username, "../");
                $result = $resultArr['success'];
            }
        }
    }
    return $result;
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:18,代码来源:deletefolder.php

示例10: b_wfs_artmenu

function b_wfs_artmenu($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $sql = "SELECT articleid, title, groupid FROM " . $xoopsDB->prefix("wfs_article") . " WHERE published < " . time() . " AND published > 0 AND (expired = 0 OR expired > " . time() . ") AND offline = 0 AND noshowart = 1 ORDER BY weight ASC";
    $result = $xoopsDB->query($sql);
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (checkAccess($myrow["groupid"])) {
            $wfsmenu2 = array();
            $nstitle = $myts->makeTboxData4Show($myrow["title"]);
            $nsid = $myts->makeTboxData4Show($myrow["articleid"]);
            $wfsmenu2['nstitle'] = $nstitle;
            $wfsmenu2['nsid'] = $nsid;
            $block['nsmenu'][] = $wfsmenu2;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:19,代码来源:wfs_artmenu.php

示例11: b_wfs_bigstory_show

function b_wfs_bigstory_show()
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $tdate = mktime(0, 0, 0, date("n"), date("j"), date("Y"));
    $result = $xoopsDB->query("SELECT articleid, title, summary, groupid FROM " . $xoopsDB->prefix("wfs_article") . " WHERE published > " . $tdate . " AND published < " . time() . " AND (expired > " . time() . " OR expired = 0) AND noshowart = 0 AND offline = 0 ORDER BY counter DESC", 1, 0);
    list($farticleid, $ftitle, $fsummary, $fgroupid) = $xoopsDB->fetchRow($result);
    if (!$farticleid && !$ftitle) {
        $block['message'] = _MB_WFS_NOTYET;
    } else {
        if (checkAccess($fgroupid)) {
            $block['message'] = _MB_WFS_TMRSI;
            $block['story_title'] = $myts->makeTboxData4Show($ftitle);
            $block['story_summary'] = $myts->makeTboxData4Show($fsummary);
            $block['story_id'] = $farticleid;
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:20,代码来源:wfs_bigstory.php

示例12: b_wfs_menu

function b_wfs_menu($options)
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    $result = $xoopsDB->query("SELECT id, title, pid, groupid FROM " . $xoopsDB->prefix("wfs_category") . " ORDER BY title ASC");
    while ($myrow = $xoopsDB->fetchArray($result)) {
        if (checkAccess($myrow["groupid"])) {
            $wfsmenu = array();
            $ctitle = $myts->makeTboxData4Show($myrow["title"]);
            $pid = $myts->makeTboxData4Show($myrow["pid"]);
            $id = $myts->makeTboxData4Show($myrow["id"]);
            if ($pid == '0') {
                $wfsmenu['ctitle'] = $ctitle;
                $wfsmenu['id'] = $id;
                $block['menus'][] = $wfsmenu;
            }
        }
    }
    return $block;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:21,代码来源:wfs_menu.php

示例13: syncResp

function syncResp($params)
{
    debug("incoming SYNC request");
    $lastSync = xmlrpc_decode($params->getParam(0));
    $nodeData = xmlrpc_decode($params->getParam(1));
    $objects = xmlrpc_decode($params->getParam(2));
    $neighbour = sotf_Neighbour::getById($nodeData['node_id']);
    if (!$neighbour) {
        logError("No access: you are not an allowed neighbour node!");
        return new xmlrpcresp(0, XMLRPC_ERR_NO_ACCESS, "No access: you are not an allowed neighbour node!");
    }
    $msg = checkAccess($neighbour);
    if ($msg) {
        logError($msg);
        return new xmlrpcresp(0, XMLRPC_ERR_NO_ACCESS, "No access: {$msg}!");
    }
    $retval = $neighbour->syncResponse($lastSync, $nodeData, $objects);
    // send response
    $retval = xmlrpc_encode($retval);
    return new xmlrpcresp($retval);
}
开发者ID:BackupTheBerlios,项目名称:sotf-svn,代码行数:21,代码来源:xmlrpcServer.php

示例14: init

 public function init()
 {
     // Set theme if it's not default
     if (getParam('default_theme')) {
         Yii::app()->theme = getParam('default_theme');
     } else {
         Yii::app()->theme = 'site/default';
     }
     // Are we in maintenance mode
     if (getParam('maintenance_status')) {
         $canAccess = false;
         // Can we override?
         if (getParam('maintenance_roles_override') && count(explode(',', getParam('maintenance_roles_override')))) {
             $roles = explode(',', getParam('maintenance_roles_override'));
             foreach ($roles as $role) {
                 if (checkAccess($role)) {
                     $canAccess = true;
                     break;
                 }
             }
         }
         $theme = Yii::app()->theme->name . '.views.layouts.maintenance_mode';
         if (Yii::app()->theme->name != 'site') {
             $theme = 'themes.' . Yii::app()->theme->name . '.views.site.layouts.maintenance_mode';
         }
         // Do we show the message or not
         if (!$canAccess) {
             $this->layout = false;
             $this->render($theme);
             Yii::app()->end();
         }
         // We can access but show a message
         $this->title[] = t('Maintenance Mode');
     }
     parent::init();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:36,代码来源:SiteBaseController.php

示例15: checkAccess

the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GetBoo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GetBoo; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
***************************************************************************/
$sorting_script = true;
include 'header.php';
include 'access.php';
$access = checkAccess('a');
if ($access) {
    echo "<h2>" . T_("Settings") . " -- " . T_("Online Users") . "</h2>";
    echo "<p>" . sprintf(T_("You can see a list of users who have been active in the past %s minutes"), ONLINE_TIMEOUT / 60) . ".</p>\n";
    include 'conn.php';
    $Query = "select name, LastActivity as formatted_time from " . TABLE_PREFIX . "session where " . DATE_DIFF_SQL . " LastActivity) < " . ONLINE_TIMEOUT . " and status <> 'disabled' order by LastActivity";
    $dbResult = $dblink->query($Query);
    //echo($Query . "<br>");
    $count = 0;
    while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
        if ($count == 0) {
            echo "<div class=\"content\"><table class='sortable'>\n<thead><tr><th>" . T_("User") . "</th><th>" . T_("Last Activity") . "</th></tr></thead><tbody>\n";
            require_once 'includes/convert_date.php';
        }
        $user_rec = "{$row["name"]}";
        $date1 = "{$row["formatted_time"]}";
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:onlineusers.php


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