Many academic and administrative units in University of British Columbia (UBC) start to use Drupal. University of British Columbia has an in-house built single sign-on service called Campus Wide Login (CWL). This module is to use CWL as Drupal's external authentication engine.
About the module:
The module itself is not a complex module. .module file is 306 lines, .install file is 37 lines.
A few notes:
1. Because some units websites' users are not from UBC and they do not have CWL. Hence, I provide an option to let users login via CWL and Drupal's built-in authentication engine.
2. Because this module will be used in many existed Drupal sites, to make user accounts migration smoothly, I provide an option to let users associate their current user account with their CWL Id.
Thank you for your time,
Cheers,
Minghui Yu
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | cwlintegration.zip | 5.32 KB | minghui.yu |
| #11 | cwlintegration.zip | 5.37 KB | minghui.yu |
| #1 | cwlintegration.zip | 5.22 KB | minghui.yu |
Comments
Comment #1
minghui.yu commentedHi,
This request is based on http://drupal.org/node/570056. My last request for a CVS account was declined because I did not reply in a timely manner.
Attached is the latest version.
Thank you.
Minghui Yu
Comment #2
minghui.yu commentedPlease note:
The demo site does not show this (CWL Integration) function at this time. That site is under active development.
Thanks.
Comment #3
avpadernoThe previous application was #570056: minghui.yu [minghuiyu].
Comment #4
avpadernohook_requirements()<br />in the description given for a form field when that is not necessary.The code is showing information about the user #1 without to verify if it is showing them to that user; I am not sure it is a good idea.
The code is duplicating the settings already used by Drupal; should not the code just use the settings already set in a Drupal settings page?
check_url(), which callscheck_plain()should not be called, in this case; the function alters the URL, which could be not useful anymore.Comment #5
minghui.yu commented"What I reported before about the functions to use is still valid. Is there a reason to not follow what said from the coding standards about the functions a module should use? "
Could you please tell me the link to "the coding standards about the functions a module should use" ? I check http://drupal.org/coding-standards and its sub sections and cannot find info about it.
Functions in the module are:
Please let me know which one is the problem.
Thanks,
Comment #6
avpadernoSee the section about Unicode string functions.
Generally speaking, a module should prefer a Drupal core function over PHP functions.
I think I have already said too much.
Comment #7
minghui.yu commentedRe: #5 The code is duplicating the settings already used by Drupal; should not the code just use the settings already set in a Drupal settings page?
This setting is here because
1) The feedback I received from users is that they want to modify user settings on the same page of Campus Wide Login (CWL) setting page. After using this module on existed sites, depending on if the site is open to all authenticated CWL users or to some of them (ie: open to students only, open to students in some faculties only, etc), the site admin needs to modify user registration option right away. Right now, most Drupal sites in the university require admin to approve user registration. With this module, some sites do not need to have site admin involved because they want all authenticated users to get accounts.
2) if a user is authenticated by CWL, it is no need to validate this user's email; especially in the forth coming future, after authenticated by CWL, a user's email registered with that CWL will be returned too. That is why I override email setting ( variable_set('user_email_verification', 0); ) in _submit
Comment #8
minghui.yu commentedRe: #4 The code is showing information about the user #1 without to verify if it is showing them to that user; I am not sure it is a good idea.
Hi KiamLaLuno,
Yes, you are very right that it is not a very good idea to show user #1 info without verifying. However, in university Drupal sites, it is not rare that user #1 is not the person who manages the site on a daily basis. Usually, someone (often students) developed a site and make himself user #1 and then left; a staff then took over and very often he thinks he is the super admin but in fact he is not. The description servers as a reminder here.
Thanks,
Comment #9
avpadernoBear in mind that a module present in Drupal.org needs to work for anybody.
To report the name of the user #1 is not a problem as that is available to anybody who has access to the user profiles (do you know who is the user #1 on Drupal.org? ;-))
I am not sure if it is a problem to show the other data, which is taken from the user profile data. The code should at least respect the settings for that field (which means that if I set that field to not be visible to anybody, the code should not show it to anybody).
Anyway, it is easier for a Drupal user to know if it is the super user, without any reminder. Just to make an example, do you think I am the ?
Comment #10
avpadernoIf you think it's more correct to report to the currently logged user s/he is not the super user, why doesn't the code explicitly says to the user (or a similar sentence)?
A module should be able to verify if a user is the super user, should not it?
Comment #11
minghui.yu commentedHi KiamLaLuno,
Thank you for your comments. Please see the attachment for latest version.
A couple of changes per your comments:
1. replace substr with drupal_substr
2. use hook_requirements to check if clean_url is enabled when installing
3. do not display user #1's CWL id; instead, display user #1's username and currently logged in user's username to remind if current user is user #1
4. remove
<br />from form fields description5. remove check_url from
$uri = parse_url(check_url($form_state['values']['cwl_xmlrpc_path']))and it is$uri = parse_url($form_state['values']['cwl_xmlrpc_path'])now.Thanks,
Comment #12
avpadernoThe string passed to
drupal_set_message()is not translatable, and the first argument passed tot()needs to be a literal string, not a dynamic string.Comment #13
minghui.yu commentedThank you.
I changed this and also changed the other two occurrences of
drupal_set_messagewhich did not usetI also removed code below since the module now uses hook_requirements.
Thanks,
Comment #14
avpadernoYou didn't upload the new code.
Comment #15
minghui.yu commentedOops!
Here it is
Thanks,
Comment #16
minghui.yu commentedPlease note the demo site is down.
Thanks,
Comment #17
minghui.yu commentedAny update?
Thanks,
Comment #18
avpadernoI would remove the phrase using in the description of some form fields; it should add something more in the description.
The error messages shown from the validate function should end with a period.
Comment #19
minghui.yu commentedTHANK YOU, KiamLaLuno!
:)
Comment #22
avpaderno