if (trim($fields[$required[$i]]) == "") {
         $errors[$required[$i]] = true;
     }
 }
 if (is_array($errors)) {
     define("__SYM_ENTRY_MISSINGFIELDS__", true);
 } elseif ($fields['new_password'] != $fields['confirm_password']) {
     $Admin->pageAlert("password-mismatch", NULL, false, 'error');
 } elseif (trim($fields['password']) != "" && md5($fields['password']) != $DB->fetchVar('password', 0, "SELECT `password` FROM tbl_authors WHERE `id` = '" . $_REQUEST['id'] . "' LIMIT 1")) {
     $Admin->pageAlert("password-incorrect", NULL, false, 'error');
 } else {
     $current_username = $DB->fetchVar('username', 0, "SELECT `username` FROM `tbl_authors` WHERE `id` = " . $_REQUEST['id']);
     if (strtolower($current_username) != strtolower($fields['username']) && $authorManager->fetchByUsername($fields['username'])) {
         $Admin->pageAlert("duplicate", array("An Author", "username"), false, 'error');
     } else {
         $author =& $authorManager->create();
         $author->set('id', $_REQUEST['id']);
         $author->set('textformat', $fields['textformat']);
         if (isset($fields['superuser'])) {
             $author->set('superuser', $fields['superuser']);
         }
         $author->set('email', $fields['email']);
         $author->set('firstname', General::sanitize($fields['firstname']));
         $author->set('lastname', General::sanitize($fields['lastname']));
         if (isset($fields['allow_sections'])) {
             $author->set('allow_sections', @implode(",", $fields['allow_sections']));
         }
         $author->set('auth_token_active', $fields['auth_token_active'] ? $fields['auth_token_active'] : 'no');
         if ($current_username != $fields['username']) {
             $author->set('username', $fields['username']);
         }