Permalink
Browse files

Uploaded for archiving purposes

  • Loading branch information...
0 parents commit bef388a076e39912de3d5b35a6fafc90de68bf8d @rickterheide rickterheide committed Apr 18, 2012
BIN _graphics/Thumbs.db
Binary file not shown.
BIN _graphics/maintenance.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 index.php
@@ -0,0 +1,85 @@
+<?php
+ global $CONFIG;
+ $text = get_plugin_setting("maintenance_text","maintenance");
+
+ $form_body = "<table><tr><td>";
+ $form_body .= elgg_echo('username') . "</td><td>" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')) . "</td><td>";
+ $form_body .= "</td></tr><tr><td>";
+ $form_body .= elgg_echo('password') . "</td><td>" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</td><td>";
+
+ $form_body .= elgg_view('input/submit', array('value' => elgg_echo('login')));
+ $form_body .= "</td></tr></table>";
+
+ $login_url = $vars['url'];
+ if ((isset($CONFIG->https_login)) && ($CONFIG->https_login))
+ $login_url = str_replace("http", "https", $vars['url']);
+
+?>
+<html>
+ <head>
+ <script type="text/javascript" src="<?php echo $CONFIG->wwwroot;?>vendors/jquery/jquery-1.2.6.pack.js"></script>
+ <script type="text/javascript">
+ function showAdmin(){
+ $("#admin_login").toggle("slow");
+ }
+ </script>
+
+ <style type="text/css">
+ body {
+ text-align:center;
+ font: 80%/1.4 "Lucida Grande", Verdana, sans-serif;
+ }
+
+ #maintenance_box {
+ margin: 15% auto;
+
+ position:relative;
+ width: 972px;
+ border: 1px solid #DEDEDE;
+ }
+
+ #image_container {
+ vertical-align:top;
+ }
+
+ #admin_login{
+ display: none;
+ }
+
+ img {
+ margin-right:40px;
+
+ }
+ </style>
+
+ </head>
+ <body>
+ <div id="maintenance_box">
+
+ <table>
+ <tr>
+ <td id="image_container">
+ <img src="<?php echo $CONFIG->wwwroot;?>mod/maintenance/_graphics/maintenance.png">
+ </td>
+ <td>
+ <h1>
+ <?php echo elgg_echo("maintenance:info");?>
+ </h1>
+ <p>
+ <?php echo $text;?>
+ </p>
+ <p>
+ <?php echo sprintf(elgg_echo("maintenance:adminlogin"), "<a href='javascript:showAdmin()'>" , "</a>");?>
+ </p>
+ <div id="admin_login">
+ <?php echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));?>
+
+ </div>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ </body>
+</html>
+<?php exit();?>
12 languages/en.php
@@ -0,0 +1,12 @@
+<?php
+
+ $english = array(
+ 'maintenance:settings:activate' => 'Activate maintenance mode',
+ 'maintenance:settings:text' => 'Enter optional extra text for maintenance message',
+ 'maintenance:info' => 'Site temporarily down for maintenance.',
+ 'maintenance:adminlogin' => 'login %shere%s if you are a siteadmin',
+
+ );
+
+ add_translation("en",$english);
+?>
17 manifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="ColdTrick IT Solutions" />
+ <field key="version" value="1.1" />
+ <field key="description" value="Provides the ability to activate a maintenance mode for you site where only admins can login" />
+ <field key="website" value="http://www.coldtrick.com/" />
+ <field key="copyright" value="(C) ColdTrick IT Solutions 2009" />
+ <field key="licence" value="GNU Public License version 2" />
+ <field key="elgg_version" value="2009030702" />
+</plugin_manifest>
+<!--
+ Version History
+ 1.1
+ - fixed: problem with maintenance plugin in combination with custom_index
+ 1.0
+ - first release
+-->
22 start.php
@@ -0,0 +1,22 @@
+<?php
+
+ function maintenance_init(){
+
+ if(get_plugin_setting("maintenance_active","maintenance")=="yes" && !isadminloggedin()){
+ register_plugin_hook('index','system','maintenance_index');
+ if($_SERVER["REQUEST_URI"] != "/" && $_SERVER["REQUEST_URI"] != "/action/login"){
+
+ admin_gatekeeper();
+ }
+ }
+ }
+
+ function maintenance_index() {
+
+ if (!@include_once(dirname(__FILE__) . "/index.php")) return false;
+ return true;
+ }
+
+ // Initialise plugin
+ register_elgg_event_handler('init','system','maintenance_init');
+?>
25 views/default/settings/maintenance/edit.php
@@ -0,0 +1,25 @@
+<?php
+ $active = $vars['entity']->maintenance_active;
+ if (!$active) $active = 'no';
+
+ $text = $vars['entity']->maintenance_text;
+
+?>
+<p>
+ <?php echo elgg_echo('maintenance:settings:activate'); ?>
+
+ <?php
+ echo elgg_view('input/pulldown', array(
+ 'internalname' => 'params[maintenance_active]',
+ 'options_values' => array(
+ 'yes' => elgg_echo('option:yes'),
+ 'no' => elgg_echo('option:no')
+ ),
+ 'value' => $active
+ ));
+ ?>
+ <br />
+ <?php echo elgg_echo('maintenance:settings:text'); ?>
+
+ <?php echo elgg_view('input/longtext', array('internalname'=>'params[maintenance_text]', 'value'=>$text));?>
+</p>

0 comments on commit bef388a

Please sign in to comment.