• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getStudentPermission函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getPermissionLevel

    $student_id = $_POST['student_id'];
}
if ($student_id == "") {
    //we shouldn't be here without a student id.
    echo "You've entered this page without supplying a valid student id. Fatal, quitting";
    exit;
}
//check permission levels
$permission_level = getPermissionLevel($_SESSION['egps_username']);
if ($permission_level > $MINIMUM_AUTHORIZATION_LEVEL || $permission_level == NULL) {
    $system_message = $system_message . "You do not have permission to view this page (IP: " . $_SERVER['REMOTE_ADDR'] . ")";
    IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
    require IPP_PATH . 'security_error.php';
    exit;
}
$our_permission = getStudentPermission($student_id);
if ($our_permission == "WRITE" || $our_permission == "ASSIGN" || $our_permission == "ALL") {
    //we have write permission.
    $have_write_permission = true;
} else {
    $have_write_permission = false;
}
//************** validated past here SESSION ACTIVE WRITE PERMISSION CONFIRMED****************
$student_query = "SELECT * FROM student WHERE student_id = " . mysql_real_escape_string($student_id);
$student_result = mysql_query($student_query);
if (!$student_result) {
    $error_message = $error_message . "Database query failed (" . __FILE__ . ":" . __LINE__ . "): " . mysql_error() . "<BR>Query: '{$student_query}'<BR>";
    $system_message = $system_message . $error_message;
    IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
} else {
    $student_row = mysql_fetch_array($student_result);
开发者ID:Byrnesz,项目名称:MyIEP,代码行数:31,代码来源:achieve_level.php


示例2: mysql_query

        }
        $target_result = mysql_query($target_query);
        if (!$target_result) {
            $error_message = $error_message . "Database query failed (" . __FILE__ . ":" . __LINE__ . "): " . mysql_error() . "<BR>Query: '{$target_query}'<BR>";
            $system_message = $system_message . $error_message;
            IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
        }
    }
}
runQuery();
//check permissions if necessary...
$have_write_permission = false;
switch ($_GET['target']) {
    case "guardian":
        while ($guardian_row = mysql_fetch_array($target_result)) {
            $our_permission = getStudentPermission($guardian_row['student_id']);
            if ($our_permission != "WRITE" && $our_permission != "ASSIGN" && $our_permission != "ALL") {
                //we don't have permission...
                //do nothing.
            } else {
                $have_write_permission = true;
            }
        }
        break;
}
if (!$have_write_permission) {
    $system_message = $system_message . "You do not have permission to view this page (IP: " . $_SERVER['REMOTE_ADDR'] . ")";
    IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
    require IPP_PATH . 'security_error.php';
    exit;
}
开发者ID:Byrnesz,项目名称:MyIEP,代码行数:31,代码来源:edit_address.php


示例3: failed

    $error_message = $error_message . "Database query failed (" . __FILE__ . ":" . __LINE__ . "): " . mysql_error() . "<BR>Query: '{$previous_guardians_query}'<BR>";
    $system_message = $system_message . $error_message;
    IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
}
//reevaluate our permissions for this student...
$our_permission = getStudentPermission($_GET['student_id']);
if ($our_permission != "READ" && $our_permission != "WRITE" && $our_permission != "ASSIGN" && $our_permission != "ALL") {
    //we don't have permission...
    $system_message = $system_message . "You do not have permission to view this page (IP: " . $_SERVER['REMOTE_ADDR'] . ")";
    IPP_LOG($system_message, $_SESSION['egps_username'], 'ERROR');
    require IPP_PATH . 'security_error.php';
    exit;
}
//check permissions if necessary...
$have_write_permission = false;
$our_permission = getStudentPermission($_GET['student_id']);
if ($our_permission != "WRITE" && $our_permission != "ASSIGN" && $our_permission != "ALL") {
    //we don't have write permission...
    //do nothing.
} else {
    $have_write_permission = true;
}
?>
 

<!DOCTYPE HTML>
<HTML lang=en>
<HEAD>
    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
    <TITLE><?php 
echo $page_title;
开发者ID:Byrnesz,项目名称:MyIEP,代码行数:31,代码来源:guardian_view.php


示例4: while

if ($iLimit + $iCur < $szTotalStudents) {
    echo "<td align=\"right\"><a href=\"./student_archive.php?iCur=" . ($iCur + $iLimit) . "&iLimit={$iLimit}&szSearchVal=" . $_GET['szSearchVal'] . "&field=" . $_GET['field'] . "&SEARCH=" . $_GET['SEARCH'] . "\" class=\"default\">next ";
    if ($sqlLogTotals - ($iCur + $iLimit) > $iLimit) {
        echo $iLimit . "</td>";
    } else {
        echo $szTotalStudents - ($iCur + $iLimit) . "</td>";
    }
} else {
    echo "<td>&nbsp;</td>";
}
echo "</tr>\n";
//end print next and prev links
//print the header row...
echo "<tr><td bgcolor=\"#E0E2F2\">&nbsp;</td><td align=\"center\" bgcolor=\"#E0E2F2\">UID</td><td align=\"center\" bgcolor=\"#E0E2F2\">Last Name, First Name</td><td align=\"center\" bgcolor=\"#E0E2F2\">School</td><td align=\"center\" bgcolor=\"#E0E2F2\">Permission</td></tr>\n";
while ($student_row = mysql_fetch_array($sqlStudents)) {
    $current_student_permission = getStudentPermission($student_row['student_id']);
    echo "<tr>\n";
    $school_colour = "#FFFFFF";
    //all white.
    echo "<td bgcolor=\"{$school_colour}\"><input type=\"checkbox\" name=\"" . $student_row['student_id'] . "\" value=\"" . $student_row['first_name'] . " " . $student_row['last_name'] . "\"></td>";
    echo "<td bgcolor=\"{$bgcolor}\" class=\"row_default\">" . $student_row['student_id'] . "<p></td>\n";
    echo "<td bgcolor=\"{$bgcolor}\"><a href=\"" . IPP_PATH . "student_view.php?student_id=" . $student_row['student_id'] . "\" class=\"default\" ";
    if ($current_student_permission == "NONE" || $current_student_permission == "ERROR") {
        echo "onClick=\"return noPermission();\" ";
    }
    echo ">" . $student_row['last_name'] . "," . $student_row['first_name'] . "</a>";
    if ($current_student_permission == "READ" || $current_student_permission != "WRITE" || $current_student_permission != "ALL") {
        echo "<a href=\"" . IPP_PATH . "ipp_pdf.php?student_id=" . $student_row['student_id'] . "\" class=\"default\" target=\"_blank\"";
        if ($current_student_permission == "NONE" || $current_student_permission == "ERROR") {
            echo "onClick=\"return noPermission();\" ";
        }
开发者ID:Byrnesz,项目名称:MyIEP,代码行数:31,代码来源:student_archive.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getStyle函数代码示例发布时间:2022-05-15
下一篇:
PHP getStringFromServer函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap