In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1031 [In-Portal CMS] Data Management refactoring always 2011-04-03 11:16 2012-11-27 09:22
alex  
alex  
normal  
closed 5.1.2  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-dev/oo24plIxkJg/discussion https://groups.google.com/d/topic/in-portal-dev/uaTOwx0vAMc/discussion
Moving UserGroup.PrimaryGroup field into PortalUser.PrimaryGroupId
3
0001031: User management internals refactoring
In-Portal has 2 sections, that are called "Users" and "Administrators". These sections are used to manage users and administrators. In fact both users and administrators are stored in a PortalUser table.

Only users who have set "admin" as their primary group are displayed under "Administrators" section. All other users are displayed under "Users" section. It works perfectly until regular In-Portal administrator wants to set another group (not "admin") as primary group for any of website administrators. At that moment that administrator suddenly is no longer displayed in "Administrators" section and is displayed in "Users" section.

This is bad, because user and administrator editing forms have a lot of differences. Also it's not obvious to an administrator, why he can't remove "admin" group from administrator's group list and add another group in it's place.

Proposition #1: distinguish admin or user not based on user's group, but based on new UserType field in PortalUser table (0 - user, 1 - admin, 2 - new ...).


Also, when "GroupId" virtual field is displayed on user registration form, then user will have selected group as primary instead of "Member" group. This way permission change in "Member" group won't have any effect on such users. This is a logical error, since "Member" group is specified in configuration variable called "Assign registered users to group". Then user is registered, but still isn't in "Member" group.

Proposition #2: add Member/admin group (id is retrieved from appropriate configuration variables) to user groups in session (not to UserGroup table) based on newly added PortalUser.UserType column after successful login.


Proposition #3:
Transform UserGroup.PrimaryGroup field into PortalUser.PrimaryGroupId. This way user's primary group will be stored in PortalUser.PrimaryGroupId (will be NULL by default).

