Incorporated changes for release 1.3.2
This commit is contained in:
@@ -8,9 +8,14 @@
|
||||
*/
|
||||
|
||||
include("common.php");
|
||||
if (array_key_exists('print',$_REQUEST)) {
|
||||
$print=true;
|
||||
} else {
|
||||
$print=false;
|
||||
}
|
||||
|
||||
// redirect to index.php on cancel button press
|
||||
if ($_REQUEST['cancel']) {
|
||||
if (array_key_exists('cancel',$_REQUEST)) {
|
||||
header("Cache-Control:no-cache, must-revalidate");
|
||||
header("Pragma:no-cache");
|
||||
header("Location:index.php");
|
||||
@@ -30,7 +35,6 @@ if ($role != ADMIN) {
|
||||
}
|
||||
|
||||
// import incoming arrays
|
||||
$print=$_REQUEST['print'];
|
||||
if ($print) {
|
||||
// if printer friendly was clicked, values will be passed in serialized
|
||||
// form as "all_parameters" so we need to load those into $incoming[]
|
||||
@@ -40,45 +44,55 @@ if ($print) {
|
||||
$incoming=arrayCopy($_REQUEST);
|
||||
}
|
||||
|
||||
// load variables from incoming array
|
||||
$update_display=$incoming['update_display'];
|
||||
$display_appname=$incoming['display_appname'];
|
||||
$display_banner=$incoming['display_banner'];
|
||||
$display_footer=$incoming['display_footer'];
|
||||
$display_funchelp=$incoming['display_funchelp'];
|
||||
$display_device_term=$incoming['display_device_term'];
|
||||
$display_discovered_term=$incoming['display_discovered_term'];
|
||||
$display_discovered_term_short=$incoming['display_discovered_term_short'];
|
||||
$display_disc_drop_data=$incoming['display_disc_drop_data'];
|
||||
$display_functional_term=$incoming['display_functional_term'];
|
||||
$display_functional_term_short=$incoming['display_functional_term_short'];
|
||||
$display_functional_yes=$incoming['display_functional_yes'];
|
||||
$display_functional_no=$incoming['display_functional_no'];
|
||||
$display_functional_yes_short=$incoming['display_functional_yes_short'];
|
||||
$display_functional_no_short=$incoming['display_functional_no_short'];
|
||||
// extract incoming array keys into variables
|
||||
extract($incoming, EXTR_SKIP);
|
||||
/*
|
||||
* possible keys are:
|
||||
* update_display
|
||||
* display_appname
|
||||
* display_banner
|
||||
* display_footer
|
||||
* display_funchelp
|
||||
* display_device_term
|
||||
* display_discovered_term
|
||||
* display_discovered_term_short
|
||||
* display_disc_drop_data
|
||||
* display_functional_term
|
||||
* display_functional_term_short
|
||||
* display_functional_yes
|
||||
* display_functional_no
|
||||
* display_functional_yes_short
|
||||
* display_functional_no_short
|
||||
* update_colors
|
||||
* reset_colors
|
||||
* newbgc
|
||||
* newmbgc
|
||||
* newtc
|
||||
* newlc
|
||||
* newvlc
|
||||
* newhc
|
||||
* edit_banner
|
||||
* add_banner
|
||||
* update_banner
|
||||
* delete_banner
|
||||
* bnrid
|
||||
* bnrname
|
||||
* bnrcolor
|
||||
* bnrtxtcolor
|
||||
* update_misc
|
||||
* sessttl
|
||||
* logoutall
|
||||
*/
|
||||
|
||||
$update_colors=$incoming['update_colors'];
|
||||
$reset_colors=$incoming['reset_colors'];
|
||||
$newbgc=$incoming['newbgc'];
|
||||
$newmbgc=$incoming['newmbgc'];
|
||||
$newtc=$incoming['newtc'];
|
||||
$newlc=$incoming['newlc'];
|
||||
$newvlc=$incoming['newvlc'];
|
||||
$newhc=$incoming['newhc'];
|
||||
|
||||
$edit_banner=$incoming['edit_banner'];
|
||||
$add_banner=$incoming['add_banner'];
|
||||
$update_banner=$incoming['update_banner'];
|
||||
$delete_banner=$incoming['delete_banner'];
|
||||
$bnrid=$incoming['bnrid'];
|
||||
$bnrname=$incoming['bnrname'];
|
||||
$bnrcolor=$incoming['bnrcolor'];
|
||||
$bnrtxtcolor=$incoming['bnrtxtcolor'];
|
||||
|
||||
$update_misc=$incoming['update_misc'];
|
||||
$sessttl=$incoming['sessttl'];
|
||||
$sessdir=$incoming['sessdir'];
|
||||
$logoutall=$incoming['logoutall'];
|
||||
if (!isset($update_display)) $update_display=false;
|
||||
if (!isset($update_colors)) $update_colors=false;
|
||||
if (!isset($reset_colors)) $reset_colors=false;
|
||||
if (!isset($add_banner)) $add_banner=false;
|
||||
if (!isset($edit_banner)) $edit_banner=false;
|
||||
if (!isset($update_banner)) $update_banner=false;
|
||||
if (!isset($delete_banner)) $delete_banner=false;
|
||||
if (!isset($update_misc)) $update_misc=false;
|
||||
if (!isset($logoutall)) $logoutall=false;
|
||||
|
||||
// assign variables from constants
|
||||
$appname=APP_NAME;
|
||||
@@ -97,6 +111,8 @@ framework("begin","$appname","Configuration",$print);
|
||||
//var_dump($incoming);
|
||||
|
||||
// ******** begin database manipulation ********
|
||||
$nameunique_err=$namesuppld_err=$ttlsuppld_err=$dirsuppld_err=false;
|
||||
|
||||
if ($update_display) {
|
||||
// remove html tags from footer_message and sanitize
|
||||
$display_footer=strip_tags($display_footer);
|
||||
@@ -174,6 +190,7 @@ if ($add_banner) {
|
||||
// test for name supplied
|
||||
if (strlen(trim($bnrname))) {
|
||||
$namesuppld=true;
|
||||
$namesuppld_err=false;
|
||||
} else {
|
||||
$namesuppld=false;
|
||||
$namesuppld_err=true;
|
||||
@@ -184,6 +201,7 @@ if ($add_banner) {
|
||||
$nameunique_err=true;
|
||||
} else {
|
||||
$nameunique=true;
|
||||
$nameunique_err=false;
|
||||
}
|
||||
if ($namesuppld && $nameunique) {
|
||||
// sanitize banner name
|
||||
@@ -204,17 +222,19 @@ if ($edit_banner) {
|
||||
// test for name supplied
|
||||
if (strlen(trim($bnrname))) {
|
||||
$namesuppld=true;
|
||||
$namesuppld_err=false;
|
||||
} else {
|
||||
$namesuppld=false;
|
||||
$namesuppld_err=true;
|
||||
}
|
||||
// test for name unique
|
||||
if (mysqli_num_rows(mysqli_query($db,"select bannerid from banners where bannername=\"$bnrname\" and bannerid!=\"$bnrid\""))) {
|
||||
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\" and bannerid!=\"$bnrid\""))) {
|
||||
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\""))) {
|
||||
$nameunique=false;
|
||||
$nameunique_err=true;
|
||||
} else {
|
||||
$nameunique=true;
|
||||
$nameunique_err=false;
|
||||
}
|
||||
} else {
|
||||
$nameunique=true;
|
||||
@@ -246,20 +266,8 @@ if ($update_misc) {
|
||||
$ttlsuppld=false;
|
||||
$ttlsuppld_err=true;
|
||||
}
|
||||
// test for sessdir supplied
|
||||
if (strlen(trim($sessdir))) {
|
||||
$dirsuppld=true;
|
||||
} else {
|
||||
$dirsuppld=false;
|
||||
$dirsuppld_err=true;
|
||||
}
|
||||
if ($ttlsuppld && $dirsuppld) {
|
||||
if ($ttlsuppld) {
|
||||
mysqli_query($drs_db,"update config set value=\"$sessttl\" where name=\"session_ttl_days\"");
|
||||
if ($ostype == 'WIN') {
|
||||
mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"win_server_session_dir\"");
|
||||
} else {
|
||||
mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"unix_server_session_dir\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,17 +544,10 @@ echo "
|
||||
<form method=\"post\" action=\"config.php#miscellaneous\">
|
||||
";
|
||||
if ($ttlsuppld_err) format_message(1,"Session expiration time cannot be blank.");
|
||||
if ($dirsuppld_err) format_message(1,"Server session file directory cannot be blank.");
|
||||
$curttl=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"session_ttl_days\""))[0];
|
||||
if ($ostype == 'WIN') {
|
||||
$curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0];
|
||||
} else {
|
||||
$curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0];
|
||||
}
|
||||
echo "
|
||||
<font size=\"+1\"><b>Miscellaneous Configuration Parameters</b></font><br><br><br><br>
|
||||
Session expiration time (users will have to log in again after this long) : <input type=\"text\" name=\"sessttl\" size=\"3\" value=\"$curttl\"> days<br><br>
|
||||
Server session file directory (must be writable by the web server process) : <br><input type=\"text\" name=\"sessdir\" size=\"40\" value=\"$curssdir\"><br><br>
|
||||
Force logout of all users <input type=\"checkbox\" name=\"logoutall\"><br><br><br><br>
|
||||
<input type=\"submit\" name=\"update_misc\" value=\"Update Options\">
|
||||
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br>
|
||||
|
||||
Reference in New Issue
Block a user