aliroOffline.php

Go to the documentation of this file.
00001 <?php
00002 
00003 /*******************************************************************************
00004  * Aliro - the modern, accessible content management system
00005  *
00006  * Aliro is open source software, free to use, and licensed under GPL.
00007  * You can find the full licence at http://www.gnu.org/copyleft/gpl.html GNU/GPL
00008  *
00009  * The author freely draws attention to the fact that Aliro derives from Mambo,
00010  * software that is controlled by the Mambo Foundation.  However, this section
00011  * of code is totally new.  If it should contain any fragments that are similar
00012  * to Mambo, please bear in mind (1) there are only so many ways to do things
00013  * and (2) the author of Aliro is also the author and copyright owner for large
00014  * parts of Mambo 4.6.
00015  *
00016  * Tribute should be paid to all the developers who took Mambo to the stage
00017  * it had reached at the time Aliro was created.  It is a feature rich system
00018  * that contains a good deal of innovation.
00019  *
00020  * Your attention is also drawn to the fact that Aliro relies on other items of
00021  * open source software, which is very much in the spirit of open source.  Aliro
00022  * wishes to give credit to those items of code.  Please refer to
00023  * http://aliro.org/credits for details.  The credits are not included within
00024  * the Aliro package simply to avoid providing a marker that allows hackers to
00025  * identify the system.
00026  *
00027  * Copyright in this code is strictly reserved by its author, Martin Brampton.
00028  * If it seems appropriate, the copyright will be vested in the Aliro Organisation
00029  * at a suitable time.
00030  *
00031  * Copyright (c) 2007 Martin Brampton
00032  *
00033  * http://aliro.org
00034  *
00035  * counterpoint@aliro.org
00036  *
00037  * aliroOffline simply makes a special display when the site is offline.
00038  *
00039  */
00040 
00041 
00042 class aliroOffline {
00043     private $live_site = '';
00044     private $sitename = '';
00045     private $offline = 0;
00046     private $offline_message = '';
00047     private $error_message = '';
00048     private $install_warn = '';
00049     private $iso = '';
00050 
00051     private $error_text = '';
00052 
00053     public function __construct ($mosSystemError=0) {
00054         $config = aliroCore::getInstance();
00055         $config->fixlanguage();
00056         $this->live_site = $config->getCfg('live_site');
00057         $this->sitename = $config->getCfg('sitename');
00058         $this->offline = $config->getCfg('offline');
00059         $this->offline_message = $config->getCfg('offline_message');
00060         $this->error_message = $config->getCfg('error_message');
00061         $this->iso = _ISO;
00062         $this->install_warn = 'For your security please completely remove the installation directory including all files and sub-folders  - then refresh this page';
00063         $this->setError($mosSystemError);
00064         $this->show();
00065     }
00066 
00067     private function setError ($mosSystemError) {
00068         if ($this->offline) $this->error_text = <<<OFFLINE_BY_ADMIN
00069 
00070     <tr>
00071         <td width="39%" align="center">
00072         <h2>
00073         $this->offline_message
00074         </h2>
00075         </td>
00076     </tr>
00077 
00078 OFFLINE_BY_ADMIN;
00079 
00080         elseif ($mosSystemError) $this->error_text = <<<OFFLINE_BY_DATABASE
00081 
00082     <tr>
00083         <td width="39%" align="center">
00084         <h2>
00085         $this->error_message
00086         </h2>
00087         $mosSystemError
00088         </td>
00089     </tr>
00090 
00091 OFFLINE_BY_DATABASE;
00092 
00093         else $this->error_text = <<<OFFLINE_DEFAULT
00094 
00095     <tr>
00096         <td width="39%" align="center">
00097         <h2>
00098         $this->install_warn
00099         </h2>
00100         </td>
00101     </tr>
00102 
00103 OFFLINE_DEFAULT;
00104 
00105     }
00106 
00107     private function show () {
00108         // needed to seperate the ISO number from the language file constant _ISO
00109         // $iso = split( '=', _ISO );
00110         // xml prolog
00111         // echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
00112 
00113         $offline = <<<OFFLINE_HTML
00114 
00115 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00116 <html xmlns="http://www.w3.org/1999/xhtml">
00117 <head>
00118 <title>$this->sitename - Offline</title>
00119 <meta http-equiv="Content-Type" content="text/html; $this->iso" />
00120 </head>
00121 <body>
00122 
00123 <p>&nbsp;</p>
00124 <table width="550" align="center" style="background-color: #ffffff; border: 1px solid">
00125 <tr>
00126     <td width="60%" height="50" align="center">
00127     <img src="$this->live_site/images/logo.png" alt="Aliro Logo" align="middle" />
00128     </td>
00129 </tr>
00130 <tr>
00131     <td align="center">
00132     <h1>
00133     $this->sitename
00134     </h1>
00135     </td>
00136 </tr>
00137 $this->error_text
00138 </table>
00139 
00140 </body>
00141 </html>
00142 
00143 OFFLINE_HTML;
00144 
00145         echo $offline;
00146     }
00147 
00148 }

Generated on Thu Apr 17 13:03:26 2008 for ALIRO by  doxygen 1.5.5