Update of /cvsroot/helpmeict/Helpdesk/system
In directory sc8-pr-cvs17:/tmp/cvs-serv30400/Helpdesk/system
Modified Files:
security.php
Log Message:
Added Login form to AccessDenied() function and changed login so that the redirect works correctly.
Index: security.php
===================================================================
RCS file: /cvsroot/helpmeict/Helpdesk/system/security.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** security.php 11 Mar 2007 16:32:12 -0000 1.5
--- security.php 7 Sep 2007 00:02:26 -0000 1.6
***************
*** 41,45 ****
// Deny access to a user - use after sidebar has been displayed
function AccessDenied() {
! global $helpdeskdb, $_lang;
// Set Language
set_text_domain("security");
--- 41,45 ----
// Deny access to a user - use after sidebar has been displayed
function AccessDenied() {
! global $helpdeskdb, $_lang , $redirect;
// Set Language
set_text_domain("security");
***************
*** 47,51 ****
print "<h1>".gettext("Access Error")."</h1>\n";
print "<h2>".gettext("Either you do not have permission to access this page or you are not currently logged in.")."</h2>\n";
! print "<div class=\"block\" align=\"center\"><p>".sprintf(gettext('Please choose another option or %slog in%s as a user who does have permission to access the page.'), '<a href="index.php?redirect='.urlencode($_SERVER["REQUEST_URI"]).'">', '</a>')."</p></div>";
// Include
--- 47,88 ----
print "<h1>".gettext("Access Error")."</h1>\n";
print "<h2>".gettext("Either you do not have permission to access this page or you are not currently logged in.")."</h2>\n";
! print "<div class=\"block\" align=\"center\"><p> Please choose another option or log in as a user who does have permission to access the page. </p></div>";
! ?>
!
! <script language="javascript" type="text/javascript" src="system/forms.js"></script>
!
! <div class="block">
! <form id="login" method="post" class="login" action="login.php">
! <input name="redirect" type="hidden" value="<?php
! $redirect = basename($_SERVER['PHP_SELF']);
! if ($_SERVER['QUERY_STRING']) { $redirect = $redirect . "?" . $_SERVER['QUERY_STRING'];}
! echo $redirect;
! ?>" />
! <div class="labelfieldpair">
! <div class="name"><label for="user"><?php echo gettext("Username");?></label></div>
! <div class="value"><input name="user" id="user" type="text" size="15" maxlength="20" value="[username]" onfocus="focusElement(this)" onblur="blurElement(this)" /></div>
! </div>
! <div class="labelfieldpair">
! <div class="name"><label for="pass"><?php echo gettext("Password");?></label></div>
! <div class="value"><input type="password" name="password" id="pass" size="15" maxlength="20" /></div>
! </div>
! <div class="labelfieldpair">
! <div class="name"> </div>
! <div class="value"><input type="submit" value="<?php echo gettext("Login"); ?>" /></div>
! </div>
! </form>
! </div>
!
! <script language="javascript" type="text/javascript">
! //<![CDATA[
! <!--
!
! document.forms.login.user.focus();
!
! //-->
! //]]>
! </script>
!
! <?php
// Include
***************
*** 53,58 ****
exit;
}
!
!
!
! ?>
\ No newline at end of file
--- 90,92 ----
exit;
}
! ?>
|