Help for making a "xoops-invite only" module hack (edited name)
  • 2010/4/27 13:06

  • Yoryo

  • Just popping in

  • Posts: 3

  • Since: 2010/4/27

Keep reading the next post for the explanation of the idea "how the module should work"...

Hello there!

I was wondering if someone could give me a hint of how to compare a value in a created database field of the "profile" module on the register form (xoops 2.4.4) with another database field in a secure way..

For example:

1. I create the field named "user_referal" on "profile" module, that users are able to see in the register form (visible)
2. I create another field, that users cannot see, named "user_refnumber" (not visible)
3. On the register form, when users sign up, mysql compares "user_referal" value with "user_refnumber" value. If these values are not exactly the same the register process stops and a message is displayed

I have an idea of how to do it from an empty php document, but Im not sure how I could do it on xoops or in that xoops module and how to use its functions or variables. Any help/tips will be deeply appreciated.

Thank you in advance for your time!

Regards from Madrid (Spain)

Re: Profile module comparison in data base
  • 2010/4/27 17:34

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1

Can't make much sense of what you are trying to accomplish.

Ask yourself, where does the data for the fields come from?
user_referal is filled in by the user.
user_refnumber is empty, because when a user registers, a blank profile record is created for the new user.
Comparaison will always fail.

Re: Profile module comparison in data base
  • 2010/4/28 9:04

  • Yoryo

  • Just popping in

  • Posts: 3

  • Since: 2010/4/27

Ok, I think I should start from the beginning...

I'm trying to accomplish is to make a humble hack for having a "invite xoops only" like it is talked in this post.

So... Using the profile module that comes in xoops 2.4.4 installation, I want to add the necessary php lines in that module that would help me to compare "user_referal" (which is going to be an invitacion code filled by the user) with another database field named "user_refnumber" (that can be in the same table) and it's gonna be filled with an invite code generator (another module that Im trying to create).

Example of how it should work:

1) A registered user goes to the "module - invite generator"
2) He or she generates a random string of 5 letters and 2 numbers (or any other combination) that is stored in "user_refnumber"
3) The invitation string is sended by email to his/her friend
4) When his/ her friend is trying to sing up, the registration form (of the profile module) asks the friend for the invitation code.
5) The code that is filled by his/her friend (user_referal) is now compared with the one that the module generated (user_refnumber). If they are the same, the registration process can continue... If not, it stops.
6) After the email account confirmation of the new user, the stored "user_refnumber" is deleted from the data base.

I know how to do some of the things of this process with my very basic php knoweadge, but I need help comparing fields in the profile module and deleting the "user_refnumber" after the new user's email is confirmed.

I more or less have a future code for the "module - invite generator". It's from another source that is not xoops... still have to convert it.

Please, give me a hand on this. I will be glad to share any of the results that I can get (hopfully a new very crapy module that could evolve into something nicer...) ;)

Thank you =)



Lost Password? Register now!

Who's Online

55 user(s) are online (38 user(s) are browsing Support Forums)

Members: 0

Guests: 55



Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits