I am using the user points module and I want to deduct a user point for every sign up. You would be required to have user points in order to sign up.

Does the signup module provide any hooks or api that could help me do this?

Thanks.

Comments

dww’s picture

Status: Active » Fixed

Yes. See signup.api.php that ships with the module. There's hook_signup_sign_up(). However, that won't let you actually prevent a signup if a user doesn't have enough points. But, you could at least deduct points whenever someone signs up (but nothing would stop them from signing up if they had 0 or negative points).

To prevent signups to users without enough points, hook_form_alter() is probably all you need -- just add another validate callback to signup_form() that checks if the user doesn't have enough points, and if not, throw a validation error. This will only handle users signing up themselves, you'd have to alter some other forms to prevent admins from signing up users without enough points if you want that behavior, since there's no global hook_signup_validate_signup() or something.

Status: Fixed » Closed (fixed)

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

drfuzetto’s picture

Status: Closed (fixed) » Active

My signup.api.php file only has one hook in it for cancel signup.
Am I missing something?

dww’s picture

Status: Active » Closed (fixed)

Grab the latest copy from DRUPAL-6--1 branch and/or the 6.x-1.x-dev release.