]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #627 from ArthurHoaro/feature/translate-init
[github/shaarli/Shaarli.git] / index.php
index 19d54db812aaf978cb323e60d98d59259f80e37e..091ad704e6e1b0d1404e878a69c9246c4466b8d4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
 /**
  * Shaarli v0.7.0 - Shaare your links...
  *
- * The personal, minimalist, super-fast, no-database Delicious clone.
+ * The personal, minimalist, super-fast, database free, bookmarking service.
  *
  * Friendly fork by the Shaarli community:
  *  - https://github.com/shaarli/Shaarli
@@ -53,6 +53,7 @@ require_once 'application/config/ConfigPlugin.php';
 require_once 'application/FeedBuilder.php';
 require_once 'application/FileUtils.php';
 require_once 'application/HttpUtils.php';
+require_once 'application/Languages.php';
 require_once 'application/LinkDB.php';
 require_once 'application/LinkFilter.php';
 require_once 'application/LinkUtils.php';
@@ -783,8 +784,6 @@ function renderPage($conf, $pluginManager)
     if ($targetPage == Router::$PAGE_LOGIN)
     {
         if ($conf->get('security.open_shaarli')) { header('Location: ?'); exit; }  // No need to login for open Shaarli
-        $token=''; if (ban_canLogin($conf)) $token=getToken($conf); // Do not waste token generation if not useful.
-        $PAGE->assign('token',$token);
         if (isset($_GET['username'])) {
             $PAGE->assign('username', escape($_GET['username']));
         }
@@ -1105,7 +1104,6 @@ function renderPage($conf, $pluginManager)
         }
         else // show the change password form.
         {
-            $PAGE->assign('token',getToken($conf));
             $PAGE->renderPage('changepassword');
             exit;
         }
@@ -1152,13 +1150,13 @@ function renderPage($conf, $pluginManager)
         }
         else // Show the configuration form.
         {
-            $PAGE->assign('token',getToken($conf));
             $PAGE->assign('title', $conf->get('general.title'));
             $PAGE->assign('redirector', $conf->get('redirector.url'));
             list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone'));
             $PAGE->assign('timezone_form', $timezone_form);
             $PAGE->assign('timezone_js',$timezone_js);
             $PAGE->assign('private_links_default', $conf->get('privacy.default_private_links', false));
+            $PAGE->assign('session_protection_disabled', $conf->get('security.session_protection_disabled', false));
             $PAGE->assign('enable_rss_permalinks', $conf->get('feed.rss_permalinks', false));
             $PAGE->assign('enable_update_check', $conf->get('updates.check_updates', true));
             $PAGE->assign('hide_public_links', $conf->get('privacy.hide_public_links', false));
@@ -1171,7 +1169,6 @@ function renderPage($conf, $pluginManager)
     if ($targetPage == Router::$PAGE_CHANGETAG)
     {
         if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
-            $PAGE->assign('token', getToken($conf));
             $PAGE->assign('tags', $LINKSDB->allTags());
             $PAGE->renderPage('changetag');
             exit;
@@ -1346,7 +1343,6 @@ function renderPage($conf, $pluginManager)
         $data = array(
             'link' => $link,
             'link_is_new' => false,
-            'token' => getToken($conf),
             'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
             'tags' => $LINKSDB->allTags(),
         );
@@ -1413,7 +1409,6 @@ function renderPage($conf, $pluginManager)
         $data = array(
             'link' => $link,
             'link_is_new' => $link_is_new,
-            'token' => getToken($conf), // XSRF protection.
             'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
             'source' => (isset($_GET['source']) ? $_GET['source'] : ''),
             'tags' => $LINKSDB->allTags(),
@@ -1491,7 +1486,6 @@ function renderPage($conf, $pluginManager)
     // -------- Show upload/import dialog:
     if ($targetPage == Router::$PAGE_IMPORT)
     {
-        $PAGE->assign('token',getToken($conf));
         $PAGE->assign('maxfilesize',getMaxFileSize());
         $PAGE->renderPage('import');
         exit;
@@ -1733,7 +1727,6 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
         'search_term' => $searchterm,
         'search_tags' => $searchtags,
         'redirector' => $conf->get('redirector.url'),  // Optional redirector URL.
-        'token' => $token,
         'links' => $linkDisp,
         'tags' => $LINKSDB->allTags(),
     );