How to make it work with 2.0.4?

Makes it possible for admin to create users from admin panel
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby antje on Wed 25. Jun, 2003 13:45

Having studied the examples, I've noticed that windstar's code repeats three lines (almost exactly, except for the htmlspecialchars, which is apparently not the problem) that Niels (mistakenly) includes and Crimson Fuzor has deleted in order to make his/her code work.

Niels had this code:

Code: Select all
$this_userdata = get_userdata($user_id);
      if( !$this_userdata )
      {
        message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
      }
    }
  else
    {
      $this_userdata = get_userdata( $HTTP_POST_VARS['username'] ); //delete this line
      if( !$this_userdata )                                         // delete this line
      {                                                             // delete this line
if ($HTTP_POST_VARS['new_user'])
{  //we need to create this user !, before continue



Crimson Fuzor had this code:

Code: Select all
   
    $this_userdata = get_userdata($user_id);
      if( !$this_userdata )
      {

        message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
      }
    }
    else
    {
                                                                    // notice those three lines
                                                                   // are deleted & it works
if ($HTTP_POST_VARS['new_user'])
{  //we need to create this user !, before continue

and windstar had this code:
Code: Select all
$this_userdata = get_userdata(htmlspecialchars($HTTP_POST_VARS['username']));   // delete this line!
      if( !$this_userdata )                                                     // delete this line!
      {                                                                         // delete this line too!

if ($HTTP_POST_VARS['new_user'])
{  //we need to create this user !, before continue


It was the started and never finished if-loop that gave windstar the parse error.
antje
 

More problems

Postby imun_sg on Sat 28. Jun, 2003 23:18

I've made the changes, but when I click on "Management" on the left Admin navigation bar, I get the message: "User does not exist" in the right pane. Could anyone give me any help? Can we get the MOD files updated to how it should be for those unexperienced with PHP (like myself) who can't tweak the code?

Thanks.
imun_sg
Poster
Poster
 
Posts: 2
Joined: Wed 18. Jun, 2003 00:57

Postby windstar on Sun 29. Jun, 2003 01:08

ok, i finally gave up an uninstalled this mod.

There is another one working for me (not so comfortable like this one) here: http://www.awsw.de/Forum/viewtopic.php?t=984
Gruß
windstar

Besucht mal meine Stammkneipe
windstar
Poster
Poster
 
Posts: 6
Joined: Sun 18. May, 2003 18:29

Postby playfulkitten on Tue 01. Jul, 2003 19:31

I had a little trouble with this, and I really don't know why, but I know I now have the code section in admin_users.php working correctly. At first, I couldn't get it to show the checkbox -- the BEGIN and END html-style comments in the template file -- user_select_body.tpl -- were causing that; when they were removed I could see the checkbox. Then, I could get the new user working but managed to break it looking up users that did exist.

I've finally gotten it to what is intended. (I have trouble with trying to insert code in the middle, especially when nested levels are involved (all those braces!).) Here's what that full section looks like for me, with it working (including a little extra code to make it easier to identify in the file):

Code: Select all
if( isset( $HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) )
{
    $user_id = ( isset( $HTTP_POST_VARS[POST_USERS_URL]) ) ? intval( $HTTP_POST_VARS[POST_USERS_URL]) : intval( $HTTP_GET_VARS[POST_USERS_URL]);
    $this_userdata = get_userdata($user_id);
    if( !$this_userdata )
    {
        message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
    }
}
else
{
    $this_userdata = get_userdata($HTTP_POST_VARS['username'], true);
    if( !$this_userdata )
    {
        if ($HTTP_POST_VARS['new_user'])
        { //we need to create this user !, before continue
            $this_userdata = get_userdata(ANONYMOUS);
            $sql = "SELECT MAX(user_id) AS total FROM " . USERS_TABLE;

            /* snipped a bunch of code to shorten the post */

            // get the data of the newly created user !
            $this_userdata = get_userdata($user_id);
        }
        else
        {
            message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
        }
    }
}
playfulkitten
Poster
Poster
 
Posts: 1
Joined: Tue 01. Jul, 2003 19:07

Postby jpb on Thu 26. Aug, 2004 23:14

jpb
Poster
Poster
 
Posts: 5
Joined: Mon 16. Aug, 2004 16:35

Previous

Return to Admin add users [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron