aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-06-25 22:03:12 +0000
committerplegall <plg@piwigo.org>2011-06-25 22:03:12 +0000
commitd9f8479cdfc4b7108c116f42e7bd7e152533b970 (patch)
tree307bf0bb5b22aa22cad88e45b939ecdc361f8ea7 /include
parentfa9b4f8871b8a2b905d94c16d135867c7412b44a (diff)
feature 2365 added: Piwigo version is written in the database (as
"piwigo_db_version" in the config table). We only store the branch, not the release : 2.3 and not 2.3.1, because database structure is not changing between minor releases. git-svn-id: http://piwigo.org/svn/trunk@11511 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/common.inc.php9
-rw-r--r--include/functions.inc.php9
2 files changed, 18 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 048290e19..6081220e6 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -132,6 +132,15 @@ catch (Exception $e)
pwg_db_check_charset();
load_conf_from_db();
+
+if (!$conf['check_upgrade_feed'])
+{
+ if (!isset($conf['piwigo_db_version']) or $conf['piwigo_db_version'] != get_branch_from_version(PHPWG_VERSION))
+ {
+ redirect(get_root_url().'upgrade.php');
+ }
+}
+
load_plugins();
include(PHPWG_ROOT_PATH.'include/user.inc.php');
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 7012db248..09ac3b668 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1600,4 +1600,13 @@ function get_privacy_level_options()
}
return $options;
}
+
+
+/**
+ * return the branch from the version. For example version 2.2.4 is for branch 2.2
+ */
+function get_branch_from_version($version)
+{
+ return implode('.', array_slice(explode('.', $version), 0, 2));
+}
?> \ No newline at end of file