aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-05-22 13:47:02 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commitba43064ddb7771fc97df135a32f9b0d5e373dd36 (patch)
treeb3519775fa4fe573af6980459e486f43837e5594 /index.php
parent2899ebb5b5e82890c877151f5c02045266ac9973 (diff)
downloadShaarli-ba43064ddb7771fc97df135a32f9b0d5e373dd36.tar.gz
Shaarli-ba43064ddb7771fc97df135a32f9b0d5e373dd36.tar.zst
Shaarli-ba43064ddb7771fc97df135a32f9b0d5e373dd36.zip
Process tools page through Slim controller
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/index.php b/index.php
index 4cd6d5f4..f4c8b391 100644
--- a/index.php
+++ b/index.php
@@ -501,18 +501,7 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM
501 501
502 // -------- Display the Tools menu if requested (import/export/bookmarklet...) 502 // -------- Display the Tools menu if requested (import/export/bookmarklet...)
503 if ($targetPage == Router::$PAGE_TOOLS) { 503 if ($targetPage == Router::$PAGE_TOOLS) {
504 $data = [ 504 header('Location: ./tools');
505 'pageabsaddr' => index_url($_SERVER),
506 'sslenabled' => is_https($_SERVER),
507 ];
508 $pluginManager->executeHooks('render_tools', $data);
509
510 foreach ($data as $key => $value) {
511 $PAGE->assign($key, $value);
512 }
513
514 $PAGE->assign('pagetitle', t('Tools') .' - '. $conf->get('general.title', 'Shaarli'));
515 $PAGE->renderPage('tools');
516 exit; 505 exit;
517 } 506 }
518 507
@@ -557,10 +546,10 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM
557 ); 546 );
558 547
559 // TODO: do not handle exceptions/errors in JS. 548 // TODO: do not handle exceptions/errors in JS.
560 echo '<script>alert("'. $e->getMessage() .'");document.location=\'./?do=tools\';</script>'; 549 echo '<script>alert("'. $e->getMessage() .'");document.location=\'./tools\';</script>';
561 exit; 550 exit;
562 } 551 }
563 echo '<script>alert("'. t('Your password has been changed') .'");document.location=\'./?do=tools\';</script>'; 552 echo '<script>alert("'. t('Your password has been changed') .'");document.location=\'./tools\';</script>';
564 exit; 553 exit;
565 } else { 554 } else {
566 // show the change password form. 555 // show the change password form.
@@ -1514,6 +1503,7 @@ $app->group('', function () {
1514 1503
1515 /* -- LOGGED IN -- */ 1504 /* -- LOGGED IN -- */
1516 $this->get('/logout', '\Shaarli\Front\Controller\Admin\LogoutController:index')->setName('logout'); 1505 $this->get('/logout', '\Shaarli\Front\Controller\Admin\LogoutController:index')->setName('logout');
1506 $this->get('/tools', '\Shaarli\Front\Controller\Admin\ToolsController:index')->setName('tools');
1517 1507
1518 $this 1508 $this
1519 ->get('/links-per-page', '\Shaarli\Front\Controller\Admin\SessionFilterController:linksPerPage') 1509 ->get('/links-per-page', '\Shaarli\Front\Controller\Admin\SessionFilterController:linksPerPage')