Display "primary icon" on "Groups" tab during user/admin editing by comparing group id being printed to group id from user record. Also "Set Primary" functionality will be changed.
parent of 0000907closed  (5.1.3)alex In-Bulletin Tag "bb-post_PosterField" doesn't work with custom fields 
parent of 0000944closed  (5.2.0)alex In-Portal CMS Ability for Users to subscribe to mailing during Registration 
parent of 0000941closed  (5.1.2)alex In-Portal CMS Impossible to Subscribe to Newsletter 
parent of 0001078closed  (5.1.3)alex In-Portal CMS Unsubscribing from mailing list doesn't delete all related user data 
parent of 0000823closed  (5.1.2)alex In-Portal CMS User primary group isn't correctly set in session after it's login 
parent of 0001080closed  (5.1.3)alex In-Portal CMS Users can register without password, when automatic passwords are turned off 
related to 0001095closed  (5.1.3)alex In-Portal CMS Error messages are displayed on unrelated forms 
related to 0001202closed  (5.2.0)alex In-Portal CMS Regular users are created instead of Admins 
patch user_group_storage_core.patch (44,053) 2011-07-07 10:51
http://tracker.in-portal.org/file_download.php?file_id=1061&type=bug
patch user_group_storage_modules.patch (8,127) 2011-07-07 10:51
http://tracker.in-portal.org/file_download.php?file_id=1062&type=bug
patch user_group_storage_themes.patch (2,534) 2011-07-07 10:51
http://tracker.in-portal.org/file_download.php?file_id=1063&type=bug
patch user_group_storage_core_v2.patch (50,490) 2011-07-07 12:59
http://tracker.in-portal.org/file_download.php?file_id=1064&type=bug
patch user_group_storage_core_v2_513.patch (45,980) 2012-11-27 09:21
http://tracker.in-portal.org/file_download.php?file_id=1869&type=bug
patch user_group_storage_modules_513.patch (10,459) 2012-11-27 09:22
http://tracker.in-portal.org/file_download.php?file_id=1870&type=bug
Issue History
2012-11-27 09:22 alex File Added: user_group_storage_modules_513.patch
2012-11-27 09:21 alex File Added: user_group_storage_core_v2_513.patch
2012-07-25 05:33 alex Note Added: 0005075
2012-07-25 05:33 alex Status resolved => closed
2012-02-06 03:31 alex Relationship added related to 0001202
2011-10-22 05:41 alex Estimate Points => 3
2011-08-10 05:11 alex Relationship added related to 0001095
2011-07-08 10:43 alex Target Version Icebox => 5.2.0
2011-07-08 06:29 alex Relationship added parent of 0001080
2011-07-07 13:02 alex Note Edited: 0003598 bug_revision_view_page.php?bugnote_id=0003598#r749
2011-07-07 13:00 alex Note Added: 0003600
2011-07-07 13:00 alex Status reviewed and tested => resolved
2011-07-07 13:00 alex Fixed in Version => 5.2.0-B1
2011-07-07 13:00 alex Resolution open => fixed
2011-07-07 13:00 alex Assigned To !COMMUNITY => alex
2011-07-07 13:00 alex Changeset attached 5.2.x r14437
2011-07-07 12:59 alex Note Added: 0003599
2011-07-07 12:59 alex Status needs testing => reviewed and tested
2011-07-07 12:59 alex File Added: user_group_storage_core_v2.patch
2011-07-07 11:03 alex Changeset attached 5.2.x r14436
2011-07-07 11:03 alex Changeset attached 1.2.x r14435
2011-07-07 10:57 alex Note Added: 0003598
2011-07-07 10:57 alex Assigned To => !COMMUNITY
2011-07-07 10:57 alex Developer => alex
2011-07-07 10:57 alex Status active => needs testing
2011-07-07 10:51 alex File Added: user_group_storage_themes.patch
2011-07-07 10:51 alex File Added: user_group_storage_modules.patch
2011-07-07 10:51 alex File Added: user_group_storage_core.patch
2011-07-07 09:58 alex Relationship added parent of 0000823
2011-07-07 09:21 alex Relationship added parent of 0001078
2011-07-07 08:53 alex Relationship added parent of 0000941
2011-07-07 08:08 alex Note Edited: 0003589 bug_revision_view_page.php?bugnote_id=0003589#r746
2011-07-07 07:39 alex Relationship added parent of 0000944
2011-07-07 07:38 alex Relationship replaced parent of 0000907
2011-07-07 07:37 alex Relationship added related to 0000907
2011-07-07 04:19 alex Note Added: 0003589
2011-04-03 11:16 alex New Issue
2011-04-03 11:16 alex Reference => https://groups.google.com/d/topic/in-portal-dev/oo24plIxkJg/discussion https://groups.google.com/d/topic/in-portal-dev/uaTOwx0vAMc/discussion
2011-04-03 11:16 alex Change Log Message => Moving UserGroup.PrimaryGroup field into PortalUser.PrimaryGroupId

Notes
(0003589)
alex   
2011-07-07 04:19   
(edited on: 2011-07-07 08:08)
Theme changes:

1. Virtual field "UserGroup" (used for primary group selection on Front-end registration form) is now called "PrimaryGroupId" and is real field now.
2. Hidden field "subscriber_email" added to "subscribe" and "unsubscribe" templates.

Please adjust your theme templates according to this.

(0003598)
alex   
2011-07-07 10:57   
(edited on: 2011-07-07 13:02)
Not obvious things, that was changed:
- "user_group" hidden field (on admin editing page) and related functionality removed in favor of new PrimaryGroupId field
- wrong icon name for "Set Primary" toolbar button, on users list template, was used
- identation of kEvent::CallSubEvent method fixed
- added "User_AdminGroup" configuration variable, to store admin group id (11 by default)

What to test:
- user registration (front-end); user registration (front-end) to custom group
- subscribe/unsubscribe to mailing list
- adding user/admin from admin console
- adding group to user/admin from admin console (user/admin editing screen)
- adding user/admin to group from admin console (group editing screen)
- changing user's/admin's primary group from admin console (user editing screen)
- "yes" display near proper primary group during group/user editing
- proper price is selected based on user's primary group on front-end

(0003599)
alex   
2011-07-07 12:59   
Will test later, but commit right now to ease merge process from 5.1.x branch.
(0003600)
alex   
2011-07-07 13:00   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001031: User management internals refactoring
(0005075)
alex   
2012-07-25 05:33   
Since 5.2.0 version was released.