コード例 #1
0
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;
}
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: general.php プロジェクト: aaron770/securelogin-repo
function admin_protect()
{
    global $user_data;
    if (has_access($user_data['user_id'], 1) === false) {
        header('Location: index.php');
        exit;
    }
}
コード例 #4
0
ファイル: general.php プロジェクト: skinnerdev/ballin-batman
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;
    }
}
コード例 #5
0
ファイル: general.php プロジェクト: rakshans1/shoppcart
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;
    }
}
コード例 #6
0
 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);
 }
コード例 #7
0
 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 &ldquo;' . $record->text . '&rdquo;';
     if (!empty($catalog[$record->parent_id]->text)) {
         $title .= ' Menu Under &ldquo;' . $catalog[$record->parent_id]->text . '&rdquo;';
     }
     $data = ['controller_title' => $title, 'record' => $record, 'controller_action' => 'edit'];
     $this->page->data($data)->build($this->controller_path . '/form');
 }
コード例 #8
0
ファイル: video.class.php プロジェクト: yukisky/clipbucket
 /**
  * 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);
         }
     }
 }
コード例 #9
0
ファイル: config.inc.php プロジェクト: yukisky/clipbucket
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);
}
コード例 #10
0
ファイル: view_channel.php プロジェクト: reactvideos/Website
    }
    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) {
コード例 #11
0
 /**
  * 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;
 }
コード例 #12
0
ファイル: index.php プロジェクト: ProjectOrangeBox/cms-banner
<?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();
コード例 #13
0
ファイル: actions.class.php プロジェクト: Coding110/cbvideo
 /**
  * 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;
 }
コード例 #14
0
 /**
  * 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']);
             }
         }
     }
 }
コード例 #15
0
ファイル: index.php プロジェクト: ProjectOrangeBox/snippet
<?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();
コード例 #16
0
/**
 * Function confirms that user can change template or not
 * 
 * @author Fawaz Tahir <*****@*****.**>
 * @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;
}
コード例 #17
0
ファイル: photos.class.php プロジェクト: yukisky/clipbucket
 /**
  * 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;
 }
コード例 #18
0
ファイル: groups.class.php プロジェクト: Coding110/cbvideo
 /**
  * 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}) ";
     }
     //FEATURED
     if ($params['featured']) {
         if ($cond != '') {
             $cond .= ' AND ';
         }
         $cond .= " " . tbl("groups.featured") . " = '" . $params['featured'] . "' ";
     }
     //GROUP ID
     if ($params['group_id']) {
         if ($cond != '') {
             $cond .= ' AND ';
         }
         $cond .= " group_id = '" . $params['group_id'] . "' ";
     }
     //Exclude Vids
     if ($params['exclude']) {
         if ($cond != '') {
             $cond .= ' AND ';
         }
         $cond .= " " . tbl("groups.group_id") . " <> '" . $params['exclude'] . "' ";
     }
     if (!$params['count_only']) {
         if (!empty($cond)) {
             $cond .= " AND ";
         }
         $result = $db->select(tbl($this->gp_tbl . ",users"), '' . tbl($this->gp_tbl) . '.*, ' . tbl("users") . '.username, ' . tbl("users") . '.userid', $cond . " " . tbl("groups.userid") . " = " . tbl("users.userid") . " ", $limit, $order);
     }
     // echo $db->db_query;
     if ($params['count_only']) {
         return $result = $db->count(tbl($this->gp_tbl), '*', $cond);
     }
     if ($params['assign']) {
         assign($params['assign'], $result);
     } else {
         return $result;
     }
 }
コード例 #19
0
    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\">&nbsp;</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();
コード例 #20
0
ファイル: list.php プロジェクト: dmyers2004/theme-orange
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();
コード例 #21
0
ファイル: test.php プロジェクト: ProjectOrangeBox/cms-people
<div class="btn-group btn-group-sm">
	<a class="btn btn-default" data-edit="insertunorderedlist" title="" data-original-title="Bullet list"><i class="fa fa-list-ul"></i></a>
	<a class="btn btn-default" data-edit="insertorderedlist" title="" data-original-title="Number list"><i class="fa fa-list-ol"></i></a>
	<a class="btn btn-default" data-edit="outdent" title="" data-original-title="Reduce indent"><i class="fa fa-outdent"></i></a>
	<a class="btn btn-default" data-edit="indent" title="" data-original-title="Indent"><i class="fa fa-indent"></i></a>
</div>

<div class="btn-group btn-group-sm">
	<a class="btn btn-default" data-edit="justifyleft" title="" data-original-title="Align Left"><i class="fa fa-align-left"></i></a>
	<a class="btn btn-default" data-edit="justifycenter" title="" data-original-title="Center"><i class="fa fa-align-center"></i></a>
	<a class="btn btn-default" data-edit="justifyright" title="" data-original-title="Align Right"><i class="fa fa-align-right"></i></a>
</div>

<div class="btn-group btn-group-sm">
	<a class="btn btn-default btn-sm" title="" id="pictureBtn" data-original-title="Insert picture"><i class="fa fa-picture-o"></i></a>
	<input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" style="opacity: 0; position: absolute; top: 0px; left: 0px; width: 36px; height: 30px;">
</div>

<div class="btn-group btn-group-sm">
	<a class="btn btn-default" data-edit="removeFormat" title="" data-original-title="Remove Style"><i class="fa fa-eraser"></i></a>
	<a class="btn btn-default" data-edit="insertHorizontalRule" title="" data-original-title="Horizontal Rule">&horbar;</a>
	<?php 
if (has_access('Edit Bio Source')) {
    ?>
	<a class="btn js-wysiwyg-source btn-default" title="" data-original-title="Source"><i class="fa fa-file-code-o"></i></a>
	<?php 
}
?>
</div>
コード例 #22
0
ファイル: actions.class.php プロジェクト: yukisky/clipbucket
 /**
  * Function used to delete playlist
  */
 function delete_playlist($id)
 {
     global $db;
     $playlist = $this->get_playlist($id);
     if (!$playlist) {
         e(lang("playlist_not_exist"));
     } elseif ($playlist['userid'] != userid() && !has_access('admin_access', TRUE)) {
         e(lang("you_dont_hv_permission_del_playlist"));
     } else {
         $db->delete(tbl($this->playlist_tbl), array("playlist_id"), array($id));
         $db->delete(tbl($this->playlist_items_tbl), array("playlist_id"), array($id));
         e(lang("playlist_delete_msg"), "m");
     }
 }
コード例 #23
0
ファイル: user_levels.php プロジェクト: reactvideos/Website
 * @License : Attribution Assurance License -- http://www.opensource.org/licenses/attribution.php
 * @URI : http://clip-bucket.com
 */
#Including Maing file and checking user level
require '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
/* Assigning page and subpage */
if (!defined('MAIN_PAGE')) {
    define('MAIN_PAGE', 'Users');
}
if (!defined('SUB_PAGE')) {
    define('SUB_PAGE', 'User Levels');
}
$userquery->login_check('admin_access');
if (!has_access('allow_manage_user_level') && $userquery->udetails['level'] != 1) {
    $Cbucket->show_page = false;
    e("You are not allowed to manage user levels");
}
$mode = $_GET['mode'];
$lid = mysql_clean($_GET['lid']);
$action = mysql_clean($_GET['action']);
//Deleteing Level
if ($action == 'delete') {
    $userquery->delete_user_level($lid);
}
switch ($mode) {
    case 'view':
    default:
        Assign('view', 'view');
        break;
コード例 #24
0
ファイル: functions.php プロジェクト: yukisky/clipbucket
/**
 * Can Delete Comment...
 * 
 * As the name suggests, it is used to check weather logged in user has
 * rights to delete the comment or not.
 * 
 * @param $comment
 * @Author Arslan Hassan
 * @return BOOLEAN 
 * @link http://docs.clip-bucket.com/user-manual/developers-guide/functions/can_delete_comment
 */
function can_delete_comment($comment, $userid = false)
{
    if (!$userid) {
        $userid = userid();
    }
    if (has_access('admin_del_access') or $comment['userid'] == $userid or $comment['type_owner_id'] == $userid) {
        return true;
    }
    return false;
}
コード例 #25
0
ファイル: index.php プロジェクト: galdiolo/theme-orange
    theme::table_start(['Name', 'Value', 'Managed' => 'text-center', 'Actions' => 'text-center']);
    /* show them in the order they where entered */
    uasort($tab_records, function ($a, $b) {
        return $a->id > $b->id ? 1 : -1;
    });
    foreach ($tab_records as $record) {
        theme::table_start_tr();
        echo !$record->enabled ? '<i class="text-muted">' : '';
        o::e($record->name);
        echo !$record->enabled ? '</i>' : '';
        theme::table_row();
        echo theme::format_value($record->value, 128);
        theme::table_row('larger text-center');
        echo theme::enum_icon((int) $record->managed);
        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 settings')) {
            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::table_tab_pane_end();
}
theme::table_tabs_end();
theme::return_to_top();
コード例 #26
0
ファイル: ajax.php プロジェクト: yukisky/clipbucket
					<span class="date">' . date("m-d-Y", strtotime($n['pubDate'])) . '</span></div>
					<span class="clearfix"></span>';
                    echo '<div>';
                    echo $n['description'];
                    echo '</div>';
                    echo '</div>';
                }
            } else {
                echo '<div align="center"><em><strong>Unable to fetch news</strong></em></div>';
            }
            break;
        case "delete_feed":
            $uid = mysql_clean($_POST['uid']);
            $file = mysql_clean($_POST['file']) . '.feed';
            if ($uid && $file) {
                if ($uid == userid() || has_access("admin_access", true)) {
                    $cbfeeds->deleteFeed($uid, $file);
                    $array['msg'] = lang("feed_has_been_deleted");
                } else {
                    $array['err'] = lang("you_cant_del_this_feed");
                }
            }
            echo json_encode($array);
            break;
        case "send_photo_pm":
            $array = $_POST;
            $array['is_pm'] = true;
            $array['from'] = userid();
            $cbpm->send_pm($array);
            if (error()) {
                $errors = error_list();
コード例 #27
0
ファイル: edit_group.php プロジェクト: reactvideos/Website
 | Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
 | @ Author	   : ArslanHassan									
 | @ Software  : ClipBucket , © PHPBucket.com					
 *************************************************************
*/
define("THIS_PAGE", 'edit_group');
define("PARENT_PAGE", 'groups');
require 'includes/config.inc.php';
$userquery->logincheck();
$udetails = $userquery->get_user_details(userid());
assign('user', $udetails);
assign('p', $userquery->get_user_profile($udetails['userid']));
$gid = mysql_clean($_GET['group_id']);
//get group details
$gdetails = $cbgroup->get_group_details($gid);
$gArray = array('group' => $gdetails, 'groupid' => $gid, 'uid' => userid(), 'user' => $userquery->udetails, 'checkowner' => 'yes');
if (!$cbgroup->is_admin($gArray) && !has_access('admin_access', true)) {
    e(lang("you_cant_edit_group"));
    $Cbucket->show_page = false;
} else {
    //Updating Video Details
    if (isset($_POST['update_group'])) {
        $_POST['group_id'] = $gid;
        $cbgroup->update_group();
        $gdetails = $cbgroup->get_group_details($gid);
    }
    assign('group', $gdetails);
}
subtitle(lang("grp_edit_grp_title"));
template_files('edit_group.html');
display_it();
コード例 #28
0
<?php

theme::header_start('Log Files', 'File based log files in "..' . str_replace(ROOTPATH, '', setting('config.log_path') . '".'));
Plugin_search_sort::field();
if (has_access('log_file_viewer::delete logs')) {
    theme::header_button('Delete All', ['href' => $controller_path . '/delete', 'icon' => 'trash']);
}
theme::header_end();
theme::table_start(['Filename', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->name);
    theme::table_row('actions text-center');
    theme::table_action('eye', $controller_path . '/details/' . $record->id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
コード例 #29
0
ファイル: upload.php プロジェクト: NotoriousPyro/phpMCWeb
 * (at your option) any later version.
 * Fusion News 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 Fusion News.  If not, see <http://www.gnu.org/licenses/>.
 */
include './common.php';
$id = !isset($VARS['id']) ? '' : $VARS['id'];
$sid = isset($_COOKIE['fus_sid']) ? $_COOKIE['fus_sid'] : '';
$uid = isset($_COOKIE['fus_uid']) ? $_COOKIE['fus_uid'] : '';
$userdata = array();
$userdata = login_session_update($uid, $sid);
if (!has_access(NEWS_REPORTER)) {
    echo $ind148;
    exit;
}
if (!$uploads_active) {
    echo $upld1;
    exit;
}
if (strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == 0 || @ini_get('file_uploads') == '') {
    echo <<<html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
\t<title>{$upld3}</title>
コード例 #30
0
ファイル: index.php プロジェクト: ProjectOrangeBox/cropper
<?php

theme::header_start('Manage ' . $controller_titles, 'Manage all ' . $controller_titles . '.');
Plugin_search_sort::field();
if (has_access('cropper::add cropper')) {
    theme::header_button('new');
}
theme::header_end();
theme::table_start(['name', 'width', 'height', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->name);
    theme::table_row();
    theme::e($record->width * $record->exportzoom);
    theme::table_row();
    theme::e($record->height * $record->exportzoom);
    theme::table_row('actions text-center');
    theme::table_action('crop', $this->controller_path . '/crop/' . $record->id);
    if (has_access('cropper::add cropper')) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if (has_access('cropper::delete cropper')) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();