Do not install this bundle of joy if you do not have to share specific user data from the CAS server to the CAS client.

What gets synced and how

  • default user fields (synced automatically)
  • custom user fields (user chooses which of these fields get synced via the configuration page)
  • user roles (configurable to do so)
  • user picture (configurable to do so)

The sync always happens from the server to the client.

The sync always happens on user login, therefor, a user must logout and then log back in for any changes to take effect if the user was logged in at the time when the changes were made. Have a look at the README.txt for more information

Dependencies :

  • CAS module
  • this project includes 2 modules that are dependent on each other

A D6 version of the cas_fields_client module is coming soon.

Both cas_fields_client and cas_fields_server are intended to be used with D7.

Project page : http://drupal.org/sandbox/CristianAndrei/1514360
Git url : http://git.drupal.org/sandbox/CristianAndrei/1514360.git

Review of other projects:

  1. http://drupal.org/node/1599646#comment-6039622
  2. http://drupal.org/node/1598956#comment-6039636
  3. http://drupal.org/node/1575066#comment-6039706

Proper review of other projects

  1. http://drupal.org/node/1599646#comment-6062296
  2. http://drupal.org/node/1598956#comment-6062376
  3. http://drupal.org/node/1575066#comment-6062494

Comments

Cristian.Andrei’s picture

Status: Active » Needs review
acobot’s picture

Status: Needs review » Needs work

You should not working on a master branch, the branch should be 6.x-1.0 or 7.x-1.0, Moving from a master to a major version branch.

operinko’s picture

  1. It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
  2. Please create a README.txt that follows the guidelines for in-project documentation.
  3. Once you've moved your project to a version-specific branch, please run http://ventral.org/pareview and fix any issues found.
Cristian.Andrei’s picture

Status: Needs work » Needs review

created a 7.x branch, fixed ventral.org/pareview issues and added meaningful text to README.txt. Please review

Cristian.Andrei’s picture

Issue summary: View changes

addded missing project page and git url

Cristian.Andrei’s picture

Issue summary: View changes

update project description

Cristian.Andrei’s picture

Issue summary: View changes

added review category

Cristian.Andrei’s picture

Issue summary: View changes

added one more review to the list

Cristian.Andrei’s picture

Issue summary: View changes

edited review category

Cristian.Andrei’s picture

Issue tags: +PAreview: review bonus

*added "PAReview: review bonus" tag*

klausi’s picture

Issue tags: -PAreview: review bonus

Removing review bonus tag, you have not done any manual review, you just posted the output of an automated review tool. Please take an actual look at the source code of the applications.

Cristian.Andrei’s picture

Hi klausi,

Thanks for pointing that the reviews need to be manual code review and not any other form of review. When reading the [META] Review bonus, I did not see any explicit piece of information that the review should be exclusively code review. I posted a comment on the page mentioned before and, hopefully, the instructions will be updated.

Cristian.Andrei’s picture

Issue summary: View changes

changed review category title

Cristian.Andrei’s picture

Issue summary: View changes

added first "proper" review comment to list

Cristian.Andrei’s picture

Issue summary: View changes

added second "proper" review comment

Cristian.Andrei’s picture

Issue tags: +PAreview: review bonus

*added "PAReview: review bonus" tag*

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Thank you for your reviews! When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732

manual review:

  1. "CAS Fields module extends the functionality of CAS module.": so you should specify that dependency in the info file(s).
  2. "'access arguments' => array('access administration pages'),": The administration menu callback should probably use "administer site configuration" - which implies the user can change something - rather than "access administration pages" which is about viewing but not changing configurations. Or maybe reuse an adminstrative permission from CAS?
  3. "variable_set('fields_that_need_updating_from_cas_server', $form_state['values']['fields']);": all your variables need to prefixed with your module's name to avoid name collisions.
  4. cas_fields_client_config_form_submit(): why do you need that function if you use system_settings_form() anyway which will do the same?
  5. cas_fields_client_config_form(): why do you use "checkboxes" if there is only one on/off option? You could use "checkbox"?
  6. json_decode(): you drupal_json_decode() instead. Same for json_encode().
  7. cas_fields_client_user_login(): this is a hook implementation and should be documented as such, see http://drupal.org/node/1354#hookimpl . Same for cas_fields_client_form_alter().
  8. _cas_fields_client_add_user_roles(): $save_user is unused.
  9. "$form['picture']['#attributes']['disabled']": why can't you use $form['picture']['#disabled'] ?
  10. cas_fields.info: that file is not needed, as there is no module with that name.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Cristian.Andrei’s picture

Status: Needs work » Needs review

Thanks for the manual review, klausi.

I've cleared the master branch of any content.

Here are some comments to your manual review :

  1. added CAS dependency to info files.
  2. "'access arguments' => array('access administration pages')," has been changed to 'access arguments' => array('administer cas)," which is an administrative permission for CAS (thanks for the hint)
  3. all custom variables have been renamed with the prefix "cas_fields_client_" and "cas_fields_server_"
  4. I'm using "cas_fields_client_config_form_submit()" as I like to keep everything explicit and easy to understand for everybody.
  5. cas_fields_client_config_form(): "checkboxes" changed to "checkbox"
  6. json_decode/encode() has been replaced with "drupal_json_decode/encode()".
  7. documented cas_fields_client_user_login() properly. Same for cas_fields_client_form_alter().
  8. $save_user is used in _cas_fields_client_add_user_roles(). See line 195.
  9. I haven't used "$form['picture']['#disabled']" as I wasn't aware of it. I changed it as per your suggestion
  10. removed cas_fields.info
operinko’s picture

Status: Needs review » Reviewed & tested by the community

Couldn't find any more show stopper issues in the code.
Testing went fine, although I think there might be an issue I didn't test.
In cas_fields_server.module line #32:
You're using regular expressions to get hostname from the referer url without the http://, but the same regex won't work with https (no matches).

This, to me, won't stop the project going full (just an idea that might be good to include, it's supposed to be a centralized login system after all).

Cristian.Andrei’s picture

Thanks for the review, operinko.

I changed
preg_match('@^(?:http://)?([^/]+)@i', $service, $matches);
to
preg_match('@^(?:http|https://)?([^/]+)@i', $service, $matches);
so this scenario is handled properly.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

manual review:

  1. cas_fields_client_config_form_submit(): why do you need that submit callback? system_settings_form() will save the form values for you, you just have to name the form elements the same as the variable names. Then remove that function.
  2. "$form["$form_field"]": the quotation marks are useless here?
  3. "$form['account']['mail']['#description'] = "This field has been disabled by CAS_Fields_Client module.";": all user facing text should run through t() for translation.
  4. You define your own variables, so you should remove them in hook_install(). In both modules.
  5. cas_fields_server_cas_server_user_attributes(): is that function a hook? Because it is not documented as such and not called from anywhere.

Although you should definitively fix those issues they are not hard blockers, so ...

Thanks for your contribution, Cristian Andrei! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

Cristian.Andrei’s picture

Hi klausi,

Thank you for your comments, I've fixed all of them , except no. 1. I think that for clarity sake I'll leave the implementation the way it is as everything is exposed and no "magic" happens in the background.

cas_fields_server_cas_server_user_attributes() is a custom hook exposed by the CAS module. I've commented the function to make sure that it is clear where that functionality comes from.

Thank you for your effort in reviewing my module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added last "proper" review comment