diff --git a/admin-dev/themes/default/template/controllers/login/content.tpl b/admin-dev/themes/default/template/controllers/login/content.tpl index 22c8658a8..bb455f992 100755 --- a/admin-dev/themes/default/template/controllers/login/content.tpl +++ b/admin-dev/themes/default/template/controllers/login/content.tpl @@ -102,9 +102,9 @@
{l s='For security reasons, you cannot connect to the Back Office until after you have:'}
{l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin123%d)' sprintf=$randomNb}
+{l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin%d)' sprintf=$randomNb}
{/if} diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index 6a12d8dc2..d98506b38 100755 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -71,16 +71,18 @@ class AdminLoginControllerCore extends AdminController if (file_exists(_PS_ADMIN_DIR_.'/../install')) $this->context->smarty->assign('wrong_folder_name', true); if (file_exists(_PS_ADMIN_DIR_.'/../admin')) - { + { $rand = sprintf('%04d', rand(0, 9999)); if (@rename(_PS_ADMIN_DIR_.'/../admin', _PS_ADMIN_DIR_.'/../admin'.$rand)) Tools::redirectAdmin('../admin'.$rand); else $this->context->smarty->assign(array( - 'randomNb' => rand(100, 999), 'wrong_folder_name' => true )); } + $this->context->smarty->assign(array( + 'randomNb' => rand(0, 9999) + )); // Redirect to admin panel if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect')))