<?php

/* Include Files *********************/
require_once "../../libs/env.php";
require_once "authUtils.php";
/*************************************/
// If the user isn't logged in, send to the login page.
if ($login_state != DELPHI_LOGGED_IN && $login_state != DELPHI_REG_PENDING) {
    header('Location: ' . $CFG->wwwroot . '/modules/auth/login.php?redir=' . $_SERVER['REQUEST_URI']);
    die;
}
$t->assign('page_title', 'PAHMA/Delphi: Edit Permission Definitions');
$opmsg = "";
// This needs to verify perms.
if (!currUserHasPerm('EditPerms')) {
    $opmsg = "You do not have rights to Edit permissions. <br />\r\n\t\tPlease contact your Delphi administrator for help.";
    $t->assign('perm_error', $opmsg);
    $t->display('adminPermissions.tpl');
    die;
}
$style_block = "<style>\r\ntd.title { border-bottom: 2px solid black; font-weight:bold; text-align:left; \r\n\t\tfont-style:italic; color:#777777; }\r\ntd.perm_label { font-weight:bold; color:#61615f; }\r\ntd.permname { font-weight:bold; }\r\ntd.perm { border-bottom: 1px solid black; }\r\ntd.permdesc textarea { font-family: Arial, Helvetica, sans-serif; }\r\nform.form_row  { padding:0px; margin:0px;}\r\n</style>";
$t->assign("style_block", $style_block);
$themebase = $CFG->wwwroot . '/themes/' . $CFG->theme;
$script_block = '
<script type="text/javascript" src="' . $themebase . '/scripts/setupXMLHttpObj.js"></script>
<script>

