My motivation for creating OTP arose because of an application I developed (using Drupal as the framework) for a client. The admin users of this application had access to sensitive data (ie. credit card numbers, client personal information) but they would also have very weak passwords. I needed a way to make sure the accounts of these admin users were as secure as possible. Implementing the password_strength module is one way to make sure users chose good passwords. However, that by itself is not enough since users will often write-down their password on a piece of paper and stick it on their monitor. Hence, OTP was developed.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | otp.tar_.gz | 10.17 KB | jchin1968 |
| #12 | otp.tar_.gz | 10.19 KB | jchin1968 |
| #10 | otp.tar_.gz | 10.18 KB | jchin1968 |
| #6 | otp.tar_.gz | 10.23 KB | jchin1968 |
| #1 | otp.tar_.gz | 10.24 KB | jchin1968 |
Comments
Comment #1
jchin1968 commentedComment #2
jchin1968 commentedComment #3
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.
What are the differences between the proposed module, and http://drupal.org/project/yubikey?
Comment #4
jchin1968 commentedHello. The Yubikey is a separate hardware device that must be purchased and carried around. With my module, the one-time password is emailed or SMS'ed to a users mobile phone which is something many, if not most, people already have and carry around wherever they go.
Additionally, it is possible to implement and use one-time passwords, using my OTP module, at almost no cost by using SMTP (ie. email) to send the OTP. The only cost that would be incurred is on the user's mobile phone data plan when retrieving the OTP email.
Comment #5
avpadernoThank you for your reply.
Comment #6
jchin1968 commentedHello. I'm attaching a new archive file as I just realized the old file contained a commented line that should have been uncommented. This error prevented the OTP from being emailed to the user. It's fixed now. Sorry for any confusion this may have caused.
Comment #7
itangalo commentedI have a small debt to repay for getting a CVS account quickly (http://drupal.org/node/904138), so I'm trying to help real coders in reviewing applications more efficiently.
The following comments are *not* ground for approving or declining an application.
The Coder module gives some warnings concerning formatting and coding standards, mostly concerning tabs and spaces but also a few true/false that should be TRUE/FALSE. It also says "@file block missing" for otp_settings.inc and otp.install.
I do not dare code review something that has to do with passwords and login, but I'd recommend that you install Coder and get rid of the code standard warnings. Cheers!
Comment #8
jchin1968 commentedHi Itangalo,
Thanks for the advice. I'll go through each warning/error and send an updated file shortly.
Cheers.
Comment #9
avpadernoI am changing the status as per Itangalo's comment.
Comment #10
jchin1968 commentedHere's a new archive file with errors/warnings from Coder corrected. Please review. Thanks.
Comment #11
avpadernoThose lines need to be removed.
Drupal variables are not initialized in
hook_install().t().Deleting Drupal variables using a query that matches any Drupal variable with a name that starts with the module name would remove also the Drupal variables of other modules (there could be a otp_menu.module module, for example).
The permissions follow the schema
<verb> <object>where the verb is written in lowercase.Hook implementation comments should be like the following one:
As reported in Documenting hook implementations:
That function is considered deprecated, from PHP 5.3. Is there any reason the code is not using the PCRE functions?
Comment #12
jchin1968 commentedHi kiamlaluno. Thanks for the feedback. Sorry, it took me a while to get back to you. I had some other commitments and then ran into all kinds of trouble with getting AHAH working on the user profile edit form. I never did resolve my issue, which was to change a textfield title and description based on the "OTP Send Method" radio buttons. The application still works albeit not as elegantly as I would have liked. I'll try to have it fixed in another release. A couple of people have inquired the status of this module so I thought I'd get it out as quickly as possible.
Comment #13
drupalshrek commentedAs far as I can see it's looking good. Very good README.txt too!
Comment #14
jchin1968 commentedHi drupalshrek. Thanks for the positive comment.
kiamlaluno - I realize you must be very busy but do you have an estimate for when you will be able to complete the review and approve the module? Thanks.
Comment #15
zumph commentedI like this module very much. What I am looking for now is to add a field to the create account form that asks for a phone number. Then i want the $user->otpSendAddress variable to use that number to send the password to the user by default. Can anyone give pointers on how to do this?
Comment #16
randomuser commentedGlad to see someone working on this module, looking good so far.
Comment #17
jchin1968 commentedHi kiamlaluno. Can this module be approved yet? What fixes if any do I need to make? Thanks.
Comment #18
jcisio commentedJust a few small issues:
- Drupal has its own valid_email_address() function
- You use PHPmailer library without having mention that anywhere. Include a minimal version (if it is GPLed) or instruct user to put it in a libraries folder
- Don't use a global variable just so save a path
- Use hook_init() to include a .css file (or I think you only need it on hook_form_alter())
- Avoid $_SERVER['DOCUMENT_ROOT']
About the module logic, it looks good after a quick verification.
Comment #19
avpadernoLibraries available from third-party sites should not be committed in Drupal.org, even if they are licensed under GPL License.
Comment #20
jchin1968 commentedThanks for the comments jcisio.
I decided to use phpmailer rather than the default Drupal mail function to make it easier for users to implement. OTPs are sent using SSL encryption but not all web host providers offers an SSL enabled SMTP server. By including phpmailer in the otp module, a user can configure the mail settings within the Drupal website and use any SSL mail server they want.
PHPmailer is mentioned in the pre-requisite and installation sections of the README.txt file. And as kiamlaluno wrote in post #19, external libraries are not supposed to be included with the module.
I got rid of the global variable $_otp_path
You're right. otp.css is only referenced once in otp_login_form() so that's where I moved the drupal_add_css statement to. Now, otp.css is only loaded when the login form appears.
The cURL option "CURLOPT_CAINFO" requires a full pathname which is why I used $_SERVER['DOCUMENT_ROOT']. Should I use getcwd instead?
@randomuser (post #16) - I'm looking into using the SMS Framework module which will make it easier to add new gateways. Thanks for the suggestion.
Comment #21
avpadernoPlease read all the following and the links provided as this is very important information about your CVS Application.
Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:Migrating from CVS Applications to (Git) Full Project Applications.
Comment #22
prakashsingh commented@jchin1968.. has this module been finalized.. or can you give a new link to GIT
Comment #23
avpadernoAs per my previous comment, I am setting this issue as Won't fix.
Since new users can now create full projects, applications have a different purpose and they are handled on a different issue queue. See Apply for permission to opt into security advisory coverage for more information.