security

2007-07-29 Thread monty

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

2007-05-02 Thread monty

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
-~--~~~~--~~--~--~---



weird production mode error

2007-05-01 Thread monty

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
-~--~~~~--~~--~--~---



Re: weird production mode error

2007-05-01 Thread monty

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
-~--~~~~--~~--~--~---



updating a record

2006-06-08 Thread monty

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
-~--~~~~--~~--~--~---



Re: Caching

2006-06-07 Thread monty

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
-~--~~~~--~~--~--~---



Re: how to organise this app

2006-06-07 Thread monty

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
-~--~~~~--~~--~--~---



Caching

2006-06-06 Thread monty

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
-~--~~~~--~~--~--~---



redirecting

2006-06-01 Thread monty

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: redirecting

2006-06-01 Thread monty

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
-~--~~~~--~~--~--~---



selection lists

2006-06-01 Thread monty

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.

?php
$region_list = $this-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: selection lists

2006-06-01 Thread monty

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
-~--~~~~--~~--~--~---



select tag annoyance

2006-06-01 Thread monty

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
select name=data[Customer][state] 
option value= /option
option value=0 NSW/option
option value=1 QLD/option
etc
/select

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
-~--~~~~--~~--~--~---



accessing models

2006-05-30 Thread monty

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
-~--~~~~--~~--~--~---



Newbie setup

2006-04-29 Thread monty

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
-~--~~~~--~~--~--~---