diff --git a/index.php b/index.php index 5ec68b29..8b70228e 100644 --- a/index.php +++ b/index.php @@ -144,6 +144,7 @@ function checkphpversion() function checkUpdate() { if (!isLoggedIn()) return ''; // Do not check versions for visitors. + if (empty($GLOBALS['config']['ENABLE_UPDATECHECK'])) return ''; // Do not check if the user doesn't want to. // Get latest version number at most once a day. if (!is_file($GLOBALS['config']['UPDATECHECK_FILENAME']) || (filemtime($GLOBALS['config']['UPDATECHECK_FILENAME'])alert("Configuration was saved.");document.location=\'?do=tools\';'; exit; @@ -2190,6 +2193,7 @@ function install() $GLOBALS['salt'] = sha1(uniqid('',true).'_'.mt_rand()); // Salt renders rainbow-tables attacks useless. $GLOBALS['hash'] = sha1($_POST['setpassword'].$GLOBALS['login'].$GLOBALS['salt']); $GLOBALS['title'] = (empty($_POST['title']) ? 'Shared links on '.htmlspecialchars(indexUrl()) : $_POST['title'] ); + $GLOBALS['config']['ENABLE_UPDATECHECK'] = !empty($_POST['updateCheck']); writeConfig(); echo ''; exit; @@ -2357,6 +2361,8 @@ function writeConfig() $config .= '$GLOBALS[\'disablesessionprotection\']='.var_export($GLOBALS['disablesessionprotection'],true).'; '; $config .= '$GLOBALS[\'disablejquery\']='.var_export($GLOBALS['disablejquery'],true).'; '; $config .= '$GLOBALS[\'privateLinkByDefault\']='.var_export($GLOBALS['privateLinkByDefault'],true).'; '; + $config .= '$GLOBALS[\'config\'][\'ENABLE_RSS_PERMALINKS\']='.var_export($GLOBALS['config']['ENABLE_RSS_PERMALINKS'], true).'; '; + $config .= '$GLOBALS[\'config\'][\'ENABLE_UPDATECHECK\']='.var_export($GLOBALS['config']['ENABLE_UPDATECHECK'], true).'; '; $config .= ' ?>'; if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0) { diff --git a/tpl/configure.html b/tpl/configure.html index 127a0895..75c6395b 100644 --- a/tpl/configure.html +++ b/tpl/configure.html @@ -12,7 +12,7 @@ Page title: Title link: - + Timezone:{$timezone_form} Redirector
(e.g. http://anonym.to/? will mask the HTTP_REFERER) @@ -24,6 +24,10 @@ New link: + + Update: + + diff --git a/tpl/install.html b/tpl/install.html index 4034ef1b..586e928c 100644 --- a/tpl/install.html +++ b/tpl/install.html @@ -2,19 +2,21 @@ {include="includes"}{$timezone_js} -
-

Shaarli

-It looks like it's the first time you run Shaarli. Please configure it:
-
-
- - - -{$timezone_html} - - -
Login:
Password:
Page title:
-
+
+

Shaarli

+ It looks like it's the first time you run Shaarli. Please configure it:
+
+ + + + {$timezone_html} + + + + +
Login:
Password:
Page title:
Update: +
+
{include="page.footer"}