| | |
Restrict access based on activation
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
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*
*PM asking for help will be ignored*
The database is Mysql, and is working with a User table.
Thanks for your help
PHP Syntax (Toggle Plain Text)
//Start Restrict Access To Page $restrict = new tNG_RestrictAccess($conn_nscar, "../"); //Grand Levels: Level $restrict->addLevel("0"); $restrict->Execute(); //End Restrict Access To Page // Start trigger $formValidation = new tNG_FormValidation(); $formValidation->addField("kt_login_user", true, "text", "", "", "", ""); $formValidation->addField("kt_login_password", true, "text", "", "", "", ""); $tNGs->prepareValidation($formValidation); // End trigger // Make a login transaction instance $loginTransaction = new tNG_login($conn_nscar); $tNGs->addTransaction($loginTransaction); // Register triggers $loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1"); $loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}"); // Add columns $loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user"); $loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password"); $loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0"); // 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
![]() |
Other Threads in the PHP Forum
- Previous Thread: PHP Variable in mySQL query
- Next Thread: problem in $_SESSION
| Thread Tools | Search this Thread |
# 5.2.10 ajax apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date display dissertation dynamic echo echo$_get[x]changingitintovariable... email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link local login loop mail memberships menu mlm multiple multipletables mysql mysqlquery oop open paypal pdf persist php problem query radio random recursion regex remote rss script search server sessions sms soap sockets source space spam sql syntax system table tutorial update upload url validator variable video web xml youtube






