Index: trunk/admin/include/functions.php
===================================================================
--- trunk/admin/include/functions.php	(revision 1069)
+++ trunk/admin/include/functions.php	(revision 1070)
@@ -1231,5 +1231,5 @@
       $insert = array();
       $insert['user_id'] = $user_id;
-      $insert['status'] = 'guest';
+      $insert['status'] = 'normal';
       $insert['template'] = $conf['default_template'];
       $insert['nb_image_line'] = $conf['nb_image_line'];
Index: trunk/admin/include/isadmin.inc.php
===================================================================
--- trunk/admin/include/isadmin.inc.php	(revision 1069)
+++ trunk/admin/include/isadmin.inc.php	(revision 1070)
@@ -28,5 +28,5 @@
 include( PHPWG_ROOT_PATH.'admin/include/functions.php' );
 
-if ($user['status'] != 'admin')
+if (!is_admin())
 {
   echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
Index: trunk/admin/mailtousers.php
===================================================================
--- trunk/admin/mailtousers.php	(revision 1069)
+++ trunk/admin/mailtousers.php	(revision 1070)
@@ -78,13 +78,15 @@
 function update_data_user_mail_notification()
 {
-/*  $query = '
-insert into '.USER_MAIL_NOTIFICATION_TABLE.'
-  (user_id, enabled)
-  (select id, \'false\' from '.USERS_TABLE.'
-  where mail_address is not null and id not in (select user_id from '.USER_MAIL_NOTIFICATION_TABLE.'))
-;';
-  pwg_query($query);*/
-
   global $conf, $page;
+
+  // Set null mail_address empty
+  $query = '
+update 
+  '.USERS_TABLE.'
+set
+  mail_address = null
+where
+  trim(mail_address) = \'\';';
+  pwg_query($query);
 
   $query = '
Index: trunk/admin/user_list.php
===================================================================
--- trunk/admin/user_list.php	(revision 1069)
+++ trunk/admin/user_list.php	(revision 1070)
@@ -378,5 +378,5 @@
       if ($conf['webmaster_id'] == $user_id and isset($data['status']))
       {
-        $data['status'] = 'admin';
+        $data['status'] = 'webmaster';
       }
       
@@ -650,5 +650,5 @@
     $selected = $_POST['status'] == $status ? 'selected="selected"' : '';
   }
-  else if ('guest' == $status)
+  else if ('normal' == $status)
   {
     $selected = 'selected="selected"';
Index: trunk/category.php
===================================================================
--- trunk/category.php	(revision 1069)
+++ trunk/category.php	(revision 1070)
@@ -369,5 +369,5 @@
   }
 
-  if ('admin' == $user['status'])
+  if (is_admin())
   {
     $template->assign_block_vars('admin', array());
@@ -409,5 +409,5 @@
 if (isset($page['cat'])
     and is_numeric($page['cat'])
-    and 'admin' == $user['status'])
+    and is_admin())
 {
   $template->assign_block_vars(
Index: trunk/include/common.inc.php
===================================================================
--- trunk/include/common.inc.php	(revision 1069)
+++ trunk/include/common.inc.php	(revision 1070)
@@ -209,5 +209,5 @@
 
   if ( basename($_SERVER["PHP_SELF"]) != 'identification.php'
-      and $user['status'] != 'admin' )
+      and !is_admin() )
   {
     exit();
Index: trunk/include/functions.inc.php
===================================================================
--- trunk/include/functions.inc.php	(revision 1069)
+++ trunk/include/functions.inc.php	(revision 1070)
@@ -356,5 +356,5 @@
   if ($conf['log'])
   {
-   if ( ($conf['history_admin'] ) or  ( (! $conf['history_admin'])  and ($user['status'] != 'admin')  ) )
+   if ( ($conf['history_admin'] ) or  ( (! $conf['history_admin'])  and (!is_admin())  ) )
 	  {
     $login = ($user['id'] == $conf['guest_id'])
Index: trunk/include/functions_notification.inc.php
===================================================================
--- trunk/include/functions_notification.inc.php	(revision 1069)
+++ trunk/include/functions_notification.inc.php	(revision 1070)
@@ -193,5 +193,5 @@
   }
   
-  if ('admin' == $user['status'])
+  if (is_admin())
   {
     $nb_unvalidated_comments = count(unvalidated_comments($end));
Index: trunk/include/functions_user.inc.php
===================================================================
--- trunk/include/functions_user.inc.php	(revision 1069)
+++ trunk/include/functions_user.inc.php	(revision 1070)
@@ -293,5 +293,5 @@
 
   // if user is not an admin, locked categories can be considered as private$
-  if ($user_status != 'admin')
+  if (!is_admin())
   {
     $query = '
@@ -440,5 +440,5 @@
     array(
       'user_id' => $user_id,
-      'status' => $user_id == $conf['webmaster_id'] ? 'admin' : 'guest',
+      'status' => $user_id == $conf['webmaster_id'] ? 'admin' : 'normal',
       'template' => $conf['default_template'],
       'nb_image_line' => $conf['nb_image_line'],
@@ -537,3 +537,14 @@
 }
 
+/*
+ * Return if current is an administrator
+ * @return bool
+*/
+function is_admin()
+{
+  global $user;
+  
+  return ($user['status'] == 'webmaster' or $user['status'] == 'admin') ? true : false;
+}
+
 ?>
Index: trunk/install/db/12-database.php
===================================================================
--- trunk/install/db/12-database.php	(revision 1070)
+++ trunk/install/db/12-database.php	(revision 1070)
@@ -0,0 +1,103 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch        : BSF (Best So Far)
+// | file          : $RCSfile$
+// | last update   : $Date: 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005) $
+// | last modifier : $Author: plg $
+// | revision      : $Revision: 870 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+  die('Hacking attempt!');
+}
+
+$upgrade_description = 'Field "Status" Table #user_infos changed';
+
+include_once(PHPWG_ROOT_PATH.'include/constants.php');
+include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
+@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
+
+// +-----------------------------------------------------------------------+
+// |                            Upgrade content                            |
+// +-----------------------------------------------------------------------+
+
+echo "Alter table ".USER_INFOS_TABLE;
+$query = "
+alter table ".USER_INFOS_TABLE."
+  modify column `status` enum('webmaster', 'admin', 'normal', 'generic', 'guest') NOT NULL default 'guest'
+;";
+pwg_query($query);
+
+echo "Define webmaster";
+$query = '
+update
+  '.USER_INFOS_TABLE.'
+set status = \'webmaster\'
+where
+  user_id = '.$conf['webmaster_id'].' and status = \'admin\'
+;';
+$result = pwg_query($query);
+
+echo "Define normal";
+$query = '
+select
+  user_id
+from
+  '.USER_INFOS_TABLE.'
+where
+  user_id != '.$conf['guest_id'].' and status = \'guest\'
+;';
+$result = pwg_query($query);
+
+$datas = array();
+
+while ($row = mysql_fetch_array($result))
+{
+  array_push(
+    $datas,
+    array(
+      'user_id'    => $row['user_id'],
+      'status' => 'normal'
+      )
+    );
+}
+
+mass_updates(
+  USER_INFOS_TABLE,
+  array(
+    'primary' => array('user_id'),
+    'update'  => array('status')
+    ),
+  $datas
+  );
+
+// +-----------------------------------------------------------------------+
+// |                           End notification                            |
+// +-----------------------------------------------------------------------+
+
+echo
+"\n"
+.'Column '.USER_INFOS_TABLE.'.status changed'
+."\n"
+;
+
+?>
Index: trunk/install/phpwebgallery_structure.sql
===================================================================
--- trunk/install/phpwebgallery_structure.sql	(revision 1069)
+++ trunk/install/phpwebgallery_structure.sql	(revision 1070)
@@ -1,2 +1,3 @@
+-- MySQL dump 9.11
 -- MySQL dump 9.11
 --
@@ -295,5 +296,5 @@
   `nb_image_line` tinyint(1) unsigned NOT NULL default '5',
   `nb_line_page` tinyint(3) unsigned NOT NULL default '3',
-  `status` enum('admin','guest') NOT NULL default 'guest',
+  `status` enum('webmaster', 'admin', 'normal', 'generic', 'guest') NOT NULL default 'guest',
   `language` varchar(50) NOT NULL default 'english',
   `maxwidth` smallint(6) default NULL,
Index: trunk/language/en_UK.iso-8859-1/admin.lang.php
===================================================================
--- trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 1069)
+++ trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 1070)
@@ -393,6 +393,9 @@
 $lang['user_id URL parameter is missing'] = 'user_id URL parameter is missing';
 $lang['user_status'] = 'User status';
+$lang['user_status_webmaster'] = 'Webmaster';
 $lang['user_status_admin'] = 'Administrator';
-$lang['user_status_guest'] = 'User';
+$lang['user_status_normal'] = 'User';
+$lang['user_status_generic'] = 'Generic';
+$lang['user_status_guest'] = 'Guest';
 $lang['username'] = 'username';
 $lang['users'] = 'Users';
Index: trunk/language/fr_FR.iso-8859-1/admin.lang.php
===================================================================
--- trunk/language/fr_FR.iso-8859-1/admin.lang.php	(revision 1069)
+++ trunk/language/fr_FR.iso-8859-1/admin.lang.php	(revision 1070)
@@ -393,6 +393,9 @@
 $lang['user_id URL parameter is missing'] = 'le paramètre d\'URL "user_id" manque';
 $lang['user_status'] = 'Statut de l\'utilisateur';
+$lang['user_status_webmaster'] = 'Webmestre';
 $lang['user_status_admin'] = 'Administrateur';
-$lang['user_status_guest'] = 'Visiteur';
+$lang['user_status_normal'] = 'Visiteur';
+$lang['user_status_generic'] = 'Générique';
+$lang['user_status_guest'] = 'Invité';
 $lang['username'] = 'nom utilisateur';
 $lang['users'] = 'Utilisateurs';
Index: trunk/password.php
===================================================================
--- trunk/password.php	(revision 1069)
+++ trunk/password.php	(revision 1070)
@@ -70,6 +70,10 @@
      , '.$conf['user_fields']['username'].' AS username
      , '.$conf['user_fields']['email'].' AS email
-  FROM '.USERS_TABLE.'
-  WHERE '.$conf['user_fields']['email'].' = \''.$mail_address.'\'
+FROM '.USERS_TABLE.' as u
+  INNER JOIN '.USER_INFOS_TABLE.' AS ui
+      ON u.'.$conf['user_fields']['id'].' = ui.user_id
+WHERE '
+  .$conf['user_fields']['email'].' = \''.$mail_address.'\' AND
+  ui.status not in (\'guest\', \'generic\', \'webmaster\')
 ;';
     $result = pwg_query($query);
Index: trunk/picture.php
===================================================================
--- trunk/picture.php	(revision 1069)
+++ trunk/picture.php	(revision 1070)
@@ -115,5 +115,5 @@
 
 //-------------------------------------------------------------- representative
-if ('admin' == $user['status'] and isset($_GET['representative']))
+if (is_admin() and isset($_GET['representative']))
 {
   $query = '
@@ -481,5 +481,5 @@
       $data{'content'} = htmlspecialchars( $_POST['content'], ENT_QUOTES);
 
-      if (!$conf['comments_validation'] or $user['status'] == 'admin')
+      if (!$conf['comments_validation'] or is_admin())
       {
         $data{'validated'} = 'true';
@@ -499,7 +499,7 @@
       $message = $lang['comment_added'];
 
-      if (!$conf['comments_validation'] or $user['status'] == 'admin')
-
-      if ( $conf['comments_validation'] and $user['status'] != 'admin' )
+      if (!$conf['comments_validation'] or is_admin())
+
+      if ( $conf['comments_validation'] and !is_admin() )
       {
         $message.= '<br />'.$lang['comment_to_validate'];
@@ -520,5 +520,5 @@
 if ( isset( $_GET['del'] )
      and is_numeric( $_GET['del'] )
-     and $user['status'] == 'admin' )
+     and is_admin() )
 {
   $query = 'DELETE FROM '.COMMENTS_TABLE;
@@ -687,5 +687,5 @@
 }
 // button to set the current picture as representative
-if ('admin' == $user['status'] and
+if (is_admin() and
     isset($page['cat']) and is_numeric($page['cat']))
 {
@@ -701,5 +701,5 @@
 }
 
-if ('admin' == $user['status'])
+if (is_admin())
 {
   $template->assign_block_vars(
@@ -753,5 +753,5 @@
 }
 //------------------------------------ admin link for information modifications
-if ( $user['status'] == 'admin' )
+if ( is_admin() )
 {
   $template->assign_block_vars('admin', array());
@@ -1153,5 +1153,5 @@
     ));
 
-      if ( $user['status'] == 'admin' )
+      if ( is_admin() )
       {
         $template->assign_block_vars(
