add 404 rule in admin
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
namespace Thelia\Admin\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Thelia\Form\AdminLogin;
|
||||
|
||||
class AdminController extends BaseAdminController {
|
||||
@@ -55,4 +56,12 @@ class AdminController extends BaseAdminController {
|
||||
|
||||
return $adminLogin->buildForm($form, array())->getForm();
|
||||
}
|
||||
|
||||
public function lostAction()
|
||||
{
|
||||
return new Response(
|
||||
$this->renderRaw("404.html"),
|
||||
404
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -10,4 +10,8 @@
|
||||
<route id="admin.login" path="/admin/login">
|
||||
<default key="_controller">Thelia\Admin\Controller\AdminController::loginAction</default>
|
||||
</route>
|
||||
<route id="admin.lost" path="/admin/{everything}">
|
||||
<default key="_controller">Thelia\Admin\Controller\AdminController::lostAction</default>
|
||||
<requirement key="everything">.*</requirement>
|
||||
</route>
|
||||
</routes>
|
||||
@@ -35,7 +35,7 @@ class Assetic implements SmartyPluginInterface
|
||||
{
|
||||
$web_root = THELIA_WEB_DIR;
|
||||
|
||||
$asset_dir_from_web_root = 'assets/admin/default'; // FIXME
|
||||
$asset_dir_from_web_root = '/assets/admin/default'; // FIXME
|
||||
|
||||
$this->asset_manager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root);
|
||||
}
|
||||
|
||||
14
templates/admin/default/404.html
Normal file
14
templates/admin/default/404.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{$page_title={intl l='Thelia'}}
|
||||
{include file='includes/header.inc.html'}
|
||||
|
||||
<div class="brandbar container">
|
||||
<a class="brand" href="index.php">{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}</a>
|
||||
</div>
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
<h1>Oops! An Error Occurred</h1>
|
||||
<h2>The server returned a "404 Not Found".</h2>
|
||||
</div>
|
||||
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
@@ -1,4 +1,4 @@
|
||||
Options +FollowSymlinks
|
||||
Options +FollowSymlinks -Indexes
|
||||
|
||||
AddDefaultCharset UTF-8
|
||||
|
||||
@@ -8,5 +8,5 @@ AddDefaultCharset UTF-8
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
|
||||
RewriteRule ^admin(/.*)?$ index_dev.php/admin/$1 [L,QSA]
|
||||
RewriteRule ^(.*)$ index_dev.php [L,QSA]
|
||||
</IfModule>
|
||||
Reference in New Issue
Block a user