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


PHP authGetUserLevel函数代码示例

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


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

示例1: getWritable

function getWritable($creator, $user)
{
    global $auth;
    // Always allowed to modify your own stuff
    if (strcasecmp($creator, $user) == 0) {
        return 1;
    }
    if (authGetUserLevel($user, $auth["admin"]) >= 2) {
        return 1;
    }
    // Unathorised access
    return 0;
}
开发者ID:rtsfc,项目名称:moodle-block_mrbs,代码行数:13,代码来源:mrbs_auth.php

示例2: htmlspecialchars

 * GRR 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 GRR; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
include "include/admin.inc.php";
$grr_script_name = "admin_accueil.php";
$back = '';
if (isset($_SERVER['HTTP_REFERER'])) {
    $back = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
if (authGetUserLevel(getUserName(), -1, 'area') < 4 && authGetUserLevel(getUserName(), -1, 'user') != 1) {
    showAccessDenied($back);
    exit;
}
print_header("", "", "", $type = "with_session");
include "admin_col_gauche.php";
?>
<table>
	<tr>
		<td>
			<img src="img_grr/totem_grr.png" alt="GRR !" class="image" />
		</td>
		<td align="center" >
			<br /><br />
			<p style="font-size:20pt">
				<?php 
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_accueil.php

示例3: get_form_var

        default:
            $type = 'string';
            break;
    }
    $var = VAR_PREFIX . $field['name'];
    ${$var} = get_form_var($var, $type);
    if ($type == 'int' && ${$var} === '') {
        unset(${$var});
    }
}
// Check the user is authorised for this page
checkAuthorised();
// Also need to know whether they have admin rights
$user = getUserName();
$required_level = isset($max_level) ? $max_level : 2;
$is_admin = authGetUserLevel($user) >= $required_level;
// Done changing area or room information?
if (isset($change_done)) {
    if (!empty($room)) {
        $area = mrbsGetRoomArea($room);
    }
    Header("Location: admin.php?day={$day}&month={$month}&year={$year}&area={$area}");
    exit;
}
// Intialise the validation booleans
$valid_email = TRUE;
$valid_resolution = TRUE;
$enough_slots = TRUE;
$valid_area = TRUE;
$valid_room_name = TRUE;
// PHASE 2
开发者ID:linuxmuster,项目名称:linuxmuster-mrbs-manager,代码行数:31,代码来源:edit_area_room.php

示例4: grr_sql_syntax_timestamp_to_unix

 // Tableau des ressources invisibles pour l'utilisateur
 $sql = "SELECT distinct e.id, e.start_time, e.end_time, e.name, e.description, " . "e.type, e.beneficiaire, " . grr_sql_syntax_timestamp_to_unix("e.timestamp") . ", a.area_name, r.room_name, r.description, a.id, e.overload_desc" . " FROM " . TABLE_PREFIX . "_entry e, " . TABLE_PREFIX . "_area a, " . TABLE_PREFIX . "_room r, " . TABLE_PREFIX . "_type_area t";
 // Si l'utilisateur n'est pas administrateur, seuls les domaines auxquels il a accès sont pris en compte
 if (authGetUserLevel(getUserName(), -1) < 6) {
     if ($test_grr_j_user_area != 0) {
         $sql .= ", " . TABLE_PREFIX . "_j_user_area j ";
     }
 }
 $sql .= " WHERE e.room_id = r.id AND r.area_id = a.id";
 // on ne cherche pas parmi les ressources invisibles pour l'utilisateur
 $tab_rooms_noaccess = verif_acces_ressource(getUserName(), 'all');
 foreach ($tab_rooms_noaccess as $key) {
     $sql .= " and r.id != {$key} ";
 }
 // Si l'utilisateur n'est pas administrateur, seuls les domaines auxquels il a accès sont pris en compte
 if (authGetUserLevel(getUserName(), -1) < 6) {
     if ($test_grr_j_user_area == 0) {
         $sql .= " and a.access='a' ";
     } else {
         $sql .= " and ((j.login='" . getUserName() . "' and j.id_area=a.id and a.access='r') or (a.access='a')) ";
     }
 }
 $sql .= " AND e.start_time < {$report_end} AND e.end_time > {$report_start}";
 $k = 0;
 if (isset($champ[0])) {
     $sql .= " AND (";
     while ($k < count($texte)) {
         if ($champ[$k] == "area") {
             $sql .= grr_sql_syntax_caseless_contains("a.area_name", $texte[$k], $type_recherche[$k]);
         }
         if ($champ[$k] == "room") {
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:report.php

示例5: time_date_string

        $link_str = time_date_string($row['start_time']);
    } else {
        list(, $link_str) = period_date_string($row['start_time']);
    }
    echo "{$link_str}</a></td>";
    // action buttons
    echo "<td>\n";
    display_buttons($row, FALSE);
    echo "</td>\n";
    echo "</tr>\n";
}
// Check the user is authorised for this page
checkAuthorised();
// Also need to know whether they have admin rights
$user = getUserName();
$is_admin = authGetUserLevel($user) >= 2;
print_header($day, $month, $year, $area, isset($room) ? $room : "");
echo "<h1>" . get_vocab("pending") . "</h1>\n";
// Get a list of all bookings awaiting approval
// We are only interested in areas where approval is required
$sql_approval_enabled = some_area_predicate('approval_enabled');
$sql = "SELECT E.id, E.name, E.room_id, E.start_time, E.create_by, " . sql_syntax_timestamp_to_unix("E.timestamp") . " AS last_updated,\n               E.reminded, E.repeat_id,\n               M.room_name, M.area_id, A.area_name, A.enable_periods,\n               E.info_time AS entry_info_time, E.info_user AS entry_info_user,\n               T.info_time AS repeat_info_time, T.info_user AS repeat_info_user\n          FROM {$tbl_room} AS M, {$tbl_area} AS A, {$tbl_entry} AS E\n     LEFT JOIN {$tbl_repeat} AS T ON E.repeat_id=T.id\n         WHERE E.room_id = M.id\n           AND M.area_id = A.id\n           AND M.disabled = 0\n           AND A.disabled = 0\n           AND {$sql_approval_enabled}\n           AND (E.status&" . STATUS_AWAITING_APPROVAL . " != 0)";
// Ordinary users can only see their own bookings
if (!$is_admin) {
    $sql .= " AND E.create_by='" . sql_escape($user) . "'";
}
// We want entries for a series to appear together so that we can display
// them as a separate table below the main entry for the series.
$sql .= " ORDER BY repeat_id, start_time";
$res = sql_query($sql);
if (!$res) {
开发者ID:linuxmuster,项目名称:linuxmuster-mrbs-manager,代码行数:31,代码来源:pending.php

示例6: header

<?php

// $Id$
require "../defaultincludes.inc";
header("Content-type: application/x-javascript");
expires_header(60 * 30);
// 30 minute expiry
if ($use_strict) {
    echo "'use strict';\n";
}
$user = getUserName();
$is_admin = authGetUserLevel($user) >= $max_level;
// function to reverse a collection of jQuery objects
?>
$.fn.reverse = [].reverse;


<?php 
// Get the sides of the rectangle represented by the jQuery object jqObject
// We round down the size of the rectangle to avoid any spurious overlaps
// caused by rounding errors
?>
function getSides(jqObject)
{
  var sides = {};
  sides.n = Math.ceil(jqObject.offset().top);
  sides.w = Math.ceil(jqObject.offset().left);
  sides.s = Math.floor(sides.n + jqObject.outerHeight());
  sides.e = Math.floor(sides.w + jqObject.outerWidth());
  return sides;
}
开发者ID:bdwong-mirrors,项目名称:mrbs,代码行数:31,代码来源:resizable.js.php

示例7: get_vocab

 // Ordre d'affichage du domaine
 echo "<td>" . get_vocab("order_display") . get_vocab("deux_points") . "</td>\n";
 echo "<td><input type=\"text\" name=\"area_order\" size=\"1\" value=\"" . htmlspecialchars($row["order_display"]) . "\" /></td>\n";
 echo "</tr><tr>\n";
 // Acces restreint ou non ?
 echo "<td>" . get_vocab("access") . get_vocab("deux_points") . "</td>\n";
 echo "<td><input type=\"checkbox\" name=\"access\"";
 if ($row["access"] == 'r') {
     echo "checked=\"checked\"";
 }
 echo " /></td>\n";
 echo "</tr>";
 // Site
 if (Settings::get("module_multisite") == "Oui") {
     // Affiche une liste deroulante des sites;
     if (authGetUserLevel(getUserName(), -1, 'area') >= 6) {
         $sql = "SELECT id,sitecode,sitename\n\t\t\tFROM " . TABLE_PREFIX . "_site\n\t\t\tORDER BY sitename ASC";
     } else {
         $sql = "SELECT id,sitecode,sitename\n\t\t\tFROM " . TABLE_PREFIX . "_site s,  " . TABLE_PREFIX . "_j_useradmin_site u\n\t\t\tWHERE s.id=u.id_site and u.login='" . getUserName() . "'\n\t\t\tORDER BY s.sitename ASC";
     }
     $res = grr_sql_query($sql);
     $nb_site = grr_sql_count($res);
     echo "<tr><td>" . get_vocab('site') . get_vocab('deux_points') . "</td>\n";
     if ($nb_site > 1) {
         echo "<td><select class=\"form-control\" name=\"id_site\" >\n\n\t\t\t\t<option value=\"-1\">" . get_vocab('choose_a_site') . "</option>\n";
         for ($enr = 0; $row1 = grr_sql_row($res, $enr); $enr++) {
             echo "<option value=\"" . $row1[0] . "\"";
             if ($id_site == $row1[0]) {
                 echo ' selected="selected"';
             }
             echo '>' . htmlspecialchars($row1[2]);
开发者ID:JeromeDevome,项目名称:GRR,代码行数:31,代码来源:admin_edit_room.php

示例8: date

    $to_year = date('Y', $date_);
}
if (Settings::get("authentification_obli") == 0 && getUserName() == '') {
    $type_session = "no_session";
} else {
    $type_session = "with_session";
}
$back = '';
if (isset($_SERVER['HTTP_REFERER'])) {
    $back = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
if (check_begin_end_bookings($day, $from_month, $from_year)) {
    showNoBookings($day, $from_month, $from_year, $back);
    exit;
}
if (authGetUserLevel(getUserName(), -1) < 1 && Settings::get("authentification_obli") == 1 || authUserAccesArea(getUserName(), $area) == 0) {
    showAccessDenied($back);
    exit;
}
// On vérifie une fois par jour si le délai de confirmation des réservations est dépassé
// Si oui, les réservations concernées sont supprimées et un mail automatique est envoyé.
// On vérifie une fois par jour que les ressources ont été rendue en fin de réservation
// Si non, une notification email est envoyée
if (Settings::get("verif_reservation_auto") == 0) {
    verify_confirm_reservation();
    verify_retard_reservation();
}
//print the page header
print_header($day, $from_month, $from_year, $type_session);
//Month view start time. This ignores morningstarts/eveningends because it
//doesn't make sense to not show all entries for the day, and it messes
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:year.php

示例9: chr

            } else {
                echo 'Error occured while performing query on database:<br>' . chr(10), exit;
            }
        }
    }
    include "include/admin_middel.php";
    $editor->printEditor();
    //echo '* = '._('Password won\'t be changed unless you type in a new one.');
    echo '* = Passordet blir bare endret hvis det blir skrevet inn ett nytt ett';
} else {
    include "include/admin_middel.php";
    echo '<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>' . chr(10);
    echo '<script src="js/hide_unhide.js" type="text/javascript"></script>' . chr(10);
    echo '<h1>' . _('Users') . '</h1>';
    // Add
    if (authGetUserLevel(getUserID()) >= $user_level) {
        echo iconHTML('user_add') . ' <a href="' . $_SERVER['PHP_SELF'] . '?editor=1">' . _('New user') . '</a><br>' . chr(10);
    }
    echo iconHTML('phone') . ' <a href="telefonliste.php">Telefonliste</a><br><br>' . chr(10);
    // List of users
    echo '<h2>' . _('List of users') . '</h2>' . chr(10);
    $Q_users = mysql_query("select user_id from `users` order by `user_name`");
    if (!mysql_num_rows($Q_users)) {
        echo _('No users found.');
    } else {
        echo '<a href="javascript:void();" class="showAll">Vis info på alle / Ikke vis info på alle</a>';
        echo '<table class="prettytable">' . chr(10);
        echo '	<tr>' . chr(10);
        echo '		<th>ID</th>' . chr(10);
        echo '		<th>Bruker</th>' . chr(10);
        echo '		<th>Login</th>' . chr(10);
开发者ID:HNygard,项目名称:JM-booking,代码行数:31,代码来源:admin_user2.php

示例10: showAccessDenied

/* Arguments passés par la méthode GET :
$use_site : 'y' (fonctionnalité multisite activée) ou 'n' (fonctionnalité multisite désactivée)
$id_site : l'identifiant du site
$default_area : domaine par défaut
$default_room : ressource par défaut
$session_login : identifiant
$type : 'ressource'-> on actualise la liste des ressources
        'domaine'-> on actualise la liste des domaines
$action : 1-> on actualise la liste des ressources
          2-> on vide la liste des ressouces
*/

include "include/admin.inc.php";

if ((authGetUserLevel(getUserName(),-1) < 1))
{
    showAccessDenied("","","","","");
    exit();
}
/*
 * Actualiser la liste des domaines
 */

if ($_GET['type']=="domaine") {
 // Initialisation
 if (isset($_GET["id_site"])) {
  $id_site = $_GET["id_site"];
  settype($id_site,"integer");
 } else die();
 if (isset($_GET["default_area"])) {
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:my_account_modif_listes.php

示例11: get_vocab

if ($area_access == 'r') {
    echo " - " . get_vocab("access");
}
echo ")";
echo "</h3>";
if ($row['statut_room'] == "0") {
    //
    echo "<h2 style=\"text-align:center;\"><span class=\"avertissement\">" . get_vocab("ressource_temporairement_indisponible") . "</span></h2>";
}
// Description
if (authGetUserLevel($getUserName(), -1) >= Settings::get("visu_fiche_description")) {
    echo "<h3>" . get_vocab("description") . "</h3>\n";
    echo "<div>" . htmlspecialchars($row["description"]) . " </div>\n";
}
// Description complète
if (authGetUserLevel($getUserName(), -1) >= Settings::get("acces_fiche_reservation") && $row["comment_room"] != '') {
    echo "<h3>" . get_vocab("match_descr") . "</h3>\n";
    echo "<div>" . $row["comment_room"] . "</div>\n";
}
// Afficher capacité
if ($row["capacity"] != '0') {
    echo "<h3>" . get_vocab("capacity_2") . "</h3>\n";
    echo "<p>" . $row["capacity"] . "</p>\n";
}
if ($row["max_booking"] != "-1") {
    echo "<p>" . get_vocab("msg_max_booking") . get_vocab("deux_points") . $row["max_booking"] . "</p>";
}
// Limitation par domaine
$max_booking_per_area = grr_sql_query1("SELECT max_booking FROM " . TABLE_PREFIX . "_area WHERE id = '" . protect_data_sql($id_area) . "'");
if ($max_booking_per_area >= 0) {
    echo "<p>" . get_vocab("msg_max_booking_area") . get_vocab("deux_points") . $max_booking_per_area . "</p>";
开发者ID:BdEINSALyon,项目名称:GRR,代码行数:31,代码来源:view_room.php

示例12: urlencode

                $col[$i][5] = "Ext.";
            }
            echo "\n<tr><td class=\"" . $fond . "\">{$col[$i][1]}</td>\n";
            // un gestionnaire d'utilisateurs ne peut pas modifier un administrateur général ou un gestionnaire d'utilisateurs
            if (authGetUserLevel(getUserName(), -1, 'user') == 1 && ($user_statut == "gestionnaire_utilisateur" || $user_statut == "administrateur")) {
                echo "<td class=\"" . $fond . "\">{$col[$i][2]}</td>\n";
            } else {
                echo "<td class=\"" . $fond . "\"><a href=\"admin_user_modify.php?user_login=" . urlencode($user_login) . "&amp;display={$display}\">{$col[$i][2]}</a></td>\n";
            }
            echo "<td class=\"" . $fond . "\">{$col[$i][3]}</td>\n";
            echo "<td class=\"" . $fond . "\"><span class=\"" . $color[$i] . "\">{$col[$i][4]}</span></td>\n";
            echo "<td class=\"" . $fond . "\">{$col[$i][5]}</td>\n";
            // Affichage du lien 'supprimer'
            // un gestionnaire d'utilisateurs ne peut pas supprimer un administrateur général ou un gestionnaire d'utilisateurs
            // Un administrateur ne peut pas se supprimer lui-même
            if (authGetUserLevel(getUserName(), -1, 'user') == 1 && ($user_statut == "gestionnaire_utilisateur" || $user_statut == "administrateur") || strtolower(getUserName()) == strtolower($user_login)) {
                echo "<td class=\"" . $fond . "\"> </td>";
            } else {
                $themessage = get_vocab("confirm_del");
                echo "<td class=\"" . $fond . "\"><a href='admin_user.php?user_del=" . urlencode($col[$i][1]) . "&amp;action_del=yes&amp;display={$display}' onclick='return confirmlink(this, \"{$user_login}\", \"{$themessage}\")'>" . get_vocab("delete") . "</a></td>";
            }
            // Fin de la ligne courante
            echo "</tr>";
        }
    }
}
echo "</table>";
// fin de l'affichage de la colonne de droite
echo "</td></tr></table>";
// Affichage d'un pop-up
affiche_pop_up($msg, "admin");
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_user.php

示例13: isset

// Session related functions
require_once "./include/session.inc.php";
// Resume session
include "include/resume_session.php";
// Paramètres langage
include "include/language.inc.php";
if (Settings::get("authentification_obli") == 0 && getUserName() == '') {
    $type_session = "no_session";
} else {
    $type_session = "with_session";
}
$area_id = isset($_GET["area_id"]) ? $_GET["area_id"] : NULL;
if (isset($area_id)) {
    settype($area_id, "integer");
}
if (authGetUserLevel(getUserName(), $area_id, "area") < 4) {
    showAccessDenied($back);
    exit;
}
echo begin_page(Settings::get("company") . get_vocab("deux_points") . get_vocab("mrbs"));
$res = grr_sql_query("SELECT * FROM " . TABLE_PREFIX . "_area WHERE id='" . $area_id . "'");
if (!$res) {
    fatal_error(0, get_vocab('error_room') . $id_room . get_vocab('not_found'));
}
$row = grr_sql_row_keyed($res, 0);
grr_sql_free($res);
echo '<h3 style="text-align:center;">';
echo get_vocab("match_area") . get_vocab("deux_points") . " " . htmlspecialchars($row["area_name"]);
$area_access = $row["access"];
if ($area_access == 'r') {
    echo " (<span class=\"avertissement\">" . get_vocab("access") . "</span>)";
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:view_rights_area.php

示例14: get_vocab

    echo "<p>";
    echo "<input type=\"radio\" name=\"moderate\" value=\"1\" checked=\"checked\" />" . get_vocab("accepter_resa");
    echo "<br /><input type=\"radio\" name=\"moderate\" value=\"0\" />" . get_vocab("refuser_resa");
    if ($repeat_id) {
        echo "<br /><input type=\"radio\" name=\"moderate\" value=\"S1\" />" . get_vocab("accepter_resa_serie");
        echo "<br /><input type=\"radio\" name=\"moderate\" value=\"S0\" />" . get_vocab("refuser_resa_serie");
    }
    echo "</p><p>";
    echo "<label for=\"description\">" . get_vocab("justifier_decision_moderation") . get_vocab("deux_points") . "</label>\n";
    echo "<textarea class=\"form-control\" name=\"description\" id=\"description\" cols=\"40\" rows=\"3\"></textarea>";
    echo "</p>";
    echo "<br /><div style=\"text-align:center;\"><input class=\"btn btn-primary\" type=\"submit\" name=\"commit\" value=\"" . get_vocab("save") . "\" /></div>\n";
    echo "</fieldset></form>\n";
}
if ($active_ressource_empruntee == 'y') {
    if (!$was_del && $moderate != 1 && getUserName() != '' && authGetUserLevel(getUserName(), $room_id) >= 3) {
        echo "<form action=\"view_entry.php\" method=\"get\">";
        echo "<fieldset><legend style=\"font-weight:bold\">" . get_vocab("reservation_en_cours") . "</legend>\n";
        echo "<span class=\"larger\">" . get_vocab("signaler_reservation_en_cours") . "</span>" . get_vocab("deux_points");
        echo "<br />" . get_vocab("explications_signaler_reservation_en_cours");
        affiche_ressource_empruntee($room_id, "texte");
        echo "<br /><input type=\"radio\" name=\"statut_id\" value=\"-\" ";
        if ($statut_id == '-') {
            if (!affiche_ressource_empruntee($room_id, "autre") == 'yes') {
                echo " checked=\"checked\" ";
            }
        }
        echo " />" . get_vocab("signaler_reservation_en_cours_option_0");
        echo "<br /><br /><input type=\"radio\" name=\"statut_id\" value=\"y\" ";
        if ($statut_id == 'y') {
            echo " checked=\"checked\" ";
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:view_entry.php

示例15: showNoBookings

} else {
    $type_session = "with_session";
}
$back = "";
if (isset($_SERVER['HTTP_REFERER'])) $back = grr_htmlSpecialChars($_SERVER['HTTP_REFERER']);

if ($type_session == "with_session") $_SESSION['type_month_all'] = "month_all";
$type_month_all='month_all';

if (check_begin_end_bookings($day, $month, $year))
{
    showNoBookings($day, $month, $year, $area,$back,$type_session);
    exit();
}

if((authGetUserLevel(getUserName(),-1) < 1) and (getSettingValue("authentification_obli")==1))
{
    showAccessDenied($day, $month, $year, $area,$back);
    exit();
}
if(authUserAccesArea(getUserName(), $area)==0)
{
    showAccessDenied($day, $month, $year, $area,$back);
    exit();
}

# 3-value compare: Returns result of compare as "< " "= " or "> ".
function cmp3($a, $b)
{
    if ($a < $b) return "< ";
    if ($a == $b) return "= ";
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:month_all.php


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