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


PHP get_page_acccess_level函数代码示例

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


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

示例1:

<?php 
if ($offline != "") {
    ?>
      <input name="offline" type="hidden" value="offline">
<?php 
}
?>
      <input type="hidden" name="workflowid" value="<?php 
echo $workflowid;
?>
" />
    </form>

    <span id="error" class="small">&nbsp;</span>
<?php 
if (!$authentication || get_page_acccess_level() <= $min_run_level) {
    ?>
      <input id="prev" type="button" value="Start Over" onclick="prevStep();"/>
<?php 
}
if ($finished) {
    ?>
    <input id="next" type="button" value="Finished" onclick="nextStep();" />
<?php 
} else {
    ?>
    <input id="next" type="button" value="Results" onclick="nextStep();" />
<?php 
}
?>
    <div class="spacer"></div>
开发者ID:justinmcgrath,项目名称:pecan,代码行数:31,代码来源:05-running.php

示例2: open_database

 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the 
 * University of Illinois/NCSA Open Source License
 * which accompanies this distribution, and is available at
 * http://opensource.ncsa.illinois.edu/license.html
 */
// Check login
require "common.php";
if ($authentication) {
    open_database();
    if (!check_login()) {
        header("Location: index.php");
        close_database();
        exit;
    }
    if (get_page_acccess_level() > $min_run_level) {
        header("Location: history.php");
        close_database();
        exit;
    }
    close_database();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>EBI Sites</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="sites.css" />
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
开发者ID:justinmcgrath,项目名称:pecan,代码行数:31,代码来源:01-introduction.php

示例3: print_entry

function print_entry($id, $table, $readonly)
{
    global $pdo;
    global $sections;
    $edit = false;
    if ($readonly) {
        if ($sections[$table]['level']['show'] < get_page_acccess_level() && ($table != "users" || $id != get_userid())) {
            #header("Location: index.php");
            die("no access");
        }
        if ($sections[$table]['level']['edit'] >= get_page_acccess_level() || $table == "users" && $id == get_userid()) {
            $edit = true;
        }
    } else {
        if ($sections[$table]['level']['edit'] < get_page_acccess_level() && ($table != "users" || $id != get_userid())) {
            #header("Location: index.php");
            die("no access");
        }
    }
    # update database
    $msg = "";
    if (!$readonly && isset($_REQUEST['action']) && $_REQUEST['action'] == "update") {
        $msg = editor_update($id, $table);
    }
    # print navigation
    print_prev_next($id, $table, $edit);
    if ($readonly) {
        $disabled = "disabled";
    } else {
        $disabled = "";
    }
    # get the row from the database (this can be empty)
    $result = $pdo->query("SELECT * FROM {$table} WHERE id={$id};");
    if (!$result) {
        die('Invalid query : ' . error_database());
    }
    $row = $result->fetch(PDO::FETCH_ASSOC);
    $result->closeCursor();
    # check access_level
    if (is_array($row) && array_key_exists('access_level', $row) && $row['access_level'] != "" && $row['access_level'] != "-1") {
        if (get_acccess_level() > $row['access_level']) {
            header("Location: index.php");
            return;
        }
    }
    if (!$readonly) {
        print "<form method=\"post\" action=\"edit.php\">\n";
        print "<input name=\"table\" type=\"hidden\" value=\"{$table}\"/>\n";
        print "<input name=\"id\" type=\"hidden\" value=\"{$id}\"/>\n";
    }
    print "<div class=\"tbl\" id=\"editor\">\n";
    foreach (column_names($table) as $key => $type) {
        if ($key == "id") {
            $fancykey = $key;
        } else {
            $fancykey = ucwords(str_replace("_", " ", str_replace("_id", "", $key)));
        }
        if (is_array($row) && array_key_exists($key, $row)) {
            $val = $row[$key];
        } else {
            $val = "";
        }
        if (substr($val, 0, 4) == "http") {
            $fancykey = "<a href=\"{$val}\">{$fancykey}</a>";
        }
        print "<div class=\"row\">\n";
        if ($key == "id") {
            if ($id == -1) {
                $val = "new entry";
            }
            print "<div class=\"key\">{$fancykey}</div>\n";
            print "<div class=\"val\"><input name=\"{$key}\" type=\"text\" disabled value=\"{$val}\"/></div>\n";
        } else {
            if ($key == "created_at") {
                if ($id == -1) {
                    $val = 'now';
                    print "<input name=\"u_{$key}\" type=\"hidden\" value=\"{$val}\"/>\n";
                }
                print "<div class=\"key\">{$fancykey}</div>\n";
                print "<div class=\"val\"><input name=\"{$key}\" type=\"text\" disabled value=\"{$val}\"/></div>\n";
            } else {
                if ($key == "updated_at") {
                    if ($id != -1) {
                        print "<input name=\"u_{$key}\" type=\"hidden\" value=\"{$val}\"/>\n";
                    }
                    print "<div class=\"key\">{$fancykey}</div>\n";
                    print "<div class=\"val\"><input name=\"{$key}\" type=\"text\" disabled value=\"{$val}\"/></div>\n";
                } else {
                    if ($key == "site_id") {
                        print "<div class=\"key\">{$fancykey}</div>\n";
                        print "<div class=\"val\">\n";
                        print_sites_options("n_{$key}", $val, $readonly);
                        print "</div>\n";
                    } else {
                        if ($key == "model_id") {
                            print "<div class=\"key\">{$fancykey}</div>\n";
                            print "<div class=\"val\">\n";
                            print_models_options("n_{$key}", $val, $readonly);
                            print "</div>\n";
                        } else {
//.........这里部分代码省略.........
开发者ID:ebimodeling,项目名称:pecan,代码行数:101,代码来源:common.php

示例4: get_footer

    
    </div>
    <div id="output">
      <h2>Execution Status <span id="workflows"></span></h2>
      <div class="table">
        <div class="row">
          <div class="header">ID</div>
          <div class="header">Site Name</div>
          <div class="header">Model Name</div>
          <div class="header">Model Type</div>
          <div class="header">Start Date</div>
          <div class="header">End Date</div>
          <div class="header">Started</div>
          <div class="header">Finished</div>
<?php 
if (check_login() && get_page_acccess_level() <= $min_delete_level) {
    ?>
          <div class="header">Delete</div>
<?php 
}
?>
        </div>
     </div>
    </div>
    <div id="footer"><?php 
echo get_footer();
?>
</div>
  </div>
</body>  
开发者ID:jsimkins2,项目名称:pecan,代码行数:29,代码来源:history.php

示例5: isset

# find the table
$table = isset($_REQUEST['table']) ? $_REQUEST['table'] : "";
$section = $sections[$table];
if (empty($section)) {
    header("Location: index.php");
    die("Invalid table.");
}
# what is the current id
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
} else {
    header("Location: index.php");
    die('need an id');
}
# Make sure we can get here.
if ($sections[$table]['level']['edit'] < get_page_acccess_level() && ($table != "users" || $id != get_userid())) {
    #header("Location: {$matches[1]}/index.php");
    die("Not authorized. " . get_userid());
}
# print top
print_header($table);
print_menu($section);
# print form to edit entry
$msg = print_entry($id, $table, false);
# list files associated
if ($section['files']) {
    $tmp = show_files($id, $table, false);
    if ($msg == "") {
        $msg = $tmp;
    } else {
        if ($tmp != "") {
开发者ID:jsimkins2,项目名称:pecan,代码行数:31,代码来源:edit.php

示例6: open_database

 * Copyright (c) 2012 University of Illinois, NCSA.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the 
 * University of Illinois/NCSA Open Source License
 * which accompanies this distribution, and is available at
 * http://opensource.ncsa.illinois.edu/license.html
 */
// Check login
require "common.php";
open_database();
if (!check_login()) {
    close_database();
    header("Location: history.php");
    exit;
}
if (get_page_acccess_level() > $min_delete_level) {
    header("Location: history.php");
    close_database();
    exit;
}
// runid
if (!isset($_REQUEST['workflowid'])) {
    close_database();
    die("Need a workflowid.");
}
$workflowid = $_REQUEST['workflowid'];
?>
<!DOCTYPE html>
<html>
<head>
<title>PEcAn Delete</title>
开发者ID:andydawson,项目名称:pecan,代码行数:31,代码来源:delete.php

示例7: isset

<?php

require "common.php";
# find the table
$table = isset($_REQUEST['table']) ? $_REQUEST['table'] : "";
$section = $sections[$table];
if (empty($section)) {
    #header("Location: index.php");
    die("Invalid table.");
}
# Make sure we can get here.
if (get_page_acccess_level() > $section['level']['show']) {
    #header("Location: index.php");
    die("Not authorized.");
}
# print top
print_header($table);
print_menu($section);
# create query to show things
$msg = print_list($table, $sections[$table]['list']);
# print footer of html
print_footer($msg);
开发者ID:jsimkins2,项目名称:pecan,代码行数:22,代码来源:list.php


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