DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Other extensions  
DwZone Forum Index -> Other extensions
.
Moderators: AdministratorsModerators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 21 to 30 of 82 (Total: 81) First |  Prev |  Next |  Last  
 Subject Author Date  
   Re: Site Security  
View this persons public profile  MatthewKing   11:18 13 Apr 2017  
   Re: Site Security  
View this persons public profile  Gianluigi   13:12 13 Apr 2017  
   Re: Site Security  
View this persons public profile  MatthewKing   13:30 13 Apr 2017  
   Re: Site Security  
View this persons public profile  Gianluigi   13:36 13 Apr 2017  
    Re: Site Security  
View this persons public profile  MatthewKing   14:12 13 Apr 2017  
 
Ok - I created a test page just for this. here it is:

<?php
//*************************
// http://www.DwZone-it.com
// DwZone security - start
// Version 1.0.16
//*************************
require_once('../../dwzSiteSecurity/dwzSiteSecurity.php');
$dwzSecurity = new dwzSiteSecurity();
$dwzSecurity->Init();
$dwzSecurity->SetRule("Maintenance");
$dwzSecurity->SetRedirect("/transcripts/user/home/accessdenied.php");
$dwzSecurity->Execute();
//*************************
// DwZone security - end
//*************************
?>
<?php require_once('../../Connections/mytx.php'); ?>
<?php
if (isset($_GET["CampusCode"])) {
$_SESSION["CampusCode"] = $_GET["CampusCode"];
} else {
if (!isset($_SESSION["CampusCode"])) {
$_SESSION["CampusCode"] = 1;
}
}
?>
<?php
if (!function_exists("GetSQLiValueString")) {
function GetSQLiValueString($theConnection, $theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string($theConnection, $theValue) : mysqli_escape_string($theConnection, $theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
//**************************
// ProfRecWiz - MySqli
// http://www.dwzone-it.com
// Version: 1.0.12
//**************************
mysqli_select_db($mytx, $database_mytx);
$mysqli_getCampuses_query = "SELECT mstcampus.CampusCode, mstcampus.Campus FROM mstcampus WHERE CampusCode IN (SELECT CampusCode FROM m2m_users_campuses WHERE UserID = ".$_SESSION['UserID'].") ORDER BY mstcampus.CampusCode Asc";
$getCampuses = mysqli_query($mytx, $mysqli_getCampuses_query) or die(mysqli_error($mytx));
$row_getCampuses = mysqli_fetch_assoc($getCampuses);
$totalRows_getCampuses = mysqli_num_rows($getCampuses);
//**************************
// ProfRecWiz - MySqli
//**************************
?>
<?php
$campusArray = array();
if ($totalRows_getCampuses) {
do {
$campusArray[dwzGetRecValue('getCampuses','CampusCode')] = dwzGetRecValue('getCampuses','Campus');
} while($row_getCampuses = mysqli_fetch_assoc($getCampuses));
}
?>
<!doctype html>
<html><!-- InstanceBegin template="/Templates/home.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<title>Transcripts</title>
<?php
//************************
// Advanced Form Controls
//************************
require_once("../../dwzFormControls/FormControl.php");

echo "<link href=\"../../dwzFormControls/Calendar/skins/calendar_system.css\" rel=\"stylesheet\" type=\"text/css\" >";
?>
<link href="../../css/main.css" rel="stylesheet" type="text/css">
<link href="../../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../../js/ajaxgold.js"></script>
<script type="text/javascript" src="../../js/event.js"></script>
<script type="text/javascript" src="../../js/validateDate.js"></script>
<script src="../../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script language="javascript" src="../../dwzFormControls/Calendar/Js/calendar.js" type="text/javascript"></script>
<script language="javascript" src="../../dwzFormControls/Calendar/lang/calendar-en.js" type="text/javascript"></script>
<script type="text/javascript">
<!-- Original: Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Take user here after session timed out
timedouturl = "../../logout.php";

function Minutes(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(0, i));
}
function Seconds(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(i + 1, data.length));
}
function Display(min, sec) {
var disp;
if (min <= 9) disp = " 0";
else disp = " ";
disp += min + ":";
if (sec <= 9) disp += "0" + sec;
else disp += sec;
return (disp);
}
function Down() {
sec--;
if (sec == -1) { sec = 59; min--; }
document.getElementById('clock').value = Display(min, sec);
window.status = "Session will time out in: " + Display(min, sec);
if (min == 0) {
document.getElementById('clockdisplay').style.color = "red";
document.getElementById('clock').style.color = "red";
}
if (min == 1 & sec == 0) {
stimer = window.open("../../sessiontimer.html", "sessiontimer", "status=0, toolbar=0, menubar=0, directories=0, resizable=0, scrollbars=0, height=200, width=200");
}
if (min == 0 && sec == 0) {
alert("Your session has timed out.");
stimer.close();
window.location.href = timedouturl;
} else {
down = setTimeout("Down()", 1000);
}
}
function timeIt() {
min = 1 * Minutes(document.getElementById('clock').value);
sec = 0 + Seconds(document.getElementById('clock').value);
Down();
}
function selectCampusCode(c) {
//var x = window.location.toString;
var t = window.location.href;
var temp = new Array();
temp = t.split('?');
var params = '?';
if (temp[1]) {
params = "?" + temp[1] + "&";
}
window.location.href=temp[0] + params + "CampusCode=" + c;
}
// End -->
</script>
<!-- InstanceBeginEditable name="Body Load Functions" -->
<script type="text/javascript">
function bodyLoad() {
//Body On Load Events
}
</script>
<!-- InstanceEndEditable -->
<link rel="shortcut icon" href="../../iotfavicon.ico" />
</head>
<body onLoad="timeIt();bodyLoad()">
<div id="container">
<div id="menu">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#">Inquiries</a> </li>
<li><a href="#">Enrollment</a></li>
<li><a href="#">Grades</a> </li>
<li><a href="#">Attendance</a></li>
<li><a href="#">Financial Aid</a></li>
<li><a href="#">Accounting</a> </li>
<li><a href="#">Scheduling</a></li>
<li><a href="#">Placement</a></li>
<li><a href="#">Student Reports</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Maintenance</a>
<ul>
<li><a href="#" class="MenuBarItemSubmenu">General</a>
<ul>
<li><a href="campuses.php">Campuses</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Security</a>
<ul>
<li><a href="users.php">Users</a></li>
<li><a href="roles.php">User Roles</a></li>
</ul>
</li>
<li><a href="tester.php">security test</a></li>
</ul>
</li>
</ul>
</div>
<div id="rightbox">
<?php
$UserFullName = '';
$UserRole = '';
mysqli_select_db($mytx, $database_mytx);
$qry = "SELECT mstusers.UserFullName, mstroles.`Role` FROM mstusers INNER JOIN mstroles ON mstusers.RoleCode = mstroles.RoleCode WHERE mstusers.UserID = ".$_SESSION['UserID']."";
$res = mysqli_query($mytx,$qry) or die(mysqli_error($mytx));
$UserFullName = mysqli_result($res,0,'UserFullName');
$UserRole = mysqli_result($res,0,'Role');
mysqli_free_result($res);
?>
<table width="150" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="center"><span class="smalltext"><?php echo $UserFullName; ?></span></td>
</tr>
<tr>
<td align="center" class="smalltext"><?php echo $UserRole; ?></td>
</tr>
<tr>
<td align="center" class="smalltext">MM_Username: <?php echo $_SESSION['MM_Username']; ?></td>
</tr>
<tr>
<td align="center"><a href="../home/myaccount.php">My Account</a> <span class="smalltext">|</span> <a href="../../logout.php">Log Out</a></td>
</tr>
<tr>
<td>Campus:<br>
<select name="CampusCodeSelect" id="CampusCodeSelect" style="width:140px" onChange="selectCampusCode(this.value)">
<?php
foreach ($campusArray as $cID=>$campus) {
$selected = '';
if ($cID == $_SESSION['CampusCode']) {
$selected = 'selected="selected"';
}
echo '<option value="'.$cID.'" '.$selected.'>'.$campus.'</option>';
}
?>
</select></td>
</tr>
<tr>
<td><span id="clockdisplay">Session Timer: 
<input type="text" id="clock" name="clock" size="5" value="20:00">
</span></td>
</tr>
</table>
<br />
<div id="calendar" align="center" style="width:140px"></div>
</div>
<div id="content"><!-- InstanceBeginEditable name="Main Content" -->Content for id "content" Goes Here<!-- InstanceEndEditable --></div>
</div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
<!-- InstanceEnd --></html>
<?php
//**************************
// ProfRecWiz - MySqli
//**************************
mysqli_free_result($getCampuses);
//**************************
// ProfRecWiz - MySqli
//**************************
?>
<?php
//**************************
// ProfRecWiz
//**************************
function dwzGetRecValue($rec, $field){
if(isset($GLOBALS['row_'.$rec])){
return $GLOBALS['row_'.$rec][$field];
}else{
return $rec .'.' .$field;
}
}
//**************************
// ProfRecWiz
//**************************
?>

 
Reply to this current thread  View this persons public profile  Send Private Message
   Re: Site Security  
View this persons public profile  Gianluigi   14:19 13 Apr 2017  
   Re: Site Security  
View this persons public profile  MatthewKing   14:32 13 Apr 2017  
   Re: Site Security  
View this persons public profile  Gianluigi   14:42 13 Apr 2017  
   Re: Site Security  
View this persons public profile  MatthewKing   15:01 13 Apr 2017  
   Re: Site Security  
View this persons public profile  Gianluigi   2:06 16 Apr 2017  
Last Visit: Sunday 22 Dec, 2024 2:52 am First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-1

Jump to: