CVS edit link for kassissieh
I have built a module that complements
http://drupal.org/project/ldap_integration. Named LDAPsync, it automatically creates Drupal users based on live queries of the LDAP database(s) specified in LDAP Integration. This feature is important for many network administrators, who want their site to reflect current user membership on their network, even if users have not yet logged in. The module can sync users on cron or manually. It also can block Drupal users that are LDAP authentified but do not exist in LDAP.
The module depends on LDAP Integration for some settings and functions. The issue queue at http://drupal.org/node/396574 demonstrates the level of support for this module. A few other drupal.org users have tested and submitted patches to the module. See the #73 in this issue queue for the latest module code.
The maintainer of LDAP Integration, http://drupal.org/user/18741 (miglius), has requested that this module be its own separate project rather than add it to LDAP Integration.
Comments
Comment #1
kassissieh commentedComment #2
kassissieh commentedI think the status should be active (not postponed), as I have uploaded module code for review. Let me know if I'm mistaken! Thanks.
Comment #3
avpadernoComment #4
avpadernoThere is no need to set Drupal variables to their default values; default values are passed to
variable_get(), which will return the default values if the variable has not been set before.If you are going to include the file unconditionally, then you should merge the files.
I am not sure the code is handling users in a secure way. I think that users who are blocked should also be logged out too.
The code should use placeholders, not concatenate strings that are translated.
The same is true here.
Strings used in the user interface should be translated.
Submission code should not depend on
$op. It is possible to have a submission functions that is specific for a single button. That would eliminate the need to know the operation being executed.Comment #5
kassissieh commentedThank you kiamlaluno for your review.
1. Done.
2. The file to include is part of ldapauth, not part of my module. As the maintainer of that module may make changes, I'd like to include that file rather than duplicate his code in this module. Okay?
3. I haven't found a Drupal 6 function to kill the session for a user other than the one logged in. So I'm not sure how to meet your request. The necessary function does exist in D7.
4. Done.
5. Done.
6. Done.
7. Done.
Please see new version attached.
Comment #6
avpadernoTo log out a user, you can look at what the function
user_logout()does.Comment #7
kassissieh commentedsession_destroy() works for the currently logged in user, but I don't see how it would work for one or more other users. I could call user_module_invoke() for other actively logged in users, but do any core modules have a logout hook that destroys that user's session? I haven't found it so far.
Comment #8
Suuch commentedYou could load each user you need to logout as $account and use user_module_invoke('logout', $null, $account) to log them out.
e.g.
Comment #9
avpadernoAn IF-statement should always be written as
I apologize on the delay on approving this application.
Comment #11
kassissieh commentedThank you for the approval. The task discussion thread recently regained momentum, so the approval is well-timed.