$wb->print_error($MESSAGE['USERS_EMAIL_TAKEN'], $js_back, false);
    } else {
        $wb->print_error($MESSAGE['USERS_INVALID_EMAIL'], $js_back, false);
    }
}
// MD5 supplied password
$md5_password = md5($new_pass);
// Inser the user into the database
$sql = '';
$query = "INSERT INTO " . TABLE_PREFIX . "users (group_id,groups_id,active,username,password,display_name,email) VALUES ('{$groups_id}', '{$groups_id}', '{$active}', '{$username}','{$md5_password}','{$display_name}','{$email}')";
$database->query($query);
if ($database->is_error()) {
    // Error updating database
    $message = $database->get_error();
} else {
    // Setup email to send
    $mail_to = $email;
    $mail_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'];
    // Replace placeholders from language variable with values
    $search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
    $replace = array($display_name, WEBSITE_TITLE, $username, $new_pass);
    $mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2_BODY_LOGIN_INFO']);
    // Try sending the email
    if ($wb->mail(SERVER_EMAIL, $mail_to, $mail_subject, $mail_message)) {
        $display_form = false;
        $wb->print_success($MESSAGE['FORGOT_PASS_PASSWORD_RESET'], WB_URL . '/account/login.php');
    } else {
        $database->query("DELETE FROM " . TABLE_PREFIX . "users WHERE username = '******'");
        $wb->print_error($MESSAGE['FORGOT_PASS_CANNOT_EMAIL'], $js_back, false);
    }
}
        if ($themail != '') {
            $email = $themail;
        } else {
            $email = '*****@*****.**';
        }
        $headers = "Content-Type: text/html\n";
        $headers .= "Content-Transfer-Encoding: 8bit\n";
        $headers .= "From: " . $thename . "<" . $email . ">\n";
        $headers .= "Reply-To: " . $email . "\n";
        $mail_message = nl2br(strip_tags(stripslashes($commentpost)));
        $mail_message .= '<br/><br/>
		<a href="' . $topic_link . '">See Comment</a> | <a href="' . $backend_link . '#comments">Edit Comments</a>';
        if ($commentextra != '') {
            $mail_message .= '| <a href="' . $topic_link . '?publ=' . $commentextra . '">Publish</a>';
        }
        $wb->mail(SERVER_EMAIL, $admin_email, $mail_subject, $mail_message);
        //echo $mail_message;
        //die('mail wurde versendet');
    } else {
        //die('mail konnte nicht versendet werden');
    }
    // End Mail
    if ($spamlevel > 1) {
        //exit(header("Location: ".WB_URL."/modules/".$mod_dir."/comments_iframe/nopage.php")); //exit(header("Location: ".WB_URL.PAGES_DIRECTORY.""));
    }
    // Insert the comment into db
    //Hinweis: FELD commentextra hier eventuell checken und einfügen
    $theq = "INSERT INTO " . TABLE_PREFIX . "mod_" . $tablename . "_comments (topic_id,name,website,email,comment,commented_when,commented_by,active,show_link,commentextra) VALUES ('{$topic_id}','{$thename}','{$thesite}','{$themail}','{$comment}','{$commented_when}','{$commented_by}','{$active}','{$show_link}','{$commentextra}')";
    $theq = str_replace(array("[", "]"), array("&#91;", "&#93;"), $theq);
    $query = $database->query($theq);
    $last_insert = $database->get_one("SELECT LAST_INSERT_ID()");