Skip to content

Commit e0bb0fc

Browse files
xh3n1Sam Tuke
authored andcommitted
Add option to disable the updater
Signed-off-by: Xheni Myrtaj <[email protected]>
1 parent 4fcaa5a commit e0bb0fc

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

public_html/lists/admin/connect.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,6 @@ function pageTitle($page)
759759
'catlists',
760760
),
761761
),
762-
'update' => array(
763-
'toplink'=> 'redirecttoupdater',
764-
'pages' => array(),
765-
'menulinks' => array(),
766-
),
767762
//'info' => array(
768763
//'toplink' => 'about',
769764
//'pages' => array(
@@ -787,6 +782,13 @@ function pageTitle($page)
787782
//'menulinks' => array(),
788783
//),
789784
);
785+
if(ALLOW_UPDATER){
786+
$GLOBALS['pagecategories']['update'] = array(
787+
'toplink'=> 'redirecttoupdater',
788+
'pages' => array(),
789+
'menulinks' => array(),
790+
);
791+
}
790792
if (DEVVERSION) {
791793
$GLOBALS['pagecategories']['develop'] = array(
792794
'toplink' => 'develop',

public_html/lists/admin/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ function mb_strtolower($string)
521521
echo Info($GLOBALS['I18N']->get('Running in testmode, no emails will be sent. Check your config file.'));
522522
}
523523
$updaterdir = __DIR__ . '/../updater';
524-
if(file_exists($updaterdir)){
524+
if(file_exists($updaterdir) && ALLOW_UPDATER){
525525
echo Info(s('Try automatic updater').' <a href="?page=redirecttoupdater" title="'.s('automatic updater').'">'.s('here').'</a>'.' ('.s('beta').')');
526526
}
527527
if (version_compare(PHP_VERSION, '5.3.3', '<') && WARN_ABOUT_PHP_SETTINGS) {

public_html/lists/admin/init.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@
606606
if (!defined('USERSPAGE_MAX')) {
607607
define('USERSPAGE_MAX', 1000);
608608
}
609+
// if false, it will disable the automatic updater.
610+
if (!defined ('ALLOW_UPDATER')){
611+
define('ALLOW_UPDATER', true);
612+
}
609613
if (!isset($plugins_disabled) || !is_array($plugins_disabled)) {
610614
$plugins_disabled = array();
611615
}

public_html/lists/admin/redirecttoupdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Only superusers can be redirected to updater.
44
*/
5-
if(isSuperUser()) {
5+
if(isSuperUser() && ALLOW_UPDATER) {
66
$_SESSION['phplist_updater_eligible'] = true;
77
header('Location: ../updater');
88
}

0 commit comments

Comments
 (0)