Description

Replicate User extends Replicate module to manage the cloning of user entities. The requirements for this module has been discussed here.

When you clone a user entity, the username needs to be updated to be unique. As the decision on how to update the username can be different per website, the replication of users is not managed by the Replicate module which is only an API (not taking any functional decision).

Replicate User provides a simple UI to let administrator to configure how the user entity is replicated. Username, password and email (mail & init) fields replication can be configured.

This module doesn't provide any UI to replicate users. Please have a look to Replicate UI to get an administrative interface to replicate entities.

Useful links

Project page is available here.
Pareview result is available here. (2 warnings about undefined variables are false positive as the purpose of these 2 lines are to test if these variables are defined)
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/vtriclot/2452305.git replicate_user
Previous project application (been promoted as a single project due to the size of codebase)
Maintainers of this module are typhonius and vbouchet

Reviews

CommentFileSizeAuthor
#12 add-replicate-tab.patch567 bytesadammalone

Comments

vbouchet’s picture

Issue summary: View changes
vbouchet’s picture

Status: Active » Needs review
vbouchet’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

kunalkursija’s picture

Status: Needs review » Needs work

Hi vbouchet,

1) Your Git clone URL is imporper. i think it should be this.

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/vtriclot/2452305.git replicate_user

2) Pareview is generating some errors.

Kindly correct them.

adammalone’s picture

Issue summary: View changes
adammalone’s picture

Status: Needs work » Needs review

I've fixed the git URL. Pareview errors are false positives as Vincent explained in the OP.

Pareview result is available here. (2 warnings about undefined variables are false positive as the purpose if these 2 lines are to test if these variables are defined)

vbouchet’s picture

Issue summary: View changes
vbouchet’s picture

Issue summary: View changes
camprandall’s picture

Assigned: Unassigned » camprandall

Reviewing.

camprandall’s picture

Assigned: camprandall » Unassigned

I attempted to review this, but with Replicate User, Replicate and Replicate UI turned on, I don't get a Replicate tab on the user so I can't test. Is there more to this?

adammalone’s picture

Assigned: Unassigned » adammalone
Status: Needs review » Needs work
StatusFileSize
new567 bytes

I think we might need to add the following patch @vbouchet.

adammalone’s picture

Assigned: adammalone » Unassigned
vbouchet’s picture

Status: Needs work » Needs review

As per this comment, this will be managed by replicate_ui directly. Replicate user module is only providing an admin interface to configure the replication. Replicate ui takes care if the replication interface itself.

vincenzo gambino’s picture

Hi vbouchet,

nice module, why don't you apply the patch provided y tephonius in comment #3?

Pareview.sh show some CodeSniffer errors http://pareview.sh/pareview/httpgitdrupalorgsandboxvtriclot2452305git

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Extend Replication Module
Master Branch
[Yes: Follows] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows] the the guidelines for in-project documentation.
Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.
Secure code
I haven't done any security review
Coding style & Drupal API usage
Please fix all of the code style issues reported by pareview.sh

FILE: /var/www/drupal-7-pareview/pareview_temp/replicate_user.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
78 | WARNING | Variable $username is undefined.
162 | WARNING | Variable $mail is undefined.
----------------------------------------------------------------------

This review uses the Project Application Review Template.

vincenzo gambino’s picture

Status: Needs review » Needs work
adammalone’s picture

Oops, my bad - I completely forgot that - @vbouchet is right!

adammalone’s picture

vbouchet’s picture

Status: Needs work » Needs review

Hi Vincenzo,

As explained in comment #14, UI is provided by replicate_ui module.
Regarding the code sniffer errors, as explained in the ticket summary, it's false positive.

Thanks,

vgriffin’s picture

Status: Needs review » Needs work

This is a useful module. I will certainly use it to build test accounts with similar names, fake email addresses, and identical roles. Because it uses entity replication, custom fields are automatically included in the replication.

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[Yes: Follows] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt/README.md
[No: Does not follow] the guidelines for in-project documentation and/or the README Template.
  1. While the README.txt file contains the necessary information, the guidelines say it should follow the README template. Modules that follow the standard template are easier for site builders to install.
  2. The README.txt file should state that Replicate UI module versions 1.4 and earlier do not work with this module. The 1.x-dev version dated 2015-Mar-12 does work with this module.
Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.
Secure code
[Yes: Meets the security requirements.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Email addresses must be unique for user entities to be saved by the User module. The replicate process implemented here permits the entity to be saved with a duplicate email address. The login process for forgotten password allows the user to provide only an email address. If the email address is a duplicate, the email is sent for the original username regardless of which user name had been desired. If any changes are desired, the email address must be changed before they can be saved. The email address must be changed to cancel the account. The code should require the email address to be updated.
  2. The title on the verification uses only the user ID field. It would be helpful to use the username instead. (I recognize that this may not be easy or even possible. Alternately, there could already be a hook from the replicate API.)

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

vbouchet’s picture

Status: Needs work » Needs review

Hi vgriffin,

Thank you for your feedbacks and sorry for the delay.

I fixed the critical point by disabling the checkbox and setting the default_value to 1. By default, a rule is now applied to the email field during the replication process. If you really don't want it (for testing purpose), you still can disable it with dush vset replicate_user_mail 0.

I also updated the README.txt to follow standards.

Can you give me more details about your second point, I didn't get it.
What do you mean by "does not working" regarding the Replicate UI. It's only supposed to extend Replicate features and where are not doing anything related to UI here so I don't see the relation.

As none of these points seem critical, I will change the status to Needs review, feel free to change it back to Needs work if needed.

Thanks,

ayesh’s picture

Thanks for submitting the application.
I will do a manual review tonight but I read the code in git viewer - really well-written.

A few points, which all of them are minor:

- When linking to modules, use https.
- in the admin for, instead of doing a #default_value = 1, you can use variable_get()'s second parameter to return 1 as the default value. That way, submitting the form does not overwrite any previously-set variables.

vbouchet’s picture

Hi Ayesh,

- I changed the link in hook_help() to use https instead.
- Both username and email address must be unique (username because of the user's table structure, email because it's used for password retrieval - as noticed by vgriffin). I'm using variable_get during the replication process so advanced people can avoid username or email modification by changing values via drush vset. I would prefer to keep this default_value forced to 1 for now and would change it if I receive issues in the future.

Thanks,

vbouchet’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
klausi’s picture

Assigned: Unassigned » naveenvalecha
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

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

Assigning to Naveen as he might have time to take a final look at this.

naveenvalecha’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 7.x-1.x branch (commit f2dba31):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: .../www/d7/sites/all/modules/contrib/pareview_temp/replicate_user.module
    ---------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ---------------------------------------------------------------------------
      78 | WARNING | Variable $username is undefined.
     162 | WARNING | Variable $mail is undefined.
    ---------------------------------------------------------------------------
    
    Time: 148ms; Memory: 6Mb
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.


FILE: ...w/d7/sites/all/modules/contrib/pareview_temp/replicate_user.admin.inc
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
 188 | ERROR | Type hint "array" missing for $element
---------------------------------------------------------------------------


FILE: ...cs/www/d7/sites/all/modules/contrib/pareview_temp/replicate_user.test
---------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
---------------------------------------------------------------------------
   9 | ERROR | [x] Doc comment short description must end with a full stop
  15 | ERROR | [ ] Missing short description in doc comment
  26 | ERROR | [ ] Missing short description in doc comment
 124 | ERROR | [x] Doc comment short description must end with a full stop
 130 | ERROR | [ ] Missing short description in doc comment
 141 | ERROR | [ ] Missing short description in doc comment
 218 | ERROR | [x] The closing brace for the class must have an empty line
     |       |     before it
 221 | ERROR | [x] Doc comment short description must end with a full stop
 227 | ERROR | [ ] Missing short description in doc comment
 238 | ERROR | [ ] Missing short description in doc comment
 259 | ERROR | [x] The closing brace for the class must have an empty line
     |       |     before it
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

Time: 349ms; Memory: 8Mb

Manual Review :

  1. The code is well written. replicate_user_help : When linking to modules on drupal.org append www to the urls as well.
  2. Address #25
  3. The module is fully relying on the user module.So add a hard dependency on the user module in replicate_user.info .The replicate module is is also not dependent on user module.
naveenvalecha’s picture

Assigned: naveenvalecha » Unassigned

Thanks for your contribution, vbouchet!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

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.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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