Restrict access based on activation

Reply

Join Date: Dec 2007
Posts: 52
Reputation: mgn2683 is an unknown quantity at this point 
Solved Threads: 0
mgn2683's Avatar
mgn2683 mgn2683 is offline Offline
Junior Poster in Training

Restrict access based on activation

 
0
  #1
Apr 8th, 2008
Right now the site I am working on has a restrict access set up for two levels, but the way they set up their registration, once someone registers, they can login to the member side without first being activated in the database. I'd like to be able to adjust the restriction kind of like a where clause, where activation= 1 or something to that effect. Is this possible or does anyone have any advice or help for me? Thanks.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Restrict access based on activation

 
0
  #2
Apr 8th, 2008
When the user registers, set the value for activation column as 0 (for that user) in the user table. When the user activates, update activation column to 1 for that user. Then, when the user tries to log in, while checking for username and password, also check if activation=1. If it isn't 1, promt him to activate first.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 3
Reputation: unabomber1 is an unknown quantity at this point 
Solved Threads: 0
unabomber1 unabomber1 is offline Offline
Newbie Poster

Re: Restrict access based on activation

 
0
  #3
Apr 8th, 2008
like nav33n said, and use sessions to store activation and add as include on each page.
Last edited by unabomber1; Apr 8th, 2008 at 10:56 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 52
Reputation: mgn2683 is an unknown quantity at this point 
Solved Threads: 0
mgn2683's Avatar
mgn2683 mgn2683 is offline Offline
Junior Poster in Training

Re: Restrict access based on activation

 
0
  #4
Apr 8th, 2008
I'm using ADDT to do this, when I click on the Restrict Access under Server Behaviors, where would I go to add activation=1 and the sessions ? Thanks.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Restrict access based on activation

 
0
  #5
Apr 8th, 2008
Can you be more specific ? If you post your code and the database structure, it will be easier for us to help you !
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 52
Reputation: mgn2683 is an unknown quantity at this point 
Solved Threads: 0
mgn2683's Avatar
mgn2683 mgn2683 is offline Offline
Junior Poster in Training

Re: Restrict access based on activation

 
0
  #6
Apr 8th, 2008
The database is Mysql, and is working with a User table.

  1. //Start Restrict Access To Page
  2. $restrict = new tNG_RestrictAccess($conn_nscar, "../");
  3. //Grand Levels: Level
  4. $restrict->addLevel("0");
  5. $restrict->Execute();
  6. //End Restrict Access To Page
  7.  
  8. // Start trigger
  9. $formValidation = new tNG_FormValidation();
  10. $formValidation->addField("kt_login_user", true, "text", "", "", "", "");
  11. $formValidation->addField("kt_login_password", true, "text", "", "", "", "");
  12. $tNGs->prepareValidation($formValidation);
  13. // End trigger
  14.  
  15. // Make a login transaction instance
  16. $loginTransaction = new tNG_login($conn_nscar);
  17. $tNGs->addTransaction($loginTransaction);
  18. // Register triggers
  19. $loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
  20. $loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
  21. $loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");
  22. // Add columns
  23. $loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
  24. $loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
  25. $loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0");
  26. // End of login transaction instance

Thanks for your help
Last edited by peter_budo; Apr 8th, 2008 at 7:30 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Restrict access based on activation

 
0
  #7
Apr 8th, 2008
Umm.. Sorry ! I don't understand what exactly your code does.. But, you can do it as I have said in my previous post.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC