Index: /trunk/admin/cat_list.php
===================================================================
--- /trunk/admin/cat_list.php	(revision 8125)
+++ /trunk/admin/cat_list.php	(revision 8126)
@@ -104,5 +104,5 @@
 // +-----------------------------------------------------------------------+
 // request to delete a virtual category / not for an adviser
-if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
+if (isset($_GET['delete']) and is_numeric($_GET['delete']))
 {
   delete_categories(array($_GET['delete']));
Index: /trunk/admin/comments.php
===================================================================
--- /trunk/admin/comments.php	(revision 8125)
+++ /trunk/admin/comments.php	(revision 8126)
@@ -38,5 +38,5 @@
 // +-----------------------------------------------------------------------+
 
-if (!empty($_POST) and !is_adviser())
+if (!empty($_POST))
 {
   if (empty($_POST['comments']))
Index: /trunk/admin/configuration.php
===================================================================
--- /trunk/admin/configuration.php	(revision 8125)
+++ /trunk/admin/configuration.php	(revision 8126)
@@ -107,5 +107,5 @@
 
 //------------------------------ verification and registration of modifications
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
 {
   $int_pattern = '/^\d+$/';
@@ -324,12 +324,9 @@
 
     $errors = array();
-    if ( !is_adviser() )
-    {
-      if (save_profile_from_post($edit_user, $errors))
-      {
-        // Reload user
-        $edit_user = build_user($conf['guest_id'], false);
-        array_push($page['infos'], l10n('Information data registered in database'));
-      }
+    if (save_profile_from_post($edit_user, $errors))
+    {
+      // Reload user
+      $edit_user = build_user($conf['guest_id'], false);
+      array_push($page['infos'], l10n('Information data registered in database'));
     }
     $page['errors'] = array_merge($page['errors'], $errors);
Index: /trunk/admin/extend_for_templates.php
===================================================================
--- /trunk/admin/extend_for_templates.php	(revision 8125)
+++ /trunk/admin/extend_for_templates.php	(revision 8126)
@@ -118,5 +118,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
 {
   $replacements = array();
Index: /trunk/admin/group_list.php
===================================================================
--- /trunk/admin/group_list.php	(revision 8125)
+++ /trunk/admin/group_list.php	(revision 8126)
@@ -43,5 +43,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
+if (isset($_GET['delete']) and is_numeric($_GET['delete']))
 {
   // destruction of the access linked to the group
@@ -86,5 +86,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['submit_add']) and !is_adviser())
+if (isset($_POST['submit_add']))
 {
   if (empty($_POST['groupname']))
@@ -128,5 +128,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']) and !is_adviser())
+if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']))
 {
   $query = '
Index: /trunk/admin/include/check_integrity.class.php
===================================================================
--- /trunk/admin/include/check_integrity.class.php	(revision 8125)
+++ /trunk/admin/include/check_integrity.class.php	(revision 8126)
@@ -78,78 +78,75 @@
 
     // Treatments
-    if (!is_adviser())
-    {
-      if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
-      {
-        $corrected_count = 0;
-        $not_corrected_count = 0;
+    if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
+    {
+      $corrected_count = 0;
+      $not_corrected_count = 0;
+
+      foreach ($this->retrieve_list as $i => $c13y)
+      {
+        if (!empty($c13y['correction_fct']) and
+            $c13y['is_callable'] and
+            in_array($c13y['id'], $_POST['c13y_selection']))
+        {
+          if (is_array($c13y['correction_fct_args']))
+          {
+            $args = $c13y['correction_fct_args'];
+          }
+          else
+          if (!is_null($c13y['correction_fct_args']))
+          {
+            $args = array($c13y['correction_fct_args']);
+          }
+          else
+          {
+            $args = array();
+          }
+          $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
+
+          if ($this->retrieve_list[$i]['corrected'])
+          {
+            $corrected_count += 1;
+          }
+          else
+          {
+            $not_corrected_count += 1;
+          }
+        }
+      }
+
+      if ($corrected_count > 0)
+      {
+        $page['infos'][] =
+          l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
+            $corrected_count);
+      }
+      if ($not_corrected_count > 0)
+      {
+        $page['errors'][] =
+          l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
+            $not_corrected_count);
+      }
+    }
+    else
+    {
+      if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
+      {
+        $ignored_count = 0;
 
         foreach ($this->retrieve_list as $i => $c13y)
         {
-          if (!empty($c13y['correction_fct']) and
-              $c13y['is_callable'] and
-              in_array($c13y['id'], $_POST['c13y_selection']))
-          {
-            if (is_array($c13y['correction_fct_args']))
-            {
-              $args = $c13y['correction_fct_args'];
-            }
-            else
-            if (!is_null($c13y['correction_fct_args']))
-            {
-              $args = array($c13y['correction_fct_args']);
-            }
-            else
-            {
-              $args = array();
-            }
-            $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
-
-            if ($this->retrieve_list[$i]['corrected'])
-            {
-              $corrected_count += 1;
-            }
-            else
-            {
-              $not_corrected_count += 1;
-            }
-          }
-        }
-
-        if ($corrected_count > 0)
+          if (in_array($c13y['id'], $_POST['c13y_selection']))
+          {
+            $this->build_ignore_list[] = $c13y['id'];
+            $this->retrieve_list[$i]['ignored'] = true;
+            $ignored_count += 1;
+          }
+        }
+
+        if ($ignored_count > 0)
         {
           $page['infos'][] =
-            l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
-              $corrected_count);
-        }
-        if ($not_corrected_count > 0)
-        {
-          $page['errors'][] =
-            l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
-              $not_corrected_count);
-        }
-      }
-      else
-      {
-        if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
-        {
-          $ignored_count = 0;
-
-          foreach ($this->retrieve_list as $i => $c13y)
-          {
-            if (in_array($c13y['id'], $_POST['c13y_selection']))
-            {
-              $this->build_ignore_list[] = $c13y['id'];
-              $this->retrieve_list[$i]['ignored'] = true;
-              $ignored_count += 1;
-            }
-          }
-
-          if ($ignored_count > 0)
-          {
-            $page['infos'][] =
-              l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
-                $ignored_count);
-          }
+            l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
+              $ignored_count);
         }
       }
Index: /trunk/admin/languages_installed.php
===================================================================
--- /trunk/admin/languages_installed.php	(revision 8125)
+++ /trunk/admin/languages_installed.php	(revision 8126)
@@ -38,5 +38,5 @@
 
 //--------------------------------------------------perform requested actions
-if (isset($_GET['action']) and isset($_GET['language']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['language']))
 {
   $page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']);
Index: /trunk/admin/languages_new.php
===================================================================
--- /trunk/admin/languages_new.php	(revision 8125)
+++ /trunk/admin/languages_new.php	(revision 8126)
@@ -57,5 +57,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_GET['revision']) and !is_adviser())
+if (isset($_GET['revision']))
 {
   if (!is_webmaster())
Index: /trunk/admin/maintenance.php
===================================================================
--- /trunk/admin/maintenance.php	(revision 8125)
+++ /trunk/admin/maintenance.php	(revision 8126)
@@ -38,5 +38,5 @@
 // +-----------------------------------------------------------------------+
 
-$action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';
+$action = isset($_GET['action']) ? $_GET['action'] : '';
 
 switch ($action)
Index: /trunk/admin/menubar.php
===================================================================
--- /trunk/admin/menubar.php	(revision 8125)
+++ /trunk/admin/menubar.php	(revision 8126)
@@ -65,5 +65,5 @@
 }
 
-if ( isset($_POST['reset']) and !is_adviser())
+if ( isset($_POST['reset']))
 {
   $mb_conf = array();
@@ -86,5 +86,5 @@
 
 
-if ( isset($_POST['submit']) and !is_adviser() )
+if ( isset($_POST['submit']) )
 {
   foreach ( $mb_conf as $id => $pos )
Index: /trunk/admin/notification_by_mail.php
===================================================================
--- /trunk/admin/notification_by_mail.php	(revision 8125)
+++ /trunk/admin/notification_by_mail.php	(revision 8126)
@@ -507,5 +507,5 @@
   case 'param' :
   {
-    if (isset($_POST['param_submit']) and !is_adviser())
+    if (isset($_POST['param_submit']))
     {
       $updated_param_count = 0;
@@ -540,17 +540,14 @@
   case 'subscribe' :
   {
-    if (!is_adviser())
-    {
-      if (isset($_POST['falsify']) and isset($_POST['cat_true']))
-      {
-        $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
-        do_timeout_treatment('cat_true', $check_key_treated);
-      }
-      else
-      if (isset($_POST['trueify']) and isset($_POST['cat_false']))
-      {
-        $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
-        do_timeout_treatment('cat_false', $check_key_treated);
-      }
+    if (isset($_POST['falsify']) and isset($_POST['cat_true']))
+    {
+      $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
+      do_timeout_treatment('cat_true', $check_key_treated);
+    }
+    else
+    if (isset($_POST['trueify']) and isset($_POST['cat_false']))
+    {
+      $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
+      do_timeout_treatment('cat_false', $check_key_treated);
     }
     break;
@@ -559,5 +556,5 @@
   case 'send' :
   {
-    if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']) and !is_adviser())
+    if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']))
     {
       $check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content']));
Index: /trunk/admin/permalinks.php
===================================================================
--- /trunk/admin/permalinks.php	(revision 8125)
+++ /trunk/admin/permalinks.php	(revision 8126)
@@ -84,5 +84,5 @@
 
 $selected_cat = array();
-if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 and !is_adviser() )
+if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 )
 {
   $permalink = $_POST['permalink'];
@@ -93,5 +93,5 @@
   $selected_cat = array( $_POST['cat_id'] );
 }
-elseif ( isset($_GET['delete_permanent']) and !is_adviser() )
+elseif ( isset($_GET['delete_permanent']) )
 {
   $query = '
Index: /trunk/admin/picture_modify.php
===================================================================
--- /trunk/admin/picture_modify.php	(revision 8125)
+++ /trunk/admin/picture_modify.php	(revision 8126)
@@ -41,5 +41,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_GET['sync_metadata']) and !is_adviser())
+if (isset($_GET['sync_metadata']))
 {
   $query = '
@@ -71,5 +71,5 @@
 }
 
-if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())
+if (isset($_POST['submit']) and count($page['errors']) == 0)
 {
   $data = array();
@@ -125,5 +125,4 @@
     and isset($_POST['cat_dissociated'])
     and count($_POST['cat_dissociated']) > 0
-    and !is_adviser()
   )
 {
@@ -137,5 +136,4 @@
     and isset($_POST['cat_associated'])
     and count($_POST['cat_associated']) > 0
-    and !is_adviser()
   )
 {
@@ -153,5 +151,4 @@
     and isset($_POST['cat_dismissed'])
     and count($_POST['cat_dismissed']) > 0
-    and !is_adviser()
   )
 {
@@ -171,5 +168,4 @@
     and isset($_POST['cat_elected'])
     and count($_POST['cat_elected']) > 0
-    and !is_adviser()
   )
 {
Index: /trunk/admin/plugins_list.php
===================================================================
--- /trunk/admin/plugins_list.php	(revision 8125)
+++ /trunk/admin/plugins_list.php	(revision 8126)
@@ -37,5 +37,5 @@
 
 //--------------------------------------------------perform requested actions
-if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['plugin']))
 {
   check_pwg_token();
Index: /trunk/admin/plugins_update.php
===================================================================
--- /trunk/admin/plugins_update.php	(revision 8125)
+++ /trunk/admin/plugins_update.php	(revision 8126)
@@ -36,5 +36,5 @@
 
 //-----------------------------------------------------------automatic upgrade
-if (isset($_GET['plugin']) and isset($_GET['revision']) and !is_adviser())
+if (isset($_GET['plugin']) and isset($_GET['revision']))
 {
   if (!is_webmaster())
Index: /trunk/admin/profile.php
===================================================================
--- /trunk/admin/profile.php	(revision 8125)
+++ /trunk/admin/profile.php	(revision 8126)
@@ -34,8 +34,5 @@
 
 $errors = array();
-if ( !is_adviser() )
-{
-  save_profile_from_post($edit_user, $errors);
-}
+save_profile_from_post($edit_user, $errors);
 
 load_profile_in_template(
Index: /trunk/admin/rating.php
===================================================================
--- /trunk/admin/rating.php	(revision 8125)
+++ /trunk/admin/rating.php	(revision 8126)
@@ -71,5 +71,5 @@
 }
 
-if (isset($_GET['del']) and !is_adviser())
+if (isset($_GET['del']))
 {
   $del_params = urldecode( $_GET['del'] );
Index: /trunk/admin/site_manager.php
===================================================================
--- /trunk/admin/site_manager.php	(revision 8125)
+++ /trunk/admin/site_manager.php	(revision 8126)
@@ -84,6 +84,5 @@
 // |                        new site creation form                         |
 // +-----------------------------------------------------------------------+
-if (isset($_POST['submit']) and !empty($_POST['galleries_url'])
-    and !is_adviser() )
+if (isset($_POST['submit']) and !empty($_POST['galleries_url']))
 {
   $is_remote = url_is_remote( $_POST['galleries_url'] );
@@ -168,5 +167,5 @@
   $page['site'] = $_GET['site'];
 }
-if (isset($_GET['action']) and isset($page['site']) and !is_adviser())
+if (isset($_GET['action']) and isset($page['site']))
 {
   $query = '
Index: /trunk/admin/site_update.php
===================================================================
--- /trunk/admin/site_update.php	(revision 8125)
+++ /trunk/admin/site_update.php	(revision 8126)
@@ -109,5 +109,5 @@
 
   // shall we simulate only
-  if ((isset($_POST['simulate']) and $_POST['simulate'] == 1) or is_adviser())
+  if (isset($_POST['simulate']) and $_POST['simulate'] == 1)
   {
     $simulate = true;
Index: /trunk/admin/tags.php
===================================================================
--- /trunk/admin/tags.php	(revision 8125)
+++ /trunk/admin/tags.php	(revision 8126)
@@ -39,5 +39,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
 {
   $query = '
@@ -105,5 +105,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['delete']) and isset($_POST['tags']) and !is_adviser())
+if (isset($_POST['delete']) and isset($_POST['tags']))
 {
   $query = '
@@ -142,5 +142,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_POST['add']) and !empty($_POST['add_tag']) and !is_adviser())
+if (isset($_POST['add']) and !empty($_POST['add_tag']))
 {
   $tag_name = $_POST['add_tag'];
Index: /trunk/admin/themes_installed.php
===================================================================
--- /trunk/admin/themes_installed.php	(revision 8125)
+++ /trunk/admin/themes_installed.php	(revision 8126)
@@ -37,5 +37,5 @@
 // +-----------------------------------------------------------------------+
 
-if (isset($_GET['action']) and isset($_GET['theme']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['theme']))
 {
   $page['errors'] = $themes->perform_action($_GET['action'], $_GET['theme']);
Index: /trunk/include/common.inc.php
===================================================================
--- /trunk/include/common.inc.php	(revision 8125)
+++ /trunk/include/common.inc.php	(revision 8126)
@@ -208,9 +208,4 @@
 }
 
-if (is_adviser())
-{
-  $header_msgs[] = l10n('Adviser mode enabled');
-}
-
 if (count($header_msgs) > 0)
 {
Index: /trunk/include/functions_user.inc.php
===================================================================
--- /trunk/include/functions_user.inc.php	(revision 8125)
+++ /trunk/include/functions_user.inc.php	(revision 8126)
@@ -1320,12 +1320,10 @@
 
 /*
- * Return if current user is an adviser
- * @return bool
+ * Adviser status is depreciated from piwigo 2.2
+ * @return false
 */
 function is_adviser()
 {
-  global $user;
-
-  return ($user['adviser'] == 'true');
+  return false;
 }
 
@@ -1385,12 +1383,5 @@
   else
   {
-    if (defined('IN_ADMIN') and is_adviser())
-    {
-      return 'adviser.mode@'.$_SERVER['SERVER_NAME'];
-    }
-    else
-    {
-      return $email_address;
-    }
+    return $email_address;
   }
 }
Index: /trunk/include/template.class.php
===================================================================
--- /trunk/include/template.class.php	(revision 8125)
+++ /trunk/include/template.class.php	(revision 8126)
@@ -354,6 +354,5 @@
 
     $this->smarty->assign( 'ROOT_URL', get_root_url() );
-    $this->smarty->assign( 'TAG_INPUT_ENABLED',
-      ((is_adviser()) ? 'disabled="disabled" onclick="return false;"' : ''));
+    $this->smarty->assign( 'TAG_INPUT_ENABLED', '');
 
     $save_compile_id = $this->smarty->compile_id;
Index: /trunk/include/ws_functions.inc.php
===================================================================
--- /trunk/include/ws_functions.inc.php	(revision 8125)
+++ /trunk/include/ws_functions.inc.php	(revision 8126)
@@ -893,5 +893,5 @@
 function ws_images_setPrivacyLevel($params, &$service)
 {
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -936,5 +936,5 @@
   // position
 
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1140,5 +1140,5 @@
 
   global $conf;
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1209,5 +1209,5 @@
 {
   global $conf;
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1585,5 +1585,5 @@
 function ws_categories_add($params, &$service)
 {
-  if (!is_admin() or is_adviser())
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1609,5 +1609,5 @@
 function ws_tags_add($params, &$service)
 {
-  if (!is_admin() or is_adviser())
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1630,5 +1630,5 @@
   global $conf;
   
-  if (!is_admin() or is_adviser())
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1706,5 +1706,5 @@
 function ws_images_checkFiles($params, &$service)
 {
-  if (!is_admin() or is_adviser())
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -1791,5 +1791,5 @@
 {
   global $conf;
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -2074,5 +2074,5 @@
 {
   global $conf;
-  if (!is_admin() || is_adviser() )
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
@@ -2148,5 +2148,5 @@
   global $conf;
 
-  if (!is_admin() or is_adviser())
+  if (!is_admin())
   {
     return new PwgError(401, 'Access denied');
Index: /trunk/picture.php
===================================================================
--- /trunk/picture.php	(revision 8125)
+++ /trunk/picture.php	(revision 8126)
@@ -277,5 +277,5 @@
     case 'set_as_representative' :
     {
-      if (is_admin() and !is_adviser() and isset($page['category']))
+      if (is_admin() and isset($page['category']))
       {
         $query = '
Index: /trunk/plugins/LocalFilesEditor/admin.php
===================================================================
--- /trunk/plugins/LocalFilesEditor/admin.php	(revision 8125)
+++ /trunk/plugins/LocalFilesEditor/admin.php	(revision 8126)
@@ -165,5 +165,5 @@
   case 'tpl':
     // New file form creation
-    if ($newfile_page and !is_adviser())
+    if ($newfile_page)
     {
       $filename = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : '';
@@ -281,5 +281,5 @@
 // |                           Load backup file
 // +-----------------------------------------------------------------------+
-if (isset($_POST['restore']) and !is_adviser())
+if (isset($_POST['restore']))
 {
   $edited_file = $_POST['edited_file'];
@@ -293,5 +293,5 @@
 // |                            Save file
 // +-----------------------------------------------------------------------+
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
 {
   if (!is_webmaster())
Index: /trunk/plugins/admin_multi_view/controller.php
===================================================================
--- /trunk/plugins/admin_multi_view/controller.php	(revision 8125)
+++ /trunk/plugins/admin_multi_view/controller.php	(revision 8126)
@@ -31,6 +31,4 @@
 if ( isset($_GET['view_as']) )
 {
-  if ( is_adviser() and $user['id']!=$_GET['view_as'] and $conf['guest_id']!=$_GET['view_as'])
-    die('security error');
   if ($user['id']===$_GET['view_as'])
     pwg_unset_session_var( 'multiview_as' );
@@ -112,12 +110,5 @@
 $query = '
 SELECT '.$conf['user_fields']['id'].' AS id,'.$conf['user_fields']['username'].' AS username
-FROM '.USERS_TABLE;
-if (is_adviser())
-{
-  $query .='
-  WHERE '.$conf['user_fields']['id']. ' IN ('.$user['id'].','.$conf['guest_id'].')
-';
-}
-$query .='
+FROM '.USERS_TABLE.'
   ORDER BY CONVERT('.$conf['user_fields']['username'].',CHAR)
 ;';
