summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb68056)
raw | patch | inline | side by side (parent: bb68056)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Nov 2006 06:50:49 +0000 (06:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Nov 2006 06:50:49 +0000 (06:50 +0000) |
Cause some actions will be done twice in this case, like moving/deleting objects... or creating a freeze
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5213 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5213 594d385d-05f5-0310-b6e9-bd551577e9d8
html/main.php | patch | blob | history |
diff --git a/html/main.php b/html/main.php
index e03e40b75cb59304a537581e8d8ab311df90eee9..fe1ae9684033fc841628333d170fcce779b95149 100644 (file)
--- a/html/main.php
+++ b/html/main.php
}
$config= $_SESSION['config'];
-
/* Check for invalid sessions */
if(empty($_SESSION['_LAST_PAGE_REQUEST'])){
$_SESSION['_LAST_PAGE_REQUEST']= time();
$start = microtime();
+
+/* Check if the user has used the browsers back button,
+ and display a warning, because using the back button could cause strange things
+ like tagging twice, moving an object twice ... */
+if(!isset($_SESSION['back_button_test'])){
+ $_SESSION['back_button_test'] = 0;
+}
+if(isset($_POST['back_button_test']) && $_POST['back_button_test'] != $_SESSION['back_button_test']){
+ print_red(_("Please don't use the browsers 'back' button. This causes GOsa to perform your last request again and this could lead into some strange situations."));
+}
+
+
+/* check if we are using account expiration */
+if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) &&
+ preg_match('/true/i', $config->data['MAIN']['ACCOUNT_EXPIRATION'])){
+
+ $expired= ldap_expired_account($config, $ui->dn, $ui->username);
+
+ if ($expired == 2){
+ gosa_log ("password for user \"$ui->username\" is about to expire");
+ print_red(_("Your password is about to expire, please change your password"));
+ }
+}
+
/* Load plugin */
if (is_file("$plugin_dir/main.inc")){
require_once ("$plugin_dir/main.inc");
exit();
}
-/* Close div/tables */
-
- /* check if we are using account expiration */
- if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) &&
- preg_match('/true/i', $config->data['MAIN']['ACCOUNT_EXPIRATION'])){
-
- $expired= ldap_expired_account($config, $ui->dn, $ui->username);
-
- if ($expired == 2){
- gosa_log ("password for user \"$ui->username\" is about to expire");
- print_red(_("Your password is about to expire, please change your password"));
- }
- }
-
/* Print_out last ErrorMessage repeated string. */
print_red(NULL);
-$smarty->assign("contents", $display.get_MicroTimeDiff($start,microtime()));
+/* Second part of browser 'back button used' check */
+$_SESSION['back_button_test'] ++;
+$bb = "<input type='hidden' name='back_button_test' value='".$_SESSION['back_button_test']."'>";
+$smarty->assign("contents", $bb.$display.get_MicroTimeDiff($start,microtime()));
+/* Assign erros to smarty */
if (isset($_SESSION['errors'])){
$smarty->assign("errors", $_SESSION['errors']);
}