// The ready state change callback method that waits for a response.
function updatePermRSC() {
  if (xmlhttp.readyState==4) {
		if( xmlhttp.status == 200 ) {
<?php

/* Include Files *********************/
require_once "../../libs/env.php";
require_once "authUtils.php";
/*************************************/
// If the user isn't logged in, send to the login page.
if ($login_state != DELPHI_LOGGED_IN && $login_state != DELPHI_REG_PENDING) {
    header('Location: ' . $CFG->wwwroot . '/modules/auth/login.php?redir=' . $_SERVER['REQUEST_URI']);
    die;
}
$t->assign('page_title', 'PAHMA/Delphi: Edit Role Definitions');
// This needs to verify perms.
if (!currUserHasPerm('EditRoles')) {
    $opmsg = "You do not have rights to Edit roles. <br />\r\n\t\tPlease contact your Delphi administrator for help.";
    $t->assign('perm_error', $opmsg);
    $t->display('adminPermissions.tpl');
    die;
}
$style_block = "<style>\r\ntd.title { border-bottom: 2px solid black; font-weight:bold; text-align:left; \r\n\t\tfont-style:italic; color:#777777; }\r\ntd.label { font-weight:bold; }\r\ntd.rolename { font-weight:bold; }\r\ntd.role { border-bottom: 1px solid black; }\r\ntd.roledesc textarea { font-family: Arial, Helvetica, sans-serif; }\r\nform.form_row  { padding:0px; margin:0px;}\r\n</style>";
$t->assign("style_block", $style_block);
$themebase = $CFG->wwwroot . '/themes/' . $CFG->theme;
$script_block = '
<script type="text/javascript" src="' . $themebase . '/scripts/setupXMLHttpObj.js"></script>
<script>

// The ready state change callback method that waits for a response.
function updateRoleRSC() {
  if (xmlhttp.readyState==4) {
		if( xmlhttp.status == 200 ) {
			// Maybe this should change the cursor or something
<?php

/* Include Files *********************/
require_once "../../libs/env.php";
/*************************************/
// If the user isn't logged in, send to the login page.
if ($login_state != DELPHI_LOGGED_IN && $login_state != DELPHI_REG_PENDING) {
    header('Location: ' . $CFG->wwwroot . '/modules/auth/login.php?redir=' . $_SERVER['REQUEST_URI']);
    die;
}
$t->assign('page_title', 'PAHMA/Delphi: Add Complex Inference');
$opmsg = "";
// This needs to verify perms.
if (!currUserHasPerm('EditInferences')) {
    $opmsg = "You do not have rights to Edit inferences. <br />\r\n\t\tPlease contact your Delphi administrator for help.";
    $t->assign('addinf_error', $opmsg);
    $t->display('addInference.tpl');
    die;
}
$themebase = $CFG->wwwroot . '/themes/' . $CFG->theme;
$style_block = '
<link rel="stylesheet" href="' . $themebase . '/style/jquery.autocomplete.css" type="text/css">
<style>
.nochoice {color:#888; }
.intro {font-size:0.9em; font-weight:bold;  margin-bottom:0;}
.up {margin-bottom: 0.1em; }
.label {font-weight:bold; margin-bottom:0;}
#formCont {padding:0px 30px; }
#table1 {padding:10px; border: solid 1px black;}
#table1 td {padding:4px; }
#table1 .label {font-size:0.9em; }
<?php

/* Include Files *********************/
require_once "../../libs/env.php";
require_once "authUtils.php";
/*************************************/
// If the user isn't logged in, send to the login page.
if ($login_state != DELPHI_LOGGED_IN && $login_state != DELPHI_REG_PENDING) {
    header('Location: ' . $CFG->wwwroot . '/modules/auth/login.php?redir=' . $_SERVER['REQUEST_URI']);
    die;
}
$t->assign('page_title', 'PAHMA/Delphi: Edit User Roles');
// This needs to verify perms.
if (!currUserHasPerm('AssignRoles')) {
    $opmsg = "You do not have rights to Assign roles to users. <br />\r\n\t\tPlease contact your Delphi administrator for help.";
    $t->assign('perm_error', $opmsg);
    $t->display('adminPermissions.tpl');
    die;
}
$style_block = "<style>\r\ntd.title { border-bottom: 2px solid black; font-weight:bold; \r\n\t\tfont-style:italic; color:#777777; }\r\ntd.label { font-weight:bold; }\r\ntd.role { border-bottom: 1px solid black; }\r\n</style>";
$t->assign("style_block", $style_block);
$themebase = $CFG->wwwroot . '/themes/' . $CFG->theme;
$script_block = '
<script type="text/javascript" src="' . $themebase . '/scripts/setupXMLHttpObj.js"></script>

<script>
var sess_login_id = ' . (isset($_SESSION['login_id']) ? $_SESSION['login_id'] : -1) . ';

// The ready state change callback method that waits for a response.
function setRoleForUserRSC() {
  if (xmlhttp.readyState==4) {
示例#5
0
<?php

require_once "../../libs/env.php";
require_once "../../libs/utils.php";
// If the user isn't logged in, send to the login page.
if ($login_state != DELPHI_LOGGED_IN && $login_state != DELPHI_REG_PENDING) {
    header('Location: ' . $CFG->wwwroot . '/modules/auth/login.php?redir=' . $_SERVER['REQUEST_URI']);
    die;
}
// TODO Update the perms for this.
if (!currUserHasPerm('EditNewsContent')) {
    $t->assign('heading', "Unauthorized Action.");
    $t->assign('message', "You do not have rights to edit news content. <br />\n\t\tPlease contact your Delphi administrator for help.");
    $t->display('error.tpl');
    die;
}
$id = -1;
$msg = array();
if (isset($_POST['submit'])) {
    /*
    	Skip this, allowing form user to clear the item, and stop the function.
    	if(empty($_POST['header']) || !strlen($_POST['header']) > 0){
    		array_push($msg, "You must enter a headline.");
    	}
    	if(empty($_POST['content']) || !strlen($_POST['content']) > 0){
    		array_push($msg, "You must enter a message.");
    	}
    */
    $header = cleanFormData($_POST['header']);
    $content = cleanFormData($_POST['content']);
    $t->assign('header', $header);