From: "Devo" <Devin.Scott.H...@gmail.com>
Date: Wed, 26 Jul 2006 00:11:47 -0000
Local: Tues, Jul 25 2006 8:11 pm
Subject: Validate fields not in the database
I'm working my way toward Advanced Validation Errors, but am struggling
with simple validation for fields that do no exist in my database. My Cake instance first checks to see if a user has access to the site by checking the database for the user (passwords are not kept here), thereafter checking LDAP to verify their username/password credentials. The database and LDAP calls work fine. Right now I'm just trying to get it to recognize VALID_NOT_EMPTY on the username and password fields in my login page. --------------------------------------------------------------------------- -------------------------- class User extends AppModel } --------------------------------------------------------------------------- -------------------------- class UserController extends AppController // Get parameters from the form if ( empty ( $username ) ) // Everything's valid // If user was in DB, authenticate with LDAP function logout () } --------------------------------------------------------------------------- -------------------------- <?php echo $html->input ( 'user/username', array ( 'size' => '40' ) ); <?php echo $html->password ('user/password', array ( 'size' => '40' ) --------------------------------------------------------------------------- -------------------------- e.g. if ( $this -> User -> validate ( 'username' ) == 0 ) Since I'm not calling save(), I believed that validate() would do the Thanks, Devo You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
From: "Devo" <Devin.Scott.H...@gmail.com>
Date: Wed, 26 Jul 2006 16:12:50 -0000
Local: Wed, Jul 26 2006 12:12 pm
Subject: Re: Validate fields not in the database
Ok, I realized that the validate() method should really be the
following: if ( $this -> User -> validates ( $this -> data ) ) Program execution is entering the if statements as it should, but the Thanks, Devo You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
From: "Devo" <Devin.Scott.H...@gmail.com>
Date: Wed, 26 Jul 2006 16:17:16 -0000
Local: Wed, Jul 26 2006 12:17 pm
Subject: Re: Validate fields not in the database
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
From: "Devo" <Devin.Scott.H...@gmail.com>
Date: Wed, 26 Jul 2006 17:22:22 -0000
Local: Wed, Jul 26 2006 1:22 pm
Subject: Re: Validate fields not in the database
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |