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


PHP UserAccess类代码示例

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


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

示例1: before

 public function before()
 {
     $userAccess = new UserAccess();
     if (!$userAccess->isSupport()) {
         if ($this->request->isAjax()) {
             die('{ "ok" : false, "msg" : "Access denied" }');
         } else {
             Header::redirect(URL::baseUrl() . '/login');
         }
     }
     try {
         $pkSupportUserAccess = array('id_support_user' => $_SESSION['support_user']['id_user']);
         $supportUserAccess = $this->orm->support_user_access[$pkSupportUserAccess];
         if (!$supportUserAccess['maintain_user']) {
             $view = View::instance();
             $view->message = 'Access denied';
             $view->render('error');
             die;
         }
     } catch (Exception $e) {
         $view = View::instance();
         $view->message = 'Error occurred';
         $view->render('error');
         die;
     }
 }
开发者ID:sandroalvesperes,项目名称:chat,代码行数:26,代码来源:Users.php

示例2: __construct

 function __construct()
 {
     // REQUIRED IN EXTENDED CLASS TO LOAD DEFAULTS
     parent::__construct();
     include_once RARS_BASE_PATH . 'api/user/access.php';
     $access = new UserAccess();
     $this->user = $access->check();
 }
开发者ID:smiffy6969,项目名称:rars,代码行数:8,代码来源:profile.php

示例3: get_index

 public function get_index()
 {
     $userAccess = new UserAccess();
     if ($userAccess->isSupport()) {
         Header::redirect(URL::baseUrl() . '/support');
     }
     $view = View::instance();
     $view->email = @$this->request->cookie('email');
     $view->render('login');
 }
开发者ID:sandroalvesperes,项目名称:chat,代码行数:10,代码来源:Login.php

示例4: before

 public function before()
 {
     $userAccess = new UserAccess();
     if (!$userAccess->isSupport()) {
         if ($this->request->isAjax()) {
             die('{ "ok" : false, "msg" : "Access denied" }');
         } else {
             Header::redirect(URL::baseUrl() . '/login');
         }
     }
 }
开发者ID:sandroalvesperes,项目名称:chat,代码行数:11,代码来源:Support.php

示例5: before

 public function before()
 {
     if (strtolower($this->getAction()) == 'evaluate' && !isset($_SESSION['chat_evaluate'])) {
         Header::redirect(URL::baseUrl());
     }
     if (!in_array(strtolower($this->getAction()), array('evaluate', 'evaluatesupport'))) {
         $userAccess = new UserAccess();
         if (!$userAccess->isValid()) {
             if ($this->request->isAjax()) {
                 die('{ "ok" : false, "msg" : "Access denied" }');
             } else {
                 Header::redirect(URL::baseUrl());
             }
         }
     }
 }
开发者ID:sandroalvesperes,项目名称:chat,代码行数:16,代码来源:Conversation.php

示例6: setUser

 protected function setUser($reddit_id, $name)
 {
     $query = new UserQuery();
     $users = $query->findByRedditID($reddit_id);
     $user = null;
     if ($users->count() == 0) {
         $user = new User();
         $user->setUsername($name);
         $user->setRedditID($reddit_id);
         $user->save();
     } else {
         $user = $users->getFirst();
     }
     if ($user->getBanned()) {
         // We block banned users by just not letting them log in
         session_destroy();
         return null;
     } else {
         $_SESSION[Auth::$SESSION_USER_ID] = $user->getId();
         //Record login
         UserAccess::addUserEvent($user, $_SERVER['REMOTE_ADDR'], UserAccessType::login);
         return $user;
     }
 }
开发者ID:pcmasteratings,项目名称:site,代码行数:24,代码来源:AAuthProvider.php

示例7: addUserEvent

 public static function addUserEvent(User $user, $ip, $eventType)
 {
     switch ($eventType) {
         case UserAccessType::login:
         case UserAccessType::addreview:
         case UserAccessType::editreview:
             break;
         default:
             throw new Exception('invalid event type.');
     }
     $event = new UserAccess();
     $event->setUser($user);
     $event->setIpv4Address($ip);
     $event->setUserAccessType(UserAccessTypeQuery::create()->findOneByType($eventType));
     $datetime = new DateTime();
     $datetime->getTimestamp();
     $event->setAccess($datetime);
     $event->save();
 }
开发者ID:pcmasteratings,项目名称:site,代码行数:19,代码来源:UserAccess.php

示例8: array

<?php

$this->breadcrumbs = array('Admin Ads Marketing Models' => array('index'), 'Create');
$this->menu = array(array('label' => 'List', 'url' => array('index'), 'visible' => UserAccess::checkAccess('ads-AdsMarketingIndex')));
$this->pageLabel = "Tạo quảng cáo truyền thông";
?>


