فهرست منبع

Bugfix: when importing a lot of users that already exists then the warning message may become too long to pass through a get parameter.
An alternative through a session has now been put in place

Patrick Cool 15 سال پیش
والد
کامیت
030dfc9380
2فایلهای تغییر یافته به همراه11 افزوده شده و 7 حذف شده
  1. 7 7
      main/admin/user_import.php
  2. 4 0
      main/admin/user_list.php

+ 7 - 7
main/admin/user_import.php

@@ -335,6 +335,11 @@ if ($_POST['formSent'] AND $_FILES['import_file']['size'] !== 0) {
 		$error_message .= '</ul>';
 	}
 
+	// if the warning message is too long then we display the warning message trough a session
+	if (strlen($error_message) > 150){
+		$_SESSION['session_message_import_users'] = $error_message;
+		$error_message = 'session_message';
+	}
  
         Security::clear_token();
         $tok = Security::get_token();       
@@ -418,11 +423,6 @@ if ($count_fields > 0) {
 </blockquote>
 
 <?php
-
-
-/*
-==============================================================================
-		FOOTER
-==============================================================================
-*/
+// footer
 Display :: display_footer();
+?>

+ 4 - 0
main/admin/user_list.php

@@ -624,6 +624,10 @@ else
 			switch ($_GET['action']) {
 				case 'show_message' :
                     if (!empty($_GET['warn'])) {
+                    	// to prevent too long messages
+                    	if ($_GET['warn'] == 'session_message'){
+                    		$_GET['warn'] = $_SESSION['session_message_import_users'];
+                    	} 
                     	Display::display_warning_message(urldecode($_GET['warn']),false);
                     }
                     if (!empty($_GET['message'])) {