Index: /extensions/LCAS/trunk/admin/LCAS_admin.php
===================================================================
--- /extensions/LCAS/trunk/admin/LCAS_admin.php	(revision 10548)
+++ /extensions/LCAS/trunk/admin/LCAS_admin.php	(revision 10549)
@@ -9,6 +9,8 @@
 check_status(ACCESS_ADMINISTRATOR);
 
-if (!defined('LCAS_PATH')) define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
-if (!defined('LCAS_PATH_ABS')) define('LCAS_PATH_ABS' ,  dirname(__FILE__).'/');
+if (!defined('LCAS_PATH'))
+ define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+if (!defined('LCAS_PATH_ABS'))
+ define('LCAS_PATH_ABS' ,  dirname(__FILE__).'/');
 
 //ini_set('error_reporting', E_ALL);
@@ -30,145 +32,160 @@
 $version = $plugin['version'];
 
-	if (isset($_POST['submit']) and isset($_POST['LCAS_Option']) and isset($_POST['LCAS_Mail']))
+if (isset($_POST['submit'])
+ and isset($_POST['LCAS_Option'])
+ and isset($_POST['LCAS_Mail']))
+{
+
+/* General configuration settings */
+  $_POST['LCAS_MailText'] = str_replace('\"', '"', str_replace("\'", "'",
+   str_replace("\\\\", "\\", $_POST['LCAS_MailText'])));
+  
+  $newconf_LCAS= array(
+    $_POST['LCAS_Option'],
+    $_POST['LCAS_Mail'],
+    $_POST['LCAS_MailText']);
+
+  $conf['LoginCaseAccentsSensitivity'] = serialize($newconf_LCAS);
+
+  $query = '
+    UPDATE '.CONFIG_TABLE.'
+    SET value="'.addslashes($conf['LoginCaseAccentsSensitivity']).'"
+    WHERE param="LoginCaseAccentsSensitivity"
+    LIMIT 1
+    ;';
+  
+  pwg_query($query);
+
+  array_push($page['infos'], l10n('LCAS_save_config'));
+}
+
+$conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']);
+
+if (isset($conf_LCAS[0]))
+{
+  $case_ins = ($conf_LCAS[0] == '1' or $conf_LCAS[0] == '3');
+  $acc_ins = ($conf_LCAS[0] == '2' or $conf_LCAS[0] == '3');
+
+  if ($case_ins or $acc_ins)
   {
 
-/* General configuration settings */
-		$_POST['LCAS_MailText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['LCAS_MailText'])));
-    
-    $newconf_LCAS= array(
-      $_POST['LCAS_Option'],
-      $_POST['LCAS_Mail'],
-      $_POST['LCAS_MailText']);
-
-    $conf['LoginCaseAccentsSensitivity'] = serialize($newconf_LCAS);
-
-		$query = '
-	  	UPDATE '.CONFIG_TABLE.'
-	  	SET value="'.addslashes($conf['LoginCaseAccentsSensitivity']).'"
-	  	WHERE param="LoginCaseAccentsSensitivity"
-	  	LIMIT 1
-	  	;';
-		
-		pwg_query($query);
-
-    array_push($page['infos'], l10n('LCAS_save_config'));
-  }
-
-	$conf_LCAS= unserialize($conf['LoginCaseAccentsSensitivity']);
-  
-  if (isset($conf_LCAS[0]))
-  {
-    $case_ins = ($conf_LCAS[0] == '1' or $conf_LCAS[0] == '3');
-    $acc_ins = ($conf_LCAS[0] == '2' or $conf_LCAS[0] == '3');
-
-    if ($case_ins or $acc_ins)
+// +-----------------------------------------------------------------------+
+// |                               user list                               |
+// +-----------------------------------------------------------------------+
+
+    $page['all_users'] = LCAS_get_user_list($conf_LCAS[0]);
+
+// +-----------------------------------------------------------------------+
+// |                           initialization                              |
+// +-----------------------------------------------------------------------+
+
+    $lcas_UserToUpdate = -1;
+    if ((isset($_POST['UserToUpdate'])) && ($_POST['UserToUpdate'] != -1)) {
+      $lcas_UserToUpdate = $_POST['UserToUpdate'];
+      
+      if ((isset($_POST['user-'.$lcas_UserToUpdate])) &&
+       ($_POST['user-'.$lcas_UserToUpdate] != '')) {
+
+        // Check if username already exists
+        $lcas_previous_compare_user =
+         LCAS_change_case($_POST['user-'.$lcas_UserToUpdate], $conf_LCAS[0]);
+
+        $LCAS_users = array();
+
+        // This is a dirty request - Works fine for small number of users
+        // but could be unoptimized for large number of users
+        $query = '
+          SELECT '.$conf['user_fields']['username'].' AS username
+          FROM '.USERS_TABLE.';';
+        
+        $res = pwg_query($query);
+        while ($r = pwg_db_fetch_assoc($res))
+        {
+          $LCAS_users[$r['username']] =
+           LCAS_change_case($r['username'], $conf_LCAS[0]);
+        }
+          
+        $users_found = array_keys($LCAS_users, $lcas_previous_compare_user);
+
+        if (count($users_found) < 1)
+        {
+          // Get old username before update -
+          // Useful for user notification if is set
+          $query ='
+            SELECT username
+            FROM '.USERS_TABLE.'
+            WHERE id = '.$lcas_UserToUpdate.'
+          ;';
+
+          $data = pwg_db_fetch_assoc(pwg_query($query));
+
+          // Username update
+          $query = '
+            UPDATE '.USERS_TABLE.'
+            SET username="'.addslashes($_POST['user-'.$lcas_UserToUpdate]).'"
+            WHERE id='.$lcas_UserToUpdate.'
+            LIMIT 1
+            ;';
+
+          pwg_query($query);
+
+          if (isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true')
+          {
+            LCAS_SendMail($lcas_UserToUpdate, $data['username'],
+             $_POST['user-'.$lcas_UserToUpdate]);
+          }
+
+          // Reloading conflict table content
+          $page['all_users'] = LCAS_get_user_list($conf_LCAS[0]);
+          array_push($page['infos'],
+           l10n('LCAS_Info_userlist_username_renamed'));
+        }
+        else
+        {
+          // Username already exists
+          array_push(
+            $page['errors'],
+            l10n('LCAS_Err_Userlist_New_Username_Exists').
+             '<br>"'.$lcas_previous_compare_user.'"'
+          );
+        }
+      }
+      else {
+        // Username is empty
+        array_push($page['errors'],
+         l10n('LCAS_Err_Userlist_Empty_New_Username'));
+      }
+    }
+
+// +-----------------------------------------------------------------------+
+// |                               user list                               |
+// +-----------------------------------------------------------------------+
+
+    $lcas_previous_compare_user = '';
+    $visible_user_list          = array();
+    foreach ($page['all_users'] as $local_user)
     {
-
-// +-----------------------------------------------------------------------+
-// |                               user list                               |
-// +-----------------------------------------------------------------------+
-
-      $page['all_users'] = LCAS_get_user_list($conf_LCAS[0]);
-
-// +-----------------------------------------------------------------------+
-// |                           initialization                              |
-// +-----------------------------------------------------------------------+
-
-      $lcas_UserToUpdate = -1;
-      if ((isset($_POST['UserToUpdate'])) && ($_POST['UserToUpdate'] != -1)) {
-        $lcas_UserToUpdate = $_POST['UserToUpdate'];
-        
-        if ((isset($_POST['user-'.$lcas_UserToUpdate])) && ($_POST['user-'.$lcas_UserToUpdate] != '')) {
-
-          // Check if username already exists
-        	$lcas_previous_compare_user = LCAS_change_case($_POST['user-'.$lcas_UserToUpdate], $conf_LCAS[0]);
-
-          $LCAS_users = array();
-
-          // This is a dirty request - Works fine for small number of users but could be unoptimized for large number of users
-          $query = '
-            SELECT '.$conf['user_fields']['username'].' AS username
-            FROM '.USERS_TABLE.';';
-          
-          $res = pwg_query($query);
-          while ($r = pwg_db_fetch_assoc($res))
-          {
-            $LCAS_users[$r['username']] = LCAS_change_case($r['username'], $conf_LCAS[0]);
-          }
-            
-          $users_found = array_keys($LCAS_users, $lcas_previous_compare_user);
-
-          if (count($users_found) < 1)
-          {
-            // Get old username before update - Usefull for user notification if is set
-            $query ='
-              SELECT username
-              FROM '.USERS_TABLE.'
-              WHERE id = '.$lcas_UserToUpdate.'
-            ;';
-
-            $data = pwg_db_fetch_assoc(pwg_query($query));
-  
-            // Username update
-            $query = '
-              UPDATE '.USERS_TABLE.'
-              SET username="'.addslashes($_POST['user-'.$lcas_UserToUpdate]).'"
-              WHERE id='.$lcas_UserToUpdate.'
-              LIMIT 1
-              ;';
-
-            pwg_query($query);
-
-            if (isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true')
-            {
-              LCAS_SendMail($lcas_UserToUpdate, $data['username'], $_POST['user-'.$lcas_UserToUpdate]);
-            }
-
-            // Reloading conflict table content
-            $page['all_users'] = LCAS_get_user_list($conf_LCAS[0]);
-            array_push($page['infos'], l10n('LCAS_Info_userlist_username_renamed'));
-          }
-          else
-          {
-            // Username already exists
-            array_push($page['errors'], l10n('LCAS_Err_Userlist_New_Username_Exists').'<br>"'.$lcas_previous_compare_user.'"');
-          }
-        }
-        else {
-          // Username is empty
-          array_push($page['errors'], l10n('LCAS_Err_Userlist_Empty_New_Username'));
-        }
-      }
-
-// +-----------------------------------------------------------------------+
-// |                               user list                               |
-// +-----------------------------------------------------------------------+
-
-      $lcas_previous_compare_user = '';
-      $visible_user_list          = array();
-      foreach ($page['all_users'] as $local_user)
-      {
-        if ($lcas_previous_compare_user != $local_user['transformed']) {
-          $display = 'orange';
-          $lcas_previous_compare_user = $local_user['transformed'];
-        }
-        else {
-          $display = '';
-        }
-
-        $template->append(
-          'users',
-          array(
-            'ID'          => $local_user['id'],
-            'USERNAME'    => stripslashes($local_user['username']),
-            'COMPARE'     => stripslashes($local_user['transformed']),
-            'EMAIL'       => get_email_address_as_display_text($local_user['email']),
-            'DISPLAY'     => $display,
-          )
-        );
-      }
-      
+      if ($lcas_previous_compare_user != $local_user['transformed']) {
+        $display = 'orange';
+        $lcas_previous_compare_user = $local_user['transformed'];
+      }
+      else {
+        $display = '';
+      }
+
+      $template->append(
+        'users',
+        array(
+          'ID'          => $local_user['id'],
+          'USERNAME'    => stripslashes($local_user['username']),
+          'COMPARE'     => stripslashes($local_user['transformed']),
+          'EMAIL'       =>
+           get_email_address_as_display_text($local_user['email']),
+          'DISPLAY'     => $display,
+        )
+      );
     }
   }
+}
 
 
@@ -176,16 +193,16 @@
 // |                           templates init                              |
 // +-----------------------------------------------------------------------+
-  $template->assign(
-    array(
-    'LCAS_VERSION'                  => $version,
-    'LCAS_PATH'                     => LCAS_PATH,
-    'PHPWG_VERSION'                 => PHPWG_VERSION,
-    'LCAS_PATH_ABS'                 => LCAS_PATH_ABS,
-		'LCAS_Option'                   => $conf_LCAS[0],
-		'LCAS_MAIL_TRUE'                => $conf_LCAS[1] == 'true'  ? 'checked = "checked"' : '' ,
-		'LCAS_MAIL_FALSE'               => $conf_LCAS[1] == 'false' ? 'checked = "checked"' : '' ,
-    'LCAS_MAILTEXT'                 => $conf_LCAS[2]
-    )
-  );
+$template->assign(
+  array(
+  'LCAS_VERSION'    => $version,
+  'LCAS_PATH'       => LCAS_PATH,
+  'PHPWG_VERSION'   => PHPWG_VERSION,
+  'LCAS_PATH_ABS'   => LCAS_PATH_ABS,
+  'LCAS_Option'     => $conf_LCAS[0],
+  'LCAS_MAIL_TRUE'  => $conf_LCAS[1] == 'true'  ? 'checked = "checked"' : '' ,
+  'LCAS_MAIL_FALSE' => $conf_LCAS[1] == 'false' ? 'checked = "checked"' : '' ,
+  'LCAS_MAILTEXT'   => $conf_LCAS[2]
+  )
+);
 
 
@@ -193,18 +210,19 @@
 // |                             errors display                            |
 // +-----------------------------------------------------------------------+
-  if (isset ($errors) and count($errors) != 0)
+if (isset ($errors) and count($errors) != 0)
+{
+  $template->assign('errors',array());
+  foreach ($errors as $error)
   {
-	  $template->assign('errors',array());
-	  foreach ($errors as $error)
-	  {
-		  array_push($page['errors'], $error);
-		}
-	}  
+    array_push($page['errors'], $error);
+  }
+}  
 
 // +-----------------------------------------------------------------------+
 // |                           templates display                           |
 // +-----------------------------------------------------------------------+
-  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/global.tpl');
-  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+$template->set_filename('plugin_admin_content',
+ dirname(__FILE__) . '/template/global.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 
 ?>
Index: /extensions/LCAS/trunk/include/admin_search.inc.php
===================================================================
--- /extensions/LCAS/trunk/include/admin_search.inc.php	(revision 10548)
+++ /extensions/LCAS/trunk/include/admin_search.inc.php	(revision 10549)
@@ -1,4 +1,4 @@
 <?php
-// Keeps file coded in UTF-8 without BOM: é
+// Keep file coded in UTF-8 without BOM: é
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
@@ -37,6 +37,6 @@
   $filter = array();
 
-    // Build a PHP regex both complying to user's request, and to LCAS current
-    // rule
+    // Build a PHP regex both complying to user's request,
+    // and to LCAS current rule
     $username=  preg_replace(array('/^\*/', '/\*$/'), '%', $_GET['username']);
     if (preg_match('/%$/', $username))
@@ -233,5 +233,6 @@
 // allow plugins to fill template var plugin_user_list_column_titles and
 // plugin_columns/plugin_actions for each user in the list
-$visible_user_list = trigger_event('loc_visible_user_list', $visible_user_list);
+$visible_user_list =
+ trigger_event('loc_visible_user_list', $visible_user_list);
 
 foreach ($visible_user_list as $local_user)
@@ -262,7 +263,8 @@
     $properties[] = l10n( sprintf('Level %d', $local_user['level']) );
   }
-  $properties[] =
-    (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))
-        ? l10n('High definition') : l10n('');
+  $properties[] = (
+    isset($local_user['enabled_high']) and
+    ($local_user['enabled_high'] == 'true')
+  ) ? l10n('High definition') : l10n('');
 
   $template->append(
@@ -282,6 +284,8 @@
       'GROUPS' => $groups_string,
       'PROPERTIES' => implode( ', ', $properties),
-      'plugin_columns' => isset($local_user['plugin_columns']) ? $local_user['plugin_columns'] : array(),
-      'plugin_actions' => isset($local_user['plugin_actions']) ? $local_user['plugin_actions'] : array(),
+      'plugin_columns' => isset($local_user['plugin_columns']) ?
+       $local_user['plugin_columns'] : array(),
+      'plugin_actions' => isset($local_user['plugin_actions']) ?
+       $local_user['plugin_actions'] : array(),
       )
     );
Index: /extensions/LCAS/trunk/include/functions.inc.php
===================================================================
--- /extensions/LCAS/trunk/include/functions.inc.php	(revision 10548)
+++ /extensions/LCAS/trunk/include/functions.inc.php	(revision 10549)
@@ -1,4 +1,5 @@
 <?php
           // Keeps file coded in UTF-8 without BOM : é
+
 include_once (LCAS_PATH.'include/constants.php');
 load_language('plugin.lang', LCAS_PATH);
@@ -20,5 +21,5 @@
 
 /**
- * Changes the characters of the given string as stated by values of
+ * Change the characters of the given string as stated by values of
  * $conf['insensitive_case_logon'] and $conf['LCAS_replacement_set'].
  *
@@ -69,15 +70,4 @@
 }
 
-
-
-
-
-
-
-
-
-
-
-
 /* Function called from LCAS_admin.php to send notification email */
 function LCAS_SendMail($id, $oldusername, $username)
@@ -97,8 +87,10 @@
   $data = pwg_db_fetch_assoc(pwg_query($query));
 
-/* Check if user is already registered (profile changing) - If not (new registration), language is set to current gallery language */
+  // Check if user is already registered (profile changing) -
+  // If not (new registration), language is set to current gallery language
   if (empty($data))
   {
-/* And switch gallery to this language before using personalized and multilangual contents */
+    // And switch gallery to this language before using personalized
+    // and multilangual contents
     $language = pwg_get_session_var( 'lang_switch', $user['language'] );
     switch_lang_to($language);
@@ -106,10 +98,12 @@
   else
   {
-/* And switch gallery to this language before using personalized and multilangual contents */
+    // And switch gallery to this language before using personalized
+    // and multilangual contents
     switch_lang_to($data['language']);
     load_language('plugin.lang', LCAS_PATH);
   }
 
-  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Username_updated_for_%s', stripslashes($oldusername)));
+  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args(
+   'Username_updated_for_%s', stripslashes($oldusername)));
 
   if (isset($conf_LCAS[2]) and $conf_LCAS[2] <> '')
@@ -143,11 +137,12 @@
     'content' => ($customtxt."\n\n").(l10n_args($info)),
   ));
-
-/* Switching back to default language */
-switch_lang_back();
-}
-
-
-/* Function called from LCAS_admin.php and main.inc.php to get the plugin version and name */
+  
+  /* Switching back to default language */
+  switch_lang_back();
+}
+
+
+// Function called from LCAS_admin.php and main.inc.php
+// to get the plugin version and name
 function LCAS_PluginInfos($dir)
 {
@@ -167,5 +162,6 @@
     $plugin['uri'] = trim($val[1]);
   }
-  if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
+  if ($desc =
+   load_language('description.txt', $path.'/', array('return' => true)))
   {
     $plugin['description'] = trim($desc);
@@ -183,5 +179,6 @@
     $plugin['author uri'] = trim($val[1]);
   }
-  if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
+  if (!empty($plugin['uri']) and
+   strpos($plugin['uri'] , 'extension_view.php?eid='))
   {
     list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
@@ -326,40 +323,3 @@
 }
 
-
-/*
- * str_from_var3($var)
- * returns a string easing array var informations displaying in Piwigo :
- *   _ the string return value starts with"<p style = "text-align:left;">" ;
- *   _ all "TAB" characters (chr(10)) are replaced by "<br>" ;
- *   _ all spaces are replaced by "&nbsp;".
- *
- * @param
- *   $var : variable to display
- * @return
- *   string easy to display in Piwigo
- */
-function str_from_var3($var) {
-  return
-   '<p style = "text-align:left;">'.
-   str_replace(
-    chr(10),'<br>',
-    str_replace(' ','&nbsp;', print_r /* var_dump */ ($var,true))
-   ).
-   '</p>';
-}
-
-
-// DebugLog function
-function DebugLog($var1, $var2, $var3, $var4, $var5)
-{
-   $fo=fopen (LCAS_PATH.'admin/debuglog.txt','a') ;
-   fwrite($fo,"======================\n") ;
-   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
-   fwrite($fo, "\n" . $var1 . "\r\n") ;
-   fwrite($fo, "\n" . $var2 . "\r\n") ;
-   fwrite($fo, "\n" . $var3 . "\r\n") ;
-   fwrite($fo, "\n" . $var4 . "\r\n") ;
-   fwrite($fo, "\n" . $var5 . "\r\n") ;
-   fclose($fo) ;
-}
 ?>
