Index: /trunk/admin/group_list.php
===================================================================
--- /trunk/admin/group_list.php	(revision 1582)
+++ /trunk/admin/group_list.php	(revision 1583)
@@ -124,4 +124,31 @@
 
 // +-----------------------------------------------------------------------+
+// | toggle is default group property                                      |
+// +-----------------------------------------------------------------------+
+
+if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']))
+{
+  $query = '
+SELECT name, is_default
+  FROM '.GROUPS_TABLE.'
+  WHERE id = '.$_GET['toggle_is_default'].'
+;';
+  list($groupname, $is_default) = mysql_fetch_row(pwg_query($query));
+  
+  // update of the group
+  $query = '
+UPDATE '.GROUPS_TABLE.'
+  SET is_default = \''.boolean_to_string(!get_boolean($is_default)).'\'
+  WHERE id = '.$_GET['toggle_is_default'].'
+;';
+  pwg_query($query);
+
+  array_push(
+    $page['infos'],
+    sprintf(l10n('group "%s" updated'), $groupname)
+    );
+}
+
+// +-----------------------------------------------------------------------+
 // |                             template init                             |
 // +-----------------------------------------------------------------------+
@@ -140,5 +167,5 @@
 
 $query = '
-SELECT id, name
+SELECT id, name, is_default
   FROM '.GROUPS_TABLE.'
   ORDER BY id ASC
@@ -150,4 +177,5 @@
 $del_url     = $admin_url.'group_list&amp;delete=';
 $members_url = $admin_url.'user_list&amp;group=';
+$toggle_is_default_url     = $admin_url.'group_list&amp;toggle_is_default=';
 
 $num = 0;
@@ -166,8 +194,10 @@
       'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1',
       'NAME' => $row['name'],
+      'IS_DEFAULT' => (get_boolean($row['is_default']) ? ' ['.l10n('is_default_group').']' : ''),
       'MEMBERS' => sprintf(l10n('%d members'), $counter),
       'U_MEMBERS' => $members_url.$row['id'],
       'U_DELETE' => $del_url.$row['id'],
-      'U_PERM' => $perm_url.$row['id']
+      'U_PERM' => $perm_url.$row['id'],
+      'U_ISDEFAULT' => $toggle_is_default_url.$row['id']
       )
     );
Index: /trunk/include/config_default.inc.php
===================================================================
--- /trunk/include/config_default.inc.php	(revision 1582)
+++ /trunk/include/config_default.inc.php	(revision 1583)
@@ -223,7 +223,4 @@
 $conf['rate_items'] = array(0,1,2,3,4,5);
 
-// Dafault groups to assign to new user
-$conf['default_group_id'] = -1;
-
 // +-----------------------------------------------------------------------+
 // |                               metadata                                |
Index: /trunk/include/functions_user.inc.php
===================================================================
--- /trunk/include/functions_user.inc.php	(revision 1582)
+++ /trunk/include/functions_user.inc.php	(revision 1583)
@@ -94,21 +94,32 @@
     mass_inserts(USERS_TABLE, array_keys($insert), array($insert));
 
-  // Assign by default one group
-  if(isset($conf['default_group_id']))
+  // Assign by default groups
   {
     $query = '
-select count(*) from '.GROUPS_TABLE.' where id = '.$conf['default_group_id'].';';
-    list($exist_group) = mysql_fetch_array(pwg_query($query));
-
-    if ($exist_group == 1)
-    {
-      $insert =
-        array(
+SELECT id
+  FROM '.GROUPS_TABLE.'
+  WHERE is_default = \''.boolean_to_string(true).'\'
+  ORDER BY id ASC
+;';
+    $result = pwg_query($query);
+
+    $inserts = array();
+    while ($row = mysql_fetch_array($result))
+    {
+      array_push
+      (
+        $inserts,
+        array
+        (
           'user_id' => $next_id,
-          'group_id' => $conf['default_group_id']
-          );
-
+          'group_id' => $row['id']
+        )
+      );
+    }
+
+    if (count($inserts) != 0)
+    {
       include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
-      mass_inserts(USER_GROUP_TABLE, array_keys($insert), array($insert));
+      mass_inserts(USER_GROUP_TABLE, array('user_id', 'group_id'), $inserts);
     }
   }
Index: /trunk/install/db/33-database.php
===================================================================
--- /trunk/install/db/33-database.php	(revision 1583)
+++ /trunk/install/db/33-database.php	(revision 1583)
@@ -0,0 +1,55 @@
+<?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 = 'Add column #group.is_default';
+
+include_once(PHPWG_ROOT_PATH.'include/constants.php');
+
+// +-----------------------------------------------------------------------+
+// |                            Upgrade content                            |
+// +-----------------------------------------------------------------------+
+
+echo "Add column is_default on ".GROUPS_TABLE;
+$query = '
+alter table '.GROUPS_TABLE.' add column 
+`is_default` enum(\'true\',\'false\') NOT NULL default \'false\'
+;';
+pwg_query($query);
+
+
+echo
+"\n"
+.'"'.$upgrade_description.'"'.' ended'
+."\n"
+;
+
+?>
Index: /trunk/install/phpwebgallery_structure.sql
===================================================================
--- /trunk/install/phpwebgallery_structure.sql	(revision 1582)
+++ /trunk/install/phpwebgallery_structure.sql	(revision 1583)
@@ -103,4 +103,5 @@
   `id` smallint(5) unsigned NOT NULL auto_increment,
   `name` varchar(255) NOT NULL default '',
+  `is_default` enum('true','false') NOT NULL default 'false',
   PRIMARY KEY  (`id`)
 ) TYPE=MyISAM;
Index: /trunk/language/en_UK.iso-8859-1/admin.lang.php
===================================================================
--- /trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 1582)
+++ /trunk/language/en_UK.iso-8859-1/admin.lang.php	(revision 1583)
@@ -243,4 +243,5 @@
 $lang['group "%s" added'] = 'group "%s" added';
 $lang['group "%s" deleted'] = 'group "%s" deleted';
+$lang['group "%s" updated'] = 'group "%s" updated';
 $lang['group'] = 'group';
 $lang['group_add_error1'] = 'The name of a group must not contain " or \' or be empty.';
@@ -487,3 +488,5 @@
 $lang['w_day'] = 'Day';
 $lang['waiting'] = 'Waiting';
+$lang['is_default_group'] = 'default';
+$lang['toggle_is_default_group'] = 'Toggle \'default group\' property';
 ?>
Index: /trunk/language/fr_FR.iso-8859-1/admin.lang.php
===================================================================
--- /trunk/language/fr_FR.iso-8859-1/admin.lang.php	(revision 1582)
+++ /trunk/language/fr_FR.iso-8859-1/admin.lang.php	(revision 1583)
@@ -243,4 +243,5 @@
 $lang['group "%s" added'] = 'groupe "%s" ajouté';
 $lang['group "%s" deleted'] = 'groupe "%s" supprimé';
+$lang['group "%s" updated'] = 'groupe "%s" mis à jour';
 $lang['group'] = 'groupe';
 $lang['group_add_error1'] = 'Le nom du groupe ne doit pas contenir " or \' et ne doit pas être vide.';
@@ -487,3 +488,5 @@
 $lang['w_day'] = 'Jour';
 $lang['waiting'] = 'En attente';
+$lang['is_default_group'] = 'par défaut';
+$lang['toggle_is_default_group'] = 'Inverser la propriété \'groupe par défaut\'';
 ?>
Index: /trunk/template/yoga/admin/group_list.tpl
===================================================================
--- /trunk/template/yoga/admin/group_list.tpl	(revision 1582)
+++ /trunk/template/yoga/admin/group_list.tpl	(revision 1583)
@@ -25,9 +25,10 @@
   <!-- BEGIN group -->
   <tr class="{group.CLASS}">
-    <td>{group.NAME}</td>
+    <td>{group.NAME}<i><small>{group.IS_DEFAULT}</small></i></td>
     <td><a href="{group.U_MEMBERS}">{group.MEMBERS}</a></td>
     <td style="text-align:center;">
       <a href="{group.U_PERM}"><img src="{themeconf:icon_dir}/permissions.png" class="button" style="border:none" alt="permissions" title="{lang:permissions}" /></a>
       <a href="{group.U_DELETE}" onclick="return confirm('{lang:Are you sure?}');"><img src="{themeconf:icon_dir}/delete.png" class="button" style="border:none" alt="delete" title="{lang:delete}" {TAG_INPUT_ENABLED}/></a>
+      <a href="{group.U_ISDEFAULT}" onclick="return confirm('{lang:Are you sure?}');"><img src="{themeconf:icon_dir}/toggle_is_default_group.png" class="button" style="border:none" alt="toggle_is_default_group" title="{lang:toggle_is_default_group}" {TAG_INPUT_ENABLED}/></a>
     </td>
   </tr>
