Author: cfinck
Date: Sun Jun 1 12:08:49 2008
New Revision: 33813
URL:
http://svn.reactos.org/svn/reactos?rev=33813&view=rev
Log:
Don't create a new phpBB group for every user, put the user in the REGISTERED group
instead
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/subsys_phpbb.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/subsys_phpbb.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/…
==============================================================================
---
trunk/web/reactos.org/htdocs/roscms/inc/subsys_phpbb.php [iso-8859-1] (original)
+++
trunk/web/reactos.org/htdocs/roscms/inc/subsys_phpbb.php [iso-8859-1] Sun Jun 1
12:08:49 2008
@@ -191,16 +191,17 @@
" $roscms_user_register)";
mysql_query($query) or die("DB error (subsys_phpbb #10)");
- /* Create a group for the user */
- $query = "INSERT INTO " . SUBSYS_PHPBB_DBNAME . ".phpbb_groups " .
- " (group_type, group_name, group_description) " .
- "VALUES (1, '', 'Personal User')";
- mysql_query($query) or die("DB error (subsys_phpbb #18)");
-
- /* Put the user in her own group */
+ /* Put the user in the REGISTERED group */
+ $query = "SELECT group_id FROM " . SUBSYS_PHPBB_DBNAME . ".phpbb_groups
WHERE group_name = 'REGISTERED'";
+ $result = mysql_query($query) or die("DB error (subsys_phpbb #18)");
+ $group_id = (int)mysql_result($result, 0);
+
+ if(!$group_id)
+ die("DB error (subsys_phpbb #20)");
+
$query = "INSERT INTO " . SUBSYS_PHPBB_DBNAME . ".phpbb_user_group
" .
" (group_id, user_id, user_pending) " .
- "VALUES (LAST_INSERT_ID(), $phpbb_user_id, 0)";
+ "VALUES ($group_id, $phpbb_user_id, 0)";
mysql_query($query) or die("DB error (subsys_phpbb #19)");
/* Finally, insert a row in the mapping table */