TankAuth: Checking user age as a callback function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: TankAuth: Checking user age as a callback function (/showthread.php?tid=54573) |
TankAuth: Checking user age as a callback function - El Forum - 09-14-2012 [eluser]Unknown[/eluser] I have added date of birth to the registration process for tankauth. The way I did it was 3 fields dob1, dob2, dob3 (mm,dd,yyyy). What I want now is to use a callback function to check to see if the user is 13 years or older before they can register. This is what I have attempted so far: NOTE: This is how I implemented the date of birth if it helps/ if anyone wants to know: http://stackoverflow.com/questions/12379703/codeigniter-tank-auth-adding-date-of-birth-issues inside the register() function: Code: $this->form_validation->set_rules('dob1', 'Date of Birth Month', 'trim|required|xss_clean|exact_length[2]'); and this is my callback funtion: Code: //Check if user is old enough Right now it acts as if the callback is not even there. Any help? TankAuth: Checking user age as a callback function - El Forum - 09-14-2012 [eluser]Unknown[/eluser] I have actually figured out my issue. It was a combination of errors, but mainly a logic error. Checking if it was < when I should be checking if it was >. Here is my final solution (for now): Code: //Check if user is old enough Code: $this->form_validation->set_rules('dob1', 'Date of Birth Month', 'trim|required|xss_clean|exact_length[2]'); |