added fluxbb for historical reasons
[archlinuxdevstack.git] / fluxbb / extras / turn_off_maintenance_mode.php
blob20909f4da935ec20ac2fde99ae8cde9f78475cc1
1 <?php
2 /***********************************************************************
4 Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
6 This file is part of PunBB.
8 PunBB is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2 of the License,
11 or (at your option) any later version.
13 PunBB is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 MA 02111-1307 USA
23 ************************************************************************/
26 // This script turns off the maintenance mode. Use it you happened to log out
27 // while the forum was in maintenance mode. Copy this file to the forum root
28 // directory and run it.
32 define('PUN_ROOT', './');
33 if (!file_exists(PUN_ROOT.'include/common.php'))
34 exit('This file must be run from the forum root directory.');
36 // Make sure common.php doesn't exit with the maintenance message
37 define('PUN_TURN_OFF_MAINT', 1);
39 require PUN_ROOT.'include/common.php';
42 if (isset($_POST['form_sent']))
44 $db->query('UPDATE '.$db->prefix.'config SET conf_value=\'0\' WHERE conf_name=\'o_maintenance\'') or error('Unable to turn off maintenance mode', __FILE__, __LINE__, $db->error());
46 // Regenerate the config cache
47 require_once PUN_ROOT.'include/cache.php';
48 generate_config_cache();
50 $db->close();
52 exit('<script type="text/javascript">window.location="turn_off_maintenance_mode.php?done=1"</script>JavaScript redirect unsuccessful. Click <a href="turn_off_maintenance_mode.php?done=1">here</a> to continue.');
57 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
59 <html dir="ltr">
60 <head>
61 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
62 <title>Turn off maintenance mode</title>
63 <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_config['o_default_style'].'.css' ?>" />
64 </head>
65 <body>
67 <div id="punwrap">
68 <div id="punutil" class="pun" style="margin: 10% 20% auto 20%">
70 <?php
72 if (isset($_GET['done']))
76 <div class="block">
77 <h2><span>Turn off maintenance mode completed</span></h2>
78 <div class="box">
79 <div class="inbox">
80 <p>Maintenance mode has been turned off. You should now remove this script from the forum root directory.</p>
81 </div>
82 </div>
83 </div>
84 <?php
87 else
91 <div class="blockform">
92 <h2><span>Turn off maintenance mode</span></h2>
93 <div class="box">
94 <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="this.start.disabled=true">
95 <div><input type="hidden" name="form_sent" value="1" /></div>
96 <div class="inform">
97 <p style="font-size: 1.1em">This script turns off maintenance mode. Use it you happened to log out while the forum was in maintenance mode.</p>
98 </div>
99 <p><input type="submit" name="start" value="Start" /></p>
100 </form>
101 </div>
102 </div>
103 <?php
109 </div>
110 </div>
112 </body>
113 </html>