Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 126 lines (99 sloc) 3.19 kb
e198df9 @flol Einen Updater fuer die SQL-Tabellen hinzugefuegt.
authored
1 <?php
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
2
e198df9 @flol Einen Updater fuer die SQL-Tabellen hinzugefuegt.
authored
3 /**
0ad5dc6 @flol Inserted new php file header and corrected all svn props, refs #166
authored
4 * This file is part of the SysCP project.
2950f30 @flol We have 2009 ;-)
authored
5 * Copyright (c) 2003-2009 the SysCP Team (see authors).
e198df9 @flol Einen Updater fuer die SQL-Tabellen hinzugefuegt.
authored
6 *
0ad5dc6 @flol Inserted new php file header and corrected all svn props, refs #166
authored
7 * For the full copyright and license information, please view the COPYING
8 * file that was distributed with this source code. You can also view the
9 * COPYING file online at http://files.syscp.org/misc/COPYING.txt
e198df9 @flol Einen Updater fuer die SQL-Tabellen hinzugefuegt.
authored
10 *
0ad5dc6 @flol Inserted new php file header and corrected all svn props, refs #166
authored
11 * @copyright (c) the authors
12 * @author Florian Lippert <flo@syscp.org>
13 * @license GPLv2 http://files.syscp.org/misc/COPYING.txt
14 * @package System
15 * @version $Id$
e198df9 @flol Einen Updater fuer die SQL-Tabellen hinzugefuegt.
authored
16 */
17
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
18 /**
19 * Includes the Usersettings eg. MySQL-Username/Passwort etc.
20 */
21
22 require ('../lib/userdata.inc.php');
23
24 /**
25 * Includes the MySQL-Tabledefinitions etc.
26 */
27
28 require ('../lib/tables.inc.php');
29
30 /**
31 * Inlcudes the MySQL-Connection-Class
32 */
33
34 require ('../lib/class_mysqldb.php');
35 $db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
36 unset($sql['password']);
37 unset($db->password);
38 $result = $db->query("SELECT `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
39
40 while($row = $db->fetch_array($result))
41 {
fb26173 Now the trunk is beautified with tabs insterad of spaces, sorry for the ...
Florian Aders authored
42 $settings[$row['settinggroup']][$row['varname']] = $row['value'];
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
43 }
44
45 unset($row);
46 unset($result);
47
48 /**
49 * Inlcudes the Functions
50 */
51
52 require ('../lib/functions.php');
53
54 /**
f5c23eb added logging for update-scripts
Michael Kaufmann authored
55 * Includes Logger-Classes
56 */
57
e28365f bugfixing paths in updatesql.php
Michael Kaufmann authored
58 require ('../lib/abstract/abstract_class_logger.php');
59 require ('../lib/class_syslogger.php');
60 require ('../lib/class_filelogger.php');
61 require ('../lib/class_mysqllogger.php');
f5c23eb added logging for update-scripts
Michael Kaufmann authored
62
63 /**
64 * Includes the SyscpLogger class
65 */
66
e28365f bugfixing paths in updatesql.php
Michael Kaufmann authored
67 require ('../lib/class_syscplogger.php');
8efb126 @flol Beautified trunk and set correct svn props, refs #741
authored
68 $updatelog = SysCPLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
f5c23eb added logging for update-scripts
Michael Kaufmann authored
69
70 /**
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
71 * First case: We are updating from a version < 1.0.10
72 */
73
74 if(!isset($settings['panel']['version'])
75 || (substr($settings['panel']['version'], 0, 3) == '1.0' && $settings['panel']['version'] != '1.0.10'))
76 {
5b87b4d * Fixing various problems with the mennu, including:
Florian Aders authored
77 $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0 to 1.0.10");
78 include_once ('./updates/1.0/update_1.0_1.0.10.inc.php');
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
79 }
80
81 /**
82 * Second case: We are updating from version = 1.0.10
83 */
84
85 if($settings['panel']['version'] == '1.0.10')
86 {
5b87b4d * Fixing various problems with the mennu, including:
Florian Aders authored
87 $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0.10 to 1.2-beta1");
88 include_once ('./updates/1.0/update_1.0.10_1.2-beta1.inc.php');
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
89 }
90
91 /**
92 * Third case: We are updating from a version > 1.2-beta1
93 */
94
95 if(substr($settings['panel']['version'], 0, 3) == '1.2')
96 {
5b87b4d * Fixing various problems with the mennu, including:
Florian Aders authored
97 $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2-beta1 to 1.2.19");
98 include_once ('./updates/1.2/update_1.2-beta1_1.2.19.inc.php');
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
99 }
100
c796248 outsourcing >1.2.19 to the future 1.2.20 version updates
Michael Kaufmann authored
101 /**
102 * 4th case: We are updating from 1.2.19 to 1.2.20 (prolly the last from the 1.2.x series)
f4c6f5b Just phpbeautify
Florian Aders authored
103 */
c796248 outsourcing >1.2.19 to the future 1.2.20 version updates
Michael Kaufmann authored
104
15304ab @flol This is maybe better...
authored
105 if(substr($settings['panel']['version'], 0, 6) == '1.2.19')
c796248 outsourcing >1.2.19 to the future 1.2.20 version updates
Michael Kaufmann authored
106 {
5b87b4d * Fixing various problems with the mennu, including:
Florian Aders authored
107 $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2.19 to 1.4");
108 include_once ('./updates/1.2/update_1.2.19_1.4.inc.php');
c796248 outsourcing >1.2.19 to the future 1.2.20 version updates
Michael Kaufmann authored
109 }
110
c312eec * Fixing lighty - redirects, fixes #1012
Florian Aders authored
111 /**
112 * 5th case: We are updating from a version >= 1.4
113 */
114
15304ab @flol This is maybe better...
authored
115 if(substr($settings['panel']['version'], 0, 3) == '1.4')
c312eec * Fixing lighty - redirects, fixes #1012
Florian Aders authored
116 {
5b87b4d * Fixing various problems with the mennu, including:
Florian Aders authored
117 $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4");
118 include_once ('./updates/1.4/update_1.4.inc.php');
c312eec * Fixing lighty - redirects, fixes #1012
Florian Aders authored
119 }
120
fb05771 PHPBeautify SysCP 1.2 at least once, to have an unitary code look. :)
Luca Longinotti authored
121 updateCounters();
122 inserttask('1');
123 @chmod('../lib/userdata.inc.php', 0440);
124 header('Location: ../index.php');
125
a8ce5ba @flol Schedule for SysCP 1.4.1
authored
126 ?>
Something went wrong with that request. Please try again.