Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Sep 2012 at 14:15 UTC
Updated:
21 Aug 2016 at 11:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sanchi.girotra commentedHi,
Comment #2
neeravbm commentedI have made the changes as suggested. Please review.
Comment #3
suhani.jain commentedHi,
Mannual Review
In .module file
1)'!==' operator is there on line no 115.It should be '!='
2)In drupal_goto you have passed 'user/register' as an argument...But what if clean url in not on???..is it work
When i click on 'No, I am new to this site.' radio button under 'Do you have a localhost password?' its get redirected to 'http://localhost/user/register' which will throw 'Page not found'.Please use the drupal base path to get the base path of drupal
Please correct your git clone link it should be 'git clone http://git.drupal.org/sandbox/neeravbm/1777308.git amazon_like_login' and also correct all the issues mentioned in ventral.org
Thanks,
Suhani Jain
Comment #4
pnemes commentedHi
I installed your module and it works well.
You should check your coding here. there is a few error you should fix.
Also, you should change your git repository link described in comment #3, because it is hard to find this way.
After enabled the module, i cant login with my user's email address. I see you mentioned it in readme, but i found this a bit confusing.
At least, you should change the login block's title to e-mail/username.
Comment #5
DmitriyMakeev commentedHi.
Nice module. Also module was checked with CAPTCHA and works fine.
1. Check automatic review http://ventral.org/pareview/httpgitdrupalorgsandboxneeravbm1777308git one more time.
2. Instead of amazon_like_login_valid_email() use valid_email_address().
3. Please add amazon_like_login.install file with:
Comment #6
neeravbm commentedThank you for reviewing the module. Here are the changes I have made:
1) When a user clicks on "No", he is redirected to "?q=user/register" rather than "user/register". This way we ensure that the link will work even without Clean URLs enabled.
2) Added javascript code so that when login page loads, "Yes" is checked by default.
Comment #7
neeravbm commentedHi Suhani,
Thank you for reviewing the module. Here are responses to your queries:
1) !== is a valid operator. In fact, this is the one required here because I need to check boolean FALSE otherwise even 0 will match.
2) In javascript, I have changed redirection URL from "user/register" to "?q=user/register" to ensure that it works without clean URL enabled. In drupal_goto(), "user/register" will work.
Thank you.
Regards,
Neerav.
Comment #8
neeravbm commentedHi pnemes,
After enabling the module, one will be able to log in using whatever username he or she used before. It does not change data of people who have already registered on the site. This way even the admin username will work since it is registered before the module is enabled.
Thank you.
Regards,
Neerav.
Comment #9
neeravbm commentedHi DmitriyMakeev,
Thank you for reviewing the module. Here are the answers:
1) Automatic review only gives a few Warnings. The only errors it gives are errors in javascript where it asks to insert space between and after operators. But this is a minified javascript and removing the space is to reduce its size.
2) I changed amazon_like_login_valid_email() to valid_email_address().
3) To me, showing the message on install does not make sense since only the administrator will be able to see it when he installs the module. It should be up to the users if they want to update.
Thank you.
Regards,
Neerav.
Comment #10
neeravbm commentedUpdating project priority since I haven't got any feedback since more than 2 weeks.
Comment #11
zymphonies-dev commentedHI neeravbm,
You are getting few js error in automatic review
you should add space after and before of the +,=,== etc.
Please read drupal JavaScript coding standards.
http://drupal.org/node/172169
Thanks,
Comment #12
neeravbm commentedFixed javascript coding format errors. Please review.
Comment #13
neeravbm commentedIncreasing the priority.
Comment #14
cubeinspire commentedWelcome neeravbm !
Automatic review:
1. Please solve the remaining code standard (minor) issue: http://ventral.org/pareview/httpgitdrupalorgsandboxneeravbm1777308git
Manual review:
2. amazon_like_login.js:There is not enough to use the hostname, as some installations are not on the root url path (as mine is at localhost/drupal/mytestsited7/?q=[...]) You can access base path on the javascript side using Drupal.settings.basePath.
window.location = window.location.protocol + '//' + window.location.hostname + '?q=user/register';3. There is mispelling on line 114. You must enter a username. should be You must enter an username.
4. You should add a tag on the query at line 223 to allow other modules to modify this query. The query does not take node access grants into account, so node access modules might have no effect. Be sure to use a dynamic query created by db_select() and add a tag of "node_access". This will allow modules dealing with node access to ensure only nodes to which the user has access are retrieved, through the use of hook_query_TAG_alter(). See: http://api.drupal.org/api/drupal/modules!node!node.module/group/node_access/7
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
Comment #15
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
If you reopen this please keep in mind that we are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #16
neeravbm commentedI have fixed points 1, 2 and 3. Line 223 does not have a node query but a user query so I am not adding "node_access" tag. I could have added another tag but then somebody might accidentally break the functionality of the module. That's why I am not adding any tag to this query.
Comment #17
Homotechsual commentedHey neeravbm,
Grammar:
Firstly, please reverse the change made in #14, point 2.
The correct phrase is "a username" this is because username starts with a palatal glide (a 'y' sound). The use of a vs an relates to the sounds and not the letters used. You are sounding a consonant when you read username therefore you use a not an.
Automated Code Review:
No serious issues found. Please shorten the lines mentioned if it's at all possible.
Automated Code Review link.
Usability Points:
Personally I'd like to see the email_update url replaced with user/emailupdate for the sake of consistency. It'd be great to see user/password user/login user/register and user/emailupdate. However this is just a suggestion based on my observations.
My second usability point questions the validity of overriding Drupal's default username handling. In my opinion it would be better to use the existing email address field attached to users instead of overriding the functionality of username.
Manual Code Review:
.module file:
Line: 241
form_set_error('name', t('You indicated that you are new to this site but an account with @username already exists.', array('@username' => $username)));This doesn't quite read right. Suggest changing to: t('Sorry, an account with @username already exists.', array('@username' => $username)));
page.inc file:
Line: 27
Change to 'Current e-mail address'
Comment #18
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #18.0
PA robot commentedChecked with Drupal Coder module and Drupal Code Sniffer. Made changes for what makes sense. Also updated the git link in the project page.
Comment #19
neeravbm commentedComment #20
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #21
manish.upadhyay commentedHi,
Please fix code formatting errors, i have found lots of error using automated code sniffer tool. You can check errors on pareview.sh or follow the following link to get all the errors :
http://pareview.sh/pareview/httpgitdrupalorgsandboxneeravbm1777308git
Thanks,
Comment #22
neeravbm commentedHi manish.upadhyay,
The errors mentioned have been patched and fixed. Please see here
Thanks for reviewing!
Comment #23
neeravbm commentedUpdating The title.
Comment #24
joachim commentedwww.hobbylocal.com/user/login looks like a phishing site.
Comment #25
neeravbm commentedHi joachim,
Thanks for spotting that. I have removed the said link from the description.
It seems the domain has expired and been taken over as the description of this issue was updated long back.
Comment #26
neeravbm commentedComment #27
manish_nagdevani commentedManual Review
Hi Neerav,
I installed your module & its working fine. Apart from a few points listed below, its good to go.
1) Remove the commented code section in the amazon_like_login.js file.
2) You have a open menu callback in amazon_like_login.module : look out for it.
3) Do check for automated review for resolving code formatting issues(minor issues).
Comment #29
gisleAutomated Review
PAReview complains about missing automated test cases. Adding test cases are strongly recommended, but they are not mandatory. You should however add a comment before the line with the open pageback call and explain why there is no access restrictions. (I see no security problem with this open pageback call).
Manual Review
There already exists some modules that allows use of Email as username for Drupal. Here is a list with those I am aware of:
Our users need to be informed about possible functional overlap. This should be made is section with the heading "Similar projects and how they are different" on the project's project page that:
(+) Your project page need to be updated with this information before creating a stable release, but not having this in place shall not block promotion to a full project.
The starred items (*) above are big issues and warrant the application going back to Needs Work. Items marked with a plus sign (+) should be addressed before a stable project release, but does not block the project from being promoted to a full project. The rest of the comments are only recommendations.
Conclusion
There are IMHO no more blockers. Moving to RTBC. Note that promotion will not happen until a git administrator has given this a second set of eyeballs.
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 #30
klausiReview of the 7.x-1.x branch (commit 8f436cc):
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.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #31
gisleklausi wrote:
To change the email address, one has to supply a valid password for the account. This means that IMHO there is no need to restrict use of this callback to
user_is_logged_in().However, I agree with the security concerns of using the full email address as screen name.
The author says this in the project's
README:After reading the review by klausi, I realize this is not enough of a precaution, and that it should be resolved in a more robust manner.
Comment #32
neeravbm commentedHi klausi, gisle
As per manual review I have made the following changes as per points noted here
1. Updated the Project Summary as per gisle's suggestion. see here
2. As gisle points out here I dont think the open callback is an issue.
Further the callback is open as it is a functionality wherein anonymous users can change the email id iff they have the previous email,password and login too in one step. see the screenshot
3. Fixed. see here
4. klausi mentioned
I am not clear on this as I have not used any check_plain() inside amazon_like_login_form_user_login_validate().
5 - Fixed. see here
6 - @gisle Do you have recommendations/pointers about how this may be handled?
Also I have fixed the Drupal Practice Warning accordingly.
Thank you for reviewing the module.
Comment #33
gisleAs pointed out by klausi, user names and user ids are not considered private information in Drupal, but a user's email address is.
This means that an email address cannot be a username. Your module may take steps to protect the username/email-address, but your module cannot control what other modules do with this field in the user's profile.
The main idea behind Amazon.com's login is that users these days are members of dozens of websites, and that usernames differ between sites, so keeping track of those puts a strain on the user's memory. One's own e-mail or mobile number is something that most people never forget, so using those as login credentials are attractive.
However, there is no requirement in Drupal to use the username as the (sole) means of identification of the account to authenticate during login. The login process just authenticates the user, and the identification part can be done by a number of alternate methods, including one that asks the user to supply a unique email-address and/or mobile number. The only constraint Drupal imposes on the username is that it must exist and be unique.
The Email registration module solves this by automatically generating a unique user name behind the scenes by cutting off the domain part of the email-address and appending the Drupal uid. Since drupal uids are unique, this simple algorithm authomatically produces usernames that are guaranteed to be unique across the site.
The LoginToboggan module solves this using slightly different approach. The registration form requires the user to register with a regular user name and email address (i.e. standard Drupal). However, when asking for credentials, the user can use one or the other (i.e. both will work equally well to identify the account to authenticate).
I prefer the way LoginToboggan handles this over Email registration, but both methods will work. One of the advantages over the LoginToboggan method is that all usernames created before the module is installed will continue to work as before.
To further emulate Amazon.com's login, you should also allow the user to register a mobile phone number, and allow that field to be used as well to identify the account to authenticate.
One of the nifty features of Amazon.com is that you're allowed to pick your own "Public Name" and you may even change it at any time. To emulate this part of Amazon's functionality, you could generate a unique user name behind the scenes during registration (Email registration method) or let the user pick an initial Drupal username (LoginToboggan method). You should the refer to the Drupal username as the user's "Public Name". The ability for users to change their "Public Name" is already in core: Simply set the "Change own username" permission for the role.
Comment #34
neeravbm commentedHi Gisle,
Thank you for providing your valuable feedback and suggestions to improve the module.
I have made the following changes to the module taking into consideration your suggestions:
1. The User is now asked for a desired username while registering.
2. The username now is not the email ID as this was the security issue pointed out by klausi
3. There is an option for the user to login with registered email-id or registered username. If someone created an account using a username before this module was installed (with or w/o an email id), it will still work.
The code diff is here
I am changing the status from `Needs work` to `Needs review`
Comment #35
ganesh_kumar commentedHi neeravbm ,
Few tweaks are here README.txt does not followed guidelines for in-project documentation and It would be good, if you implement hook_help in your module and check below Coding style & Drupal API usage content.
Automated Review
All Pareview issues fixed
Manual Review
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.
Comment #36
neeravbm commentedHi ganesh_kumar ,
A few Clarifications :
Can you please elaborate on what I am missing out?
IMO $_SESSION['messages']['error'] is used just to set error message. why is that a major issue? Can you point me to any documentation which states we need to unset it?
Thanks for reviewing the module.
Comment #37
ganesh_kumar commentedHi neeravbm,
You should follow the template for "README.txt" file . Please refer the below url
https://www.drupal.org/node/2181737
if the session is not destroy properly variable will be stored in the session until the user logout, Better to clear the session variable after it is use its not highly critical but its safe to do so.
Comment #38
neeravbm commentedComment #39
neeravbm commentedAdding Review Bonus Tag after reviewing other projects see the Issue Changes here
Comment #40
neeravbm commentedHi ganesh_kumar,
1. README.txt is fixed and now follows the guidelines see the diff here.
2. Added hook_help() as per your suggestion see here.
3. Regarding your comment
I am not setting the value of this variable in my module. If you see here I am just removing the message to show a custom message. Further if you see Line 88, 92 They are just conditionals to check whether the variable has a value. Further I only Alter the message of the error in Line 98. So I dont think It is wise/justified why I should unset the variable as I am not setting it in my module. It might be set by drupal core and unsetting may not be wise.
Thank you!
Comment #41
ganesh_kumar commentedHi neeravbm,
For the session issue its not a blocker.
Automated Review
Fix all the Pareview issue listed in the given url http://pareview.sh/pareview/httpsgitdrupalorgsandboxneeravbm1777308git
Its not a blocker but its recommendation it would be fixed
Comment #42
neeravbm commentedHi ganesh_kumar
I have fixed the pareview.sh issues noted by you above.
Please see here
Thank you :)
Comment #43
klausimanual review:
The second point is the same security issue again and a blocker right now.
Comment #44
neeravbm commentedHi klausi,
The issues mentioned above have now been fixed. here is the diff.
Thanks for reviewing the module :)
Changing the issue status to 'Needs review'
Comment #45
vishalkhialani commentedI have reviewed the module and its ready for approval.
All the security issues seem to be fixed according to me.
Thank you,
Vishal
Comment #46
klausiLooks good to me now.
Thanks for your contribution, neeravbm!
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.