Re: HABTM with 3 tables

2006-08-05 Thread [EMAIL PROTECTED]
Hey henthoca, Thanks for your posts, I pretty much understand your explanations and I'll let you know how I get on. Ryno henthoca wrote: Whoops, I forgot to mention that each other model should have a hasMany relation with the JoinModel, and the JoinModel should belongTo each of the other

Re: newbie:othAuth: how to login from a page with a non Admin group?

2006-08-05 Thread CraZyLeGs
this is not a bug! yes by default othAuth accepts group_id = 1 you need to have [User][group_id] set in the array you pass to the login method this can come from a selectTag in the form, a hidden field or set manually in the login action before calling othAuth's login method

Re: newbie:othAuth: how to login from a page with a non Admin group?

2006-08-05 Thread gmwebs
Thanks CraZyLeGs, you pointed me in the right direction. I have now amended my login action to this... function login() { if(isset($this-params['data'])) { $user_data = $this-params['data']['User']; $username = $user_data['username'];

Re: missing table / forcing $db-listsource() to re-read tables from database

2006-08-05 Thread Dr. Tarique Sani [EMAIL PROTECTED]
Once again replying to my own post - apprently the only way to achieve this right now is in your code write $db = ConnectionManager::getDataSource($this-Addon-useDbConfig); $db-__Sources = null; Yes, I am fully aware that __sources is a private variable Thanks to gwoo for the ideas about

Unable to Access the Models from Admin Controller

2006-08-05 Thread Sharan
Hi, Here is the controller code ?php class AdminController extends AppController { var $name = 'Admin'; var $layout='admin'; var $uses = array('State','Agent'); function agents_index() { $this-set('agents', $this-Agent-findAll()); } } ? and here is

advanced validation, complex controller, error helper

2006-08-05 Thread vtbludgeon
I've been experimenting with advanced validation per http://wiki.cakephp.org/tutorials:advanced_validation:advance_validation_with_parameters and the ErrorHelper class. I need my UsersController's update() method to update both the underlying 'users' table as well as the 'people' table that

Where best to put query logic?

2006-08-05 Thread LikeSoy
I'm fairly new to OO development, and I'm probably overthinking this, but ... The manual explains [find($x), findAll($x), findAllBy($x)] as model functions which leads me to want to put all of my dbaccess logic there, within functions like getAllWidgets, getSubWidgets, etc. Then my controller

Re: Where best to put query logic?

2006-08-05 Thread LikeSoy
EDIT: Then my controller would be mostly lines like: $this-set('widgets', $this-Widget-getAllWidgets()); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Where best to put query logic?

2006-08-05 Thread nate
Nope, what you're doing makes complete sense. The purpose of the controller is to act as the glue between the model and the view. The controller can also aggregate and operate on other types of data as well, and for some of the logic, you need data outside the model, i.e. session data, so it

Database configuration

2006-08-05 Thread milicic.marko
What is the best way to configure production and development configuration? Should I define $default connection depending on debug level or there is some smarter solution.. Bakers ... help me..please :) --~--~-~--~~~---~--~~ You received this message because

Re: Database configuration

2006-08-05 Thread Martin Wood
milicic.marko wrote: What is the best way to configure production and development configuration? Should I define $default connection depending on debug level or there is some smarter solution.. I use this style to switch database configurations :

Re: Database configuration

2006-08-05 Thread milicic.marko
This is how I switch configuration class DATABASE_CONFIG { var $default = array('driver' = 'mysql', 'connect' = 'mysql_connect', 'host' = 'mysql50.hub.org',

creating and viewing an image database

2006-08-05 Thread JP
I am a bit of a beginner to cakePHP, tried RoR but couldn't find decent hosting so thought I'd give PHP a go. I would like to make an image upload and view database, storing the images in the file system isn't really practical for my project. I read the great cakebaker article on uploads

IMPORTANT CakePHP Security Fix

2006-08-05 Thread Larry E. Masters aka PhpNut
All CakePHP users,A kind soul informed us that the Not Found error page can be exploited via inserting _javascript_ code in the address bar. This release provides a fix for this vulnerability. This release also includes some other improvements to the bake script and prepares for the day when the

Re: creating and viewing an image database

2006-08-05 Thread Dr. Tarique Sani [EMAIL PROTECTED]
JP wrote: I would like to make an image upload and view database, storing the images in the file system isn't really practical for my project. care to elaborate why it is not practical to store images on the file system? (in your case of course) Cheers Tarique