Various reformats. Changed boolean variables from 1/0 to TRUE/FALSE in multiple files.
This commit is contained in:
@@ -11,55 +11,53 @@
|
||||
$today = date("Y-m-d");
|
||||
$now = date("H:i:s");
|
||||
|
||||
$sttl=mysqli_fetch_row(mysqli_query($db,"select confvalue from configs where confname=\"session_ttl_days\""))[0];
|
||||
$ostype=strtoupper(substr(php_uname('s'), 0, 3));
|
||||
$sttl = mysqli_fetch_row(mysqli_query($db, "select confvalue from configs where confname=\"session_ttl_days\""))[0];
|
||||
$ostype = strtoupper(substr(php_uname('s'), 0, 3));
|
||||
if ($ostype == 'WIN') {
|
||||
$sdir=mysqli_fetch_row(mysqli_query($db,"select confvalue from configs where confname=\"win_server_session_dir\""))[0];
|
||||
$sdir = mysqli_fetch_row(mysqli_query($db, "select confvalue from configs where confname=\"win_server_session_dir\""))[0];
|
||||
} else {
|
||||
$sdir=mysqli_fetch_row(mysqli_query($db,"select confvalue from configs where confname=\"unix_server_session_dir\""))[0];
|
||||
$sdir = mysqli_fetch_row(mysqli_query($db, "select confvalue from configs where confname=\"unix_server_session_dir\""))[0];
|
||||
}
|
||||
$lifetime=60 * 60 * 24 * $sttl;
|
||||
$lifetime = 60 * 60 * 24 * $sttl;
|
||||
if (!is_dir($sdir)) mkdir($sdir, 0700, true);
|
||||
ini_set('session.cookie_lifetime', $lifetime);
|
||||
ini_set('session.gc_maxlifetime', $lifetime);
|
||||
ini_set('session.save_path', $sdir);
|
||||
|
||||
$ss=session_status();
|
||||
if ($ss==PHP_SESSION_NONE) session_start();
|
||||
$ss = session_status();
|
||||
if ($ss == PHP_SESSION_NONE) session_start();
|
||||
|
||||
// get config options from database and assign them to constants
|
||||
unset($techid);
|
||||
if (isset($_SESSION['login']) && $_SESSION['login'] != '') {
|
||||
$techid=$_SESSION['login'];
|
||||
$techid = $_SESSION['login'];
|
||||
}
|
||||
|
||||
$configqry=mysqli_query($db,"select confname,confvalue,confid from configs");
|
||||
$configqry = mysqli_query($db, "select confname,confvalue,confid from configs");
|
||||
while ($configrow = mysqli_fetch_assoc($configqry)) {
|
||||
$constname=strtoupper($configrow["confname"]);
|
||||
$constname = strtoupper($configrow["confname"]);
|
||||
if (isset($techid)) {
|
||||
$confid=$configrow["confid"];
|
||||
$custqry=mysqli_query($db,"select customconfvalue from customs where customconfnum=\"$confid\" and customtech=\"$techid\"");
|
||||
$confid = $configrow["confid"];
|
||||
$custqry = mysqli_query($db, "select customconfvalue from customs where customconfnum=\"$confid\" and customtech=\"$techid\"");
|
||||
if (mysqli_num_rows($custqry)) {
|
||||
$custrow=mysqli_fetch_row($custqry);
|
||||
$custval=$custrow[0];
|
||||
$custrow = mysqli_fetch_row($custqry);
|
||||
$custval = $custrow[0];
|
||||
} else {
|
||||
unset($custval);
|
||||
}
|
||||
}
|
||||
if (isset($custval)) {
|
||||
$constvalue=$custval;
|
||||
$constvalue = $custval;
|
||||
} else {
|
||||
$constvalue=$configrow["confvalue"];
|
||||
$constvalue = $configrow["confvalue"];
|
||||
}
|
||||
define("$constname","$constvalue");
|
||||
define("$constname", "$constvalue");
|
||||
}
|
||||
|
||||
// error reporting
|
||||
$logerrors=LOG_ERRORS;
|
||||
if ($logerrors==1) {
|
||||
$logerrors = LOG_ERRORS;
|
||||
if ($logerrors == 1) {
|
||||
error_reporting(E_ALL);
|
||||
} else {
|
||||
error_reporting(0);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user