[-] BO : Fix bug #PSCFV-8626 rename actual admin folder
This commit is contained in:
@@ -22,91 +22,79 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
var there_are = '{l s='There are'}';
|
||||
var there_is = '{l s='There is'}';
|
||||
var label_errors = '{l s='errors'}';
|
||||
var label_error = '{l s='error'}';
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
<div id="error" {if !isset($errors)}class="hide"{/if}>
|
||||
{if isset($errors)}
|
||||
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
|
||||
<ol style="margin: 0 0 0 20px;">
|
||||
{foreach from=$errors item="error"}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
<br />
|
||||
{if isset($warningSslMessage)}
|
||||
<div class="warn">
|
||||
{$warningSslMessage}
|
||||
</div>
|
||||
{/if}
|
||||
<div id="login">
|
||||
<h1>{$shop_name}</h1>
|
||||
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
|
||||
<form action="#" id="login_form" method="post">
|
||||
<div class="field">
|
||||
<label for="email">{l s='Email address:'}</label>
|
||||
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="passwd">{l s='Password:'}</label>
|
||||
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
|
||||
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
|
||||
</form>
|
||||
|
||||
<form action="#" id="forgot_password_form" method="post" class="hide">
|
||||
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
|
||||
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
|
||||
|
||||
<div class="field">
|
||||
<label>{l s='Email address:'}</label>
|
||||
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
|
||||
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-login-form">{l s='Back to login'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
{else}
|
||||
<div class="padding-30">
|
||||
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
|
||||
<ul>
|
||||
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. /admin%d)' sprintf=$randomNb}</li>{/if}
|
||||
</ul>
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<p>{l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin%d)' sprintf=$randomNb}</p>{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<h2><a href="http://www.prestashop.com">© 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var there_are = '{l s='There are'}';
|
||||
var there_is = '{l s='There is'}';
|
||||
var label_errors = '{l s='errors'}';
|
||||
var label_error = '{l s='error'}';
|
||||
</script>
|
||||
<div id="container">
|
||||
<div id="error" {if !isset($errors)}class="hide"{/if}>
|
||||
{if isset($errors)}
|
||||
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
|
||||
<ol style="margin: 0 0 0 20px;">
|
||||
{foreach from=$errors item="error"}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
<br />
|
||||
{if isset($warningSslMessage)}
|
||||
<div class="warn">{$warningSslMessage}</div>
|
||||
{/if}
|
||||
<div id="login">
|
||||
<h1>{$shop_name}</h1>
|
||||
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
|
||||
<form action="#" id="login_form" method="post">
|
||||
<div class="field">
|
||||
<label for="email">{l s='Email address:'}</label>
|
||||
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="passwd">{l s='Password:'}</label>
|
||||
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
|
||||
</form>
|
||||
<form action="#" id="forgot_password_form" method="post" class="hide">
|
||||
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
|
||||
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
|
||||
<div class="field">
|
||||
<label>{l s='Email address:'}</label>
|
||||
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-login-form">{l s='Back to login'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
{else}
|
||||
<div class="padding-30">
|
||||
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
|
||||
<ul>
|
||||
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. /%s)' sprintf=$randomNb}</li>{/if}
|
||||
</ul>
|
||||
<p><a href="{$adminUrl|escape:'htmlall':'UTF-8'}">{l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}</a></p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<h2><a href="http://www.prestashop.com">© 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
|
||||
</div>
|
||||
@@ -22,33 +22,31 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
{if $display_footer}
|
||||
{hook h="displayBackOfficeFooter"}
|
||||
<div id="footer">
|
||||
<div class="footerLeft">
|
||||
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a><br />
|
||||
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
||||
</div>
|
||||
{if $display_footer}
|
||||
{hook h="displayBackOfficeFooter"}
|
||||
<div id="footer">
|
||||
<div class="footerLeft">
|
||||
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a><br />
|
||||
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
||||
</div>
|
||||
<div class="footerRight">
|
||||
{if $iso_is_fr}
|
||||
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h à 18h
|
||||
{/if}
|
||||
| <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|
||||
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
||||
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
|
||||
</div>
|
||||
<div class="footerRight">
|
||||
{if $iso_is_fr}
|
||||
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h à 18h
|
||||
{/if}
|
||||
| <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|
||||
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
||||
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax_confirmation" style="display:none"></div>
|
||||
{* ajaxBox allows*}
|
||||
<div id="ajaxBox" style="display:none"></div>
|
||||
{/if}
|
||||
<div id="scrollTop"><a href="#top"></a></div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
<div id="ajax_confirmation" style="display:none"></div>
|
||||
{* ajaxBox allows*} <div id="ajaxBox" style="display:none"></div>
|
||||
{/if}
|
||||
<div id="scrollTop"><a href="#top"></a></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -82,7 +82,6 @@
|
||||
<script type="text/javascript" src="{$js_uri}"></script>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_dir}favicon.ico" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$img_dir}favicon.ico" />
|
||||
{if isset($displayBackOfficeHeader)}
|
||||
@@ -91,16 +90,15 @@
|
||||
<!--[if IE]>
|
||||
<link type="text/css" rel="stylesheet" href="{$base_url}css/admin-ie.css" />
|
||||
<![endif]-->
|
||||
{if isset($brightness)}
|
||||
{if isset($brightness)}
|
||||
<style type="text/css">
|
||||
div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess {ldelim}color:{$brightness}{rdelim}
|
||||
</style>
|
||||
{/if}
|
||||
{/if}
|
||||
</head>
|
||||
<body style="{if isset($bo_color) && $bo_color}background:{$bo_color};{/if}{if isset($bo_width) && $bo_width > 0}text-align:center;{/if}">
|
||||
{if $display_header}
|
||||
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
|
||||
|
||||
<div id="top_container" {if $bo_width > 0}style="margin:auto;width:{$bo_width}px"{/if}>
|
||||
<div id="container">
|
||||
{* begin HEADER *}
|
||||
@@ -108,7 +106,7 @@
|
||||
<div id="header_infos">
|
||||
<a id="header_shopname" href="{$link->getAdminLink('AdminHome')|escape:'htmlall':'UTF-8'}"><span>{$shop_name}</span></a>
|
||||
<div id="notifs_icon_wrapper">
|
||||
{if {$show_new_orders} == 1}
|
||||
{if {$show_new_orders} == 1}
|
||||
<div id="orders_notif" class="notifs">
|
||||
<span id="orders_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="orders_notif_value">0</span>
|
||||
@@ -120,8 +118,8 @@
|
||||
<p><a href="index.php?controller=AdminOrders&token={getAdminToken tab='AdminOrders'}">{l s='Show all orders'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if ($show_new_customers == 1)}
|
||||
{/if}
|
||||
{if ($show_new_customers == 1)}
|
||||
<div id="customers_notif" class="notifs notifs_alternate">
|
||||
<span id="customers_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="customers_notif_value">0</span>
|
||||
@@ -133,8 +131,8 @@
|
||||
<p><a href="index.php?controller=AdminCustomers&token={getAdminToken tab='AdminCustomers'}">{l s='Show all customers'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if {$show_new_messages} == 1}
|
||||
{/if}
|
||||
{if {$show_new_messages} == 1}
|
||||
<div id="customer_messages_notif" class="notifs">
|
||||
<span id="customer_messages_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="customer_messages_notif_value">0</span>
|
||||
@@ -146,9 +144,8 @@
|
||||
<p><a href="index.php?tab=AdminCustomerThreads&token={getAdminToken tab='AdminCustomerThreads'}">{l s='Show all messages'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div id="employee_box">
|
||||
<div id="employee_infos">
|
||||
<div class="employee_name">{l s='Welcome,'} <strong>{$first_name} {$last_name}</strong></div>
|
||||
@@ -157,14 +154,13 @@
|
||||
<li><a href="{$link->getAdminLink('AdminEmployees')|escape:'htmlall':'UTF-8'}&id_employee={$employee->id}&updateemployee">{l s='My preferences'}</a></li>
|
||||
<li class="separator"> </li>
|
||||
<li><a id="header_logout" href="index.php?logout">{l s='logout'}</a></li>
|
||||
{if {$base_url}}
|
||||
<li class="separator"> </li>
|
||||
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
|
||||
{/if}
|
||||
{if {$base_url}}
|
||||
<li class="separator"> </li>
|
||||
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="header_search">
|
||||
<form method="post" action="index.php?controller=AdminSearch&token={getAdminToken tab='AdminSearch'}">
|
||||
<input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
|
||||
@@ -183,8 +179,7 @@
|
||||
<input type="submit" id="bo_search_submit" class="button" value="{l s='Search'}"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{if count($quick_access) > 0}
|
||||
{if count($quick_access) > 0}
|
||||
<div id="header_quick">
|
||||
<select onchange="quickSelect(this);" id="quick_select" class="chosen no-search">
|
||||
<option value="0">{l s='Quick Access'}</option>
|
||||
@@ -193,19 +188,15 @@
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($displayBackOfficeTop)}
|
||||
{$displayBackOfficeTop}
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($displayBackOfficeTop)}{$displayBackOfficeTop}{/if}
|
||||
</div>{* end header_infos*}
|
||||
|
||||
<ul id="menu">
|
||||
{if !$tab}
|
||||
<div class="mainsubtablist" style="display:none">
|
||||
</div>
|
||||
{/if}
|
||||
{foreach $tabs AS $t}
|
||||
{if $t.active}
|
||||
{if !$tab}
|
||||
<div class="mainsubtablist" style="display:none"></div>
|
||||
{/if}
|
||||
{foreach $tabs AS $t}
|
||||
{if $t.active}
|
||||
<li class="submenu_size maintab {if $t.current}active{/if}" id="maintab{$t.id_tab}">
|
||||
<a href="#" class="title">
|
||||
<img src="{$t.img}" alt="" />{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}
|
||||
@@ -218,23 +209,20 @@
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>{* end header*}
|
||||
|
||||
</div>{* end header*}
|
||||
{/if}
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
{if $display_header && $install_dir_exists}
|
||||
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
|
||||
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
|
||||
<div class="multishop_toolbar">
|
||||
<span class="text_multishop">{l s='Multistore configuration for'}</span>
|
||||
{$shop_list}
|
||||
</div>
|
||||
{/if}
|
||||
{if $display_header && $install_dir_exists}
|
||||
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
|
||||
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
||||
</div>
|
||||
{/if}
|
||||
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
|
||||
<div class="multishop_toolbar">
|
||||
<span class="text_multishop">{l s='Multistore configuration for'}</span> {$shop_list}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -47,7 +47,6 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="hint clear" style="display:block;">
|
||||
<span id="see_more_infos">
|
||||
@@ -60,7 +59,6 @@
|
||||
</div>
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="conf" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
@@ -68,7 +66,6 @@
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if count($warnings)}
|
||||
<div class="warn">
|
||||
<span style="float:right">
|
||||
@@ -94,6 +91,5 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{$page}
|
||||
{include file='footer.tpl'}
|
||||
{include file='footer.tpl'}
|
||||
@@ -70,18 +70,23 @@ class AdminLoginControllerCore extends AdminController
|
||||
|
||||
if (file_exists(_PS_ADMIN_DIR_.'/../install'))
|
||||
$this->context->smarty->assign('wrong_install_name', true);
|
||||
if (file_exists(_PS_ADMIN_DIR_.'/../admin'))
|
||||
|
||||
if (basename(_PS_ADMIN_DIR_) == 'admin' && 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);
|
||||
$rand = 'admin'.sprintf('%04d', rand(0, 9999)).'/';
|
||||
if (@rename(_PS_ADMIN_DIR_.'/../admin/', _PS_ADMIN_DIR_.'/../'.$rand))
|
||||
Tools::redirectAdmin('../'.$rand);
|
||||
else
|
||||
$this->context->smarty->assign(array(
|
||||
'wrong_folder_name' => true
|
||||
));
|
||||
}
|
||||
else
|
||||
$rand = basename(_PS_ADMIN_DIR_).'/';
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'randomNb' => rand(0, 9999)
|
||||
'randomNb' => $rand,
|
||||
'adminUrl' => Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.$rand
|
||||
));
|
||||
|
||||
// Redirect to admin panel
|
||||
|
||||
Reference in New Issue
Block a user