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


PHP view::noAccess方法代码示例

本文整理汇总了PHP中view::noAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP view::noAccess方法的具体用法?PHP view::noAccess怎么用?PHP view::noAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在view的用法示例。


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

示例1: add

 public function add()
 {
     // Get URI vars
     $slugID = urldecode(utf8::trim(uri::segment(4)));
     // Do we have a slug ID?
     if ($slugID == '') {
         error::show404();
     }
     // Get user
     if (!($user = $this->users_model->getUser($slugID)) || !$user['active'] || !$user['verified']) {
         error::show404();
     }
     // Is this a self request
     if ($user['user_id'] == session::item('user_id')) {
         router::redirect($user['slug']);
     } elseif (!in_array($user['group_id'], session::permission('users_groups_browse', 'users')) || !in_array($user['type_id'], session::permission('users_types_browse', 'users'))) {
         view::noAccess();
     }
     // Does blocked user exist?
     if ($blocked = $this->users_blocked_model->getUser($user['user_id'], true)) {
         view::setError(__('user_duplicate', 'users_blocked'));
         router::redirect($user['slug']);
     }
     // Block user
     $this->users_blocked_model->addUser($user['user_id']);
     // Success
     view::setInfo(__('user_blocked', 'users_blocked'));
     //router::redirect($user['slug']);
     router::redirect('users/blocked');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:30,代码来源:blocked.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to search users?
     if (!session::permission('users_search_access', 'users') && !session::permission('users_search_access_advanced', 'users')) {
         view::noAccess();
     } elseif (!session::permission('users_groups_browse', 'users') || !session::permission('users_types_browse', 'users')) {
         view::noAccess();
     }
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:users.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     if (!config::item('feedback_active', 'feedback')) {
         error::show404();
     } elseif (!session::permission('feedback_access', 'feedback')) {
         view::noAccess();
     }
     loader::model('feedback/feedback');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:feedback.php

示例4: index

 public function index()
 {
     if (session::permission('users_manage', 'users')) {
         loader::controller('cp/users');
         $this->users->browse();
     } else {
         view::noAccess(false);
         // Load view
         view::load('cp/home');
     }
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:11,代码来源:home.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('settings_manage', 'users')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'users');
     view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'users', 'items'));
     view::setTrail('cp/users', __('users', 'system_navigation'));
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:11,代码来源:users.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     if (!config::item('news_active', 'news')) {
         error::show404();
     } elseif (!session::permission('news_access', 'news')) {
         view::noAccess();
     } elseif (config::item('news_blog', 'news') && uri::segment(1) != 'blog') {
         router::redirect('blog/' . utf8::substr(uri::getURI(), 5));
     }
     loader::model('news/news');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:12,代码来源:news.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     if (users_helper::isLoggedin()) {
         // Does user have permission to access this plugin?
         if (!session::permission('users_manage', 'users') && uri::getURI() != 'cp/users/login' && uri::getURI() != 'cp/users/login/license' && uri::getURI() != 'cp/users/logout') {
             view::noAccess();
         }
         view::setCustomParam('section', 'users');
         view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'users', 'items'));
     }
     view::setTrail('cp/users', __('users', 'system_navigation'));
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:13,代码来源:users.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('counters_manage', 'utilities')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'system');
     view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'system', 'items', 'system/utilities', 'items'));
     loader::model('utilities/counters', array(), 'recalculate_model');
     view::setTrail('cp/system/config/system', __('system', 'system_navigation'));
     view::setTrail('cp/utilities/counters', __('utilities_counters', 'system_navigation'));
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:13,代码来源:counters.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('newsletters_manage', 'newsletters')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'content');
     view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'content', 'items', 'content/newsletters', 'items'));
     view::setTrail('cp/system/plugins', __('content', 'system_navigation'));
     view::setTrail('cp/content/newsletters', __('newsletters', 'system_navigation'));
     loader::model('newsletters/newsletters', array(), 'newsletters_model');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:13,代码来源:newsletters.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('languages_manage', 'system')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'system');
     view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'system', 'items', 'system/languages', 'items'));
     loader::model('system/languages');
     view::setTrail('cp/system/config/system', __('system', 'system_navigation'));
     view::setTrail('cp/system/languages/', __('system_languages', 'system_navigation'));
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:13,代码来源:languages.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('plans_manage', 'billing')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'billing');
     view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'billing', 'items'));
     loader::model('billing/plans');
     view::setTrail('cp/billing/transactions', __('billing', 'system_navigation'));
     view::setTrail('cp/billing/plans', __('billing_plans', 'system_navigation'));
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:13,代码来源:plans.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     // Does user have permission to access this plugin?
     if (!session::permission('license_manage', 'system')) {
         view::noAccess();
     }
     view::setCustomParam('section', 'help');
     view::setCustomParam('options', array('help/license' => array('name' => __('help_license', 'system_navigation'), 'uri' => 'help/license', 'keyword' => 'help/license', 'attr' => array('help license'), 'items' => array())));
     loader::model('system/license');
     view::setTrail('cp/help/license', __('help', 'system_navigation'));
     view::setTrail('cp/help/license', __('help_license', 'system_navigation'));
     // Check if demo mode is enabled
     if (input::demo(1, 'cp/system/config/system')) {
         return false;
     }
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:17,代码来源:license.php

示例13: manage

 public function manage()
 {
     // Does user have permission to view visitors?
     if (!session::permission('users_visitors_browse', 'users')) {
         view::noAccess();
     }
     // Assign user from session to variable
     $user = session::section('session');
     // Get fields
     $fields = array();
     foreach (config::item('usertypes', 'core', 'keywords') as $categoryID => $keyword) {
         $fields[$categoryID] = $this->fields_model->getFields('users', $categoryID, 'view', 'in_list');
     }
     // Parameters
     $params = array('total' => session::permission('users_visitors_limit', 'users') && session::permission('users_visitors_limit', 'users') < $user['total_visitors'] ? session::permission('users_visitors_limit', 'users') : $user['total_visitors'], 'profiles' => true);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Get visitors
     $visitors = array();
     if ($params['total']) {
         $visitors = $this->users_visitors_model->getVisitors(session::item('user_id'), $qstring['order'], $qstring['limit'], $params);
     } else {
         view::setInfo(__('no_visitors', 'users_visitors'));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('users/visitors/manage?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => config::item('visitors_per_page', 'users'), 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Assign vars
     view::assign(array('user' => $user, 'visitors' => $visitors, 'fields' => $fields, 'pagination' => $pagination));
     // Dow we have new visitors?
     if (session::item('total_visitors_new')) {
         // Reset new visitors counter
         $this->users_visitors_model->resetCounter();
     }
     // Set title
     view::setTitle(__('my_visitors', 'system_navigation'));
     // Set trail
     view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
     view::setTrail('users/visitors/manage', __('users_visitors', 'system_navigation'));
     // Load view
     view::load('users/visitors/manage');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:42,代码来源:visitors.php

示例14: add

 public function add()
 {
     // Is user loggedin ?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     }
     // Get URI vars
     $slugID = urldecode(utf8::trim(uri::segment(4)));
     // Do we have a slug ID?
     if ($slugID == '') {
         error::show404();
     }
     // Get user
     if (!($user = $this->users_model->getUser($slugID)) || !$user['active'] || !$user['verified']) {
         error::show404();
     } elseif ($user['user_id'] == session::item('user_id')) {
         router::redirect($user['slug']);
     }
     // Does user have permission to view this user group/type?
     if (!in_array($user['group_id'], session::permission('users_groups_browse', 'users')) || !in_array($user['type_id'], session::permission('users_types_browse', 'users'))) {
         view::noAccess();
     }
     // Did we block this user or did they block us?
     if (config::item('blacklist_active', 'users') && ($blocked = $this->users_blocked_model->getUser($user['user_id']))) {
         if ($blocked['user_id'] == session::item('user_id')) {
             view::setError(__('user_blocked', 'users'));
         } else {
             view::setError(__('user_blocked_self', 'users'));
         }
         // Load view
         router::redirect($user['slug']);
     }
     // Does friend exist?
     if ($friend = $this->users_friends_model->getFriend($user['user_id'], false)) {
         // Is request already approved?
         if ($friend['active']) {
             view::setInfo(__('friend_active', 'users_friends'));
         } elseif ($friend['user_id'] == session::item('user_id')) {
             view::setError(__('friend_duplicate', 'users_friends'));
         } else {
             view::setError(__('friend_duplicate_self', 'users_friends'));
         }
         router::redirect($user['slug']);
     }
     // Add friend request
     $this->users_friends_model->addFriend($user['user_id']);
     // Send friend request email
     if (!isset($user['config']['notify_friends_request']) || $user['config']['notify_friends_request']) {
         // Create email replacement tags
         $tags = array();
         foreach (session::section('session') as $key => $value) {
             $tags['from.' . $key] = $value;
         }
         $tags = array_merge($tags, $user);
         $tags['friends_link'] = config::siteURL('users/friends/confirm/' . session::item('slug_id'));
         loader::library('email');
         $this->email->sendTemplate('users_friend_request', $user['email'], $tags, $user['language_id']);
     }
     // Success
     view::setInfo(__('friend_requested', 'users_friends'));
     router::redirect($user['slug']);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:62,代码来源:friends.php

示例15: delete

 public function delete()
 {
     // Is user logged in?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     } elseif (!session::permission('albums_post', 'pictures')) {
         view::noAccess(session::item('slug'));
     }
     // Get URI vars
     $albumID = (int) uri::segment(4);
     // Get album
     if (!$albumID || !($album = $this->pictures_albums_model->getAlbum($albumID)) || $album['user_id'] != session::item('user_id')) {
         view::setError(__('no_album', 'pictures'));
         router::redirect('pictures/albums/manage');
     }
     // Delete album
     $this->pictures_albums_model->deleteAlbum($albumID, session::item('user_id'), $album);
     // Process query string
     $qstring = $this->parseQuerystring(config::item('user_albums_per_page', 'pictures'));
     // Success
     view::setInfo(__('album_deleted', 'pictures'));
     router::redirect('pictures/albums/manage?' . $qstring['url'] . 'page=' . $qstring['page']);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:23,代码来源:albums.php


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