本文整理汇总了PHP中has_access函数的典型用法代码示例。如果您正苦于以下问题:PHP has_access函数的具体用法?PHP has_access怎么用?PHP has_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了has_access函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: confirm_collection_type
function confirm_collection_type($type)
{
global $cbcollection;
if (empty($type)) {
$type = 'photos';
}
if ($type != $cbcollection->types) {
if (VERSION < '3.0') {
// Get Deprecated Types;
$dep_types = $cbcollection->deprecated_types;
$message = 'Collections feature now only support photos';
if (array_key_exists($type, $dep_types)) {
$message .= '. ' . $cbcollection->deprecated_types[$type] . ' support has been dropped since 2.6';
$dep_type = $cbcollection->deprecated_types[$type] . ' ';
}
if (userid() && has_access('admin_access', true)) {
$message .= '. Please upgrade your Clipbucket to <a href="http://clip-bucket.com" target="_blank">latest version</a>';
} else {
$message .= '. Please contact Site Administrator about this.';
}
e(lang($message));
cb_show_page();
}
return $cbcollection->types;
}
return $cbcollection->types;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:27,代码来源:functions_collections.php
示例2: editAction
public function editAction($id = null, $advanced = null)
{
if ($advanced == 'advanced' && has_access('Orange::Advanced Settings')) {
$this->page->data('advanced', true);
}
$this->page->js('/themes/orange/assets/js/settings.min.js');
parent::editAction($id);
}
开发者ID:dmyers2004,项目名称:theme-orange,代码行数:8,代码来源:SettingController.php
示例3: admin_protect
function admin_protect()
{
global $user_data;
if (has_access($user_data['user_id'], 1) === false) {
header('Location: index.php');
exit;
}
}
开发者ID:aaron770,项目名称:securelogin-repo,代码行数:8,代码来源:general.php
示例4: admin_page
function admin_page()
{
global $user_data;
if (has_access($user_data['user_id'], USER_TYPE_ADMIN) === false) {
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=index.php">';
exit;
}
}
开发者ID:skinnerdev,项目名称:ballin-batman,代码行数:8,代码来源:general.php
示例5: adminormoderate_protect
function adminormoderate_protect()
{
global $user_data;
if (has_access($user_data['user_id'], 2) === true || has_access($user_data['user_id'], 1) === true) {
} else {
header('Location: /');
exit;
}
}
开发者ID:rakshans1,项目名称:shoppcart,代码行数:9,代码来源:general.php
示例6: edit_savePostAction
public function edit_savePostAction()
{
has_access('templates::edit');
$id = $this->input->post('id');
$content = $this->input->post('content');
$name = $this->input->post('name');
$is_file = $this->input->post('is_file');
$this->c_templates_model->save($id, $content, $name, $is_file);
$this->output->json('err', false);
}
开发者ID:ProjectOrangeBox,项目名称:templates,代码行数:10,代码来源:TemplatesController.php
示例7: editAction
public function editAction($id = null, $advanced = null)
{
if ($advanced == 'advanced' && has_access('Orange::Advanced Menubar')) {
$this->page->data('advanced', true);
}
$this->page->data('return_to', $this->input->server('HTTP_REFERER'));
$record = $this->o_menubar_model->get($id);
$catalog = $this->o_menubar_model->catalog();
$title = 'Edit “' . $record->text . '”';
if (!empty($catalog[$record->parent_id]->text)) {
$title .= ' Menu Under “' . $catalog[$record->parent_id]->text . '”';
}
$data = ['controller_title' => $title, 'record' => $record, 'controller_action' => 'edit'];
$this->page->data($data)->build($this->controller_path . '/form');
}
开发者ID:dmyers2004,项目名称:theme-orange,代码行数:15,代码来源:MenubarController.php
示例8: update_broadcast
/**
* update video broadcast option
*
* @param INT videoid
* @param STRING broadcast
*
* @return BOOLEAN
*/
function update_broadcast($vid, $brd)
{
if (!is_valid_broadcast($brd)) {
e(lang('Invalid broadcast option'));
} else {
if ($this->is_video_owner($vid, userid()) || has_access('admin_access', TRUE)) {
db_update(tbl('video'), array('broadcast' => mysql_clean($brd)), " videoid='{$vid}' ");
} else {
e(lang('You cannot update this video'), true);
}
}
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:20,代码来源:video.class.php
示例9: Assign
Assign('layout_dir', LAYOUT);
if (USE_PHOTO_TAGGING == true) {
$Cbucket->addJS('jquery_plugs/jquery.cbtagger.js', 'view_item');
}
$Cbucket->addJS('jquery_plugs/jquery.Jcrop.js', 'edit_account');
$Cbucket->addJS('amplify/amplify.core.min.js');
$Cbucket->addJS('amplify/amplify.request.min.js');
$Cbucket->addJS('amplify/amplify.store.min.js');
$Cbucket->addJS('amplify_requests.js');
//Assigning JS Files
Assign('jsArray', $Cbucket->JSArray);
//Assigning Module Files
Assign('module_list', $Cbucket->moduleList);
//Checking Website is closed or not
if (config('closed') && THIS_PAGE != 'ajax' && !$in_bg_cron && THIS_PAGE != 'cb_install') {
if (!has_access("admin_access", TRUE)) {
e($row['closed_msg'], "w");
template("global_header.html");
template("message.html");
exit;
} else {
e(lang("ATTENTION: THIS WEBSITE IS IN OFFLINE MODE"), "w");
}
}
//Configuring Uploader
uploaderDetails();
register_filter('photo_action_links', 'cbphoto_pm_action_link_filter');
attach_photo_pm_handlers();
if (!IN_MODULE) {
isSectionEnabled(PARENT_PAGE, true);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:31,代码来源:config.inc.php
示例10: subtitle
}
subtitle(sprintf(lang('user_s_channel'), $udetails['username']));
//Setting profilte item
$profileItem = $userquery->getProfileItem($udetails['userid'], true);
assign('profile_item', $profileItem);
} else {
if ($_GET['seo_diret'] != 'yes') {
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
} else {
header("HTTP/1.0 404 Not Found");
if (file_exists(LAYOUT . "/404.html")) {
template_files('404.html');
} else {
$data = "404_error";
if (has_access('admin_access')) {
e(sprintf(lang("err_warning"), "404", "http://docs.clip-bucket.com/?p=154"), "w");
}
e(lang($data));
}
display_it();
exit;
}
}
add_js(array('jquery_plugs/compressed/jquery.jCarousel.js' => 'view_channel'));
if ($Cbucket->show_page) {
template_files('view_channel.html');
display_it();
} else {
$Cbucket->show_page = true;
if ($udetails) {
开发者ID:reactvideos,项目名称:Website,代码行数:31,代码来源:view_channel.php
示例11: set_the_template
/**
* Function used to set template (Frontend)
*/
function set_the_template()
{
global $cbtpl, $myquery;
$template = $this->template;
$can_change = can_change_template();
if (isset($_SESSION['the_template']) && $cbtpl->is_template($_SESSION['the_template'])) {
$template = $_SESSION['the_template'];
}
if ($_GET['template'] and $can_change) {
if (is_dir(STYLES_DIR . '/' . $_GET['template']) && $_GET['template']) {
$template = $_GET['template'];
}
}
if (isset($_GET['set_the_template']) && $cbtpl->is_template($_GET['set_the_template']) and $can_change) {
$template = $_SESSION['the_template'] = $_GET['set_the_template'];
}
if (!is_dir(STYLES_DIR . '/' . $template) || !$template || is_template_hidden($template)) {
$template = 'cbv3';
}
if (!is_dir(STYLES_DIR . '/' . $template) || !$template) {
$template = $cbtpl->get_any_template();
}
if (!is_dir(STYLES_DIR . '/' . $template) || !$template) {
exit("Unable to find any template, please goto <a href='http://clip-bucket.com/no-template-found'><strong>ClipBucket Support!</strong></a>");
}
if ($_GET['set_template'] and has_access('admin_access')) {
$myquery->set_template($template);
}
$this->template_details = $cbtpl->get_template_details($template);
//CHecking if there is any php file, include it like a BOSS!
//if($this->template_details['php_file'])
// include($this->template_details['php_file']);
$this->template = $template;
return $this->template;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:38,代码来源:ClipBucket.class.php
示例12:
<?php
theme::header_start('Banners', 'mange banners.');
Plugin_search_sort::field();
if (has_access('templates::add')) {
theme::header_button('new');
}
theme::header_end();
theme::table_start(['Title', 'Starts After', 'End After', 'Points To', 'Weight' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $key => $record) {
theme::table_start_tr();
theme::e($record->title);
theme::table_row();
theme::date($record->start_on);
theme::table_row();
theme::date($record->end_on);
theme::table_row();
theme::e($record->url);
theme::table_row('text-center');
theme::e($record->weight);
theme::table_row('actions text-center');
if ($record->is_editable) {
theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
}
if ($record->is_deletable) {
o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
}
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
开发者ID:ProjectOrangeBox,项目名称:cms-banner,代码行数:31,代码来源:index.php
示例13: get_playlists
/**
* Function used to get playlists
*/
function get_playlists($params = array())
{
global $cb_columns, $db;
$fields = array('playlists' => $cb_columns->object('playlists')->get_columns());
$order = $params['order'];
$limit = $params['limit'];
$main_query = $query = "SELECT " . table_fields($fields) . " FROM " . table('playlists');
$condition = "playlists.playlist_type = 'v'";
if (!has_access('admin_access')) {
$condition .= $condition ? " AND " : "";
$condition .= "playlists.privacy = 'public'";
} else {
if ($params['privacy']) {
$condition .= $condition ? " AND " : "";
$condition .= " playlists.privacy = '" . mysql_clean($params['privacy']) . "' ";
}
}
if ($params['category']) {
$condition .= $condition ? " AND " : "";
$condition .= " playlists.category = '" . $params['category'] . "' ";
}
if ($params['include']) {
$ids = is_array($params['include']) ? $params['include'] : explode(',', $params['include']);
if (is_array($ids) and !empty($ids)) {
$condition .= $condition ? " AND " : "";
$ids = implode(",", array_map('trim', $ids));
$condition .= " playlists.playlist_id IN ({$ids}) ";
}
}
if ($params['exclude']) {
$ids = is_array($params['exclude']) ? $params['exclude'] : explode(',', $params['exclude']);
if (is_array($ids) and !empty($ids)) {
$condition .= $condition ? " AND " : "";
$ids = implode(",", array_map('trim', $ids));
$condition .= " playlists.playlist_id NOT IN ({$ids}) ";
}
}
if ($params['date_span']) {
$condition .= $condition ? " AND " : "";
$column = $params['date_span_column'] ? trim($params['date_span_column']) : 'playlists.date_added';
$condition .= cbsearch::date_margin($column, $params['date_span']);
}
if ($params['last_update']) {
$condition .= $condition ? " AND " : "";
$condition .= cbsearch::date_margin('playlists.last_update', $params['last_update']);
}
if ($params['user']) {
$condition .= $condition ? " AND " : "";
$condition .= " playlists.userid = '" . $params['user'] . "' ";
}
if ($params['has_items']) {
$condition .= $condition ? " AND " : "";
$condition .= " playlists.total_items > '0' ";
}
if ($params['count_only']) {
$result = $db->count(cb_sql_table('playlists'), 'playlist_id');
return $result;
}
if ($condition) {
$query .= " WHERE " . $condition;
}
$order = " ORDER BY " . ($order ? trim($order) : "playlists.date_added DESC");
$limit = $limit ? " LIMIT {$limit} " : "";
$query .= $order . $limit;
$query_id = cb_query_id($query);
$action_array = array('query_id' => $query_id);
$data = cb_do_action('select_playlists', array_merge($action_array, $params));
if ($data) {
return $data;
}
$results = select($query);
if (!empty($results)) {
cb_do_action('return_playlists', array('query_id' => $query_id, 'results' => $results));
return $results;
}
return false;
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:80,代码来源:actions.class.php
示例14: update_collection
/**
* Function used to create collection preview
*/
function update_collection($array = NULL)
{
global $db;
if ($array == NULL) {
$array = $_POST;
}
if (is_array($_FILES)) {
$array = array_merge($array, $_FILES);
}
$this->validate_form_fields($array);
$cid = $array['collection_id'];
if (!error()) {
$reqFields = $this->load_required_fields($array);
$otherFields = $this->load_other_fields($array);
$collection_fields = array_merge($reqFields, $otherFields);
if ($this->custom_collection_fields > 0) {
$collection_fields = array_merge($collection_fields, $this->custom_collection_fields);
}
foreach ($collection_fields as $field) {
$name = formObj::rmBrackets($field['name']);
$val = $array[$name];
if ($field['use_func_val']) {
$val = $field['validate_function']($val);
}
if (!empty($field['db_field'])) {
$query_field[] = $field['db_field'];
}
if (is_array($val)) {
$new_val = '';
foreach ($val as $v) {
$new_val .= "#" . $v . "# ";
}
$val = $new_val;
}
if (!$field['clean_func'] || !function_exists($field['clean_func']) && !is_array($field['clean_func'])) {
$val = $val;
} else {
$val = apply_func($field['clean_func'], sql_free('|no_mc|' . $val));
}
if (!empty($field['db_field'])) {
$query_val[] = $val;
}
}
if (has_access('admin_access', TRUE)) {
if (!empty($array['total_comments'])) {
$total_comments = $array['total_comments'];
if (!is_numeric($total_comments) || $total_comments < 0) {
$total_comments = 0;
}
$query_field[] = "total_comments";
$query_val[] = $total_comments;
}
if (!empty($array['total_objects'])) {
$tobj = $array['total_objects'];
if (!is_numeric($tobj) || $tobj < 0) {
$tobj = 0;
}
$query_field[] = "total_objects";
$query_val[] = $tobj;
}
}
}
if (!error()) {
if (!userid()) {
e(lang("you_not_logged_in"));
} elseif (!$this->collection_exists($cid)) {
e(lang("collect_not_exist"));
} elseif (!$this->is_collection_owner($cid, userid()) && !has_access('admin_access', TRUE)) {
e(lang("cant_edit_collection"));
} else {
$db->update(tbl($this->section_tbl), $query_field, $query_val, " collection_id = {$cid}");
e(lang("collection_updated"), "m");
if (!empty($array['collection_thumb']['tmp_name'])) {
$this->upload_thumb($cid, $array['collection_thumb']);
}
}
}
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:81,代码来源:collections.class.php
示例15: foreach
<?php
theme::header_start($controller_titles, 'manage random bits of text.');
Plugin_search_sort::field();
if (has_access('Snippets::Add Snippets')) {
theme::header_button('new');
}
theme::header_end();
theme::table_start(['Name', 'Value', 'Note', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
theme::table_start_tr();
theme::e($record->name);
theme::table_row();
theme::shorten($record->value);
theme::table_row();
theme::shorten($record->note);
theme::table_row('actions text-center');
if ($record->is_editable && has_access('Snippets::Edit Snippets')) {
theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
}
if ($record->is_deletable && has_access('Snippets::Delete Snippets')) {
o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
}
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
开发者ID:ProjectOrangeBox,项目名称:snippet,代码行数:27,代码来源:index.php
示例16: can_change_template
/**
* Function confirms that user can change template or not
*
* @author Fawaz Tahir <[email protected]>
* @return boolean
*/
function can_change_template()
{
$is_allowed = ALLOW_STYLE_SELECT;
$can_change = true;
if (!$is_allowed) {
if (has_access('admin_access')) {
$can_change = true;
} else {
$can_change = false;
}
}
$hidden = get_hidden_templates();
if ($hidden) {
$the_template = mysql_clean($_GET['set_the_template']);
if (in_array($the_template, $hidden)) {
if (has_access('admin_access')) {
$can_change = true;
} else {
$can_change = false;
}
} else {
$can_change = true;
}
}
return $can_change;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:32,代码来源:functions_templates.php
示例17: remove_photo_tag
/**
* Remove photo tag
* @global OBJECT $db
* @global OBJECT $userquery
* @param INT $tag
* @return boolean
*/
function remove_photo_tag($tag_id)
{
global $db, $userquery;
$uid = $userquery->userid;
if (empty($uid)) {
e(lang('login_to_remove_tag'));
return false;
}
if (!is_array($tag_id)) {
$tag = $this->get_tag_with_id($tag_id);
} else {
$tag = $tag_id;
}
/* if tag is empty return */
if (empty($tag)) {
e(lang('tag_not_exist'));
return false;
}
/* if user is not photo owner or tagger or tagged or does not have admin access */
if ($uid != $tag['photo_owner_userid'] && $uid != $tag['ptag_by_userid'] && $uid != $tag['ptag_userid'] && !has_access('admin_access', true)) {
e(lang('cant_remove_tag_1'));
return false;
}
/* if tagged is user, make sure tag hash matches */
if ($tag['ptag_isuser'] == true) {
if ($uid != $tag['ptag_userid'] && !has_access('admin_access', true)) {
e(lang('cant_remove_tag_2'));
return false;
}
}
/* Deletion Good TO GO */
$db->delete(tbl('photo_tags'), array('ptag_id'), array($tag['ptag_id']));
/* Decrease photo tag count */
$db->update(tbl('photos'), array('ptags_count'), array('|f|ptags_count-1'), " photo_id = '" . $tag['photo_id'] . "' ");
return true;
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:43,代码来源:photos.class.php
示例18: get_groups
/**
* Function used to get groups
* @parma ARRAY
* group_id => {id of group} INT
* user => {all groups of the user INT
* category => {all groups in specified category INT,INT,INT
* featured => {get featured groups only} yes,no
* limit => {number of results including offset}
* order => {soring by}
* date_margin => {date span}
*/
function get_groups($params = NULL, $force_admin = FALSE)
{
global $db;
$limit = $params['limit'];
$order = $params['order'];
$cond = "";
if (!has_access('admin_access', TRUE) && !$force_admin) {
$cond .= " " . tbl("groups.active") . "='yes' ";
} else {
if ($params['active']) {
$cond .= " " . tbl("groups.active") . "='" . $params['active'] . "'";
}
}
//Setting Category Condition
if (!is_array($params['category'])) {
$is_all = strtolower($params['category']);
}
if ($params['category'] && $is_all != 'all') {
if ($cond != '') {
$cond .= ' AND ';
}
$cond .= " (";
if (!is_array($params['category'])) {
$cats = explode(',', $params['category']);
} else {
$cats = $params['category'];
}
$count = 0;
foreach ($cats as $cat_params) {
$count++;
if ($count > 1) {
$cond .= " OR ";
}
$cond .= " " . tbl("groups.category") . " LIKE '%#{$cat_params}#%' ";
}
$cond .= ")";
}
//date span
if ($params['date_span']) {
if ($cond != '') {
$cond .= ' AND ';
}
$cond .= " " . cbsearch::date_margin("date_added", $params['date_span']);
}
//uid
if ($params['user']) {
if ($cond != '') {
$cond .= ' AND ';
}
$cond .= " " . tbl("groups.userid") . "='" . $params['user'] . "'";
}
$tag_n_title = '';
//Tags
if ($params['tags']) {
//checking for commas ;)
$tags = explode(",", $params['tags']);
if (count($tags) > 0) {
if ($tag_n_title != '') {
$tag_n_title .= ' OR ';
}
$total = count($tags);
$loop = 1;
foreach ($tags as $tag) {
$tag_n_title .= " " . tbl("groups.group_tags") . " LIKE '%" . $tag . "%'";
if ($loop < $total) {
$tag_n_title .= " OR ";
}
$loop++;
}
} else {
if ($tag_n_title != '') {
$tag_n_title .= ' OR ';
}
$tag_n_title .= " " . tbl("groups.group_tags") . " LIKE '%" . $params['tags'] . "%'";
}
}
//TITLE
if ($params['title']) {
if ($tag_n_title != '') {
$tag_n_title .= ' OR ';
}
$tag_n_title .= " " . tbl("groups.group_name") . " LIKE '%" . $params['title'] . "%'";
}
if ($tag_n_title) {
if ($cond != '') {
$cond .= ' AND ';
}
$cond .= " ({$tag_n_title}) ";
}
//.........这里部分代码省略.........
开发者ID:Coding110,项目名称:cbvideo,代码行数:101,代码来源:groups.class.php
示例19: block
if (eregi("\\/\\.\\.", $file) || $file == ".." || eregi("\\.\\.\\/", $file)) {
$file = "";
}
}
$breadcrumbs[] = "<a href=\"../projects/listprojects.php?{$sid}\">" . $strings["projects"] . "</a>";
$breadcrumbs[] = "<a href=\"../projects/viewproject.php?{$sid}&id={$id}\">" . $projectDetail->pro_name[0] . "</a>";
$breadcrumbs[] = $strings["repository"];
require_once "../themes/" . THEME . "/header.php";
//---- content -----
$block1 = new block();
$block1->headingForm($strings["browse_cvs"] . " : " . $projectDetail->pro_name[0]);
$block1->openContent();
$block1->contentTitle("Files");
echo "<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\"> </td><td>";
if ($cvs_protected) {
$cvs_access = has_access($_SESSION['loginSession'], $id);
} else {
$cvs_access = true;
}
if ($cvs_access) {
echo "<!-- Start browsecvs -->";
require_once "theme.php";
// echo $theme->header();
$rgb_top = $theme->bgcolor3;
$rgb_sub = $theme->bgcolor2;
$rgb_off = $theme->bgcolor1;
$dirs = listdirs($path, array(".", "..", "CVSROOT", "Attic"));
$files = listfiles($path);
sort($dirs);
sort($files);
echo $theme->opentable();
开发者ID:TICanalyste,项目名称:netOffice--remix-,代码行数:31,代码来源:browsecvs.php
示例20: foreach
theme::header_start('Menubar', 'manage menubars using the list view.');
Plugin_search_sort::field();
theme::header_button('Back', $controller_path, 'reply');
theme::header_end();
theme::table_start(['Text', 'URL', 'Access', 'Parent', 'Active' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
theme::table_start_tr();
o::e($record->text);
theme::table_row();
o::e($record->url);
theme::table_row();
o::smart_model('o_access', $record->access_id, 'key');
theme::table_row();
o::smart_model('o_menubar', $record->parent_id, 'text');
theme::table_row('text-center larger');
theme::enum_icon($record->active);
theme::table_row('actions text-center');
if ($record->is_editable) {
theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
}
if (has_access('orange::advanced menubar')) {
theme::table_action('pencil-square', $this->controller_path . '/edit/' . $record->id . '/advanced');
}
if ($record->is_deletable) {
o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
}
theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
开发者ID:dmyers2004,项目名称:theme-orange,代码行数:30,代码来源:list.php
注:本文中的has_access函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论