Provides the invite link for invite module.

Link is described as follows:
http://yoursite/invite/code/inviter_id

Link to the sandbox:
http://drupal.org/sandbox/zpieslak/1153856

To get current version:
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/zpieslak/1153856.git

Comments

zpieslak’s picture

Component: new project application » module

Here is updated info:

Provides the invite link for invite module. Link can be used on external sites and clicked by unlimited visitors. When someone registers invitation is treated like sent from invite module.

Link is described as follows:
http://yoursite/invite/code/inviter_id

Dependencies:
Invite (required) - http://drupal.org/project/invite
User Points Invite (optional, described below) - http://drupal.org/project/userpoints_contrib

Module can be very useful if used with userpoints_invite module:
(for example, the user can paste the invite link on the external sites and gain points more efficiently)

jordojuice’s picture

Status: Needs review » Needs work

Interesting. Have you considered submitting this as a patch for Invite or mentioned its existence to Invite maintainers?

Review:

You can remove version information from your .info file. This is added by git.

You need to add a README.txt file with instructions on installation and setup of the module.

Need to add an @file doc block at the top of the module file.

All functions need to be documented, not just hooks.

Good luck!

zpieslak’s picture

Hi,

Thank you for the feedback. I did all the changes you requested. Please review it again.

>> Interesting. Have you considered submitting this as a patch for Invite or mentioned its existence to Invite maintainers?

I assumed that this logic is to big for the patch as well as I wanted to separate the logic from the invite module. So that administrator can decide wheter or not he wants the module functionality enabled or disabled in particular moment.

zpieslak’s picture

Status: Needs work » Needs review
BManuel’s picture

How do you use a php snippet to print it out on a page.tpl or add it to a custom block.
Better if this module can also generate a block.
Nice work buddy and a big thanks
BM

zpieslak’s picture

>> How do you use a php snippet to print it out on a page.tpl or add it to a custom block.

What do you mean? Please explain.

>> Better if this module can also generate a block.

Interesting idea. I think about it.

BManuel’s picture

