Index: trunk/services/admins.php
===================================================================
--- trunk/services/admins.php	(revision 20)
+++ trunk/services/admins.php	(revision 21)
@@ -196,5 +196,4 @@
     }
 
-    // If the username was changed during edit, verify.
     if (getFormData('user_type') == 'root' && 'root' != $auth->getVal('user_type')) {
         $fv->addError('user_type', sprintf(_("You do not have clearance to create a user with root privileges."), null));
@@ -267,5 +266,5 @@
     if (!$frm = mysql_fetch_assoc($qid)) {
         App::logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__);
-        App::raiseMsg(sprintf(_("The requested record %s could not be found"), $id), MSG_ERR, __FILE__, __LINE__);
+        App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
         App::dieBoomerangURL();
     }
@@ -312,40 +311,40 @@
     if ($lock->isLocked() && !$lock->isMine()) {
         $lock->dieErrorPage();
+    }
+
+    // Break the cache because we are changing the list data.
+    SessionCache::breakCache($_SERVER['PHP_SELF']);
+    
+    // Get the information for this object.
+    $qid = DB::query("
+        SELECT username, user_type from admin_tbl
+        WHERE admin_id = '" . addslashes($id) . "'
+    ");
+    if (! list($name, $user_type) = mysql_fetch_row($qid)) {
+        App::logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__);
+        App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
+        App::dieBoomerangURL();
+    }
+    
+    // Get the information for this object.
+    $qid = DB::query("SELECT COUNT(*) from admin_tbl");
+    list($num_admins) = mysql_fetch_row($qid);
+    if ('root' == $user_type && 'root' != $auth->getVal('user_type')) {
+        // Only root users can delete root users!
+        App::raiseMsg(_("You do not have clearance to delete a root administrator."), MSG_NOTICE, __FILE__, __LINE__);
+    } else if ($num_admins <= 1) {
+        // There must always be at least one admnistrator!
+        App::raiseMsg(_("You cannot delete the only administrator in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__);
+    } else if ($auth->getVal('user_id') == $id) {
+        // Do not delete yourself!
+        App::raiseMsg(_("You cannot delete yourself."), MSG_NOTICE, __FILE__, __LINE__);
     } else {
-        // Break the cache because we are changing the list data.
-        SessionCache::breakCache($_SERVER['PHP_SELF']);
-        
-        // Get the information for this object.
-        $qid = DB::query("
-            SELECT username, user_type from admin_tbl
-            WHERE admin_id = '" . addslashes($id) . "'
-        ");
-        if (! list($name, $user_type) = mysql_fetch_row($qid)) {
-            App::logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__);
-            App::raiseMsg(sprintf(_("The requested record %s could not be found"), $id), MSG_ERR, __FILE__, __LINE__);
-            App::dieBoomerangURL();
-        }
-        
-        // Get the information for this object.
-        $qid = DB::query("SELECT COUNT(*) from admin_tbl");
-        list($num_admins) = mysql_fetch_row($qid);
-        if ('root' == $user_type && 'root' != $auth->getVal('user_type')) {
-            // Only root users can delete root users!
-            App::raiseMsg(_("You do not have clearance to delete a root administrator."), MSG_NOTICE, __FILE__, __LINE__);
-        } else if ($num_admins <= 1) {
-            // There must always be at least one admnistrator!
-            App::raiseMsg(_("You cannot delete the only administrator in the database. There must be at least one to log in and create other users."), MSG_NOTICE, __FILE__, __LINE__);
-        } else if ($auth->getVal('user_id') == $id) {
-            // Do not delete yourself!
-            App::raiseMsg(_("You cannot delete yourself."), MSG_NOTICE, __FILE__, __LINE__);
-        } else {
-            // Delete the record.
-            DB::query("DELETE FROM admin_tbl WHERE admin_id = '" . addslashes($id) . "'");
-            App::raiseMsg(sprintf(_("The admin <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
-        }
-
-        // Unlock record.
-        $lock->remove();
-    }
+        // Delete the record.
+        DB::query("DELETE FROM admin_tbl WHERE admin_id = '" . addslashes($id) . "'");
+        App::raiseMsg(sprintf(_("The admin <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
+    }
+
+    // Unlock record.
+    $lock->remove();
 }
 
@@ -399,36 +398,36 @@
     if ($lock->isLocked() && !$lock->isMine()) {
         $lock->dieErrorPage();
-    } else {
-        // Break the cache because we are changing the list data.
-        SessionCache::breakCache($_SERVER['PHP_SELF']);
-        
-        // If the userpass is left blank or with the filler **** characters, we don't want to update it.
-        if (!empty($frm['userpass']) && !preg_match('/[\*]{4,}/', $frm['userpass'])) {
-            // Set user password.
-            $auth->setPassword($frm['admin_id'], $frm['userpass']);
-        }
-        
-        // Update record data.
-        DB::query("
-            UPDATE admin_tbl SET
-                username = '" . addslashes($frm['username']) . "',
-                first_name = '" . addslashes($frm['first_name']) . "',
-                last_name = '" . addslashes($frm['last_name']) . "',
-                email = '" . addslashes($frm['email']) . "',
-                user_type = '" . addslashes($frm['user_type']) . "',
-                modified_by_user_id = '" . addslashes($auth->getVal('user_id')) . "',
-                modified_datetime = NOW()
-            WHERE admin_id = '" . addslashes($frm['admin_id']) . "'
-        ");
-
-        // Create version.
-        $version = RecordVersion::getInstance($GLOBALS['auth']);
-        $version->create('admin_tbl', 'admin_id', $frm['admin_id'], $frm['username']);
-    
-        App::raiseMsg(sprintf(_("The Admin <strong>%s</strong> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
-
-        // Unlock record.
-        $lock->remove();
-    }
+    }
+
+    // Break the cache because we are changing the list data.
+    SessionCache::breakCache($_SERVER['PHP_SELF']);
+    
+    // If the userpass is left blank or with the filler **** characters, we don't want to update it.
+    if (!empty($frm['userpass']) && !preg_match('/[\*]{4,}/', $frm['userpass'])) {
+        // Set user password.
+        $auth->setPassword($frm['admin_id'], $frm['userpass']);
+    }
+    
+    // Update record data.
+    DB::query("
+        UPDATE admin_tbl SET
+            username = '" . addslashes($frm['username']) . "',
+            first_name = '" . addslashes($frm['first_name']) . "',
+            last_name = '" . addslashes($frm['last_name']) . "',
+            email = '" . addslashes($frm['email']) . "',
+            user_type = '" . addslashes($frm['user_type']) . "',
+            modified_by_user_id = '" . addslashes($auth->getVal('user_id')) . "',
+            modified_datetime = NOW()
+        WHERE admin_id = '" . addslashes($frm['admin_id']) . "'
+    ");
+
+    // Create version.
+    $version = RecordVersion::getInstance($GLOBALS['auth']);
+    $version->create('admin_tbl', 'admin_id', $frm['admin_id'], $frm['username']);
+
+    App::raiseMsg(sprintf(_("The Admin <strong>%s</strong> has been updated."), $frm['username']), MSG_SUCCESS, __FILE__, __LINE__);
+
+    // Unlock record.
+    $lock->remove();
 }
 
Index: trunk/services/templates/admin_list.ihtml
===================================================================
--- trunk/services/templates/admin_list.ihtml	(revision 20)
+++ trunk/services/templates/admin_list.ihtml	(revision 21)
@@ -8,5 +8,5 @@
     
     <input type="text" class="small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: Admin id, Username, Userpass, First name, Last name, Email, User type, Login abuse exempt, Blocked, Blocked reason, Abuse warning level, Seconds online, Last login datetime, Last access datetime, Last login ip, Added by user id, Modified by user id, Added datetime, Modified datetime.")); ?>" />
-    <input type="submit" name="list" value="<?php echo _("Search"); ?>" />
+    <input type="submit" value="<?php echo _("Search"); ?>" />
 </div>
 
Index: trunk/services/versions.php
===================================================================
--- trunk/services/versions.php	(revision 20)
+++ trunk/services/versions.php	(revision 21)
@@ -79,14 +79,14 @@
     if ($lock->isLocked() && !$lock->isMine()) {
         $lock->dieErrorPage();
+    }
+
+    if ($v = $version->restore($version_id)) {
+        // Create version of this restored record as the "current" version.
+        $version->create($record_table, $record_key, $record_val, $v['version_title']);
+        App::raiseMsg(sprintf(_("The record <strong>%s</strong> has been replaced with <strong>%s</strong> version <strong>%s</strong> from <strong>%s</strong>."), getFormData('version_title'), $v['version_title'], $version_id, $v['version_datetime']), MSG_SUCCESS, __FILE__, __LINE__);
+        App::dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
     } else {
-        if ($v = $version->restore($version_id)) {
-            // Create version of this restored record as the "current" version.
-            $version->create($record_table, $record_key, $record_val, $v['version_title']);
-            App::raiseMsg(sprintf(_("The record <strong>%s</strong> has been replaced with <strong>%s</strong> version <strong>%s</strong> from <strong>%s</strong>."), getFormData('version_title'), $v['version_title'], $version_id, $v['version_datetime']), MSG_SUCCESS, __FILE__, __LINE__);
-            App::dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
-        } else {
-            App::raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
-            App::dieURL($_SERVER['PHP_SELF']);
-        }
+        App::raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
+        App::dieURL($_SERVER['PHP_SELF']);
     }
     break;
