Changeset 153 for admin.php

Show
Ignore:
Timestamp:
29/07/05 22:34:03 (3 years ago)
Author:
rollercow
Message:

Lots of little changes, mostly checking input and new comments
Goes some way to dealing with #27

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.php

    r152 r153  
    1010        switch ($request[0]) { 
    1111                case "login": 
    12                         $admin->login(); 
    13                         //why? 
    14                         // Reinitalise the admin variable now the user is logged in 
    15                         // (fixes the bug whereby the date is not displayed on recent posts when you first log in 
    16                         // because there is no date format string provided) 
    17                         $admin = new admin(); 
     12                        //if login was suscessfull.. 
     13                        if ($admin->login()) { 
     14                               //Reinitalise the admin variable now the user is logged in, thus setting up the stuff thats dependent on having a username 
     15                               $admin = new admin(); 
     16                        } 
     17                        //otherwise dont mess with it, so we dont lose the error 
    1818                        break; 
    1919                case "logout": 
     
    2121                        break; 
    2222        } 
     23 
    2324?> 
    2425<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     
    2829        <link rel="stylesheet" href="<? echo $admin->httpPath; ?>blog.css" type="text/css" /> 
    2930<?php 
    30         if ($admin->blog->editor) { 
     31        //No point loading all that java script gubbins if its not going to be used 
     32        if ($admin->blog->editor && ($request[0] == "newentry" || $request[0] == "update" || $request[0] == "postupdate" || $request[0] == "postentry")) { 
    3133?> 
    3234        <script language="javascript" type="text/javascript" src="<?php echo $admin->httpPath; ?>tinymce/jscripts/tiny_mce/tiny_mce.js"></script> 
     
    116118                                        break; 
    117119                                case "adduser": 
    118                                         echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3></div>\n"; 
     120                                        echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3>\n"; 
    119121                                        $admin->addUser(); 
    120122                                        break;