Loading...
 

Enhancement: Add option to select whether LDAP group synchronisation creates new groups or only sync existing ones

Status
Open
Subject
Enhancement: Add option to select whether LDAP group synchronisation creates new groups or only sync existing ones
Version
8.x
Category
  • Feature request
  • Patch
  • Less than 30-minutes fix
Feature
User Administration (Registration, Login & Banning)
External Authentication (LDAP, AD, PAM, CAS, etc)
Admin Interface (UI)
Resolution status
New
Submitted by
Manuel Schneider
Lastmod by
Manuel Schneider
Rating
(0)
Description

When groups are synchronised with a big LDAP organisation many empty groups may end up in Tikiwiki.

This enhancement / patch adds an option to let the administrator of a tikiwiki instance decide whether during synchronisation of groups only the user assignments to existing groups will be done or if non-existent groups will be created in tikiwiki.

The default behaviour - as of now - is that when a LDAP user logs in all the groups he belongs to will be created in tikiwiki and he is being added as a member of these groups.

This enhancement adds the preference "ldap_create_groups_tiki" which is "y" by default - which corresponds to the current behaviour.

If "ldap_create_groups_tiki" is set to "n" and a LDAP user logs in the group synchronisation process will silently ignore groups that exist in LDAP but not in tikiwiki. Existing groups will be synced, though.

Solution
lib/prefs/ldap.php
30c40
+                'ldap_create_group_tiki' => array(
+                        'name' => tra('If group does not exist in Tiki'),
+                        'type' => 'list',
+                        'perspective' => false,
+                        'options' => array(
+                                'y' => tra('Create the group'),
+                                'n' => tra('Ignore it'),
+                        ),
+                        'default' => 'y',
+                ),

templates/admin/include_login.tpl
223c227
+                        <fieldset>
+                                <legend>{tr}LDAP group synchronisation{/tr}</legend>
+                                {preference name=ldap_create_group_tiki}
+                        </fieldset>

lib/userslib.php
@@ -1261,18 +1261,21 @@
                                        }
                                }

-                       } else if (!$this->group_exists($gname)){ // create group
-                               if (isset($group[$prefs['auth_ldap_groupdescattr']])) {
-                                       $gdesc=$group[$prefs['auth_ldap_groupdescattr']];
-                               } else {
-                                       $gdesc='';
-                               }
-                               $logslib->add_log('ldap','Creating external group '.$gname);
-                               $this->add_group($gname,$gdesc,'',0,0,'','',0,'',0,0,'y');
+                       } else if (!$this->group_exists($gname)){ // group does not exist
+                               // create group if we should do so
+                               if ($group[$prefs['auth_ldap_create_group_tiki']] == 'y') {
+                                       if (isset($group[$prefs['auth_ldap_groupdescattr']])) {
+                                               $gdesc=$group[$prefs['auth_ldap_groupdescattr']];
+                                        } else {
+                                               $gdesc='';
+                                        }
+                                        $logslib->add_log('ldap','Creating external group '.$gname);
+                                        $this->add_group($gname,$gdesc,'',0,0,'','',0,'',0,0,'y');
+                                }
                        }

-                       // add user
-                       if (!in_array($gname,$tikigroups)) {
+                       // add user - before check again if group exists
+                       if (!in_array($gname,$tikigroups) && $this->group_exists($gname)) {
                                $logslib->add_log('ldap','Adding user '.$user.' to external group '.$gname);
                                $this->assign_user_to_group($user,$gname);
                        }
Importance
3
Easy to solve?
10 easy
Priority
30
Demonstrate Bug
Please demonstrate your bug on show2.tikiwiki.org

 About show2.tikiwiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tikiwiki.org instance. To start, simply select a version and click on "Create show2.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tikiwiki.org.

Version: Create show2.tikiwiki.org instance
Rating (deprecated)
(2)
Ticket ID
4150
Created
Tuesday 31 January, 2012 10:27:27 GMT-0000
LastModif
Tuesday 30 September, 2014 16:57:40 GMT-0000

Attachments

 filenamecreatedhitscommentversionfiletype 
No attachments for this item


Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Group
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend, alert + Social Bookmarking
Terms and Conditions
Theme
TikiTests
Timesheet
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools