Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#95 Bugs about member edit in ADMIN.php(1700)

closed-fixed
Admin Area (22)
5
2004-09-08
2004-08-13
Edmond Hui
No

Discussion

  • Edmond Hui
    Edmond Hui
    2004-09-02

    • status: open --> wont-fix
     
  • Edmond Hui
    Edmond Hui
    2004-09-02

    • status: wont-fix --> open
     
  • Edmond Hui
    Edmond Hui
    2004-09-02

    Logged In: YES
    user_id=850273

    It seem fixed now.

     
  • Edmond Hui
    Edmond Hui
    2004-09-02

    • status: open --> pending
     
    • assigned_to: nobody --> dekarma
    • status: pending --> open-accepted
     
  • Logged In: YES
    user_id=315939

    Re: "It's fixed now"

    It isn't :)

    Here's the problem: When editing a user, a check is done to
    see if the resulting site state will still have at least one
    administrator left that can logon (admin=1 and canlogon=1).

    The forum topic describes a situation where the "edit user"
    action will be disallowed where it should be allowed. The
    solution presented in the forum topic however, is incorrect

    I'm looking at it right now...

     
  • Logged In: YES
    user_id=315939

    Fixed now.

    Update code:

    // check if there will remain at least one site member
    with both the logon and admin rights
    // (check occurs when taking away one of these rights from
    such a member)
    if ( (!$admin && $mem->isAdmin() && $mem->canLogin())
    || (!$canlogin && $mem->isAdmin() && $mem->canLogin())
    )
    {
    $r = sql_query('SELECT * FROM '.sql_table('member').'
    WHERE madmin=1 and mcanlogin=1');
    if (mysql_num_rows($r) < 2)
    $this->error(_ERROR_ATLEASTONEADMIN);
    }

     
    • status: open-accepted --> closed-fixed