<?php 
echo $this->renderPartial('_form', array('model' => $model));
开发者ID:giangnh264,项目名称:mobileplus,代码行数:10,代码来源:create.php

示例9: array

<?php

$this->breadcrumbs = array('Quản lí nhóm SMS' => array('index'), $model->name);
$this->menu = array(array('label' => Yii::t('admin', 'Danh sách'), 'url' => array('index'), 'visible' => UserAccess::checkAccess('spam-GroupIndex')), array('label' => Yii::t('admin', 'Thêm mới'), 'url' => array('create')), array('label' => Yii::t('admin', 'Cập nhật'), 'url' => array('update', 'id' => $model->id), 'visible' => UserAccess::checkAccess('spam-GroupUpdate')), array('label' => Yii::t('admin', 'Xóa'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?'), 'visible' => UserAccess::checkAccess('spam-GroupDelete')));
$this->pageLabel = Yii::t('admin', "Thông tin SpamSmsGroup") . "#" . $model->id;
?>

<div class="content-body">
<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'name', 'description')));
$this->renderPartial('phone_list', array('model' => $phoneList, 'group_id' => $group_id, 'uploadModel' => $uploadModel, 'message' => $message, 'errorList' => $errorList, 'dupList' => $dupList, 'subscribeList' => $subscribeList));
?>
</div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:13,代码来源:view.php

示例10: array

<?php

$this->breadcrumbs = array('Game Event Report All Models' => array('index'), $model->date => array('view', 'id' => $model->date), 'Update');
$this->menu = array(array('label' => Yii::t('admin', 'Danh sách'), 'url' => array('index'), 'visible' => UserAccess::checkAccess('GameEventReportAllModelIndex')), array('label' => Yii::t('admin', 'Thêm mới'), 'url' => array('create'), 'visible' => UserAccess::checkAccess('GameEventReportAllModelCreate')), array('label' => Yii::t('admin', 'Thông tin'), 'url' => array('view', 'id' => $model->date), 'visible' => UserAccess::checkAccess('GameEventReportAllModelView')));
$this->pageLabel = Yii::t('admin', "Sao chép GameEventReportAll") . "#" . $model->date;
?>



<?php 
echo $this->renderPartial('_form', array('model' => $model));
开发者ID:giangnh264,项目名称:mobileplus,代码行数:11,代码来源:copy.php

示例11: array

<?php

Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . "/js/admin/common.js");
$this->breadcrumbs = array('Admin Ads Source Models' => array('index'), 'Manage');
$this->menu = array(array('label' => Yii::t("admin", "Thêm mới"), 'url' => array('create'), 'visible' => UserAccess::checkAccess('ads-AdsSourceCreate')), array('label' => Yii::t("admin", "Tạo link quảng cáo"), 'url' => array('/ads/adsMarketing/create'), 'visible' => UserAccess::checkAccess('ads-AdsMarketingCreate')));
$this->pageLabel = Yii::t("admin", "Danh sách AdsSource");
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('admin-ads-source-model-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n\n");
?>

<div class="title-box search-box">
    <?php 
echo CHtml::link(yii::t('admin', 'Tìm kiếm'), '#', array('class' => 'search-button'));
?>
</div>

<div class="search-form" style="display:block">

<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$html_exp = '
    <div id="expand">
        <p id="show-exp">&nbsp;&nbsp;</p>
        <ul id="mn-expand" style="display:none">
            <li><a href="javascript:void(0)" class="item-in-page">' . Yii::t("admin", "Chọn trang này") . '(' . $model->search()->getItemCount() . ')</a></li>
            <li><a href="javascript:void(0)" class="all-item">' . Yii::t("admin", "Chọn tất cả") . ' (' . $model->count() . ')</a></li>
            <li><a href="javascript:void(0)" class="uncheck-all">' . Yii::t("admin", "Bỏ chọn tất cả") . '</a></li>
        </ul>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:index.php

示例12: array

<?php

$this->breadcrumbs = array('Admin Ads Source Models' => array('index'), $model->name);
$this->menu = array(array('label' => Yii::t('admin', 'Danh sách'), 'url' => array('index'), 'visible' => UserAccess::checkAccess('ads-AdsSourceIndex')), array('label' => Yii::t('admin', 'Thêm mới'), 'url' => array('create')), array('label' => Yii::t('admin', 'Cập nhật'), 'url' => array('update', 'id' => $model->id), 'visible' => UserAccess::checkAccess('ads-AdsSourceUpdate')), array('label' => Yii::t('admin', 'Xóa'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?'), 'visible' => UserAccess::checkAccess('AdminAdsSourceModelDelete')), array('label' => Yii::t('admin', 'Sao chép'), 'url' => array('copy', 'id' => $model->id), 'visible' => UserAccess::checkAccess('ads-AdsSourceCopy')));
$this->pageLabel = Yii::t('admin', "Thông tin AdsSource") . "#" . $model->id;
?>


<div class="content-body">
<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'name', 'description', 'created_datetime', 'status')));
?>
</div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:13,代码来源:view.php

示例13: array

<?php

Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . "/js/admin/common.js");
$this->breadcrumbs = array('Admin Admin User Models' => array('index'), 'Manage');
$this->menu = array(array('label' => Yii::t("admin", "Thêm mới"), 'url' => array('create'), 'visible' => UserAccess::checkAccess('AdminUserCreate')));
$this->pageLabel = Yii::t("admin", "Danh sách Admin User");
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('admin-admin-user-model-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n\n");
?>

<div class="title-box search-box">
    <?php 
echo CHtml::link(yii::t('admin', 'Tìm kiếm'), '#', array('class' => 'search-button'));
?>
</div>

<div class="search-form" style="display:block">

<?php 
$this->renderPartial('_search', array('model' => $model, 'cpList' => $cpList));
?>
</div><!-- search-form -->

<?php 
$html_exp = '
    <div id="expand">
        <p id="show-exp">&nbsp;&nbsp;</p>
        <ul id="mn-expand" style="display:none">
            <li><a href="javascript:void(0)" class="item-in-page">' . Yii::t("admin", "Chọn trang này") . '(' . $model->search()->getItemCount() . ')</a></li>
            <li><a href="javascript:void(0)" class="all-item">' . Yii::t("admin", "Chọn tất cả") . ' (' . $model->count() . ')</a></li>
            <li><a href="javascript:void(0)" class="uncheck-all">' . Yii::t("admin", "Bỏ chọn tất cả") . '</a></li>
        </ul>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:index.php

示例14: array

<?php

Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . "/js/admin/common.js");
$this->breadcrumbs = array('Import Song File Models' => array('index'), 'Manage');
$this->menu = array(array('label' => Yii::t("admin", "Thêm mới"), 'url' => array('create'), 'visible' => UserAccess::checkAccess('ImportSongFileModelCreate')));
$this->pageLabel = Yii::t("admin", "Danh sách ImportSongFile");
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('import-song-file-model-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n\n");
?>
<div class="title-box search-box">
    <?php 
echo CHtml::link(yii::t('admin', 'Tìm kiếm'), '#', array('class' => 'search-button'));
?>
</div>

<div class="search-form" style="display:block">

<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$html_exp = '
    <div id="expand">
        <p id="show-exp">&nbsp;&nbsp;</p>
        <ul id="mn-expand" style="display:none">
            <li><a href="javascript:void(0)" class="item-in-page">' . Yii::t("admin", "Chọn trang này") . '(' . $model->search()->getItemCount() . ')</a></li>
            <li><a href="javascript:void(0)" class="all-item">' . Yii::t("admin", "Chọn tất cả") . ' (' . $model->count() . ')</a></li>
            <li><a href="javascript:void(0)" class="uncheck-all">' . Yii::t("admin", "Bỏ chọn tất cả") . '</a></li>
        </ul>
    </div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:31,代码来源:index.php

示例15: array

<?php

$this->breadcrumbs = array('Admin Tools Setting Get Msisdn Models' => array('index'), $model->name);
$this->menu = array(array('label' => Yii::t('admin', 'Danh sách'), 'url' => array('index'), 'visible' => UserAccess::checkAccess('tools-ToolsSettingGetMsisdnIndex')), array('label' => Yii::t('admin', 'Thêm mới'), 'url' => array('create')), array('label' => Yii::t('admin', 'Cập nhật'), 'url' => array('update', 'id' => $model->id), 'visible' => UserAccess::checkAccess('tools-ToolsSettingGetMsisdnUpdate')), array('label' => Yii::t('admin', 'Xóa'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?'), 'visible' => UserAccess::checkAccess('tools-ToolsSettingGetMsisdnDelete')), array('label' => Yii::t('admin', 'Sao chép'), 'url' => array('copy', 'id' => $model->id), 'visible' => UserAccess::checkAccess('tools-ToolsSettingGetMsisdnCopy')));
$this->pageLabel = Yii::t('admin', "Thông tin ToolsSettingGetMsisdn") . "#" . $model->id;
?>


<div class="content-body">
<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'name', 'params', 'description', 'created_datetime', 'status')));
?>
</div>
开发者ID:giangnh264,项目名称:mobileplus,代码行数:13,代码来源:view.php


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