First time login module prompts user to reset their profile, when they login to their account for the first time (once profile is updated it will not prompt from next login on wards).
After creating a user account with basic details, user can be intimated to log on to their profile and ask them to update it. Where in the user can update their account password also.
You can configure the threshold number of days after, which user will be again prompted to update their profile.
Timestamp for the existing users will be updated to their last access time, at the time of module installation.
NOTE:
*Super user (user with UID = 1), will not be prompted for profile update.
*Default threshold number of days after which user will be again prompted to update their profile is set to 120 days.
Project URL: https://www.drupal.org/sandbox/neerajsingh/2477075
Clone URL: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/neerajsingh/2477075.git first_time_login
Comments
Comment #1
blacksnipeYou might want to change the git-command. You can do this by unchecking the checkbox next to "Maintainer", on the Version Control-tab of your module-page.
You might also want to check out the automated project review on http://pareview.sh/pareview/httpgitdrupalorgsandboxneerajsingh2477075git
Comment #2
neerajsinghThanks Blacksnipe, for your suggestions..!!
I have worked on the reviews from 'pareview'.
Also as suggested, I have unchecked the checkbox next to "Maintainer", at module page, following is the updated GIT Clone URL:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/neerajsingh/2477075.git
Regards,
Neeraj Singh
Comment #3
blacksnipeHi neerajsingh,
Nice of you to update the module so quickly. However, the automated review shows that you haven't set the default branch of the module. No idea if this issue could be solved over time, but you might want to check the documentation on how to do so if it does not.
Marked this application to 'Needs review' for the time being.
Comment #4
PA robot commentedWe 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.
Comment #5
manjit.singhUpdating project description as well for better understanding of Git command. :)
Comment #6
ziomizar commentedHi neerajsingh,
See your code i see that you use
header("Location: $path");To perform a redirect and also you are using exit.
You would to use drupal_goto to get the same result in a drupal way.
Also your code seems only 90lines of code when the min suggested for a contrib module is 120 lines
Comment #7
RavindraSingh commentedLimited scope of this project:
@neerajsingh, I have reviewed this project and found the limited scope. The functionality you are doing by this module can be achieved by rules and flag module easily. we should avoid writing code in drupal if something can be used to achieve the same type of functionality.
"Collaboration rather than competition" - https://www.drupal.org/contribute/development.
You can Try (https://www.drupal.org/node/683696) the ways to achieve the functionality you are developing.
Comment #8
neerajsinghThank you Manjit.Singh, for updating GIT command.
ziomizar: Point Noted, I will amend my code as per Drupal way.
RavindraSingh: Thanks for guiding me, this is just a beginning; I will try to add few more functionality to the project.
Again, thanks a Lot guys for reviewing this project..!!
Regards,
Neeraj Singh
Comment #9
neerajsingh@ziomizar, I have updated the code to work in a Drupal way.
@RavindraSingh, I have added another functionality to configure the threshold number of days after, which user will be again prompted to update their profile.
admin/config/first-time-login
NOTE: I am updating the issue summary as a part of this comment.
Thanks a Lot for all your guidance and review.
Regards,
Neeraj Singh
Comment #10
replicaobscuraAutomated Review
Looks good!
Manual Review
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.
Comment #11
ayesh commentedI'm wondering... DateObject class?
Comment #12
neerajsinghHi Ayesh,
Where did you find "DateObject class" in this module..
Regards,
Neeraj Singh
Comment #13
ayesh commentedRe #12.
See line 147.
Comment #14
neerajsinghRe #13
Line 147 - is "function first_time_login_menu() {"
Comment #15
ayesh commentedSorry the number is wrong.
I'm referring to the snippet above. See your hook_user_login implementation.
Comment #16
neerajsinghThanks Ayesh, for reviewing this. I will work on it and update it;as required.
Regards,
Neeraj Singh
Comment #17
ayesh commented... thus, making this Needs Work.
Sorry I tried to test the module but I don't have this class. Note that you can use DateTime class from PHP, that comes in all versions after 5.2. Drupal core requires 5.2 anyway, so you can use without requiring a PHP version explicitly in your module.
Comment #18
neerajsinghThanks Ayesh, for guiding me.
I have fixed the issue of DateTime object and committed the code. Please review the module.
Regards,
Neeraj Singh
Comment #19
ayesh commentedThanks.
There's a typo in .module:151 ("aoount" instead of "account"). Not a blocker though.
Comment #20
ziomizar commentedHi neerajsingh,
On first_time_login.module you don't need of $base_url to perform a redirect, you can do:
$path = "user/" . $account->uid . "/edit";Comment #21
ziomizar commentedComment #22
neerajsingh#19
Thanks Ayesh, for pointing out this typo. I have fixed it.. :)
#20
Thanks ziomizar, I have updated the code as suggested.
Comment #23
ajaynimbolkar commentedReview of the 7.x-1.x branch (commit e749f7a):
No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.
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 / No: Does not follow] the licensing requirements.
3rd party assets/code
[Yes: Follows ] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows] the guidelines for in-project documentation and/or the README Template.
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:
$path = url("user/" . $accountr->uid . "/edit", array('absolute' => true));
if ($days_diff > variable_get('first_time_login_config_days')
$path = url("user/" . $accountr->uid . "/edit", array('absolute' => true));
Comment #24
rgkimball commentedneerajsingh,
While this functionality is easily replicable by something like Rules, I think your simplified implementation will help some people, and I don't think it warrants a limited scope blocker.
Code Review
The first thing I noticed is that you broke up your t() strings to adhere to the 80 character line limit in your hook_help(). Though I'm sure this is something Coder/pareview.sh had you address, most of the major contrib modules I've seen do not do this.
I also noticed you were using
$account->is_new !=/== 1instead ofTRUEin your user_update and user_insert hooks. Obviously not a blocker, but I think the use ofTRUE/FALSEwhere applicable would make your code slightly more readable.This is also more of a stylistic change, but in the hook user login, you could simplify this excerpt to improve readability:
To the following:
$needsupdate = ($days_diff > $conf['first_time_login_config_days']);I noticed you have double stacked comment blocks to explain the hook you're about to write. In most cases, it's more practical (and common) to do the following instead:
Lastly, when you're setting
$account_createdand$last_updated_date, I would prefer to see you useformat_date()instead, so the date format isn't set in code, as this commonly differs by region/language. In future extensions I think the message text should also be configurable from your admin page, but that isn't necessarily prohibitive for the application process.Comment #25
neerajsinghRe: #23
Thanks ajayNimbolkar for this review, I have resolved most of the points and following is an update of the same:
1 - I did not find a way to update module name instead of the ID. Can you please guide me here.
2 - Resolved.
3 - Already resolved. #20 and #22
4 - Resolved.
5 - Resolved.
6 - Resolved.
7 - "title": is Required and is the untranslated title of the menu item. And same applies for "description" of menu item. see here
8 - Resolved.
9 - Resolved.
10 - Resolved.
Regards,
Neeraj Singh
Comment #26
neerajsinghRe #24
Thanks rgkmball for your review comments. As per your suggestions, I have updated the code.
Surely, I will consider message text to be configurable as future extensions of this module.
Regards,
Neeraj Singh
Comment #27
neerajsinghRe #23,
Hi ajayNimbolkar,
With reference to point 1 at #23...
I came to know that; once project is promoted from "sandbox" to "full project", I can update the project's short name and hence the module's folder name would be updated.
Refer: https://www.drupal.org/node/1068952
Regards,
Neeraj Singh
Comment #28
nitin.k commentedManual Review:
The module looks simple. Although functionality seems to be serving the motive of module.
My recommendations for the new releases are as follows.
1. Improve UI in new releases, try to show the info in popup. It will improve user experience as well.
2. All messages should be made configurable.
Regards
Nitin Kumar
Comment #29
neerajsinghThanks nitin.k, for you valuable review comments..!!
I will surely consider your recommendations for further enhancement of the project.
Regards,
Neeraj Singh
Comment #30
neerajsinghRE: #23
Hi ajayNimbolkar,
I have updated the GIT clone command to clone as per module name and not with project ID.
Clone URL: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/neerajsingh/2477075.git first_time_login
Rest of the issues are also resolved. Refer: #25
Regards,
Neeraj Singh
Comment #31
cweagansThanks for your contribution!
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.
Comment #32
neerajsinghThanks a Lot @cweagans, for updating my account and providing access to build FULL projects.!! :)
Regards,
Neeraj Singh