#9 user_can_add ()

v0.0.3
closed-rejected
Corey
None
5
2005-08-13
2005-08-13
marcoparco
No

i have notice a strange behaviour, for example:
we are an admin, and want to add a mailbox to a domain
which is not assigned to anyone,
we will get a javascript warning "this users is only
allowed to create 0 email accounts".
this is a low-critical problem, but maybe there are
other places where the user_can_add () function can
give strange results..
what do u think about this fixing for line 603 of
/httpdocs/functions.php:
add 1 line:

if($uid=='0' AND is_admin()) return true;

just before:
if(!$lim) return false;
if($lim < 0) return true;

ciaooo

Discussion

  • Corey
    Corey
    2005-08-13

    • assigned_to: nobody --> cormander
    • status: open --> closed-rejected
     
  • Corey
    Corey
    2005-08-13

    Logged In: YES
    user_id=1066333

    This is actually the intended behavior.

    The idea is a client can't add beyond the permissions, but
    the admin can. There wasn't anything that pissed me off more
    when using plesk, than having to raise permissions on a
    users account whenever I wanted to add / remove something.
    It was quite the tedius task. Me, like many other in the
    company that I worked for at the time, wished it would just
    give a warning rather then stop you completly. Perhaps
    automatically raise the limit when an admin add something.

    Anyway, this code should definatly be looked at, but for the
    purposes of this ticket, this is not a bug. Please start a
    thread on the website forums about the behavior of this
    funtion so it can be in open discussion there.

    Thanks!