本文整理汇总了PHP中requirePermission函数的典型用法代码示例。如果您正苦于以下问题:PHP requirePermission函数的具体用法?PHP requirePermission怎么用?PHP requirePermission使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requirePermission函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::__construct();
$this->css = "modules/online/css/online.css";
$this->js = "modules/online/js/sort.js";
requirePermission("view");
}
示例2: index
/**
* Load the page
*/
public function index()
{
requirePermission("view");
clientLang("cant_afford", "teleport");
clientLang("select", "teleport");
clientLang("selected", "teleport");
clientLang("dp", "teleport");
clientLang("free", "teleport");
//Set the title
// $this->template->setTitle("Convert Times DP");
//Load the content
$content_data = array("characters" => $this->characters, "url" => $this->template->page_url, "total" => $this->total, "dp" => $this->user->getDp(), "config" => $this->config);
$page_content = $this->template->loadPage("playtime.tpl", $content_data);
$PriceCurrency = $this->config->item('cta_price_currency');
if ($PriceCurrency == 'dp') {
$headline = "تبدیل زمان بازیکن به امتیاز ویژه";
} elseif ($PriceCurrency == 'vp') {
$headline = "تبدیل زمان بازیکن به امتیاز رایگان";
} elseif ($PriceCurrency == 'op') {
$headline = "تبدیل زمان بازیکن به امتیاز آنلاین";
}
$this->template->setTitle($headline);
//Load the page
$page_data = array("module" => "default", "headline" => $headline, "content" => $page_content);
$page = $this->template->loadPage("page.tpl", $page_data);
$this->template->view($page, "modules/playtime/css/playtime.css", "modules/playtime/js/playtime.js");
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->user->userArea();
$this->load->model("store_model");
requirePermission("view");
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->load->library('administrator');
$this->load->model('session_model');
requirePermission("viewSessions");
}
示例5: reply
public function reply($id = false)
{
requirePermission("reply");
if (!$id || $id == $this->user->getId()) {
die(lang("enter_recipient", "messages"));
}
$content = $this->input->post('content');
if (!$content && strlen($content) > 3) {
die(lang("enter_message", "messages"));
}
// Format title
$title = $this->read_model->getLastTitle($id);
if (!preg_match("/Re: /", $title)) {
$title = "Re: " . $title;
}
// Compile it into BBcode
$content = $this->fusioneditor->compile($content, $this->removeTools);
// Add it to the database
$this->read_model->reply($id, $this->user->getId(), $title, $content);
$this->plugins->onReply($id, $this->user->getId(), $title, $content);
// Clear the sender and receiver's PM cache
$this->cache->delete('messages/' . $id . "_*");
$this->cache->delete('messages/' . $this->user->getId() . "_*");
die($this->fusioneditor->parse($content, $this->removeTools));
}
示例6: index
public function index()
{
requirePermission("view");
$this->template->setTitle(lang("user_panel", "ucp"));
$cache = $this->cache->get("profile_characters_" . $this->user->getId());
if ($cache !== false) {
$characters = $cache;
} else {
$characters_data = array("characters" => $this->realms->getTotalCharacters(), "realms" => $this->realms->getRealms(), "url" => $this->template->page_url, "realmObj" => $this->realms);
$characters = $this->template->loadPage("ucp_characters.tpl", $characters_data);
$this->cache->save("profile_characters_" . $this->user->getId(), $characters, 60 * 60);
}
$links = $this->menu_model->getMenuLinks();
if ($links) {
foreach ($links as $key => $value) {
// Check if we have the permission, otherwise unset the row
if ($value['permission'] != '') {
if (hasPermission($value['permission'], $value['permissionModule']) !== true) {
unset($links[$key]);
continue;
}
}
// Add the website path if internal link
if (!preg_match("/https?:\\/\\//", $value['link'])) {
$links[$key]['link'] = $this->template->page_url . $value['link'];
}
$links[$key]['name'] = langColumn($links[$key]['name']);
}
}
$data = array("username" => $this->user->getNickname(), "expansion" => $this->realms->getEmulator()->getExpansionName($this->external_account_model->getExpansion()), "vp" => $this->internal_user_model->getVp(), "dp" => $this->internal_user_model->getDp(), "url" => $this->template->page_url, "location" => $this->internal_user_model->getLocation(), "groups" => $this->acl_model->getGroupsByUser($this->user->getId()), "register_date" => $this->user->getRegisterDate(), "status" => $this->user->getAccountStatus(), "characters" => $characters, "avatar" => $this->user->getAvatar($this->user->getId()), "id" => $this->user->getId(), "menu_links" => $links, "config" => array("vote" => $this->config->item('ucp_vote'), "donate" => $this->config->item('ucp_donate'), "store" => $this->config->item('ucp_store'), "settings" => $this->config->item('ucp_settings'), "expansion" => $this->config->item('ucp_expansion'), "teleport" => $this->config->item('ucp_teleport'), "admin" => $this->config->item('ucp_admin'), "gm" => $this->config->item('ucp_gm')));
$this->template->view($this->template->loadPage("page.tpl", array("module" => "default", "headline" => lang("user_panel", "ucp"), "content" => $this->template->loadPage("ucp.tpl", $data))), "modules/ucp/css/ucp.css");
}
示例7: view
public function view($id)
{
requirePermission("canViewSpecificArticle");
// if it's not an int or the article doesn't exist, load the index page.
if (!$this->news_model->articleExists($id)) {
$this->index();
return;
}
// Get the cache
$cache = $this->cache->get("news_id" . $id . "_" . getLang());
// Check if cache is valid
if ($cache !== false) {
$this->template->view($cache, "modules/news/css/news.css", "modules/news/js/ajax.js");
} else {
// Get the article passed
$this->news_articles = $this->template->format(array($this->news_model->getArticle($id)));
// For each key we need to add the special values that we want to print
foreach ($this->news_articles as $key => $article) {
$this->news_articles[$key]['headline'] = langColumn($article['headline']);
$this->news_articles[$key]['content'] = langColumn($article['content']);
$this->news_articles[$key]['date'] = date("Y/m/d", $article['timestamp']);
$this->news_articles[$key]['author'] = $this->user->getNickname($article['author_id']);
$this->news_articles[$key]['link'] = $article['comments'] == -1 ? '' : "href='javascript:void(0)' onClick='Ajax.showComments(" . $article['id'] . ")'";
$this->news_articles[$key]['comments_id'] = "id='comments_" . $article['id'] . "'";
$this->news_articles[$key]['comments_button_id'] = "id='comments_button_" . $article['id'] . "'";
$this->news_articles[$key]['tags'] = $this->news_model->getTags($id);
}
$content = $this->template->loadPage("articles.tpl", array("articles" => $this->news_articles, 'url' => $this->template->page_url, "pagination" => ''));
$content .= $this->template->loadPage("expand_comments.tpl", array("article" => $this->news_articles[0], 'url' => $this->template->page_url));
$this->cache->save("news_id" . $id . "_" . getLang(), $content);
// Load the template and pass the page content
$this->template->view($content, "modules/news/css/news.css", "modules/news/js/ajax.js");
}
}
示例8: index
public function index()
{
requirePermission("view");
$this->template->setTitle(lang("donate_title", "donate"));
$donate_jahanpay = $this->config->item('donate_jahanpay');
$user_id = $this->user->getId();
$data = array("donate_jahanpay" => $donate_jahanpay, "user_id" => $user_id, "server_name" => $this->config->item('server_name'), "currency" => $this->config->item('donation_currency'), "currency_sign" => $this->config->item('donation_currency_sign'), "multiplier" => $this->config->item('donation_multiplier'), "multiplier_paygol" => $this->config->item('donation_multiplier_paygol'), "url" => pageURL);
$output = $this->template->loadPage("donate.tpl", $data);
$this->template->box("<span style='cursor:pointer;' onClick='window.location=\"" . $this->template->page_url . "ucp\"'>" . lang("ucp") . "</span> ← " . lang("donate_panel", "donate"), $output, true, "modules/donate/css/donate.css", "modules/donate/js/donate.js");
if ($this->config->item('api') == '') {
if (!isset($api)) {
$api = '';
}
}
if (!empty($api)) {
$data = array("api" => $api);
}
if ($this->config->item('callback') == '') {
if (!isset($callback)) {
$callback = '';
}
}
if (!empty($callback)) {
$data = array("callback" => $callback);
}
}
示例9: __construct
public function __construct()
{
// Make sure to load the administrator library!
$this->load->library('administrator');
$this->load->model('realm_model');
parent::__construct();
requirePermission("editSystemSettings");
}
示例10: __construct
public function __construct()
{
// Make sure to load the administrator library!
$this->load->library('administrator');
parent::__construct();
require_once 'application/libraries/configeditor.php';
requirePermission("changeTheme");
}
示例11: index
public function index()
{
requirePermission("view");
$this->template->setTitle(lang("donate_title", "donate"));
$user_id = $this->user->getId();
$data = array("donate_paypal" => $this->config->item('donate_paypal'), "donate_paygol" => $this->config->item('donate_paygol'), "donate_paymentwall" => $this->config->item('donate_paymentwall'), "user_id" => $user_id, "server_name" => $this->config->item('server_name'), "currency" => $this->config->item('donation_currency'), "currency_sign" => $this->config->item('donation_currency_sign'), "multiplier" => $this->config->item('donation_multiplier'), "multiplier_paygol" => $this->config->item('donation_multiplier_paygol'), "url" => pageURL);
$output = $this->template->loadPage("donate.tpl", $data);
$this->template->box("<span style='cursor:pointer;' onClick='window.location=\"" . $this->template->page_url . "ucp\"'>" . lang("ucp") . "</span> → " . lang("donate_panel", "donate"), $output, true, "modules/donate/css/donate.css", "modules/donate/js/donate.js");
}
示例12: __construct
public function __construct()
{
// Make sure to load the administrator library!
$this->load->library('administrator');
$this->load->library('pagination');
$this->load->model("character_transfer_model");
parent::__construct();
requirePermission("viewAdmin");
}
示例13: __construct
public function __construct()
{
// Make sure to load the administrator library!
$this->load->library('administrator');
$this->load->model('donate_model');
$this->load->config('donate');
parent::__construct();
requirePermission("viewAdmin");
}
示例14: __construct
/**
* Load our resources
*/
public function __construct()
{
parent::__construct();
//Load libs and models.
$this->load->library('pagination');
$this->load->model('inbox_model');
$this->load->config('pm');
$this->user->userArea();
requirePermission("view");
}
示例15: __construct
public function __construct()
{
parent::__construct();
requirePermission("view");
$this->load->model('armory_model');
$this->load->config('tooltip/tooltip_constants');
$this->weapon_sub = $this->config->item("weapon_sub");
$this->armor_sub = $this->config->item("armor_sub");
$this->slots = $this->config->item("slots");
}