I find your module very promising and might use it on a current project, but there's one feature that would be nice and that would be a limit on the number of subusers a parent account can create. I inserted a hack that removes the create link when a certain number is reached but it's not much. First, I'm hacking your module and 2nd, all it does is remove the link. It doesn't actually prevent the creation of more subusers. I may look into a better solution, but even better yet would be if you considered adding a subuser limit feature.

        global $user;
        $totalSubusers = db_result(db_query("SELECT COUNT(*) FROM {user_relationship} WHERE parent_id = %d",$user->uid));
        if ($totalSubusers < 10) {
          if ($create) {
            $links[] = l(t(SUBUSER_CREATE), 'user/' . $account->uid . '/subuser/create');
          }
          if ($administer) {
            $links[] = l(t(SUBUSER_ADMINISTER), 'admin/user/user');
          }

          $output = implode(' | ', $links);
        }

Comments

eojthebrave’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #459694: Limit number of subusers