Following fixes: admin theme supports <button> tag now, PageProcessor can eval now, and SpecialAdmin.php plugin can no longer be disabled
authordan@fuhry
Sat, 16 Jun 2007 18:47:06 -0400
changeset 9 1e61232606d6
parent 8 4bb20dddef00
child 10 2f530ad04f1b
Following fixes: admin theme supports <button> tag now, PageProcessor can eval now, and SpecialAdmin.php plugin can no longer be disabled
includes/clientside/static/misc.js
includes/pageprocess.php
plugins/SpecialAdmin.php
themes/admin/css/default.css
--- a/includes/clientside/static/misc.js	Wed Jun 13 19:53:18 2007 -0400
+++ b/includes/clientside/static/misc.js	Sat Jun 16 18:47:06 2007 -0400
@@ -342,7 +342,8 @@
         ajax_auth_mb_cache.updateContent(form_html);
         $('messageBox').object.nextSibling.firstChild.tabindex = '3';
         $('ajaxlogin_user').object.focus();
-        $('ajaxlogin_pass').object.onblur = function() { $('messageBox').object.nextSibling.firstChild.focus(); };
+        $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); };
+        $('ajaxlogin_pass').object.onkeypress = function(e) { if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); };
       }
     });
 }
--- a/includes/pageprocess.php	Wed Jun 13 19:53:18 2007 -0400
+++ b/includes/pageprocess.php	Sat Jun 16 18:47:06 2007 -0400
@@ -148,20 +148,6 @@
         return false;
       }
     }
-    else if ( in_array($this->namespace, array('Article', 'User', 'Project', 'Help', 'File', 'Category')) && $this->page_exists )
-    {
-      // Send as regular page
-      $text = $this->fetch_text();
-      if ( $text == 'err_no_text_rows' )
-      {
-        $this->err_no_rows();
-        return false;
-      }
-      else
-      {
-        $this->render();
-      }
-    }
     else if ( ( $this->namespace == 'Template' || $this->namespace == 'System' ) && $this->page_exists )
     {
       $this->header();
@@ -195,6 +181,20 @@
         $this->err_page_not_existent();
       }
     }
+    else // if ( in_array($this->namespace, array('Article', 'User', 'Project', 'Help', 'File', 'Category')) && $this->page_exists )
+    {
+      // Send as regular page
+      $text = $this->fetch_text();
+      if ( $text == 'err_no_text_rows' )
+      {
+        $this->err_no_rows();
+        return false;
+      }
+      else
+      {
+        $this->render();
+      }
+    }
     
     
   }
@@ -246,9 +246,20 @@
     $text = $this->fetch_text();
     
     $this->header();
-    display_page_headers();
-    echo RenderMan::render($text);
-    display_page_footers();
+    if ( $this->send_headers )
+    {
+      display_page_headers();
+    }
+    
+    $text = '?>' . RenderMan::render($text);
+    // echo('<pre>'.htmlspecialchars($text).'</pre>');
+    eval ( $text );
+    
+    if ( $this->send_headers )
+    {
+      display_page_footers();
+    }
+    
     $this->footer();
   }
   
--- a/plugins/SpecialAdmin.php	Wed Jun 13 19:53:18 2007 -0400
+++ b/plugins/SpecialAdmin.php	Sat Jun 16 18:47:06 2007 -0400
@@ -505,24 +505,35 @@
     return;
   }
   
-  
-  if(isset($_GET['action'])) {
-    switch($_GET['action']) {
+  if(isset($_GET['action']))
+  {
+    switch($_GET['action'])
+    {
       case "enable":
         setConfig('plugin_'.$_GET['plugin'], '1');
         break;
       case "disable":
-        if($_GET['plugin']!='admin.php') setConfig('plugin_'.$_GET['plugin'], '0');
-        else echo('<h3>Error disabling plugin</h3><p>The administration panel plugin cannot be disabled.</p>');
+        if ( $_GET['plugin'] != 'SpecialAdmin.php' )
+        {
+          setConfig('plugin_'.$_GET['plugin'], '0');
+        }
+        else 
+        {
+          echo('<h3>Error disabling plugin</h3><p>The administration panel plugin cannot be disabled.</p>');
+        }
         break;
     }
   }
   $dir = './plugins/';
   $plugin_list = Array();
   $system = Array();
-  if (is_dir($dir)) {
-    if ($dh = opendir($dir)) {
-      while (($file = readdir($dh)) !== false) {
+  
+  if (is_dir($dir))
+  {
+    if ($dh = opendir($dir))
+    {
+      while (($file = readdir($dh)) !== false)
+      {
         if(preg_match('#^(.*?)\.php$#is', $file) && $file != 'index.php')
         {
           if ( in_array($file, $plugins->system_plugins) )
@@ -554,6 +565,16 @@
       }
       closedir($dh);
     }
+    else
+    {
+      echo '<div class="error-box">The plugins/ directory could not be opened.</div>';
+      return;
+    }
+  }
+  else
+  {
+    echo '<div class="error-box">The plugins/ directory is missing from your Enano installation.</div>';
+    return;
   }
   echo('<div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
       <tr><th>Plugin filename</th><th>Plugin name</th><th>Description</th><th>Author</th><th>Version</th><th></th></tr>');
--- a/themes/admin/css/default.css	Wed Jun 13 19:53:18 2007 -0400
+++ b/themes/admin/css/default.css	Sat Jun 16 18:47:06 2007 -0400
@@ -130,7 +130,7 @@
 }
 
 /* Buttons - this is CSS3 */
-input[type ^="button"], input[type ^="submit"] {
+input[type ^="button"], input[type ^="submit"], button {
   border-width: 1px;
   border-color: #666;
   border-style: solid;
@@ -144,11 +144,11 @@
   background-repeat: repeat-x;
 }
 
-input[type ^="button"]:hover, input[type ^="submit"]:hover {
+input[type ^="button"]:hover, input[type ^="submit"]:hover, button:hover {
   border-color: #999;
 }
 
-input[type ^="button"]:active, input[type ^="submit"]:active {
+input[type ^="button"]:active, input[type ^="submit"]:active, button:active {
   padding: 6px 2px 4px 4px;
   border-color: #333;
 }