Changeset 82

Show
Ignore:
Timestamp:
28/05/05 20:24:10 (4 years ago)
Author:
stringfellow
Message:

started on the add user form, and thought about auth on the add user function... not sure on this one?
both need work :S

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.lib.php

    r79 r82  
    317317/* Some functions to manage posts, users etc. */ 
    318318 
    319         function addUser()  
     319        function addUser($user) //user is the user adminning (a staff member?) 
    320320        { 
    321321                $username = ''; 
     
    327327                $css = 'blog.css'; 
    328328                $enabled = False; // seems sensible.. 
    329  
     329                 
     330                //if (check_auth($user)) {} 
    330331                //sanitise username 
    331332                if (isset($_POST['username']) && trim($_POST['username']) != "" && (int)$_POST['username'] == 0) { 
    332                         $username = $_POST['username']; 
     333                               $username = $_POST['username']; 
    333334                } else { 
    334335                        $this->inputError = _("Bad Input - Username"); 
     
    409410                } 
    410411        } 
     412 
     413        // ok this should take all the input and post it to addUser, passing in the current user and stuff... i think... 
     414        function addUserForm()  
     415        { 
     416                echo "<div class=\"adduser\">\n"; 
     417                if ($this->inputError != "") { 
     418                        echo "<p class=\"invalid\">*** " . $this->inputError . " ***</p>\n"; 
     419                } 
     420                elseif (isset($_POST['submit'])) { 
     421                        echo "<p>New user added.</p>\n"; 
     422                } 
     423                echo "<h2>"._("Add User")."</h2>\n"; 
     424                echo "<form action=\"".$this->blogPath."adduser\" method=\"post\" id=\"adduserform\">\n"; 
     425                echo "<p>\n"; 
     426                echo "<input type=\"text\" name=\"username\" id=\"username\" value=\"" . (($this->inputError != "") ? strip_tags(trim($_POST['username'])) : "") . "\" size=\"22\" maxlength=\"50\" tabindex=\"1\" />\n"; 
     427                echo "<label for=\"username\">"._("Username")."</label>\n"; 
     428        } 
    411429}