/** * Generates a unique username for a wiki account based on the prefix specified * in the message 'fbconnect-usernameprefix'. The number appended is equal to * the number of Facebook Connect to user ID associations in the user_fbconnect * table, so quite a few numbers will be skipped. However, this approach is * more scalable. For smaller wiki installations, uncomment the line $i = 1 to * have consecutive usernames starting at 1. */ public function generateUserName() { // Because $i is incremented the first time through the while loop $i = FBConnectDB::countUsers(); #$i = 1; // This is the DUMB WAY to do this while ($i < PHP_INT_MAX) { $name = $this->userNamePrefix . $i; if ($this->userNameOK($name)) { return $name; } ++$i; } return $prefix; }