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


PHP acl函数代码示例

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


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

示例1: local_headers

function local_headers()
{
    global $cTheme;
    echo "<html><head><title>" . BOT_NAME . "@ (Accept Application)</title>";
    std_theme_styles();
    echo "</head>\n";
    std_theme_body("../../");
    if (acl(XCHGMGR_ADMIN)) {
        echo "<h2>" . BOT_NAME . "@ Admin (Accept Application)</h2>\n";
    } else {
        echo "<h2>" . BOT_NAME . "@ Review (Accept Application)</h2>\n";
    }
}
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:13,代码来源:accept.php

示例2: open_url

 /**
  * Devuelve true si el usuario actual tiene acceso a la URL $url
  *
  * @param string $url
  * @return boolean
  */
 public static function open_url($url)
 {
     list($controller, $action, $type) = controller_action($url);
     switch ($controller) {
         case 'admin':
             $result = acl('p:Admin');
             break;
         case 'profile':
             $result = User::current() instanceof User;
             break;
         case 'special':
             $result = acl('p:Special');
             break;
         default:
             $result = true;
             break;
     }
     return $result;
 }
开发者ID:aercolino,项目名称:tech-test,代码行数:25,代码来源:acl.php

示例3: pg_safe_exec

$res = pg_safe_exec("SELECT user_name FROM users WHERE id='" . (int) $user_id . "'");
$adm_usr = pg_fetch_object($res, 0);
$adm_user = $adm_usr->user_name;
if ($admin == 0) {
    echo "Restricted to logged in CService Admins, sorry.";
    die;
}
if (!($admin >= 800)) {
    echo "Sorry, your admin access is too low.";
    die;
}
$nrw_lvl = 0;
if (acl(XWEBAXS_2)) {
    $nrw_lvl = 1;
}
if (acl(XWEBAXS_3)) {
    $nrw_lvl = 2;
}
echo "<html><head><title>LOCKED VERIFICATION ANSWERS (DELETE MODE)</title>";
std_theme_styles();
echo "</head>\n";
std_theme_body("../");
if ($admin < $min_lvl) {
    echo "Sorry, Your admin access is too low.<br><br>\n";
    echo "</body></html>\n\n";
    die;
}
$special_pass = CRC_SALT_0010;
if ($id <= 0 || $id == "") {
    echo "<b>INVALID ARGUMENTS</b> - <a href=\"./index.php\">Click here</a><br>\n";
} else {
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:remove_va.php

示例4: die

            }
        } else {
            echo "<br><br>Invalid credentials";
        }
        echo "</body></html>\n\n";
        die;
        break;
}
if (!acl(XCOMPLAINTS_ADM_REPLY) || $admin == 0) {
    die("ERROR-1337: You cannot access that page, sorry.");
}
// ... then the admin only part(s)...
$cTheme = get_theme_info();
std_theme_styles(1);
std_theme_body();
if (!acl(XCOMPLAINTS_ADM_REPLY) && !acl(XCOMPLAINTS_ADM_READ)) {
    die("Your level is too low to access this page</body></html>");
}
echo "<h2>Complaint Manager";
switch ($_GET["A"]) {
    case 'replyadm':
        echo " (reply to user)";
        break;
    case 'cancel':
        echo " (force ticket close)";
        break;
    case 'resolve':
        echo " (ticket resolve)";
        break;
    case 'delete':
        echo " (ticket removal)";
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:ticket.php

示例5: std_connect

<?php

$min_lvl = 800;
/* $Id: newusers.php,v 1.2 2003/08/31 19:52:16 nighty Exp $ */
require "../../../php_includes/cmaster.inc";
std_connect();
$user_id = std_security_chk($auth);
$admin = std_admin();
if (!acl(XWEBCTL)) {
    echo "<b>Go away</b>!!!";
    die;
}
if ($switch == "ON" && newusers_off()) {
    echo "Already LOCKED";
    die;
}
if ($switch == "OFF" && !newusers_off()) {
    echo "Already UNLOCKED";
    die;
}
if ($switch == "ON") {
    pg_safe_exec("INSERT INTO locks VALUES (3,now()::abstime::int4," . $user_id . ")");
}
if ($switch == "OFF") {
    pg_safe_exec("DELETE FROM locks WHERE section='3'");
    pg_safe_exec("DELETE FROM counts WHERE count_type='1'");
}
header("Location: redir.php?RET=index.php");
die;
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:29,代码来源:newusers.php

示例6: str_rot13

         $p = str_rot13($p);
         if (!empty($_SESSION['CO'][$p])) {
             unset($_SESSION['CO'][$p]);
         } else {
             if (!empty($_SESSION['MO'][$p])) {
                 unset($_SESSION['MO'][$p]);
             }
             $_SESSION['CO'][$p] = 1;
         }
     }
     if (isset($_POST['fca']) && !empty($_POST['fc'])) {
         foreach ($_POST['fc'] as $f) {
             acl($f);
         }
     } elseif (!empty($_POST['fcf'])) {
         acl($_POST['fcf']);
     }
 } elseif (isset($_POST['fbc'])) {
     unset($_SESSION['MO'], $_SESSION['CO']);
 } elseif (isset($_POST['fbp'])) {
     function cd($p, $d)
     {
         $p = @realpath($p);
         $sd = @stat($d);
         $n = $d . DIRECTORY_SEPARATOR . bname($p);
         if (@is_dir($n) && @is_writable($n) || @mkdir($n)) {
             if ($h = @opendir($p)) {
                 $s = @stat($n);
                 while (FALSE !== ($f = @readdir($h))) {
                     if ($f != '.' && $f != '..') {
                         if (@is_dir($p . DIRECTORY_SEPARATOR . $f)) {
开发者ID:ershov-ilya,项目名称:decoding-pas,代码行数:31,代码来源:index.php

示例7: Lock

if ($admin == 0 && !acl(XWEBAXS_2) && !acl(XWEBAXS_3) && !acl(XDOMAIN_LOCK)) {
    echo "Sorry, your admin access is too low.";
    die;
}
$nrw_lvl = 0;
if (acl(XWEBAXS_2)) {
    $nrw_lvl = 1;
}
if (acl(XWEBAXS_3)) {
    $nrw_lvl = 2;
}
echo "<html><head><title>Domain Lock (DELETE MODE)</title>";
std_theme_styles();
echo "</head>\n";
std_theme_body("../");
if ($admin < $min_lvl && !acl(XDOMAIN_LOCK)) {
    echo "Sorry, Your admin access is too low.<br><br>\n";
    echo "</body></html>\n\n";
    die;
}
$special_pass = CRC_SALT_0005;
if ($id <= 0 || $id == "") {
    echo "<b>INVALID ARGUMENTS</b> - <a href=\"./index.php\">Click here</a><br>\n";
} else {
    if ($crc != md5("{$HTTP_USER_AGENT}{$special_pass}{$ts}")) {
        echo "<b>Domain/User Lock</b> Editor (DELETE MODE) - <a href=\"./index.php\">Home</a> - <a href=\"add.php\">Add a new entry</a><br><br>\n";
        echo "<h2>Are you sure you want to permanently delete this DOMAIN/USER LOCK entry ?<h3><br>\n";
        $res = pg_safe_exec("select * from {$lock_domain_table} where id='{$id}'");
        $row = pg_fetch_object($res, 0);
        $dom = $row->domain;
        if (ereg("@", $dom)) {
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:remove.php

示例8: std_init

<?php

require "../../../php_includes/cmaster.inc";
std_init();
$cTheme = get_theme_info();
std_theme_styles(1);
std_theme_body("../");
if (!acl(XWEBSESS)) {
    echo "Oi! What are you doing here eh?";
    exit;
}
?>
<!-- $Id: view_admins.php,v 1.9 2004/07/25 03:31:51 nighty Exp $ //-->
<h1>Admins Logged to the website</h1><h3>
<a href="index.php">Back</a></h3>
<hr>
<?php 
$ENABLE_COOKIE_TABLE = 1;
pg_safe_exec("DELETE FROM webcookies WHERE expire<now()::abstime::int4");
$r1 = pg_safe_exec("SELECT COUNT(*) AS count FROM webcookies WHERE is_admin>0");
$r2 = pg_safe_exec("SELECT COUNT(*) AS count FROM webcookies WHERE is_admin=0");
$active_mins = 20;
$r3 = pg_safe_exec("SELECT COUNT(*) AS count FROM webcookies WHERE is_admin=0 AND expire>(now()::abstime::int4+" . $active_mins . "*60)");
$s1 = pg_fetch_object($r1, 0);
$s2 = pg_fetch_object($r2, 0);
$s3 = pg_fetch_object($r3, 0);
echo "<b>" . $s1->count . "</b> CService official(s) logged in,&nbsp;";
echo "<b>" . $s2->count . "</b> regular user(s) logged in,&nbsp;";
if ($s3->count > $s2->count) {
    $s3c = $s2->count;
} else {
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:view_admins.php

示例9: std_init

<?php

include "../../../../php_includes/cmaster.inc";
std_init();
/* $Id: view_tmp.php,v 1.6 2003/05/25 06:36:29 nighty Exp $ */
$ENABLE_COOKIE_TABLE = 0;
if (!acl(XCHGMGR_ADMIN) && $admin < 600) {
    echo "Wrong way ;)";
    die;
}
if (!acl(XCHGMGR_ADMIN)) {
    $spc_user = 1;
} else {
    $spc_user = 0;
}
$cTheme = get_theme_info();
echo "<html><head><title>" . BOT_NAME . "@ (Channels with a temporary manager)</title>";
?>
<style type=text/css>
<!--
.frauduser { color: #<?php 
echo $cTheme->main_headtextcolor;
?>
; background: #<?php 
echo $cTheme->main_frauduser;
?>
; bgcolor: #<?php 
echo $cTheme->main_frauduser;
?>
; }
//-->
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:view_tmp.php

示例10: check_login

function check_login($type)
{
    global $url_string;
    switch ($type) {
        case 'anonymous':
            if (defined(DISABLED)) {
                redirect(DISABLED);
            }
            anonymous_session();
            break;
        case 'special':
            check_login_special();
            if (!acl("open_url", $url_string)) {
                redirect_to('noaccess.php');
            }
            break;
        case 'xmlrpc':
            check_login_xmlrpc();
            if (!acl("open_url", $url_string)) {
                forward_to('xmlrpc', 'noaccess');
            }
            break;
        case 'standard':
            check_login_standard();
            if (!acl("open_url", $url_string)) {
                redirect_to('noaccess.php');
            }
            break;
        default:
            redirect_to('noaccess.php');
            break;
    }
}
开发者ID:aercolino,项目名称:tech-test,代码行数:33,代码来源:login.php

示例11: header

    $isAdmin = 1;
} else {
    $isAdmin = 0;
}
if ($isAdmin && $isAdminLvl >= $admin && $user_id != $id && $admin != 1000) {
    header("Location: users.php?id={$id}&r=2&fc=" . md5($id . 2 . CRC_SALT_0013));
    exit;
}
// non admin's/ACL can't edit people other than themselves
if ($admin < 600 && !acl(XAT_CAN_EDIT) && $user_id != $id) {
    header("Location: users.php?id={$id}&r=3&fc=" . md5($id . 3 . CRC_SALT_0013));
    exit;
}
$id = $id + 0;
//activate user_log if an admin or an acl user modifies someone else than him/herself
if (($admin > 0 || acl(XAT_CAN_EDIT)) && $user_id != $id) {
    $log = 1;
} else {
    $log = 0;
}
function set_flag($allowed, &$num, $bit, $bool)
{
    global $database;
    if (!$allowed) {
        return;
    }
    switch ($bool) {
        case "off":
            $num = (int) $num & ~(int) $bit;
            break;
        case "on":
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:save_user.php

示例12: explode

 $daval = explode(" ", $val);
 $microtime = $daval[0] * 1000000000;
 $time = $daval[1];
 $cookie = md5(CRC_SALT_0007 . $time . $microtime . $username . $password . $user_id . CRC_SALT_0009);
 // Remove any previous login.
 $ENABLE_COOKIE_TABLE = 1;
 //pg_safe_exec(CLEAR_COOKIES_QUERY);
 pg_safe_exec("delete from webcookies where user_id = " . (int) $user_id);
 $ENABLE_COOKIE_TABLE = 0;
 unset($is_alumni);
 $is_alumni = 0;
 if ($ouu->flags & 128 && $is_admin > 0) {
     $is_alumni = 1;
 }
 // check IP restrictions . . . (only for * persons or persons with an ACL set, excepted ALUMNIs (as X on IRC))
 if ($is_alumni == 0 && ($is_admin > 0 || acl())) {
     if (is_ip_restrict()) {
         header("Pragma: no-cache");
         echo "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n";
         echo "<html>\n";
         echo "<head><title>Error</title>";
         std_theme_styles();
         echo "</head>";
         std_theme_body();
         echo "<font size=+0>\n";
         echo "You can't login to this account using your current IP number (" . cl_ip() . ").<br><br>";
         echo "<a href=\"index.php\" target=\"_top\">click here</a>.<br>\n";
         echo "</font></body></html>\n\n";
         die;
     }
 }
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:login.php

示例13: std_init

require "../../php_includes/cmaster.inc";
std_init();
unset($axslock);
unset($da_u_adm);
$axslock = 1;
$da_u_adm = 0;
if (acl(XIPR_MOD_OWN) && $user_id == (int) $_GET["user_id"]) {
    $axslock = 0;
}
$tmpr = @pg_safe_exec("SELECT access FROM levels WHERE channel_id=1 AND user_id=" . (int) $_GET["user_id"] . "");
if ($tmpr) {
    if ($tmpo = pg_fetch_object($tmpr)) {
        $da_u_adm = (int) $tmpo->access;
    }
}
if (acl(XIPR_MOD_OTHERS) && ($admin > $da_u_adm || $admin >= $min_lvl)) {
    $axslock = 0;
}
if ($axslock == 1) {
    die("Oi! what are you doing here ?!");
}
$cTheme = get_theme_info();
if (check_secure_form("delfrm" . $_POST["user_id"])) {
    pg_safe_exec("DELETE FROM ip_restrict WHERE user_id=" . (int) $_POST["user_id"] . " AND id=" . (int) $_POST["delid"] . "");
    header("Location: ip_restrict.php?user_id=" . (int) $_POST["user_id"]);
    die;
}
$usrq = pg_safe_exec("SELECT * FROM users WHERE id=" . (int) $_GET["user_id"] . "");
$usr = pg_fetch_object($usrq);
$err = "";
if (check_secure_form("addrestrict" . $_POST["user_id"])) {
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:ip_restrict.php

示例14: show_ticket_events

                echo "<input type=button onClick=\"to_resolved()\" value=\"Mark as RESOLVED\">&nbsp;&nbsp;";
            }
            if ($o->status < 3) {
                echo "<input type=button onClick=\"to_abandonned()\" value=\"Mark as ABANDONNED\">&nbsp;&nbsp;";
            }
            if ($admin >= 800 && $o->status != 99) {
                echo "<input type=button onClick=\"to_deleted()\" value=\"Mark as DELETED\">";
            }
        }
        if ($o->reviewed_by_id > 0) {
            echo "<br><br>";
            $lastid_RT = show_ticket_events($o->id);
        } else {
            $lastid_RT = 0;
        }
        if (acl(XCOMPLAINTS_ADM_REPLY) && COMPLAINTS_DO_FOLLOWUP == 0 || acl(XCOMPLAINTS_ADM_REPLY) && COMPLAINTS_DO_FOLLOWUP && ($o->reviewed_by_id == $user_id || $o->current_owner == $user_id)) {
            $RT = (int) $lastid_RT;
            ?>
<script language="JavaScript1.2">
<!--
<?php 
            if ($o->status < 3) {
                ?>
function switch_owner() {
	if (document.forms[0].newowner.options[document.forms[0].newowner.selectedIndex].value > 0) {
		if (confirm('Are you sure you want to tranfer/change ownership of this ticket/complaint ?')) {
			document.forms[0].submit();
		}
	} else {
		alert('Please select a new OWNER !');
	}
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:admin.php

示例15: ucwords

		acl();
		tag::generate_index();
		robots::generate("robots_".$config_q["locale"].".txt");
		sitemap::generate("sitemap_".$config_q["locale"].".xml");
		die("done");
		break;
	case "find_similar_quotes":
		acl();
		quote::find_similar_quotes();
		break;
	case "get_new_quotes_from_zitate_de":
		acl();
		quote::get_new_quotes_from_zitate_de();
		break;
	case "admin":
		acl();
		echo "admin";
		break;
	case "userprofile":
		$context["h1"] = "";
		$context["fake_h1"] = _("User") ." ". $a_path[0];

		$userinfo = user_q::user_info($a_path[0]);

		if ($config_q["locale"] == "et")
		{
			$content = ucwords($a_path[0]) . " on olnud tsitaat.com kasutaja alates ".$userinfo["user_regdate_parsed"].'. Ta on '.
      ($userinfo["quotes_added"]?'<a href="'.$user->data["username_clean"]."/".$context["labels"]["added-quotes_clean"].'">':'').
        'lisanud '.$userinfo["quotes_added"].' tsitaati'.
      ($userinfo["quotes_added"]?'</a>':'').
      ', hääletanud '.$userinfo["votes"].' korda ja talle '.
开发者ID:hkirsman,项目名称:tsitaat_com,代码行数:31,代码来源:index.php


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