Auth Login Component not working :(
Hi I am trying to return a rendered element so I have to customize the login() function on the controller I am using, however its not running the query right even though the fields it is supposed to process are defined in the model. Here is the beforeRender code: PHP Code: function beforeFilter() { $this->Auth->loginAction = array( 'controller' => 'users', 'action' => 'login_form' ); $this->Auth->allow(array( 'login_form', 'login', 'logout' )); $this->Auth->redirectLogin = array( 'controller' => 'users', 'action' => 'index' ); } Here is my login function: PHP Code: function login() { $this->layout = null; if ($this->Auth->login($this->data['User'])) { $this->render('login_success', 'ajax'); } else { $this->render('login_failure', 'ajax'); } } The data in the form is named as data['User']['username'] and data['User']['password'] Does anyone know why the login function won't correctly process this? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help With Using 2 Primary Keys
Hi is this the correct way to relate data like this? I switched them around and it still doesn't work the way I need it to. On Mar 7, 8:19 pm, Walker Hamilton <[EMAIL PROTECTED]> wrote: > you need to read this: > > http://book.cakephp.org(especially the models part). > > Your belongsTo and hasOne forum keys are wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help With Using 2 Primary Keys
I have a Thread modeal with associated models ForumUser and ForumCategory: var $hasOne = array('ForumUser' => array('className' => 'ForumUser', 'conditions' => '', 'order' => '', 'dependent' => FALSE, 'foreignKey' => 'id'), 'ForumCategory' => array('className' => 'ForumCategory', 'conditions' => '', 'order' => '', 'dependent' => FALSE, 'foreignKey' => 'id') ); The ForumUser is related by author_id (in the Thread table) and the ForumCategory is related to category_id (in the Thread table). Even with a belongs to and specifying a different foreign key it always uses 'id' as its association. For ForumUser var $belongsTo = array('Thread' => array('className' => 'Thread', 'conditions' => '', 'order' => '', 'foreignKey' => 'user_id') ); For ForumCategory var $belongsTo = array('Thread' => array('className' => 'Thread', 'conditions' => '', 'order' => '', 'foreignKey' => 'category_id') ); Please help me so I can continue development. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Reading A File
Hi I am trying to upload a file through my form but its not interpreting it right. What is the correct way to interpret a file's type? I tried $this->data['Graphic']['file']['type'] but it will not work. Please help. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help with data validation...
have a registration form and I am trying to make it so the user verified his password I have this: var $validate = array( 'username' => VALID_NOT_EMPTY, 'password' => VALID_NOT_EMPTY, 'verify' => VALID_NOT_EMPTY, 'email' => VALID_EMAIL, 'website' => VALID_NOT_EMPTY ); How would I make it so 'verify' has to be the same value as password? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$this->data variable not showing data passed on?
Is it my server? The data will save but when I used print_r to output the array it will not show the post data. The only data it shows is if the value is pass through like value="data" in the input tag. If I try to use $this->data['att']['field'] it will not display any inputted data passed on through a post form... any ideas as to why this occurs? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---