aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-05-07 23:08:51 +0000
committerpatdenice <patdenice@piwigo.org>2010-05-07 23:08:51 +0000
commit973d15f33862c986b3cf8a8598898ca80d5df4da (patch)
tree4aba22f8cccf99f00b9df0c1d1ff603543c2c406 /upgrade.php
parent2ef789b9b16e7cb80569ed28ce63d307f253771c (diff)
Upgrade can be launched automaticaly if user is already connected as webmaster.
git-svn-id: http://piwigo.org/svn/trunk@6110 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'upgrade.php')
-rw-r--r--upgrade.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/upgrade.php b/upgrade.php
index 7383a5e8a..9d8d78ff8 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -36,9 +36,6 @@ if ($php_end_tag === false)
die('Cannot find php end tag in '.$config_file);
}
-include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');
-include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
-
include(PHPWG_ROOT_PATH.'local/config/database.inc.php');
include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
@@ -49,6 +46,9 @@ include_once(PHPWG_ROOT_PATH.'include/constants.php');
define('PREFIX_TABLE', $prefixeTable);
define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db');
+include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
// +-----------------------------------------------------------------------+
// | functions |
// +-----------------------------------------------------------------------+
@@ -279,12 +279,10 @@ $page['infos'] = array();
$page['errors'] = array();
$mysql_changes = array();
-if (isset($_POST['username']) and isset($_POST['password']))
-{
- check_upgrade_access_rights($current_release, $_POST['username'], $_POST['password']);
-}
+check_upgrade_access_rights();
-if (isset($_POST['submit']) and check_upgrade())
+if ((isset($_POST['submit']) or isset($_GET['now']))
+ and check_upgrade())
{
$upgrade_file = PHPWG_ROOT_PATH.'install/upgrade_'.$current_release.'.php';
if (is_file($upgrade_file))