Changeset 152

Show
Ignore:
Timestamp:
20/07/05 20:47:57 (3 years ago)
Author:
rollercow
Message:

Tweaks the localuser check to only allow members of groups, staff and societys to sign up
Fixes so the signup form validates,

Files:

Legend:

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

    r149 r152  
    802802                if(!posix_getpwnam($username)) { 
    803803                        $this->inputError = _("You need to be a SUCS member to sign up for a blog here!");                       
     804                } 
     805                //check the user is a member of the users, staff or socieys groups 
     806                else { 
     807                        $posixInfo = posix_getpwnam($username); 
     808                        if ($posixInfo[gid] != 100 && $posixInfo[gid] != 106 && $posixInfo[gid] != 113) { 
     809                                $this->inputError = _("Err, No, Your not realy a system user now are you?"); 
     810                        } 
    804811                } 
    805812                //if we dont have any errors 
     
    822829                                ); 
    823830                                echo _("Account Added!<br />Your password has been sent to your SUCS email account"); 
     831                                //bodge it so the username is filled in 
     832                                $_POST['username'] = $username; 
     833                                //print a login box 
     834                                $this->printLoginForm(); 
     835                                 
    824836                        } 
    825837                } 
     
    833845        function addUserForm()  
    834846        { 
    835                 echo "<div class=\"adduser\">\n"; 
     847                echo "<div class=\"entry\">\n"; 
    836848                if ($this->inputError != "") { 
    837849                        echo "<div class=\"errorinfo\">"._("Error")." : " . $this->inputError . "</div>\n"; 
    838850                } 
    839851                echo "<h2>"._("Register for a Blog")."</h2>\n"; 
     852                echo "<div class=\"td\">\n"; 
    840853                echo "<form action=\"".$this->adminPath."adduser\" method=\"post\" id=\"adduserform\">\n"; 
    841854                echo "<p>\n"; 
     
    843856                echo "<label for=\"username\">"._("Username")."</label>\n"; 
    844857                echo "</p>\n"; 
     858                echo "<p>\n"; 
    845859                echo "<input type=\"text\" name=\"name\" id=\"name\" value=\"" . (($this->inputError != "") ? strip_tags(trim($_POST['name'])) : "") . "\" size=\"30\" maxlength=\"60\" tabindex=\"2\" />\n"; 
    846860                echo "<label for=\"name\">"._("Real name")."</label>\n"; 
     
    860874                echo "<p>"._("You need to be a member of ")."<a href=\"http://sucs.org/\">SUCS</a>"._(" to register")."<br />"._("The normal ")."<a href=\"http://sucs.org/info/conditions.php\">"._("Terms and Conditions")."</a>"._(" apply")."</p>\n"; 
    861875                echo "</div>\n";         
     876                echo "</div>\n";         
    862877        } 
    863878} 
  • admin.php

    r149 r152  
    112112                        switch (array_shift($request)) { 
    113113                                case "signup": 
    114                                         echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3>\n"; 
     114                                        echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3></div>\n"; 
    115115                                        $admin->addUserForm(); 
    116116                                        break; 
    117117                                case "adduser": 
    118                                         echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3>\n"; 
     118                                        echo "<div class=\"login\"><h3><a href=\"{$admin->adminPath}\">"._("Not logged in")."</a></h3></div>\n"; 
    119119                                        $admin->addUser(); 
    120120                                        break;