Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
//                                                                            //
5
//   Copyright (C) 2006  Phorum Development Team                              //
6
//   http://www.phorum.org                                                    //
7
//                                                                            //
8
//   This program is free software. You can redistribute it and/or modify     //
9
//   it under the terms of either the current Phorum License (viewable at     //
10
//   phorum.org) or the Phorum License that was distributed with this file    //
11
//                                                                            //
12
//   This program is distributed in the hope that it will be useful,          //
13
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
14
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
15
//                                                                            //
16
//   You should have received a copy of the Phorum License                    //
17
//   along with this program.                                                 //
18
////////////////////////////////////////////////////////////////////////////////
19
define('phorum_page','version_iframe');
20
 
21
// Check for new versions of the Phorum software. Only do this once by
22
// issuing a cookie which remembers whether we need to upgrade or not.
23
// This file is included within an <iframe> in the admin interface header,
24
// so downtime of the phorum.org website won't affect the performance of
25
// the admin interface for Phorum users.
26
 
27
require_once('./common.php');
28
 
29
if (isset($_COOKIE["phorum_upgrade_available"])) {
30
    $upgrade_available = $_COOKIE["phorum_upgrade_available"];
31
} else {
32
    require_once('./include/version_functions.php');
33
    $releases = phorum_find_upgrades();
34
    if (isset($releases["stable"]) && $releases["stable"]["upgrade"]) {
35
        $upgrade_available = $releases["stable"]["version"];
36
    } elseif (isset($releases["development"]) && $releases["development"]["upgrade"]) {
37
        $upgrade_available = $releases["development"]["version"];
38
    } else {
39
        $upgrade_available = 0;
40
    }
41
}
42
setcookie("phorum_upgrade_available", $upgrade_available, 0,
43
          $PHORUM["session_path"], $PHORUM["session_domain"]);
44
 
45
?>
46
<html>
47
  <head>
48
    <title>Phorum upgrade notification</title>
49
    <style type="text/css">
50
    body {
51
        background-color: white;
52
        margin: 0px;
53
        padding: 0px;
54
    }
55
    .notify_upgrade {
56
        text-align: center;
57
        border: 2px solid black;
58
        background-color: #e00000;
59
        padding: 3px;
60
        margin: 0px;
61
    }
62
    .notify_upgrade a {
63
        font-family: Lucida Sans Unicode,Lucida Grand,Verdana,Arial,Helvetica;
64
        color: white;
65
        font-weight: bold;
66
        font-size: 13px;
67
    }
68
    .notify_noupgrade {
69
        text-align: center;
70
        border: 1px solid black;
71
        padding: 3px;
72
        margin: 0px;
73
        font-family: Lucida Sans Unicode,Lucida Grand,Verdana,Arial,Helvetica;
74
        font-size: 13px;
75
    }
76
    </style>
77
  </head>
78
  <body>
79
  <?php if ($upgrade_available) { ?>
80
    <div class="notify_upgrade">
81
      <a target="_top" href="admin.php?module=version">New Phorum version <?php print $upgrade_available ?> available!</a>
82
    </div>
83
  <?php } else { ?>
84
    <div class="notify_noupgrade">
85
      Your Phorum installation is up to date
86
    </div>
87
  <?php } ?>
88
  </body>
89
</html>