]>
Commit | Line | Data |
---|---|---|
a5eae6b7 MR |
1 | <?php |
2 | /* $Id$ */ | |
3 | if (! file_exists('config.inc.php') || filesize('config.inc.php') == 0) { | |
4 | header("Location: install/install.php"); | |
5 | exit(); | |
6 | } | |
7 | ||
8 | /* remove pgsql.php from root. Accidentally placed there in release 0.7.4 */ | |
9 | $cwd = dirname(__FILE__); | |
10 | if (file_exists("$cwd/pgsql.php")) { | |
11 | if (! unlink("$cwd/pgsql.php")) { | |
12 | echo "An unrecoverable error has occured call the administrator an inform | |
13 | him that he should read the error log file for further assistans"; | |
14 | error_log("$cwd/pgsql.php: Must be deleted.\nI tried but it failed due to | |
15 | missing permissions. You must delete it manually"); | |
16 | exit; | |
17 | } | |
18 | } | |
19 | ||
20 | $timezone_offset = date("Z"); | |
21 | ||
22 | include_once 'config.inc.php'; | |
23 | require_once 'user_validate.php'; | |
24 | require_once 'utils/helper.php'; | |
25 | ||
26 | $_SESSION['timezone_offset'] = $timezone_offset; | |
27 | ||
28 | $_SESSION['__ROOT__'] = TOP_FOLDER; | |
29 | ||
30 | if (PHP_VERSION < 5.1) { | |
31 | die("PHP >= 5.1 is required to run this application"); | |
32 | } | |
33 | ||
34 | valid_user(); | |
35 | ||
36 | if (strtoupper($_SESSION['user_settings']->getUid()) == 'ADMIN' && newUpdates()) { | |
37 | $pwd = WEB_ROOT; | |
38 | if ($pwd[strlen($pwd)-1] == '/') | |
39 | $pwd = substr($pwd, 0, -1); | |
40 | ||
41 | print '<?xml version="1.0" encoding="utf-8"?> | |
42 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
43 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
44 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
45 | <head> | |
46 | <title>Web Calendar</title> | |
47 | <link rel="stylesheet" type="text/css" | |
48 | href="'.$pwd.'/css/top_level.css" /> | |
49 | <link rel="shortcut icon" | |
50 | href="'.$pwd.'/pixmaps/favicon.ico" /> | |
51 | <script type="text/javascript" src="'.$pwd.'/js/helper.js"></script> | |
52 | </head> | |
53 | <body> | |
54 | <div id="update_msg"> | |
55 | <h3 style="text-align: center"> | |
56 | New updates available for the database | |
57 | </h3> | |
58 | <div style="text-align: center"> | |
59 | <button type="button" name="cancel" | |
60 | onclick="javascript:redirect('."'navigate/goto_today.php'".')">Skip</button> | |
61 | <button type="button" value="upgrade" | |
62 | onclick="javascript:redirect('."'utils/upgrade_db.php'".')">Upgrade</button> | |
63 | </div> | |
64 | </div> | |
65 | </body> | |
66 | </html>'; | |
67 | } | |
68 | else | |
69 | include 'navigate/goto_today.php'; | |
70 | ?> |