Module assigned role of the current user after payment by SMS. The role is appointed for a fixed period, after which it takes. Works with the regional service website mobio.bg. Requires Role Expire - http://drupal.org/project/role_expire, and configured service "Verification code" in you profile on mobio.bg.

Comments

apaderno’s picture

Assigned: svetlio » Unassigned
Status: Active » Needs review
svetlio’s picture

Link to project: http://drupal.org/sandbox/svetlio/1093016
Extended description of the project,
added LICENSE.txt and description on README.txt in english

svetlio’s picture

Anybody here? How can i make this sandbox to real project? Thanks

Ralt’s picture

Component: new project application » module

Hi,

Let me apologize in the name of the Drupal community, the review process is quite long. They are trying to make it better here.

Concerning your module, are you sure it is not possible to do this with Rules or triggers/actions ?

Ralt’s picture

Status: Needs review » Postponed (maintainer needs more info)
jordojuice’s picture

Issue tags: +pdx-code-review

Indeed, sorry about the long delay! I will try to get your application on the fast track!

On a side note, I would think this could certainly be implemented in a Rules module, which would be by far a best option in my opinion.

Please remove LICENSE.txt, that will be added when your project is promoted.

Just to let you know, you are likely committing with a git application on windows, correct? \r is being added to your commits in your repository, and this will make it very difficult for you to create patches for other projects in the future. Please visit http://help.github.com/line-endings/ for information on how to correct this.

You should remove README.html and keep README.txt.

Please run your module through Coder module (http://drupal.org/project/coder) on minor (most). Ignore CVS tag warnings, and remove all CVS tags like // $Id$ and similar.

Be sure to read over coding standards documentation if you haven't already (http://drupal.org/coding-standards). Namely, read about documentation and commenting. You need an @file comment in each module file, and comments should be in sentence format, beginning with a space, capital letter, and ending with a period. For good examples look at core module files.

In hook_uninstall() you need to remove any variables that are set with your module by using variable_del().

By the way, why did you opt to have roles be expirable?

svetlio’s picture

Thanks Ralt and jordojuice for your time and answers,
for awhile I'm committed to other projects, but will take into account any comments as soon as I have for this opportunity and make the necessary changes.
Rules or triggers/actions? Although I understand their nature and purpose are still difficult for me to understand and use, so I applied the ways that understand and know what is happening. But I will pay attention to what and how to apply them in this module.
Choices of roles have undergone a slight adjustment, but so are such choices - the idea is to have a variety of roles created without applying the default for all registered users for example, if I correctly understood the question.

jordojuice’s picture

Status: Postponed (maintainer needs more info) » Needs work

Regardless of whether it is implemented through Rules, I think this module provides a useful and unique feature for Drupal sites. It's certainly not a requirement that modules that can be implemented with Rules or triggers/actions use those methods, and knowledge of those APIs is not part of the application review process.

I'm moving this back to "Needs work" until the issues in #6 are fixed. We don't currently use the priority field in this queue (we are working on it), but consider your application prioritized. Please fix the issues that I mentioned and set this issue back to "Needs review" once completed. Once that is done I'll do a more thorough review and try to get you through the process.

svetlio’s picture

Status: Needs work » Needs review

I made some modifications to the code, in particular the construction of block processing of data already in the form FORM_submit, adjustment requests containing LIMIT, and also any comments. Coder module shows me only messages related to / / $ Id $. Added variable_del () in hook_uninstall (). I hope I have not missed something.

jordojuice’s picture

Priority: Normal » Critical

We had a talk about prioritization, and I updated documentation here. As per the new documentation I'm moving this issue to critical, though I'll still be completing the review.

Thanks for the update, I will check it out.

jordojuice’s picture

Assigned: Unassigned » jordojuice
Status: Needs review » Needs work
Issue tags: +PAReview: Screening Complete

By the way, don't forget to check out th line-endings link I posted above. It will be important to resolve that issue so you can create patches for other modules and so others can patch your module. If this is not done then patches will remove all lines of a file because git sees the \r even though you can't.

All functions need to be documented.

Drupal coding standards (http://drupal.org/coding-standards) dictate that if statements need to have brackets.

Variables should be lower case and underscores only, no camelCase

Makes good use of t() and database placeholders. Looks secure.

Doc blocks must not have a blank line between the documentation and the function. Php only associates a comment with a function if the function is on the next line.

Your first function documentation, properly formatted according to standards, should look like this

/**
 * Implementation of hook_block().
 *
 * @param string $op
 *   One of "list", "view", "save" and "configure".
 * @param integer $delta
 *   Code to identify the block.
 */

... Although common hook implementations do not need parameters, Drupal will associate the comment with the hook as it is.

92 drupal_set_message(t("<p>The code is valid! Your account has access to <strong>$dt_plus_duration</strong>.</p>"), $type = 'accept'); This needs to use placeholders for the variable. Variables should not be placed directly in t()

Line 209: Inline // comments (on the same line as code) are generally discouraged.

Fix these issues and set this back to needs review once complete. I think you'll be pretty close!

svetlio’s picture

Status: Needs work » Needs review

Thank you again for the quick response today.
I made the changes necessary to meet code standards.
We will expect your score.
Good evening.

jordojuice’s picture

Priority: Normal » Critical

Just one issue I see has not been fixed. I referred to this in my last comment

  drupal_set_message(t("<p>The code is valid! Your account already has access to <strong>$new_role_exp</strong>.</p>"), $type = 'accept');

Needs to be

  drupal_set_message(t('<p>The code is valid! Your account already has access to <strong>%expire</strong>.</p>', array('%expire' => $new_role_exp)), $type = 'accept');

Which is what I meant by using placeholders. Even more, you could avoid using tags in t() if possible. So you could do something like

$message = '<p>'. t('The code is valid! Your account has access to <strong>%expire</strong>.', array('%expire' => $new_role_exp)) .'</p>';
drupal_set_message($message);

Implements menu_hook(). should be Implements hook_menu(). must have missed that!

Aside from those small items, all functions are documented, files have an @file docblock, the module uses t() and database queries use placeholders properly. I don't see any security vulnerabilities. Variables are removed in hook_uninstall(). The README.txt file is well written.

You have been in the review process for a long time, and have been responsive to my comments.

Considering these points, I'm marking this RTBC. Just fix the line that I mentioned. A git administrator will be along (usually in a couple days or so) to review these comments and grant you the git vetted user role.

jordojuice’s picture

Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community
svetlio’s picture

Priority: Critical » Normal

I changed menu_hook() to hook_menu() and drupal_set_message() line to use placeholder.
Thanks for your detailed instructions to make my code Drupal-valid.

sreynen’s picture

Status: Reviewed & tested by the community » Fixed

Hi svetlio,

I added a couple issues in your project issue queue, nothing that needs to hold up moving this to a full project.

I went to grant you the git vetted user role, but it looks like someone else already did that. You should now be able to 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 for your contribution and 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. As someone who has recently completed an application, your input would be especially useful in the code review group as we work to improve this process.

Status: Fixed » Closed (fixed)
Issue tags: -pdx-code-review, -PAReview: Screening Complete

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

Issue tags: +, +
apaderno’s picture

Title: Sms payments Mobio » [D6] Sms payments Mobio
Assigned: jordojuice » Unassigned
Issue summary: View changes
Issue tags: -pdx-code-review, -PAReview: screening complete