static function adduser(&$username, &$password, &$email, $userlevel, $usergroups = array(), $no_create = false, $right_publish = true, $straight_insert = false, $approve = false, $use_captcha = false)
 {
     global $serendipity;
     if (serendipity_common_adduser::checkuser($usergroups)) {
         return true;
     }
     if (!empty($serendipity['POST']['adduser_action'])) {
         if (empty($username) || empty($password) || empty($email)) {
             echo PLUGIN_ADDUSER_MISSING . '<hr />';
             return false;
         }
         if ($use_captcha) {
             // Fake call to spamblock/captcha and other comment plugins.
             $ca = array('id' => 0, 'allow_comments' => 'true', 'moderate_comments' => false, 'last_modified' => 1, 'timestamp' => 1);
             $commentInfo = array('type' => 'NORMAL', 'source' => 'commentform', 'name' => $username, 'url' => '', 'comment' => 'A new user ' . md5(time()) . ' is registered.', 'email' => $email, 'source2' => 'adduser');
             serendipity_plugin_api::hook_event('frontend_saveComment', $ca, $commentInfo);
             if ($ca['allow_comments'] === false) {
                 echo PLUGIN_ADDUSER_ANTISPAM . '<hr />';
                 return false;
             }
             // End of fake call.
         }
         $user = serendipity_db_query("SELECT authorid FROM {$serendipity['dbPrefix']}authors WHERE username = '******'", true);
         if (is_array($user) && !empty($user['authorid'])) {
             printf(PLUGIN_ADDUSER_EXISTS . '<hr />', function_exists('serendipity_specialchars') ? serendipity_specialchars($username) : htmlspecialchars($username, ENT_COMPAT, LANG_CHARSET));
             return false;
         }
         $hash = serendipity_common_adduser::addAuthor($username, $password, $email, $userlevel, $right_publish, $no_create);
         if ($approve) {
             serendipity_common_adduser::sendMail($username, $hash, $email, true);
             echo PLUGIN_ADDUSER_SENTMAIL_APPROVE;
         } elseif ($straight_insert) {
             $serendipity['GET']['adduser_activation'] = $hash;
             serendipity_common_adduser::checkuser($usergroups);
         } elseif (serendipity_common_adduser::sendMail($username, $hash, $email)) {
             echo PLUGIN_ADDUSER_SENTMAIL;
         } else {
             echo ERROR;
         }
         unset($serendipity['POST']['adduser_action']);
         // Ensure the plugin is not called twice
         return true;
     }
     return false;
 }