This module allows redirects to non-Drupal URLs after login. This module is for Drupal 7.
The link to this module: http://drupal.org/sandbox/legendm33066/1626862.
The direct link to the git repository: legendm33066@git.drupal.org:sandbox/legendm33066/1626862.git.

Comments

rogical’s picture

Status: Active » Needs work

Manual review:

  1. What's the difference with LoginToboggan http://drupal.org/project/logintoboggan ?
  2. Would you consider merging your project into LoginToboggan?
  3. installation, configuration howto.
  4. remove version in info file
Jeffrey C.’s picture

1. This module allows redirects based on URL parameter, for example, user/login?redirect=http://www.google.com, not sure if LoginToboggan provides this function.
2. No, I believe there are many users out there who just want a simple and easy way of achieving non-Drupal redirects, not a whole lot module with fancy functions.
3. Should I provide instructions in README.txt or should I implement hook_help()?
4. Done. Also removed 7.x-1.0 branch.

Thanks for your quick review :)

Jeffrey C.’s picture

Status: Needs work » Needs review
rogical’s picture

instructions on your project and a README.txt is always very good, hook_help() ofcourse is welcome.

Jeffrey C.’s picture

Thank you. Working on it. Btw I made a few commits and now I've deleted 7.x-1.x branch these commits still appear in my sandbox "View all commits". I'm a beginner to Git, so wondering if there's a Git command that could be used to delete those commits on Drupal.org?

Jeffrey C.’s picture

Status: Needs review » Needs work
rogical’s picture

I think you've misunderstood, you can remove version in info file, because it will be added automatically when release.

You should put your code into a branch, Moving from a master to a major version branch.

Old commits history is no harm, just leave it.

Jeffrey C.’s picture

Got it.

Jeffrey C.’s picture

Status: Needs work » Needs review

Finished on commit 2cc8f5c. Added hook_help() implementation and README.txt. Also moved from master to 7.x-1.x. Anything now?

skipyT’s picture

Status: Needs review » Needs work

Hi,

I think this module is too short. I tried once with a similar module 2 weeks ago and it wasn't accepted. You should have at least 120 lines of code.

Some things are in plus there: you don't need to implement hook_install only to show the message that module was enabled. Drupal is doing that for you.

Also I don't understand why you need the status setting there. I think you should redirect the page automatically if and only if the redirect is not empty.

Also I would filter the _GET parameter for xss attacks. It is now a big security problem, cause it will not affect your site but the external one could be affected.

Also you should modify the module's weight to be a huge number (else all the user login form submits added by other modules with a bigger weight wil not be executed due to your drupal_goto.) Or another way to do this I think is to register a drupal shutdown function during your submit, which will make the redirect for you.

skipyT’s picture

Also I forgot to mention, that your project page is only one line long. You should try to follow the tips for a great project page: http://drupal.org/node/997024.

Jeffrey C.’s picture

Hi,

Thanks for your quick reply. Yes this module is very short, that's why I would like to publish it. It is lightweight and is useful for users that only want this simple function not a whole lot module, like I've mentioned earlier. The reason I added "status" option is to prevent the module from functioning when the parameter name is illegal (contains numeric, or left empty), like the SMTP Authentication Support module. As for the XSS concern, I will add a few lines to make sure XSS will be filtered. I will also remove the hook_install() implementation. And, can you please elaborate the "module weight" thing a little? I don't quite understand what you mean.

skipyT’s picture

Hi,

Drupal is calling the implemented hooks from the modules depending on the module weight. Every module is having a numeric weight, stored in the 'system' table in the database. If you have several modules implementing the same hook, the hook calls are ordered by the module's weight.

Anyway, this is one of the solutions, I think the solution to register a Drupal shutdown function is better.

Jeffrey C.’s picture

Thank you. Working on it.

Jeffrey C.’s picture

Sorry, but could you explain how to implement the drupal_register_shutdown_function function? Should I call it in my submission function, where now I'm using to perform the redirect?

skipyT’s picture

Yes, and you should send the url as a parameter to that function.

You should write something like: drupal_register_shutdown_function('my_shutdown_function_for_redirect',$url);

and you write that function to make the drupal_goto.

Jeffrey C.’s picture

Ok got it. Working on it.

Jeffrey C.’s picture

Status: Needs work » Needs review

All done. Anything else?

Jeffrey C.’s picture

Anyone there?

Rahul Singh’s picture

Status: Needs review » Needs work

Manual Review:
In manual review I found only one issue.
1) Please remove t() from login_redirect_menu() function it is not neccessary to use t() in hook_menu().

Automated Review:
There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:

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.

Please try to resolve http://ventral.org/pareview/httpgitdrupalorgsandboxlegendm330661626862git

Jeffrey C.’s picture

Thank you. I'm a little busy these days, will try to meet the above standards and get back as soon as possible.

Jeffrey C.’s picture

Status: Needs work » Needs review

All done. Any other things now?

dev001’s picture

Status: Needs review » Needs work

Manual review - issues in login_redirect.module file:
1. You don't have description for the hooks you created, follow the link below and add description.
http://drupal.org/node/1354#hookimpl
2. In function login_redirect_help($path, $arg) - Use theme('item_list', ...) to create list markup, instead of ul, li.

mondrake’s picture

Hello legendm33066,

I am a fellow applicant and have been reviewing your project towards geeting a review bonus for my application.

It's my first review so please take the following in this perspective.

Automatic review:
- ventral PAreview is clean

Manual review:

'needs work' from my POV:

- lines 10 and 19: menu items 'admin/login_redirect' and 'admin/login_redirect/settings' are too high level within the administration menu. In particular, 'admin/login_redirect' just presents a page with a link to the settings form - it seems redundant to me.
You may consider to remove the first menu item (and its callback login_redirect_main_page() ), and change the
second to 'admin/config/system/login_redirect'. This would place your configuration under a more appropriate section.

- follow up placing a configure = admin/config/system/login_redirect line entry in your login_redirect.info file

- instead of $_GET[$parameter_name], you may want to use Drupal function drupal_get_query_parameters(), which returns an array of elements you can then check against

- implement hook_install and hook_uninstall in a separate login_redirect.install file:

In the hook_install implementation you can place a drupal_message() with recommendation to visit configuration (waht you're currently doing in login_redirect_main_page())

function yourmodule_install() {
  $t = get_t();
  drupal_set_message($t('Thank you for installing Login Redirect. Please make sure you proceed to the <a href="@settings">Settings Page</a> and configure Login Redirect properly.', array('@settings' => url('admin/login_redirect/settings'))),
                     array('@settings' => url('admin/config/system/login_redirect'))));
}

In the hook_uninstall, mind about deleting the variables that you set via the configuration.

- in README.txt

1. Place this module directory in your modules folder (usually
sites/all/modules/).

This will be managed by the installation process once your project is full, so you may instead consider just

1. Install and enable the module.

Food for thought

- you may consider to implement hook_permission() and create a role that administrators could use to identify which users could or could not use the feature

- you may consider to extent the logic so to pass additional values to your destination - e.g. destination is something like

?destination=http://www.mydomain.com&passthrough_user=!!DrupalUserId!!

becomes a call to

http://www.mydomain.com?passthrough_user=1

Just an idea though.

Just for curiosity - what would be the practical usage of this? Maybe some example in the project page would help.

Overall, looks like 'needs work' for me.

Regards
mondrake

Jeffrey C.’s picture

Status: Needs work » Needs review

Thank you so much for both of your detailed reviews. I consider my hooks rather standard so did not add any description. As for the rest, all done.

Jeffrey C.’s picture

Seems there's no tasks left. Should I report this to a moderator or someone to get the application approved or something?

skipyT’s picture

I think you should make some review for the other projects applications to get some review bonus. You shouldn't wait for help from others if you not provide any :).

Jeffrey C.’s picture

Ok thank you new here don't know anything :)

mitchell’s picture

Status: Needs review » Postponed (maintainer needs more info)
StatusFileSize
new316 bytes
new257 bytes

> 1. This module allows redirects based on URL parameter, for example, user/login?redirect=http://www.google.com, not sure if LoginToboggan provides this function.
It probably does, but no problem. It's your first contribution. :)

> 2. No, I believe there are many users out there who just want a simple and easy way of achieving non-Drupal redirects, not a whole lot module with fancy functions.
I agree with this logic for the most part, except I'm personally a Rules fan (and a maintainer along with klausi), so I personally would have went with Rules. And for you, I did! :) See the attached example that accomplishes the goal of your module with only 1 dependency.. Rules! ...well, it has a dependency on Entity API, but that doesn't count ;)

All you need to do is import each one (in the component and rule import pages). The reaction rule is configurable to take any path, and it currently redirects to drupal.org by default. It doesn't force the redirect if the user has a predefined destination parameter, however that can be changed in the component configuration screen.

While I acknowledge that this submission uses Drupal's API well, I would personally prefer not to have this as a full project. There are already a lot of projects and at some point we should clean out the obsolete, deprecated, abandoned, etc projects. I'm not saying yours would end up becoming one if this became a full project, but if you could hold off on full project permissions, I would be happy to review your next project. Thank you for contributing!!

Please let us know how you would like to move forward with your application, and if you have any questions about the attached code, check out the Rules handbook or request support in Rules' issue queue. Thanks again!

Jeffrey C.’s picture

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

Hello! Thank you for your review. Just a quick question, though, does the export you provide allows redirects to actually the URL parameter supplied? Haven't really test it out but it seems that it only works with a predefined URL.

Jeffrey C.’s picture

Let me just state my intention with this module here. I'm using Drupal as an authentication system, or to be exact, a user control system. I'm pulling all the user data and storing it as well into Drupal, thanks to its complete and powerful structure. So just trying to build a quick solution to this, and some other day I woke up with this thought, "hey if I can find a lot of similar questions online like for instance StackExchange, but no one is actually giving solution, doesn't that mean there's a bunch lot guys out there who's thinking the exact same thing as me and getting stuck?", there, that's why I'm posting a project application here. Not sure if your Rules thing work, though, at least so far I've tested, it only works with a predefined URL.

mitchell’s picture

> does the export you provide allows redirects to actually the URL parameter supplied?
You're right, it's predefined.. But it is configurable and also easily extendable. So, I'll change it to get the URL parameter and let you know.

Until then, other reviews requested.

mitchell’s picture

Issue tags: +PAreview: review bonus

@legendm33066: Adding URL and session header parameters to Entity API has been in the back of my mind for a little while, but this motivated me at least to file an issue to #1675020: Add query string property for the current page request. That'd be a direction worth investigating, or alternatively, the Rules URL Arguement. What do you think?

The review bonus tag will put this on klausi's list; he's a good person to get feedback from, especially on stuff like this.

Jeffrey C.’s picture

That'd be good. However I still insist on this module being reviewed and hopefully it will be approved and published on Drupal.org. You might want to take a look at Require Login, which I believe can also be done with Rules, but Rules, in both that case and this case, seems like a more complex solution.

What I want to say is, sure this of course can be done using Rules, but is it really necessary while you can just use a few lines of code and be done with it? Furthermore, I'm planning to add some more features like token validation and session implementation, which I believe can be easily done with a custom module not a non-specific module like Rules with limited extendability.

That's what I figured so far and it doesn't make much sense, at least from my point of view, to, again, use a whole lot module like Rules, since it actually gives a easy start but makes it very difficult to extend later. If you have a different idea, well, I'm all ears.

Jeffrey C.’s picture

If there's no more activity, review or comments within 5 days, starting from the last reply was added, I shall put the status to RTBC. Thank you all for your helpful reviews.

klausi’s picture

Issue tags: -PAreview: review bonus

Removing review bonus tag, you have not done any manual review, you just posted the output of an automated review tool. Please read through the source code of other projects and report any issues you find. And don't forget to add your manual reviews to your issue summary.

Jeffrey C.’s picture

Status: Needs review » Reviewed & tested by the community
klausi’s picture

Status: Reviewed & tested by the community » Needs review

Don't RTBC your own issues, see http://drupal.org/node/532400

varunmishra2006’s picture

Status: Needs review » Needs work

There are some errors according to http://ventral.org.
Make sure you have all of the things are as mentoined in
http://ventral.org/pachecklist

Please check the review i had done here
http://ventral.org/pareview/httpgitdrupalorgsandboxlegendm330661626862git

klausi’s picture

Status: Needs work » Needs review

Minor coding standards are not application blockers, please do a full review.

iamwinner001’s picture

Manual Review
It seems that everything is done with this module. Marking this as RTBC. But please also make sure you create a documentation page for this module, and even better correct the minor coding inconformity as per #40.

iamwinner001’s picture

Status: Needs review » Reviewed & tested by the community

Forgot to change the status.

mitchell’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again for your contribution, legendm33066!

I updated your account to let you 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 again, and good luck! :)

Edit: Removed accidental, bad irc channel recommendation.

iamwinner001’s picture

If you're looking for a maintainer, let me know ;)

Jeffrey C.’s picture

Thank you! And thank everyone who has posted reviews and opinions here!

Status: Fixed » Closed (fixed)

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