security
Hi there, I have an web application I have built for a company in Cake where I want internal users to access certain controllers 192.168.1.173/cake/internal say. External users should only be able to access mydomain.com/cake/external/ from the same application. What would be the best way to set this up? through .htaccess or firewall (I am not a sys admin but it looks like I can only limit settings to the port level on the firewall). PLease help, Simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
route confusion
after reading some of the posts i'm a bit confused about routes on my local machine I have localhost/app/pub/action1 localhost/app/pub/action2 etc.. I want my links to be like echo $html->link('go here','/action1') to go to /pub/action1 etc.. I want this to work the same on local and live server. Is this what routes are for or should I use mod rewrite? I tried $Route->connect ('/*', array('controller'=>'pub', 'action'=>'display')); Much appreciated, Simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: weird production mode error
thanks old fart, that works a treat. I've been doing cake for a while and I still havn't come across the cache thing. On May 2, 2:25 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > Have you tried clearing your caches? and make sure that the whole of > the tmp directory is writable and has the right layout. In particular > you might clear out > > tmp/caches/models > > in your apps folder > > Sam D > > On 5/1/07, monty <[EMAIL PROTECTED]> wrote: > > > > > > > I'm getting a strange problem where if I'm in production mode, a > > postgresql column called 'keywords' is not getting updated using the > > $this->Model->save() function. When i'm in debug mode, it works fine. > > > A similar problem also happens when I query a certain postgres table > > called 'offers' with the function $this->Model->findAll();. When in > > debug mode it works fine, however in production mode it returns false > > which indicates there must be an error in the findAll function. > > > What is the essential difference between debug and production modes > > (besides error messages) that could help me track down this problem. > > > Much appreciated, Simon. > > > ps. I have run sql queries directly on the table and works fine. I may > > have also dropped and recreated the column with the same name but > > can't remember. > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
weird production mode error
I'm getting a strange problem where if I'm in production mode, a postgresql column called 'keywords' is not getting updated using the $this->Model->save() function. When i'm in debug mode, it works fine. A similar problem also happens when I query a certain postgres table called 'offers' with the function $this->Model->findAll();. When in debug mode it works fine, however in production mode it returns false which indicates there must be an error in the findAll function. What is the essential difference between debug and production modes (besides error messages) that could help me track down this problem. Much appreciated, Simon. ps. I have run sql queries directly on the table and works fine. I may have also dropped and recreated the column with the same name but can't remember. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
updating a record
Hi to all cake bakers, I am using session based authentication and I want to update a record based on information supplied on a form submission. If i use the standard save function, the record will be saved based on the id of the record i supply update some record WHERE ID = $ID The problem is that I want to update a record based on the id and the session_id update some recored WHERE ID = $ID and client_id = $SESSION_ID This ensures that each client can only update their own records in a table based on the session id. Seeing as how there is no update method in cake, how do i do this? Cheers. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
saving a record
I'll use a basic examle to explain my question. I have two tables with the containing fields: Customer => id, name , address, etc Purchase_order => id, amount, item, customer_id In the customer's management screen, he can see a list of purchase orders and update them via a form. I use the model's save function. The form sends the purchase order id (within a hidden field), so presumably when the save function executes, the purchase order record with the corresponding id will be updated. For security reasons, I want to also make sure that the purchase order record that will be updated will also have the correct customer_id. The customer_id will be set as a session value. So I want to be able to update the record like : update purchase order where id = $id AND customer_id = $customer_id. How do i do this in cake? ( by not using sql statements). Thanks in advance, Simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: how to organise this app
my application is similiar with admin/client/user. Roughly speaking, each model represents a table. For a small application I would create a controller for each admin, client and user, but there are no hard and fast rules for this. You may split your controller into smaller chunks for whatever reason. I really struggled with web developement before MVC. The whole PHP thing was a bleeding mess and i think cake is just what the doctor ordered. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Caching
i don't change the name of the image, but shouldn't i be able to tell the browser not to cache it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Caching
I have a controller that handles all management functions for my application. I have a particular action that uploads images and then redisplays them in a view. Sometimes when I upload a new image, the old one is still displayed. Is there someway I can totally disable caching for a view through a controller function or something? Or should this be handled by setting headers directly. Thanks in advance. Simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Single field, multiple validation errors
Mika wrote: > To clarify, once using the advanced validation, you can add the > validation needed to the model even if the field is not in the table. Advanced validation? *sigh*, It shouldn't be that hard. i'd prefer to use the "hacky" way. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
select tag annoyance
I want to generate a selection with Australian states so i used the following.. $html->selectTag('Customer/state',array('NSW','QLD','ACT','VIC','WA','SA','TAS','NT'). This generates the following NSW QLD etc I dont need values set to "0","1", etc. I need the display values to be the same as option values. Do i have to specify array('NSW=>'NSW','QLD'=>'QLD' etc everytime? Any shortcuts? Thanks in advance, simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: selection lists
fantastic! thanks alot --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
selection lists
i want to fill a selection list based on a table of data called Region. It has two columns, id and region (containing the actual name of the region). To do this i wrote code below. Is there a faster, less convoluted way? This seems like a common task and should be an easier way. Thanyou. controller->Region->findAll(); $region_options = array(); foreach($region_list as $region_item){ $region_options[$region_item['Region']['id']] = $region_item['Region']['region']; } echo $html->selectTag('Customer/region',$region_options) ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: redirecting
there's no reason i suppose not to include the controller name, it's just that i would have expected this behaviour similuar to $html-link('methodname'). -its all good. Thanks for the solutions. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
redirecting
after playing around with the redirect function i figured out that to redirect to a method within the same controller you put $this->redirect('ControllerName/methodName'); is there a way to redirect to a method within the same controller without specifying the controller name? ie, defaults to the current controller by default. 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 -~--~~~~--~~--~--~---
Re: accessing models
thankyou to all your responses. I wasn't asking in order to solve a particlar problem but just wanted to know how it all fits together. I think its probably wise not to do this anyway, and work from the controller when working with more than one model, but handy to know. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
accessing models
hi there, this is probably already been posted , but cant' find. How do you access a Model from within another Model. Thankyou. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
instantiating a model
I am fairly new to Cake, but have been reading a bit of RoR. I'd actually prefer to us Cake because of speed and deployment issues. Just wondering how you instantiate a model class within your controller. In RoR the 'find' method actually returns objects but in cake seems to return just an array of data. RoR example: myObject = Model.new myObject.methodcall some_objects = myObject.children etc... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
getInsertID
I'm using the first stable version of Cake and postgres. I'm performing a query using Model->query function to insert a new record and i want to get the last inserted id from this query using Model->getInsertID. Howeever this function gives me blank. It works however if i insert a new record using Model->Save Has anyone noticed this? or am i using incorrectly. Thanks for help. Simon. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Newbie setup
Hi all, I am running through the posts tutorial on the Cake site and got stuck when come across $this->Post->findAll(); After setting my degub level to 2, letting me see my sql output, i got the following Notice: Undefined offset: 0 in C:\Program Files\Apache Group\Apache2\htdocs\vouchme_cake\cake\libs\model\dbo\dbo_postgres.php on line 213 The generated sql: SELECT "Post"."" AS "Post__", "Post"."" AS "Post__", "Post"."" AS "Post__", "Post"."" AS "Post__", "Post"."" AS "Post__" FROM "posts" AS "Post" WHERE 1 = 1 I tried using $this->Post->findBySql("select * from posts"); and this worked fine. Is this problem familiar to anyone? Help much appreciated. Si. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---