I used (global user) to print out the link on the page.tpl.
But what would make this module really sleek is a UI like this
http://www.steamdev.com/zclip/
A click to copy behavior, this one, is easy for end user to
grab the link.
Let me know how I can help besides coding (not a programmer :()
BM

gillisig’s picture

I have found 2 issues with this module

1. If anonymous users do not have a permission to view nodes, they wont be able to use the link provided. So the module needs to add permissions specifically for it.

2. Currently all users who register on my site need administrator approval unless they are invited, which happens by default when using the invite module. However using the link the user gets fills his info, but gets a message saying he is waiting for approval but if he goes and tries to register for the second time, using a different e-mail, then he is able to register without a problem and it behaves as if he was invited indeed.

But good work! this feature is really something that I think should have been included in the original module!

Thanks!

zpieslak’s picture

Thanks for the feedback.

>> 1. If anonymous users do not have a permission to view nodes, they wont be able to use the link provided. So the module needs to add permissions specifically for it.

This is committed to repository (except permissions).

>> 2. Currently all users who register on my site need administrator approval unless they are invited, which happens by default when using the invite module. However using the link the user gets fills his info, but gets a message saying he is waiting for approval but if he goes and tries to register for the second time, using a different e-mail, then he is able to register without a problem and it behaves as if he was invited indeed.

For this I need more info. This module uses invite module permissions. In order to work as you expect there need to be put additional permissions (as you mentioned). But despites that why you need invite link if your site is closed for external users?

gillisig’s picture

Well the site is invite only, although users can sign up but they will need to wait for approval from the admin, otherwise we encourage users to invite their friends which we then reward them for.

so only if users are invited they can sign up right away without waiting for approval.

zpieslak’s picture

Yes, i understand your logic, but intention for this module was different. It is suppose to give users tool to invite other users to site more efficiently (so that more users can register). It depends fully on invite module, so does it uses its permissions. What you want is not an issue but feature request.

Edit:
I indicated your issue in project description.

zpieslak’s picture

Thank you for the feedback. I indicated your posts as feature request in project issue queue.

gillisig’s picture

Edit: as it turns out my invite link module was a bit outdated and the problem i described is no longer an issue after i updated to the newest version. So the link does indeed work even though my site requires admin confirmation for non invited users.

Keep up the good work!

Thanks!

klausi’s picture

Status: Needs review » Needs work

Some minor things:
* git release branch is missing, see http://drupal.org/node/1015226
* lines in README.txt should not exceed 80 characters
* "// check if user_info is numeric" comments should be on a new line, start capitalized and end with a "."

zpieslak’s picture

misc’s picture

@zpieslak has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

misc’s picture

Status: Needs work » Closed (won't fix)

The application has been closed. If you would like to reopen it, you are free to do so.
See http://drupal.org/node/894256#abandonedtwoweekscontact

zpieslak’s picture

Status: Closed (won't fix) » Needs review

Hi,

I did all the requested changes from #14 comment. Let me know your feedback.

zpieslak’s picture

Hey,

Is it possible to get this application approved? This is simple application and it will be almost year from creation :) I have more projects I want to share (left one more in sandbox) but still cannot get rights to publish modules. Anyway I appreciate your time.

patrickd’s picture

Hi,

I'm very sorry for the delay, but as there are currently tons of applications in queue this is going to take some time.
We do really need more hands in the application queue and highly recommend to get a review bonus so we will(/can) come back to your application sooner.

regards

chertzog’s picture

In your module you have the following:

function invite_link_page($user_info) {  
  if (is_numeric($user_info)) {  
    if (!($user_info > 0)) {  
      drupal_not_found();  
    }  
    $user = user_load(array('uid' => $user_info));  
    if (empty($user)) {  
      drupal_not_found();  
    }  
  }  
  else {  
    $user = user_load(array('name' => $user_info));  
     if (empty($user)) {  
       drupal_not_found();  
     }  
  }  

  $_SESSION[INVITE_LINK_SESSION] = $user;  
  drupal_goto('user/register'); 
}

You do a lot unnecessary checking and you call user_load twice. Why not use something like this:

function invite_link_page($user_info) {
  $user = user_load($user_info);
  if ($user) {
    $_SESSION[INVITE_LINK_SESSION] = $user;  
    drupal_goto('user/register'); 
  }
  else {
    drupal_not_found();
  }
}

Also, This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project.

I would strongly suggest that you contact the maintainers of the Invite module and see if you cant get this functionality included as a new feature. Roll it as a submodule patch and submit an issue in the issue queue.

chertzog’s picture

Status: Needs review » Needs work
zpieslak’s picture

Status: Needs work » Needs review

Hi chertzog,

Thank you for your response. I cleaned the code as you proposed. I understand the standards in Drupal community and I have one more project I can push on the queue - http://drupal.org/sandbox/zpieslak/1489652, but on the other hand:

- the project invite link was created May 11, 2011 and the discussion started December 9, 2011
- it is really demotivating if you have to wait one year for approve such a small module and if I have to wait one more year to approve the second module. It makes me think that it is better to get than to contribute to community. Sorry if this sounds rude I know that you are volunteer also, but this is how it looks like now from my point of view.

patrickd’s picture

Hey,
I can really understand your desperation, unfortunately I have to agree with #21. This is simply not enough code to be sure that you can write code in a secure and good way (I'm not saying you can't - but how should we know)

If possible please think about adding some more functionality to this module, we can still remove the single promotion tag if there is more to review.

SORRY :(

zpieslak’s picture

Hi,

Thank you for the reply. OK, so just leave it like that. I just wanted to share with the community with the projects I made, at the time I was using the great cms which Drupal is.

chertzog’s picture

Status: Needs review » Closed (won't fix)

I glad to see you are moving ahead with your Profile Visits module application.

Marking this as closed, as this is too short to approve. But hope to see your other one get through.

chertzog’s picture

Issue summary: View changes

additional information