Index: trunk/lib/RecordLock.inc.php
===================================================================
--- trunk/lib/RecordLock.inc.php	(revision 28)
+++ trunk/lib/RecordLock.inc.php	(revision 42)
@@ -33,5 +33,5 @@
     {
         static $instances = array();
-                
+
         if (!isset($instances[$auth_object->getVal('auth_name')])) {
             $instances[$auth_object->getVal('auth_name')] = new RecordLock($auth_object);
@@ -53,5 +53,5 @@
 
         $this->_auth = $auth_object;
-        
+
         // Get create tables config from global context.
         if (!is_null(App::getParam('db_create_tables'))) {
@@ -70,5 +70,5 @@
     {
         static $_db_tested = false;
-    
+
         if ($recreate_db || !$_db_tested && $this->getParam('create_table')) {
             if ($recreate_db) {
@@ -89,18 +89,18 @@
                 KEY record_val (record_val)
             )");
-            
+
             if (!DB::columnExists($this->getParam('db_table'), array(
-				'lock_id',
-				'record_table',
-				'record_key',
-				'record_val',
-				'title',
-				'set_by_admin_id',
-				'lock_datetime',
+                'lock_id',
+                'record_table',
+                'record_key',
+                'record_val',
+                'title',
+                'set_by_admin_id',
+                'lock_datetime',
             ), false, false)) {
                 App::logMsg(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), LOG_ALERT, __FILE__, __LINE__);
                 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', $this->getParam('db_table')), E_USER_ERROR);
             }
-        }    
+        }
         $_db_tested = true;
     }
@@ -151,9 +151,9 @@
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         if (is_numeric($record_table_or_lock_id) && !isset($record_key) && !isset($record_val)) {
             // Get lock data by lock_id.
             $qid = DB::query("
-                SELECT * FROM " . $this->getParam('db_table') . " 
+                SELECT * FROM " . $this->getParam('db_table') . "
                 WHERE lock_id = '" . addslashes($record_table_or_lock_id) . "'
             ");
@@ -161,5 +161,5 @@
             // Get lock data by record specs
             $qid = DB::query("
-                SELECT * FROM " . $this->getParam('db_table') . " 
+                SELECT * FROM " . $this->getParam('db_table') . "
                 WHERE record_table = '" . addslashes($record_table_or_lock_id) . "'
                 AND record_key = '" . addslashes($record_key) . "'
@@ -189,5 +189,5 @@
 
     /**
-     * Returns the status of who set the lock. Use this to ignore locks set by 
+     * Returns the status of who set the lock. Use this to ignore locks set by
      * the current user.
      *
@@ -197,5 +197,5 @@
     {
         $this->initDB();
-        
+
         if (isset($this->data['lock_id'])) {
             $qid = DB::query("SELECT * FROM " . $this->getParam('db_table') . " WHERE lock_id = '" . addslashes($this->data['lock_id']) . "'");
@@ -221,18 +221,18 @@
      */
     function set($record_table, $record_key, $record_val, $title='')
-    {       
+    {
         $this->initDB();
 
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         // Remove previous locks if exist. Is this better than using a REPLACE INTO?
         DB::query("
-            DELETE FROM " . $this->getParam('db_table') . " 
+            DELETE FROM " . $this->getParam('db_table') . "
             WHERE record_table = '" . addslashes($record_table) . "'
             AND record_key = '" . addslashes($record_key) . "'
             AND record_val = '" . addslashes($record_val) . "'
         ");
-        
+
         // Set new lock.
         DB::query("
@@ -254,8 +254,8 @@
         ");
         $lock_id = mysql_insert_id(DB::getDBH());
-        
+
         // Must register this locked record as the current.
         $this->select($lock_id);
-        
+
         return $lock_id;
     }
@@ -270,11 +270,11 @@
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         // Delete a specific lock.
         DB::query("
-            DELETE FROM " . $this->getParam('db_table') . " 
+            DELETE FROM " . $this->getParam('db_table') . "
             WHERE lock_id = '" . addslashes($this->data['lock_id']) . "'
         ");
-        
+
         App::logMsg(sprintf('Removing lock: %s', $this->data['lock_id']), LOG_DEBUG, __FILE__, __LINE__);
     }
@@ -284,10 +284,10 @@
      */
     function removeAll($user_id=null)
-    {        
+    {
         $this->initDB();
 
         // Expire old locks.
         $this->_auto_timeout();
-        
+
         if (isset($user_id)) {
             // Delete specific user's locks.
@@ -309,9 +309,9 @@
 
         $this->initDB();
-        
+
         if (!$_timeout_run) {
             // Delete all old locks.
             DB::query("
-                DELETE FROM " . $this->getParam('db_table') . " 
+                DELETE FROM " . $this->getParam('db_table') . "
                 WHERE DATE_ADD(lock_datetime, INTERVAL '" . $this->getParam('auto_timeout') . "' SECOND) < NOW()
             ");
@@ -337,18 +337,18 @@
         <?php App::printHiddenSession() ?>
         <input type="hidden" name="lock_id" value="<?php echo $this->getID(); ?>" />
-        
+
         <p><?php
-        printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."), 
-            $this->getTitle(), 
-            $this->getEditor(), 
+        printf(_("The record <strong>%s</strong> is currently being edited by <strong>%s</strong> (%d minutes elapsed). You cannot modify the record while it is locked by another user."),
+            $this->getTitle(),
+            $this->getEditor(),
             date('i', $this->getSecondsElapsed() + 60)
         );
         ?></p>
-        
+
         <?php if ($this->getSecondsElapsed() > $this->getParam('timeout')) { ?>
         <p><?php printf(_("You can forcibly unlock the record if you believe the editing session has expired. You might want to confirm with %s before doing this."), $this->getEditor()) ?></p>
         <input type="submit" name="unlock" value="<?php echo _("Unlock"); ?>" />
         <?php } ?>
-        
+
         <input type="submit" name="cancel" value="<?php echo _("Cancel"); ?>" />
         </form>
