Re: Auth Component custom error message for different situations
Great, I will try that out when I get home today. Thanks Dhana On Mar 13, 6:09 am, Brendon Kozlowski brendon...@hotmail.com wrote: I can't look up the exact steps to do this at the moment (rushing to prepare for a meeting), but going from memory I believe you'd actually take advantage of the empty login() function in your UsersController in this instance so that you can send a specific use-case error depending on the circumstances. I'd do a google search for CakePHP auth custom login (without the quotes) and see what comes up. :) On Mar 12, 7:18 pm, Dhana sldh...@gmail.com wrote: I was wondering if it's possible to print out a custom error message in cakephp when using the auth component. I am using the scope attribute to check if the user is active or not. Instead of flashing the loginError which is the usual either login or password is wrong, I want to say the account has been deactivated . Any way around this?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Auth Component custom error message for different situations
I was wondering if it's possible to print out a custom error message in cakephp when using the auth component. I am using the scope attribute to check if the user is active or not. Instead of flashing the loginError which is the usual either login or password is wrong, I want to say the account has been deactivated . Any way around this? --~--~-~--~~~---~--~~ 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: how to arrange Checkbox in one Row
You might have to use CSS for that. If there is a div around each checkbox, just make sure you assign a float to them in css lke this: In case you just want to target the checkboxes div, wrap a div around all your checboxes. Give it a class or an id. Then in css, #divname input{ float: left; } or .divname input{ float: left; } On Feb 28, 5:29 am, Maulik maulik@gmail.com wrote: hi to all, here my question is how can i arrange my checkbox in one row. 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 -~--~~~~--~~--~--~---
habtm - need some clarification
I have a groups, users and tasks models. Groups has a HABTM to users. Users has a HABTM to groups. Users has many tasks. From the tasks model, I am trying to find out which group the user belongs to. Once I have this information, I plan to put into a session variable so I only need to query this once while the user is in session. But, how do I make this query efficiently? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Admin login and user login without ACL
Is it possible to secure the admin_path so that regular users don't have access to it? I am already using the Auth component for a user login where they can perform their user tasks. But I would also like to have an admin that can see all the users stuff. The prefix routing works fine in creating the admin pages, but I was wondering if I could create a separate login for admins so that only they can access the admin tasks. The acl component looks a little too complex for my current app. --~--~-~--~~~---~--~~ 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: How do I save related model data
I tried that, but that didn't work either. Another thing I did was to make sure I assigned the foreign key to the data like this so the todo data has a task_id, but that just creates a new db row. $this-data['Todo']['task_id'] = $this-data['Task']['id']; On Feb 24, 11:37 pm, mscdex msc...@gmail.com wrote: On Feb 25, 2:21 am, Dhana sldh...@gmail.com wrote: Here's a snippet of the save code I am calling. if($this-Task-saveAll($this-data['Task'])){ $this-Session-setFlash('The task has been updated', 'default', array('class' = 'information')); $this-redirect(array('action' = 'show', $id)); } I think you may want: if($this-Task-saveAll($this-data)){ instead of: if($this-Task-saveAll($this-data['Task'])){ The latter appears to be just providing saveAll with just your Task information and thus is excluding your array of Todo items that came from the form. --~--~-~--~~~---~--~~ 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: How do I save related model data
I tried the one below, but the todos still don't get updated. I tried a variation where I did this to make sure the foreign id(task_id) is added, but that just creates a new row instead of updating the row. $this-data['Todo']['task_id'] = $this-data['Task']['id']; On Feb 24, 11:37 pm, mscdex msc...@gmail.com wrote: On Feb 25, 2:21 am, Dhana sldh...@gmail.com wrote: Here's a snippet of the save code I am calling. if($this-Task-saveAll($this-data['Task'])){ $this-Session-setFlash('The task has been updated', 'default', array('class' = 'information')); $this-redirect(array('action' = 'show', $id)); } I think you may want: if($this-Task-saveAll($this-data)){ instead of: if($this-Task-saveAll($this-data['Task'])){ The latter appears to be just providing saveAll with just your Task information and thus is excluding your array of Todo items that came from the form. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How do I save related model data
I have a Task model which has many todos. I have a form that edits both the title of the todo and any number of the todos (if the task has any) in one form. The form as you can see below submits to the task edit action. But when I submit the form, only the title of the task is updated, but not the titles of the todos. Am I supposed to be handling the save of the todos myself in the edit action? The association are already set in the model, such $belongsTo and $hasMany. Any ideas on what I should do here? Here's my code for the form. e($form-create('Task', array('controller' = 'task', 'action' = edit/{$task['Task']['id']}, 'class' = 'form'))); e($form-hidden('Task.id', array('value' = $task['Task']['id']))); e($form-text('Task.title', array('value' = $task['Task']['title'], 'class' = 'long'))); ?php foreach($task['Todo'] as $todo): ? li ?php e($form-text({$todo['id']}.Todo.id, array('value' = $todo['title'], 'class' = 'long'))); ? /li ?php endforeach; ? e($form-submit('Edit')); e($form-end()); Here's a snippet of the save code I am calling. if($this-Task-saveAll($this-data['Task'])){ $this-Session-setFlash('The task has been updated', 'default', array('class' = 'information')); $this-redirect(array('action' = 'show', $id)); } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
admin routing issues
Hi, I have uncommented this line in my core.php Configure::write('Routing.admin', 'admin'); and I have a controller called Formats. This controller has an action called admin_index, but when I try to access this page, I get this error = Private Method in FormatsController. Is there any other thing I have to do to get this working. Tried adding this (got this from prefix routing page in the cookbook site), but am still getting the same issue. Router::connect('/admin', array('controller' = 'formats', 'action' = 'index', 'admin' = true)); Does anyone have any idea what I am doing wrong. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---