Where to DL RC2?

2009-03-30 Thread rocket

I can't find the link to download Cake 1.2 RC2. I'm trying to run a
site that was built on RC2 that doesn't work with the current release.
Can anyone direct me?

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



Adding/Deleting HABTM on existing records

2009-03-30 Thread Sidney

Hi, I have searched this forum and read the manuals, and finally got
my code working, BUT am I doing this right or have I just found a
cludge by dumb luck?

I have 2 tables Questions and Games joined correctly thru
games_questions table. Users can attach or detach Questions from a
Game (drag 'n drop) but I was having trouble writing/deleting into the
games_questions x-ref.

The post on this forum titled "not understanding simple HABTM save/
delete" by Ryan McKillen gave me my solution (adapted version below),
along with 
http://teknoid.wordpress.com/2008/07/11/notes-on-cakephp-habtm-part-2-saving-data/

So my question is: Do I have to read the existing relationships ($this-
>Question->find) just to insert/remove a new relationship? I have used
containable to make the read as efficient as possible, but it seems
wasteful.

If I don't populate the array then all existing relationships get
replaced by the new one, and this is the only way I found to get it to
work.

//Read the existing Question to get current relationships...
$data=$this->Question->find('first',array(

'conditions'=>array('Question.id'=>$q_id),
'contain'=>array('Game.id')
));
// Extract only the Game's ids into an array
$existing=Set::extract('/Game/id',$data);
// Build a new datastructure
$this->data['Question']['id']=$q_id;
$this->data['Game']=$existing;
$this->data['Game'][]=$target_game_id'];

if ($this->Question->save($this->data)){
   /// Yay it saved
 }


I haven't written the code to Detach a Question from a Game yet, but
unless I hear otherwise I guess I'll do something similar:
1. Read existing relationships
2. Remove the target from the array
3. Save the Question (the delete would be implied)

Somehow it seems unnatural IMO to use Save on a model to Insert, Save,
and Delete HABTM relationships, but I'll get used to it, if that's
what it takes.

Thanks folks.
--~--~-~--~~~---~--~~
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: Useing different database for the different actions

2009-03-30 Thread Pippo

Great, Thanks! I guess was searching for the wrong terms.

On 30 Mrz., 20:57, Alfredo Quiroga-Villamil  wrote:
> Yep, even better.
>
> Tx Martin.
>
> On Mon, Mar 30, 2009 at 2:54 PM, Martin Westin
>
>  wrote:
>
> > I think this is what you are looking for
>
> >http://bakery.cakephp.org/articles/view/load-balancing-and-mysql-mast...
>
> > On Mar 30, 6:28 pm, Alfredo Quiroga-Villamil 
> > wrote:
> >> Pippo:
>
> >> I've never done this or even thought about how to do it; so there
> >> might be a better way to accomplish what you want. Perhaps what I am
> >> about to tell you might not be a valid solution; but one thing that
> >> comes to mind is the following:
>
> >> Assuming that what you want is to read from one DB and perform CUD
> >> operations on the other one (Master), you could try to:
>
> >> Overwrite the methods related to "select" in AppModel and specify the
> >> DB to use for those cases. Do the same for methods that will be of CUD
> >> type in AppModel and point in this case to the other database you
> >> would like to use (master in this case)
>
> >> Everyone, please keep me honest here.
>
> >> Regards,
>
> >> Alfredo
>
> >> On Mon, Mar 30, 2009 at 11:42 AM, Pippo  wrote:
>
> >> > Hi
>
> >> > We would like to use scalr.net and amazon webservices in order to be
> >> > able to scale if we have more and more users.
>
> >> > We would like to use one master Database and some slave Databases. The
> >> > synchronization in between of the different databases will go only in
> >> > one way, from the master to the slaves. This would mean that we need
> >> > to be able to differentiate in between of the actions done to the
> >> > database. All the Select statements (cakephp function find) would need
> >> > to go to the slaves, the Insert and Update statements should go to the
> >> > master database. The different Databases are on different Servers
> >> > (IP).
>
> >> > I couldn't find any information how this could be done with cakephp. I
> >> > have seen that I can use different databases by defining  useDbConfig
> >> > (http://book.cakephp.org/view/435/useDbConfig) but this would mean
> >> > that it would do all the type of SQL statement to one Database, no
> >> > matter whether it is a SELECT (read data) or an UPDATE or INSERT
> >> > (edit, create data).
>
> >> > Did someone have the same issue and does someone have a solution for
> >> > 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: Why is validation called twice?

2009-03-30 Thread mscdex

On Mar 30, 10:33 pm, Miles J  wrote:
> How am I to fix this problem?

One workaround may be just setting some sort of flag on the model or
elsewhere to determine you have already checked the recaptcha
validation.
--~--~-~--~~~---~--~~
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: Security white paging (blackholes) on certain pages

2009-03-30 Thread Miles J

I found this, Im assuming it will bypass these fields so it wont
blackhole.

$this->Security->disabledFields = array('field1', 'field2');
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Why is validation called twice?

2009-03-30 Thread Miles J

Ive noticed this numerous times when creating my own methods for model
validation. When I do a debug() within the method, it outputs the data
twice, which means the validation is happening twice. Now this hasnt
been a problem until now. Im trying to get recaptcha working correctly
using model validation, heres my code:

/**
 * Validate recaptcha
 * @param array $data
 * @return boolean
 */
function recaptcha($data) {
App::import('Vendor', 'recaptcha', array('file' => 'recaptcha.php'));
$private = Configure::read('Settings.captcha_private');
$public = Configure::read('Settings.captcha_public');

$verify = recaptcha_check_answer($private, env('REMOTE_ADDR'), $this-
>data[$this->name]['recaptcha_challenge'], $this->data[$this->name]
['recaptcha']);

debug($verify);

return ($verify->is_valid) ? true : false;
}


And the model validation:

'recaptcha' => array(
'recaptcha' => array(
'rule' => array('recaptcha'),
'message' => 'captchaFailed'
)
)

The problem is that recaptcha is valid the first time, but since it
validates twice, it fails the second time, thus causing my form never
to validate. As you can see in the debug below, its called twice.

app/app_model.php (line 157)

ReCaptchaResponse Object
(
[is_valid] => 1
[error] =>
)


app/app_model.php (line 157)

ReCaptchaResponse Object
(
[is_valid] =>
[error] => incorrect-captcha-sol
)

How am I to fix this problem?
--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread Jon Bennett

Hi James,

> I've added the Rewrite Base line but I'm still seeing a 500 error
> page, this is what my htaccess file currently reads:
>
> 
>        RewriteEngine on
>        RewriteBase /~palacevi/cakephp/
>        RewriteRule    ^webstats/(.*)    webstats/$1 [L]
>        RewriteRule    ^$ app/webroot/    [L]
>        RewriteRule    (.*) app/webroot/$1 [L]
> 

The above doesn't look like the standard cakephp htaccess. try
downloading the most recent stable of 1.1 (which I think you're using)
and replace (backup first!) the htaccess files in each folder with
their defaults.

Not sure if that'll do it, but need to start somewhere.

What does the apache logs say? anything more than just a 404? what
about php logs?

cheers,

Jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: Notice (8): Undefined index: id?

2009-03-30 Thread mscdex

On Mar 30, 6:11 pm, Marcelo Andrade  wrote:
> On Mon, Mar 30, 2009 at 6:44 PM, Aurelius  wrote:
>
> > What does that mean, and where is the problem?
> > Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
> > 1281...on line 77
>
> > That's line 77:
> > if ($this->User->save ( $this->data, true , array ( 'firstname',
> > 'lastname', '' ))) {
> > ... }
>
> > What's wrong?
>
> It's hard to say.  Maybe you're in an edit action and
> your $this->data doesn't contain the desired record id.
>
> Please, tell us more about your scenario.
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.com

Also, do you have any beforeValidate or beforeSave callbacks that are
changing the data?
Sounds like the data for your primary key for your User model is being
unset somewhere possibly.
--~--~-~--~~~---~--~~
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: Couldn't use method named 'object'

2009-03-30 Thread joshua
I got what you said. Thanks!

On Mon, Mar 30, 2009 at 11:54 PM, brian  wrote:

>
> On Mon, Mar 30, 2009 at 10:54 AM, joshua  wrote:
> > You have totally answered my questions. Thanks! But I still have a
> question
> > for the ticket 4026 which has already been closed.
> > It was suggested we use boolean. If so, how can use several values in a
> > boolean field? I don't think this bug has been solved.
>
> What do you mean by "several values"? Like, 1, 2, 3, ... etc? You can
> use smallint to get around Cake's treating tinyint as a boolean. That
> convention, while not terrific, exists to deal with other issues.
>
> >
>


-- 
Thanks
Joshua

--~--~-~--~~~---~--~~
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: CakePHP on Hiawatha web server

2009-03-30 Thread solie

Again, I have to set var $base into var $base = "/APP_NAME/index.php",
so that scaffolding points to correct URL (add/view/edit/delete)
--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread jmdesign

Okay it's actually reading a 404 Error now (it's late...)!

James
--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread Samuel DeVore

At this point I don't have any new ideas, I will keep pondering...

Sam D


On Mon, Mar 30, 2009 at 3:17 PM, jmdesign
 wrote:
>
> Error log reads the following erron on the htaccess file:
>
> "Invalid command 'php_value', perhaps misspelled or defined by a
> module not included in the server configuration"
>
> I've removed the php_value line from the htaccess file, there's no
> error in the logs now but the 500 error is still showing!
>
> I knew this wouldn't be straight forward but I wasn't expecting it to
> be this difficult!
>
> James
> >
>

--~--~-~--~~~---~--~~
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: CakePHP on Hiawatha web server

2009-03-30 Thread solie

well, after creating model and controller, I must change the var
$webroot into fixed path, ie var $webroot = '/APP_NAME/app/webroot/',
change APP_NAME with your main APP (cake) folder, because all
controller is callled with index.php/controller_name, so webroot has
to be in the fixed location.
--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread jmdesign

Error log reads the following erron on the htaccess file:

"Invalid command 'php_value', perhaps misspelled or defined by a
module not included in the server configuration"

I've removed the php_value line from the htaccess file, there's no
error in the logs now but the 500 error is still showing!

I knew this wouldn't be straight forward but I wasn't expecting it to
be this difficult!

James
--~--~-~--~~~---~--~~
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: Notice (8): Undefined index: id?

2009-03-30 Thread Marcelo Andrade

On Mon, Mar 30, 2009 at 6:44 PM, Aurelius  wrote:
>
> What does that mean, and where is the problem?
> Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
> 1281...on line 77
>
> That's line 77:
> if ($this->User->save ( $this->data, true , array ( 'firstname',
> 'lastname', '' ))) {
> ... }
>
> What's wrong?

It's hard to say.  Maybe you're in an edit action and
your $this->data doesn't contain the desired record id.

Please, tell us more about your scenario.

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

http://mfandrade.wordpress.com

--~--~-~--~~~---~--~~
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: Setting Layout for Scaffolding?

2009-03-30 Thread Amit

Here's a good walkthrough:
http://teknoid.wordpress.com/2009/01/31/take-control-over-your-bake-and-scaffold-html-templates/

On Mar 30, 5:05 pm, Amit  wrote:
> I think you're referring to cake/libs/views/scaffold/(add|edit|
> view.ctp). These will let you alter the way scaffolding looks
>
> On Mar 30, 2:42 am, bbf  wrote:
>
>
>
> > I've searched the groups and Google and can't find an answer for this.
>
> > How do I set a different layout for the scaffolding?
>
> > Thanks for your help!
--~--~-~--~~~---~--~~
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: Setting Layout for Scaffolding?

2009-03-30 Thread Amit

I think you're referring to cake/libs/views/scaffold/(add|edit|
view.ctp). These will let you alter the way scaffolding looks

On Mar 30, 2:42 am, bbf  wrote:
> I've searched the groups and Google and can't find an answer for this.
>
> How do I set a different layout for the scaffolding?
>
> Thanks for your help!

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



CakePHP on Hiawatha web server

2009-03-30 Thread solie

Recently I just moved from apache/lighttpd to hiawatha, but
unfortunately dealing with mod_rewrite is very time consuming. So, my
problem with cakePHP (and other MVC with mod_rewrite) is unable to
access webroot folder. The main site is just showing the plain HTML,
no CSS, favicon and so on.

So, here is what I've done to make CakePHP works in hiawatha without
adding urltoolkit into main httpd config file.

Edit file dispatcher.php, find var $webroot and change its value into
'app/webroot/', next jump to line 360th and comment that line ($this-
>webroot = $base .'/')

Now cakePHP works in hiawatha (I mean webroot dir is now direct to app/
webroot, so that CSS, favicon, etc in webroot is now accessible).

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



Notice (8): Undefined index: id?

2009-03-30 Thread Aurelius

What does that mean, and where is the problem?
Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
1281...on line 77

That's line 77:
if ($this->User->save ( $this->data, true , array ( 'firstname',
'lastname', '' ))) {
... }

What's wrong?

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



BUG? srand() is seeded with a constant in Security::cipher()

2009-03-30 Thread Stack

Later calls to shuffle() or other functions which do not use the
mt_srand() seed then return the same predictable results time and time
again.

Shouldn't the seed be set to a new seed at the end of the function
before the return? This behavior is in the latest version of CakePHP
and has been in for awhile.

--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread Samuel DeVore

what is in the error logs for those hits that 500?  My shared host
gives me access to those you might check them

Sam D


On Mon, Mar 30, 2009 at 1:26 PM, jmdesign
 wrote:
>
> Hi Sam,
>
> It's definately a Linux shared host.
>
> I've added the Rewrite Base line but I'm still seeing a 500 error
> page, this is what my htaccess file currently reads:
>
> 
>        RewriteEngine on
>        RewriteBase /~palacevi/cakephp/
>        RewriteRule    ^webstats/(.*)    webstats/$1 [L]
>        RewriteRule    ^$ app/webroot/    [L]
>        RewriteRule    (.*) app/webroot/$1 [L]
> 
>
> php_value magic_quotes_gpc "Off"
>
>
> Does that look okay for cake php?
>
> Thanks,
>
> James
> >
>

--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread jmdesign

Hi Sam,

It's definately a Linux shared host.

I've added the Rewrite Base line but I'm still seeing a 500 error
page, this is what my htaccess file currently reads:


RewriteEngine on
RewriteBase /~palacevi/cakephp/
RewriteRule^webstats/(.*)webstats/$1 [L]
RewriteRule^$ app/webroot/[L]
RewriteRule(.*) app/webroot/$1 [L]


php_value magic_quotes_gpc "Off"


Does that look okay for cake php?

Thanks,

James
--~--~-~--~~~---~--~~
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: Setting Layout for Scaffolding?

2009-03-30 Thread bbf

That would change the layout for the whole site.

I want my site to use one layout (e.g. the pretty layout), but the
scaffolding to use a different layout (e.g. the plain layout).


On Mar 30, 5:04 am, John Andersen  wrote:
> As far as I can understand from the documentation, you just replace
> the default layout with your own.
> The default layout can be found in  the "app/views/layout" folder.
>
> Enjoy,
>    John
>
> On Mar 30, 10:42 am, bbf  wrote:
>
> > I've searched the groups and Google and can't find an answer for this.
>
> > How do I set a different layout for the scaffolding?
>
> > Thanks for your help!
--~--~-~--~~~---~--~~
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread Miles J

If you want to separate them, look at this.

http://book.cakephp.org/view/189/Automagic-Form-Elements#options-before-options-between-options-separator-a-191

But literally the best way to do these types of checkboxes are
manually, that's what I do.
--~--~-~--~~~---~--~~
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 destroy sessions after close browser windows

2009-03-30 Thread Miles J

Just set the security to high in your config. That will end it.
--~--~-~--~~~---~--~~
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 silently redirects to login page ?

2009-03-30 Thread iFeghali

Hi Martin,

Yes I am talking exactly about that message. Changing it the way you
suggest would make it very weird to users already logged in that are
trying to access resources they are not allowed to. Also, I would like
to have no message at all... just the login form.

Thank you.

On 30 mar, 15:28, Martin Westin  wrote:
> That would be the authError message you are seeing.
>
> You can set it (from AppController::beforeFilter for example) like
> this:
>
> $this->Auth->authError = 'Hi, and welcome. Please login before
> proceeding.';
--~--~-~--~~~---~--~~
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 silently redirects to login page ?

2009-03-30 Thread iFeghali

Hello John,

Thanks for the answer but I don't see how it could help me. Can you
please clarify ?

On 30 mar, 15:13, John Andersen  wrote:
> Use thishttp://book.cakephp.org/view/385/logoutas the redirect!
--~--~-~--~~~---~--~~
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: Useing different database for the different actions

2009-03-30 Thread Alfredo Quiroga-Villamil

Yep, even better.

Tx Martin.

On Mon, Mar 30, 2009 at 2:54 PM, Martin Westin
 wrote:
>
> I think this is what you are looking for
>
> http://bakery.cakephp.org/articles/view/load-balancing-and-mysql-master-and-slaves-2
>
>
>
>
> On Mar 30, 6:28 pm, Alfredo Quiroga-Villamil 
> wrote:
>> Pippo:
>>
>> I've never done this or even thought about how to do it; so there
>> might be a better way to accomplish what you want. Perhaps what I am
>> about to tell you might not be a valid solution; but one thing that
>> comes to mind is the following:
>>
>> Assuming that what you want is to read from one DB and perform CUD
>> operations on the other one (Master), you could try to:
>>
>> Overwrite the methods related to "select" in AppModel and specify the
>> DB to use for those cases. Do the same for methods that will be of CUD
>> type in AppModel and point in this case to the other database you
>> would like to use (master in this case)
>>
>> Everyone, please keep me honest here.
>>
>> Regards,
>>
>> Alfredo
>>
>> On Mon, Mar 30, 2009 at 11:42 AM, Pippo  wrote:
>>
>> > Hi
>>
>> > We would like to use scalr.net and amazon webservices in order to be
>> > able to scale if we have more and more users.
>>
>> > We would like to use one master Database and some slave Databases. The
>> > synchronization in between of the different databases will go only in
>> > one way, from the master to the slaves. This would mean that we need
>> > to be able to differentiate in between of the actions done to the
>> > database. All the Select statements (cakephp function find) would need
>> > to go to the slaves, the Insert and Update statements should go to the
>> > master database. The different Databases are on different Servers
>> > (IP).
>>
>> > I couldn't find any information how this could be done with cakephp. I
>> > have seen that I can use different databases by defining  useDbConfig
>> > (http://book.cakephp.org/view/435/useDbConfig) but this would mean
>> > that it would do all the type of SQL statement to one Database, no
>> > matter whether it is a SELECT (read data) or an UPDATE or INSERT
>> > (edit, create data).
>>
>> > Did someone have the same issue and does someone have a solution for
>> > 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: Useing different database for the different actions

2009-03-30 Thread Martin Westin

I think this is what you are looking for

http://bakery.cakephp.org/articles/view/load-balancing-and-mysql-master-and-slaves-2




On Mar 30, 6:28 pm, Alfredo Quiroga-Villamil 
wrote:
> Pippo:
>
> I've never done this or even thought about how to do it; so there
> might be a better way to accomplish what you want. Perhaps what I am
> about to tell you might not be a valid solution; but one thing that
> comes to mind is the following:
>
> Assuming that what you want is to read from one DB and perform CUD
> operations on the other one (Master), you could try to:
>
> Overwrite the methods related to "select" in AppModel and specify the
> DB to use for those cases. Do the same for methods that will be of CUD
> type in AppModel and point in this case to the other database you
> would like to use (master in this case)
>
> Everyone, please keep me honest here.
>
> Regards,
>
> Alfredo
>
> On Mon, Mar 30, 2009 at 11:42 AM, Pippo  wrote:
>
> > Hi
>
> > We would like to use scalr.net and amazon webservices in order to be
> > able to scale if we have more and more users.
>
> > We would like to use one master Database and some slave Databases. The
> > synchronization in between of the different databases will go only in
> > one way, from the master to the slaves. This would mean that we need
> > to be able to differentiate in between of the actions done to the
> > database. All the Select statements (cakephp function find) would need
> > to go to the slaves, the Insert and Update statements should go to the
> > master database. The different Databases are on different Servers
> > (IP).
>
> > I couldn't find any information how this could be done with cakephp. I
> > have seen that I can use different databases by defining  useDbConfig
> > (http://book.cakephp.org/view/435/useDbConfig) but this would mean
> > that it would do all the type of SQL statement to one Database, no
> > matter whether it is a SELECT (read data) or an UPDATE or INSERT
> > (edit, create data).
>
> > Did someone have the same issue and does someone have a solution for
> > 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: How destroy sessions after close browser windows

2009-03-30 Thread Martin Westin

Unloading is not the same as closing the window. I don't know if
jQuery has some magic of it's own but unless you use all ajax, frames
or an iframe and attach the script to the top html document, the
unload will fire every time the window reloads (each link clicked).

There is no event for the window being closed that can effectively be
used for this purpose.

/Martin


On Mar 30, 2:52 pm, Eber Freitas Dias  wrote:
> You can use Javascript.
>
> jQuery, for instance, has a helper event handler that let's you bind
> functions to the "unload" event. Check it 
> out:http://docs.jquery.com/Events/unload#fn
>
> You can make it with raw JS or other libraries... I think jQuery is easier.
>
> So you can make a asynchronous call to a method in your app that cleans the
> session and then closes the window... It's an option...
>
> 2009/3/30 John Andersen 
>
>
>
>
>
> > Ok, then I understand :) That is a scenario you can't catch, as you
> > don't get any information that the user has closed the window.
>
> > Used timed sessions, so that if the user is inactive for more than X
> > minutes, the session becomes invalid and the user must log in again!
>
> > Use session renew when a user logs in, so that the session used for
> > accessing the site as a visitor (not logged in user) and the session
> > used when the user is logged in, is not the same. Avoids session
> > hijacking!
>
> > Hope this helps you on the way,
> >    John
>
> > On Mar 30, 12:19 pm, Petr Vytlačil  wrote:
> > > Hi, I this know but I dont know how destroy session when user close
> > > windows.
> > > THX
>
> > > On 30 Bře, 11:10, John Andersen  wrote:
>
> > > > Use session destroy as stated in the CakePHP documentation athttp://
> > book.cakephp.org/view/404/destroy
> > > > Enjoy,
> > > >    John
>
> > > > On Mar 30, 11:49 am, Petr Vytlačil  wrote:
>
> > > > > Hi i need destry sessions after close browser windows. I need logout
> > > > > user from admin section when he close browser windows. If now close
> > > > > browser windows and startup browser, he can go to admin section. I
> > use
> > > > > CakePHP 1.2.
>
> > > > > THX
>
> --
> Éber Freitas Dias
>
> www.eberfdias.comwww.dejamps.net
--~--~-~--~~~---~--~~
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: CakePHP Multilevel Users

2009-03-30 Thread nurvzy

I do something similar.  But I DO use the Auth component.  ACL is a
bit too much for my needs so I didn't go with it.

All I have is a status column in my user table that is an enum
('user','manager','admin').

I then use beforeFilters and isAuthorized in app_controller to check
for admin or manager in a route and verify the user is admin or
manager status ($this->Auth->user('status') == 'admin').   I went this
route because cake with the Auth component already gives you 2 layers
of authentication access just out of the box; but I wanted 3 layers
without getting into the complicated ACL component.

On Mar 28, 11:59 am, Zorancho  wrote:
> Hi to all
> I am building a multilevel users application, but i don't want to use
> the Auth or ACL components, cause they give me so much troubles, i
> want to manage to create the whole thing with using my own functions
> so i can have different groups of users like Administrators, Managers
> and the common Users. So i was wondering if i could use in the
> core.php:
> Configure::write('Routing.admin', 'admin');
> Configure::write('Routing.manager', 'manager');
>
> and then in the controllers to have actions like admin_add,
> manager_add, admin_delete, manager_delete etc...
> Is this possible to do in cake? How safe would be to place this kind
> of made application in production?
> Also, another question is about javascript, i personally prefer to
> work with MooTools (which i find much easier to understand than
> Prototype or Jquery) and could i use that one with CakePHP? Has anyone
> ever used them together? I have never found any real world example of
> using MooTools and CakePHP together, so i was having doubts. Thanks in
> advance.
--~--~-~--~~~---~--~~
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread Martin Westin


I maintain one hack in my core (used to be a few more during 1.2 pre-
release) and it is enough to worry about forgetting even though it is
only two lines. Pulling the core with Git has helped tremendously,
though. All fast-forwards so far.

If you need to make a "hack" in the core you will save yourself a lot
of trouble if you use Git.

/Martin


On Mar 30, 6:11 pm, brian  wrote:
> On Mon, Mar 30, 2009 at 8:17 AM, Martin Westin
>
>
>
>  wrote:
>
> > That sounds like a lot of work just to avoid using html. If you are
> > concerned about CakePHP coding standards (do they exist?) you should
> > definitely not be thinking about hacking the core files. Creating
> > "manual" form elements must be way better than editing files in the
> > core.
>
> > Even using different names for each group of boxes and merging them in
> > the controller or model must be better than modifying the core.
>
> > I am still not clear about why you need to call the select multiple
> > times. The only situation that would require you to call it twice is
> > some layout issue you need to adress. Like:
>
> > div
> > checkbox
> > checkbox
> > /div
> > div
> > checkbox
> > checkbox
> > /div
> > ...
>
> > That is the only situation I can think of that can't be handled by a
> > single select. It would be interesting to hear about it.
>
> Yes, that seems to be the problem keyur is addressing--how to split up
> the group of checkboxes across the page. My first thought was that
> this might be better dealt with through a change in model/association
> but I think I understand the problem better now.
>
> Creating a helper would, of course, be much better than hacking the
> core, but your idea of creating separate checkbox groups and merging
> the results in the controller seems reasonable, also.
--~--~-~--~~~---~--~~
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: Querying / filtering an array done by find('threaded')

2009-03-30 Thread toka...@gmail.com

I have tried also $this->Section->children($id), that seems to be ok,
but it doesnt generate such nice nested structure like find
('threaded').  Is there any change to filter threaded array similar
way like getting childs from the tree? Tnkx Tomas
--~--~-~--~~~---~--~~
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: Ajax gone after redirect

2009-03-30 Thread Martin Westin

I go by the rule-of-thumb to use ajax when the application really is
an application and not in any way similar to a website. Anytime I want
to use the word page to describe something or "go to" to describe an
action I know ajax is a bad choice. Ajax is so cool when you manage to
find a good use for it, though.


Google Calendar (even Gmail to a lesser extent) is a good example of a
"proper" application. I have never clicked the back button in Calendar
by mistake but I have managed to do it a few times in Gmail (trying to
switch back to the inbox and instead reloading the whole thing).

/Martin


On Mar 30, 3:45 pm, Stu  wrote:
> Hahaha, I hear you.  I have learned thru the hard way that Ajax is to
> be used in moderation.  Switched from a 100% Ajax navigated site, to
> about a 5%.
>
> I wouldn't say it was a waste of time.  My Ajax knowledge grew and I
> learned a valuable lesson.
--~--~-~--~~~---~--~~
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 silently redirects to login page ?

2009-03-30 Thread Martin Westin


That would be the authError message you are seeing.

You can set it (from AppController::beforeFilter for example) like
this:

$this->Auth->authError = 'Hi, and welcome. Please login before
proceeding.';

I have a habit of setting it to something more friendly than the
default. The direct way to make it disappear is to clear out the
sessions "auth" flash message. I am not sure how to turn it off more
elegantly.




On Mar 30, 7:26 pm, iFeghali  wrote:
> Hello,
>
> I have followed [1] to get a simple login form working. Currently when
> a visitor tries to reach '/' one is redirected to the login form,
> which is desirable, but an error message is displayed "You are not
> authorized to access that location.", which is not desirable. Any clue
> how do I prevent this error only in the case where the user is going
> to login ?
>
> Thank you.
>
> [1]http://book.cakephp.org/view/172/Authentication
--~--~-~--~~~---~--~~
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 silently redirects to login page ?

2009-03-30 Thread John Andersen

Use this http://book.cakephp.org/view/385/logout as the redirect!
Enjoy,
   John

On Mar 30, 8:26 pm, iFeghali  wrote:
> Hello,
>
> I have followed [1] to get a simple login form working. Currently when
> a visitor tries to reach '/' one is redirected to the login form,
> which is desirable, but an error message is displayed "You are not
> authorized to access that location.", which is not desirable. Any clue
> how do I prevent this error only in the case where the user is going
> to login ?
>
> Thank you.
>
> [1]http://book.cakephp.org/view/172/Authentication
--~--~-~--~~~---~--~~
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: Save null or empty datetime fields

2009-03-30 Thread geste

Edwin,

I have a similar interest.  I have started a new application with 40+
tables and I am trying to get as much mileage as possible from "baked"
models, views and controllers.

In several tables I have DATE fields that allow NULL dates.  For
example, in the equipment_items table, the disposal_date field should
be empty/NULL until the equipment is disposed of.

In the default baked views, though, those dates appear in the form as
January 1 2029 and if I save a new record or edit an existing, it will
save date as 2029-01-01 in place of the desired -00-00.  The DATE
fields in question are set to accept NULL.

So, I am also interested in the easiest way to modify bake-generated
MVC to permit this.

Jim


On Mar 18, 2:00 pm, edwingt  wrote:
> Hello,
> I want to save an emptydatefield, but I cant.
> There are some options to tell thedatefield that can benull?
> I already check that no rule is defined in the model, for thedate
> field and the databasedatefield accepts nulls.
>
> Any advice?

--~--~-~--~~~---~--~~
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: looking for a method to record 'page views'

2009-03-30 Thread JamesF

i did see that article but i think im goign to go with a different
approach...

i'm making a table called visits with four fields

id ->auto increment
listing_id ->related listing id
timestamp ->now()
ip_address ->users ip

basically whenever a listing is view i will execute an insert on the
database logging the information. when i display the stats i will run
queries off the table.
i have a feeling this isn't going to be very MVC compliant but bottom
line is i need to get it working. i have a few concerns about database
performance but i think it will be better to do it this way than a log
file/cron job method.

On Mar 30, 12:21 pm, brian  wrote:
> Have a look at this 
> HitCountBehaviorhttp://dsi.vozibrale.com/articles/view/simple-hitcount-behavior-for-c...
>
> I haven't used this, though it's been on my list of things to investigate.
>
> On Mon, Mar 30, 2009 at 11:14 AM, JamesF  wrote:
>
> > Hi all,
>
> > I am looking for a simple way of keeping track of page views. The
> > application is a rental properties website and I would like
> > advertisers who list their properties to know how many times they have
> > been viewed.
>
> > Anyone have a tried and true method for 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: $form->value | How does it work?

2009-03-30 Thread mscdex

On Mar 30, 12:28 pm, brotherkeen  wrote:
> Where does $form->value come from?  There doesn't seem to be anything
> about it in Cake documentation.
>
> All I know is that this works for selected checkboxes...
>
> echo $form->input('Tag',array(
>                 'label' => 'Tags',
>                 'type' => 'select',
>                 'multiple' => 'checkbox',
>                 'options' => $tags,
>                 'value' => $form->value('Tags.Tags')
>                 )
>             );

It appears to just read the value(s) for the specified field from
$this->data and return them. Here's the (fairly short) function from
the API: http://api.cakephp.org/view_source/helper/#line-552
--~--~-~--~~~---~--~~
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 to silently redirects to login page ?

2009-03-30 Thread iFeghali

Hello,

I have followed [1] to get a simple login form working. Currently when
a visitor tries to reach '/' one is redirected to the login form,
which is desirable, but an error message is displayed "You are not
authorized to access that location.", which is not desirable. Any clue
how do I prevent this error only in the case where the user is going
to login ?

Thank you.

[1] http://book.cakephp.org/view/172/Authentication
--~--~-~--~~~---~--~~
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: Cannot connect to database

2009-03-30 Thread dr. Hannibal Lecter

If you're 100% sure this is a firewall issue, that it is NOT a CakePHP
related question. You should go to the firewall related forums.

As a tip, you should definitely stop using the built-in windows
firewall and try something functional. Comodo is one of the best and
it's free (http://personalfirewall.comodo.com/), just skip the
antivirus during installation.

Hope that helps.

On Mar 30, 7:17 am, Pittore  wrote:
> I am using Windows XP with a wamp installation...starting to get
> somewhere but when I attempt to run "CakeTooDoo" from CAKEPHP
> Application Development by Bari and Syam, I get "cannot connect to
> database."
>
> I have been doing some diagnostics and found out my firewall is
> blocking port 3306 which is needed to connect to any of my mysql
> databases.
>
> Not sure how to add this port.  When I go to control center under
> Firewall exceptions I attempt to add this port but it says port
> already exists.  I guess I do not need to add it, if it exists, I just
> need to open it (get Firewall to stop blocking it). any ideas?
>
> I think I have resolved all my mysql and php userid and password
> issues...but one never knows. I have not yet edited my.ini which is
> something one can get to from the wamp mysqladmin.  I haven't edited
> that because I might screw everyhting up.
>
> My php seems to be working.  My apache is working.  The problem is
> getting php to talk connect to mysql database.
>
> Is there some kind of test to run?
>
> The wampserver console indicates I have databases and displays their
> structure and all. I can run SQL queries on them.  Just cannot get
> CAKEPHP to function yet.
>
> Why should this be so difficult?  I have only been working on this for
> 4 months now!
>
> Pittore
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



media view and files on the fly

2009-03-30 Thread Mark (Germany)

i tried to use the media view for files generated on the fly (some
exported text inside a export.txt or whatever)
but it seems like the media view can only handle downloads of
"existing" files on the server

trying to rewrite it did not turn out very well
so, did anyone manage to create a txt file to download, that is filled
with the echoed content

echo 'blabla'
or
$content = 'blabla' transfered to the media view

without creating locale (temp.) files on the server?
--~--~-~--~~~---~--~~
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: Useing different database for the different actions

2009-03-30 Thread Alfredo Quiroga-Villamil

Pippo:

I've never done this or even thought about how to do it; so there
might be a better way to accomplish what you want. Perhaps what I am
about to tell you might not be a valid solution; but one thing that
comes to mind is the following:

Assuming that what you want is to read from one DB and perform CUD
operations on the other one (Master), you could try to:

Overwrite the methods related to "select" in AppModel and specify the
DB to use for those cases. Do the same for methods that will be of CUD
type in AppModel and point in this case to the other database you
would like to use (master in this case)

Everyone, please keep me honest here.

Regards,

Alfredo


On Mon, Mar 30, 2009 at 11:42 AM, Pippo  wrote:
>
> Hi
>
> We would like to use scalr.net and amazon webservices in order to be
> able to scale if we have more and more users.
>
> We would like to use one master Database and some slave Databases. The
> synchronization in between of the different databases will go only in
> one way, from the master to the slaves. This would mean that we need
> to be able to differentiate in between of the actions done to the
> database. All the Select statements (cakephp function find) would need
> to go to the slaves, the Insert and Update statements should go to the
> master database. The different Databases are on different Servers
> (IP).
>
> I couldn't find any information how this could be done with cakephp. I
> have seen that I can use different databases by defining  useDbConfig
> (http://book.cakephp.org/view/435/useDbConfig) but this would mean
> that it would do all the type of SQL statement to one Database, no
> matter whether it is a SELECT (read data) or an UPDATE or INSERT
> (edit, create data).
>
> Did someone have the same issue and does someone have a solution for
> 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
-~--~~~~--~~--~--~---



$form->value | How does it work?

2009-03-30 Thread brotherkeen

Where does $form->value come from?  There doesn't seem to be anything
about it in Cake documentation.

All I know is that this works for selected checkboxes...

echo $form->input('Tag',array(
'label' => 'Tags',
'type' => 'select',
'multiple' => 'checkbox',
'options' => $tags,
'value' => $form->value('Tags.Tags')
)
);
--~--~-~--~~~---~--~~
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: looking for a method to record 'page views'

2009-03-30 Thread brian

Have a look at this HitCountBehavior
http://dsi.vozibrale.com/articles/view/simple-hitcount-behavior-for-cakephp

I haven't used this, though it's been on my list of things to investigate.

On Mon, Mar 30, 2009 at 11:14 AM, JamesF  wrote:
>
> Hi all,
>
> I am looking for a simple way of keeping track of page views. The
> application is a rental properties website and I would like
> advertisers who list their properties to know how many times they have
> been viewed.
>
> Anyone have a tried and true method for 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
-~--~~~~--~~--~--~---



Useing different database for the different actions

2009-03-30 Thread Pippo

Hi

We would like to use scalr.net and amazon webservices in order to be
able to scale if we have more and more users.

We would like to use one master Database and some slave Databases. The
synchronization in between of the different databases will go only in
one way, from the master to the slaves. This would mean that we need
to be able to differentiate in between of the actions done to the
database. All the Select statements (cakephp function find) would need
to go to the slaves, the Insert and Update statements should go to the
master database. The different Databases are on different Servers
(IP).

I couldn't find any information how this could be done with cakephp. I
have seen that I can use different databases by defining  useDbConfig
(http://book.cakephp.org/view/435/useDbConfig) but this would mean
that it would do all the type of SQL statement to one Database, no
matter whether it is a SELECT (read data) or an UPDATE or INSERT
(edit, create data).

Did someone have the same issue and does someone have a solution for
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
-~--~~~~--~~--~--~---



Useing different database for the different actions

2009-03-30 Thread Pippo

Hi

We would like to use scalr.net and amazon webservices in order to be
able to scale if we have more and more users.

We would like to use one master Database and some slave Databases. The
synchronization in between of the different databases will go only in
one way, from the master to the slaves. This would mean that we need
to be able to differentiate in between of the actions done to the
database. All the Select statements (cakephp function find) would need
to go to the slaves, the Insert and Update statements should go to the
master database. The different Databases are on different Servers
(IP).

I couldn't find any information how this could be done with cakephp. I
have seen that I can use different databases by defining  useDbConfig
(http://book.cakephp.org/view/435/useDbConfig) but this would mean
that it would do all the type of SQL statement to one Database, no
matter whether it is a SELECT (read data) or an UPDATE or INSERT
(edit, create data).

Did someone have the same issue and does someone have a solution for
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread brian

On Mon, Mar 30, 2009 at 8:17 AM, Martin Westin
 wrote:
>
>
> That sounds like a lot of work just to avoid using html. If you are
> concerned about CakePHP coding standards (do they exist?) you should
> definitely not be thinking about hacking the core files. Creating
> "manual" form elements must be way better than editing files in the
> core.
>
> Even using different names for each group of boxes and merging them in
> the controller or model must be better than modifying the core.
>
>
> I am still not clear about why you need to call the select multiple
> times. The only situation that would require you to call it twice is
> some layout issue you need to adress. Like:
>
> div
> checkbox
> checkbox
> /div
> div
> checkbox
> checkbox
> /div
> ...
>
> That is the only situation I can think of that can't be handled by a
> single select. It would be interesting to hear about it.

Yes, that seems to be the problem keyur is addressing--how to split up
the group of checkboxes across the page. My first thought was that
this might be better dealt with through a change in model/association
but I think I understand the problem better now.

Creating a helper would, of course, be much better than hacking the
core, but your idea of creating separate checkbox groups and merging
the results in the controller seems reasonable, also.

--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread Samuel DeVore

you might need to add a

RewriteBase /

also you should confirm that the shared host is linux flavor and not
windows IIS (this has bitten a client of mine)

Sam D



On Mon, Mar 30, 2009 at 8:51 AM, jmdesign
 wrote:
>
> Hi Martin,
>
> Thanks for the advice, i've now copied across the missing htaccess
> files although the site now won't display at all! It just gives me a
> 404 error.
>
> The old host was a virtual dedicated server whereas the new one is a
> shared hosting account so I guess the htaccess file needs tweaking as
> the mod-rewrite rules are different?
>
> Thanks,
>
> James
> >
>

--~--~-~--~~~---~--~~
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: Couldn't use method named 'object'

2009-03-30 Thread brian

On Mon, Mar 30, 2009 at 10:54 AM, joshua  wrote:
> You have totally answered my questions. Thanks! But I still have a question
> for the ticket 4026 which has already been closed.
> It was suggested we use boolean. If so, how can use several values in a
> boolean field? I don't think this bug has been solved.

What do you mean by "several values"? Like, 1, 2, 3, ... etc? You can
use smallint to get around Cake's treating tinyint as a boolean. That
convention, while not terrific, exists to deal with other issues.

--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread jmdesign

Actually I meant it's now showing a 500 Internal Server Error not a
404.

I'm pretty certain it's a problem with the URL's/site configuration
and not the actual website files that make up the site as they're
running fine on the current site.

Thanks,

James
--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread jmdesign

Hi Martin,

Thanks for the advice, i've now copied across the missing htaccess
files although the site now won't display at all! It just gives me a
404 error.

The old host was a virtual dedicated server whereas the new one is a
shared hosting account so I guess the htaccess file needs tweaking as
the mod-rewrite rules are different?

Thanks,

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



looking for a method to record 'page views'

2009-03-30 Thread JamesF

Hi all,

I am looking for a simple way of keeping track of page views. The
application is a rental properties website and I would like
advertisers who list their properties to know how many times they have
been viewed.

Anyone have a tried and true method for 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: LI instead of DIV as global preference in forms

2009-03-30 Thread logout

Well, the only thing I can think of is to extend the FormHelper and
redefine the input function to add the 'div'=>array('tag'=>'li')
option to the rest of your options every time you use it.

On Mar 30, 1:07 pm, mintao  wrote:
> Hi,
>
> in every form-view I change the default "div" to an "li" like that:
> e($form->input('username', array('label'=>__('Username', true),
> 'div'=>array('tag'=>'li';
>
> Could anyone please tell me, how to change this globally?
>
> Thank you very much
> Florian Fackler
--~--~-~--~~~---~--~~
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: Couldn't use method named 'object'

2009-03-30 Thread joshua
You have totally answered my questions. Thanks! But I still have a question
for the ticket 4026  which has already
been closed.
It was suggested we use boolean. If so, how can use several values in a
boolean field? I don't think this bug has been solved.


On Mon, Mar 30, 2009 at 10:06 PM, Ralph Marchildon <
ralph.marchil...@gmail.com> wrote:

>
> Re: Object class name
> It's a class that's already defined and in use by the CakePHP
> framework itself. Don't duplicate any of the class names listed here -
> > http://api.cakephp.org/classes  Sucks not having namespaces, yes I
> know they're slotted for the next PHP release.
>
> Re: tinyint(1)
> See https://trac.cakephp.org/ticket/3903
>
> Ralph
>
> On Mar 30, 12:27 am, joshua  wrote:
> > Thanks , I will give a double check of this.
> >
> > On Mon, Mar 30, 2009 at 1:12 PM, Miles J 
> wrote:
> >
> > > Im pretty sure its because the data is a string before its inserted,
> > > and not an integer. Try intval() ing it.
> >
> > --
> > Thanks
> > Joshua
> >
>


-- 
Thanks
Joshua

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



Querying / filtering an array done by find('threaded')

2009-03-30 Thread Tokasa


Hi, I got a little problem how to get only specific branch of categories in
my threaded array.

Imagine self-joined table with categories  joined by parent ID.

e.g. e-shop sections like Bikes, Electronics, Vines, ... etc..
Each of them have its own categories, who have its own categories, etc...

I would like to use find('threaded'), but just PER one section (e.g. vines)
... Now I get the WHOLE tree! Thats I dont want, I would prefer say in
conditions  Category.name = 'vines' and receive already array just with
wines.. but that seems not working, with conditions I dont get childers!!
becasue they dont match that conditions (of course :))

Any Ideas? Is it better to filter the result or it is possible specify that
when querying database??

I am posting an example array I get now (just with find('threaded')): 

Array
(
[0] => Array
(
[Section] => Array
(
[id] => 1
[parent_id] => 
[name] => Vine
)

[ParentSection] => Array
(
[id] => 
[parent_id] => 
[name] => 
)

[children] => Array
(
[0] => Array
(
[Section] => Array
(
[id] => 4
[parent_id] => 1
[name] => Red
)
   )
)
)

[1] => Array
(
[Section] => Array
(
[id] => 1
[parent_id] => 
[name] => Electronic
)

[ParentSection] => Array
(
[id] => 
[parent_id] => 
[name] => 
)

[children] => Array
(
[0] => Array
(
[Section] => Array
(
[id] => 4
[parent_id] => 1
[name] => Computer
)
   )
)
)
)


Thanks a lot!
Tomas


-- 
View this message in context: 
http://www.nabble.com/Querying---filtering-an-array-done-by-find%28%27threaded%27%29-tp22782400p22782400.html
Sent from the CakePHP mailing list archive at Nabble.com.


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



LI instead of DIV as global preference in forms

2009-03-30 Thread mintao

Hi,

in every form-view I change the default "div" to an "li" like that:
e($form->input('username', array('label'=>__('Username', true),
'div'=>array('tag'=>'li';

Could anyone please tell me, how to change this globally?


Thank you very much
Florian Fackler

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



Cannot connect to database

2009-03-30 Thread Pittore

I am using Windows XP with a wamp installation...starting to get
somewhere but when I attempt to run "CakeTooDoo" from CAKEPHP
Application Development by Bari and Syam, I get "cannot connect to
database."

I have been doing some diagnostics and found out my firewall is
blocking port 3306 which is needed to connect to any of my mysql
databases.

Not sure how to add this port.  When I go to control center under
Firewall exceptions I attempt to add this port but it says port
already exists.  I guess I do not need to add it, if it exists, I just
need to open it (get Firewall to stop blocking it). any ideas?

I think I have resolved all my mysql and php userid and password
issues...but one never knows. I have not yet edited my.ini which is
something one can get to from the wamp mysqladmin.  I haven't edited
that because I might screw everyhting up.

My php seems to be working.  My apache is working.  The problem is
getting php to talk connect to mysql database.

Is there some kind of test to run?

The wampserver console indicates I have databases and displays their
structure and all. I can run SQL queries on them.  Just cannot get
CAKEPHP to function yet.

Why should this be so difficult?  I have only been working on this for
4 months now!

Pittore


--~--~-~--~~~---~--~~
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 does parameter work in Jake

2009-03-30 Thread Brendon Kozlowski

Robin, for something as specific as Jake (that is not necessarily an
oft-asked topic about CakePHP), you might have better luck requesting
help specific to Jake itself:
http://dev.sypad.com/projects/jake/support/

On Mar 29, 1:23 pm, Robin  wrote:
> Any help here? Thanks a lot!
>
> On Mar 26, 3:12 pm, Robin  wrote:
>
>
>
> > Anybody can explain to me how the parameters work in Jake, the bridge
> > between joomla and cake? I searched but there's not much information
> > online. Anybody with experience can show me an example? Thanks so much!- 
> > 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
-~--~~~~--~~--~--~---



Re: Couldn't use method named 'object'

2009-03-30 Thread Ralph Marchildon

Re: Object class name
It's a class that's already defined and in use by the CakePHP
framework itself. Don't duplicate any of the class names listed here -
> http://api.cakephp.org/classes  Sucks not having namespaces, yes I
know they're slotted for the next PHP release.

Re: tinyint(1)
See https://trac.cakephp.org/ticket/3903

Ralph

On Mar 30, 12:27 am, joshua  wrote:
> Thanks , I will give a double check of this.
>
> On Mon, Mar 30, 2009 at 1:12 PM, Miles J  wrote:
>
> > Im pretty sure its because the data is a string before its inserted,
> > and not an integer. Try intval() ing it.
>
> --
> Thanks
> Joshua
--~--~-~--~~~---~--~~
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: Ajax gone after redirect

2009-03-30 Thread Stu

Hahaha, I hear you.  I have learned thru the hard way that Ajax is to
be used in moderation.  Switched from a 100% Ajax navigated site, to
about a 5%.

I wouldn't say it was a waste of time.  My Ajax knowledge grew and I
learned a valuable lesson.


--~--~-~--~~~---~--~~
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: Why is it so hard to find answers on cakephp trouble?

2009-03-30 Thread thalund

Hi there

Thanks again for all the reactions to my worries.

The small issue that was the source of frustration is now clarified
(in another thread).
And I understand that if I don't find the answer on this group there's
a lot of nice people willing to help :-)

Just to clarify: I don't expect cakePHP to be usable for the absolute
php beginner.
When I was at that point I remember trying desperately using MySQL
functions in my PHP and vice versa,
and imo there's a learning curve there that you have to overcome
before thinking about frameworks etc.

My point is that, at my current level, even though I would understand
the source code of CakePHP,
it would take me weeks to get in-depth with – and really I'd rather
not.

Perhaps when I've used it for a while and want to try to contribute to
the thing itself...

// thalund
--~--~-~--~~~---~--~~
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 destroy sessions after close browser windows

2009-03-30 Thread Eber Freitas Dias
You can use Javascript.

jQuery, for instance, has a helper event handler that let's you bind
functions to the "unload" event. Check it out:
http://docs.jquery.com/Events/unload#fn

You can make it with raw JS or other libraries... I think jQuery is easier.

So you can make a asynchronous call to a method in your app that cleans the
session and then closes the window... It's an option...

2009/3/30 John Andersen 

>
> Ok, then I understand :) That is a scenario you can't catch, as you
> don't get any information that the user has closed the window.
>
> Used timed sessions, so that if the user is inactive for more than X
> minutes, the session becomes invalid and the user must log in again!
>
> Use session renew when a user logs in, so that the session used for
> accessing the site as a visitor (not logged in user) and the session
> used when the user is logged in, is not the same. Avoids session
> hijacking!
>
> Hope this helps you on the way,
>John
>
> On Mar 30, 12:19 pm, Petr Vytlačil  wrote:
> > Hi, I this know but I dont know how destroy session when user close
> > windows.
> > THX
> >
> > On 30 Bře, 11:10, John Andersen  wrote:
> >
> > > Use session destroy as stated in the CakePHP documentation athttp://
> book.cakephp.org/view/404/destroy
> > > Enjoy,
> > >John
> >
> > > On Mar 30, 11:49 am, Petr Vytlačil  wrote:
> >
> > > > Hi i need destry sessions after close browser windows. I need logout
> > > > user from admin section when he close browser windows. If now close
> > > > browser windows and startup browser, he can go to admin section. I
> use
> > > > CakePHP 1.2.
> >
> > > > THX
> >
>


-- 
Éber Freitas Dias

www.eberfdias.com
www.dejamps.net

--~--~-~--~~~---~--~~
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: Webroot problem when accessing cake app through service provider's SSL

2009-03-30 Thread Martin Westin

Just guessing but try this:

http://book.cakephp.org/view/37/Apache-and-mod_rewrite-and-htaccess

The last part about setups that have already been "rewritten". Your
provider might be using mod_rewrite for it's ssl urls and then Cake's
rewriting will not work as expected.

/Martin



On Mar 29, 8:02 pm, karma  wrote:
> Hi!
>
> I have a problem getting cakephp to set correct webroot directory.
> I've the webroot installed in "/ssl/application_name
> /webroot" folder at the service providers server. The application
> works perfectly when I access it through
> "www.thesite.com/ssl/application_name".
>
> BUT
>
> The service provider offers SSL-encryption through this centered
> service, where the site is accessed through address "https://
> ssl.serviceprovider.com/thesite.com/application_name/". This messes
> the application up cause the webroot is not set correctly. I tried to
> change WWW_ROOT constant but it doesn't help. If I echo $this->webroot
> in a view it says "/ssl/application_name/". I need to get this
> application to work through this centered SSL.
>
> So, how could I get the application work correctly in this kind of a
> setup? I'm in quite a hurry to get this to work so any help is
> appreciated!
--~--~-~--~~~---~--~~
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread Martin Westin


That sounds like a lot of work just to avoid using html. If you are
concerned about CakePHP coding standards (do they exist?) you should
definitely not be thinking about hacking the core files. Creating
"manual" form elements must be way better than editing files in the
core.

Even using different names for each group of boxes and merging them in
the controller or model must be better than modifying the core.


I am still not clear about why you need to call the select multiple
times. The only situation that would require you to call it twice is
some layout issue you need to adress. Like:

div
checkbox
checkbox
/div
div
checkbox
checkbox
/div
...

That is the only situation I can think of that can't be handled by a
single select. It would be interesting to hear about it.




On Mar 30, 12:33 pm, keyurvaghani  wrote:
> Hello Miles,
>
> I have one more alternate way to prevent hidden control without doing
> any kind of  directly changes into libarary helper file (form.php).
>
> that is ...
>
>  we can make out own custom helper with similar kind of function with
> applied condition for not generating hidden while displaying multiple
> checkboxes
>
> for that we have to follow steps as below:
>
>  1. make php helper file on location app/views/helpers/
>
>  2. Make Helper Class like Helper and extends Helper as
> base class.
>
> class MultipleCheckboxHelper extends Helper { }
>
> 3. include required helpers by defining  var $helpers = array
> ('Html','Form'); into custom helper class.
>
> 4. here we need Html and Form so define $helpers array variable as
> shown above.
>
> 5. Now, just copy select Function from Form.php (cake library helper
> file) and paste it over here.
>
> 6. Rename function name and take for conflict naming conventions with
> another existing function name
>
> 7. Find and Replace $this-> TO $this->Form->
>
> 8. Replace line where hidden element will be generated with $style
> condition as below:
>
> function selectMultiple($fieldName, $options = array(), $selected =
> null, $attributes = array(), $showEmpty = '') {
>  
>  
> if($style!='checkbox'){
>       $select[] = $this->Form->hidden(null, array('value' => '', 'id'
> => null, 'secure' => false));}
>
>  .
>  .
>
> }
>
> 9. Open controller file where you need to use this helper and include
> this custom helpers by defining array variable as below:
>
> var $helpers = array('Form','Html','Javascript','MultipleCheckbox');
>
> 10. call method  from custom helpers into view files (.ctp / .thml) as
> below:
>
> "  Create Lead");
>                 e($multipleCheckbox->selectMultiple
> ('ProfilePermissionsMaster.permission',$options1,NULL,array
> ('multiple'=>'checkbox' , 'separator'=>'  ','value'=>'1')));
>
>  $options2=array(2=>"   Approve/Reject Lead");
>                                  e($multipleCheckbox->selectMultiple
> ('ProfilePermissionsMaster.permission',$options2,NULL,array
> ('multiple'=>'checkbox' , 'separator'=>'  ','value'=>'2')));
>
> ?>
>
> Note: we have to call helper methods with object name with small case
> of first word like $multipleCheckbox->method( )
>
> Please let me your view which is correct way that i should have to
> follow
>
> which is the most standard way as per cakephp rule or its MVC
> structure.
>
> Thanks and Regards,
> Keyur.
>
> On Mar 30, 2:39 pm, keyurvaghani  wrote:
>
> > Hi Miles,
>
> >   Thanks for your needful help.
>
> >   But currently i am developing company product through pure cakephp
> > 1.2  standards and i have to follow its conventions during whole
> > development cycle.
>
> >  currently i have created multiple check boxes using $form->select()
> > with 'multiple'=>'checkbox' options.
>
> >  For these reasons, i have three alternate for this solution in which
> > i will prevent to generate these hidden controls while displaying
> > multiple check boxes as below:
>
> >  (1) First way is pass extra boolean parameter say $showHidden=true /
> > false
>
> >      based on above parameter i will hide line no#: 1190 from file
> > cake library helper "form.php".
> >      this line is executed from "select" Function.
>
> >  (2) Second way is that in same file "form.php" and "select" Function
> > on line No: 1187,
>
> >      the variable $style get its value based on 'multiple' key and
> > value attributes if it is 'checkbox' then stored same value otherwise
> > null.
>
> >     so i can use this $style variable as conditional variable for
> > generating hidden control or not.
>
> >   Means instead line no: 1190 as below:
> >    $select[] = $this->hidden(null, array('value' => '', 'id' => null,
> > 'secure' => false));
>
> >   i will change it as below:
>
> >   if($style!='checkbox'){
>
> >          $select[] = $this->hidden(null, array('value' => '', 'id' =>
> > null, 'secure' => false));
>
> > }
>
> >  (3) Third way is alternate way of above but in different way.
>
> >     If we don't want any changes directly t

Re: Security white paging (blackholes) on certain pages

2009-03-30 Thread the_woodsman

When using JS to dynamically change the form, you're basically doing
exactly what the form helper is intended to prevent -
it tries to ensure that no form fields are tampered with, and a hidden
form field is exactly such an example!

I'd have thought that making it a non hidden field, ie a text field
which you hide with CSS, should have worked though.

You may just have to do your own form restrictions for actions like
this, i.e ensure the whitelist you pass into model->save is correct.



On Mar 30, 7:56 am, Lamiunto  wrote:
> Are you using $form->end() ?
> Also, if you want to populate your fields with Javascript, look for
> form ID's that represent the model and field you're trying to find, so
> if you're trying to edit the hidden "username" field in for the User
> model, the field ID would be UserUsername, you could just use $
> ('UserUsername').value = '...' if you're using Prototype.
>
> Remember when using the security component you must use the form
> helper for all of your forms, most of the time this isn't a problem
> because you can specify all kinds of information about your fields
> quite easily with the form helper. I haven't come across any situation
> yet where the form helper doesn't work correctly. Remember to start
> forms with $form->create() and end them with $form->end().
>
> On Mar 30, 2:22 pm, Miles J  wrote:
>
> > It seems even if I use form helper, I still have the same problem.
>
> >https://trac.cakephp.org/ticket/6254
--~--~-~--~~~---~--~~
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: Paginate Find All Results

2009-03-30 Thread timtrice

Ended up getting this working by assigning

$this->paginate['conditions'] = 'MATCH( name, keywords, description,
encoded ) AGAINST ( \'adwords\' )';
$this->paginate['fields'] = '*, MATCH( name, keywords, description,
encoded ) AGAINST( \'adwords\' ) AS score ';

I had tried to do array_merge and push but I think it was assigning
those to a next level; debugging would only bring back my 'limits' and
'recursive' keys and would print out an empty FeedContent array.
Works well from what I see so far.

Thanks for everyone's help


On Mar 29, 9:47 pm, brian  wrote:
> That should be:
>
> $paginate = array(
>    'FeedContent' => array(
>            'conditions' => 'CONDITIONS',
>            'fields' => 'FIELDS'
>    )
> );
>
> I don't know about using a key like 'Feed.FeedContent' but if it works ...
>
> But you said that you already had your global paginate array set up
> fine, but you want it altered just for one method. In that case, you
> just need to alter $this->paginate before calling $this->paginate()
> (why are those named the same, anyway?)
>
> function your_action()
> {
>         $this->paginate['FeedContent']['order'] = ...
>         $this->paginate['FeedContent']['conditions'] = ...
>
>         Or use array_merge() if you need to change several things
>
> On Sun, Mar 29, 2009 at 10:04 PM, timtrice  wrote:
>
> > I did attempt that with something like:
>
> >        $paginate = array(
> >                'Feed.FeedContent',
> >                array(
> >                        'conditions' => 'CONDITIONS',
> >                        'fields' => 'FIELDS'
> >                )
> >        );
>
> > Obviously I had myc onditions and fields listed, but that generated an
> > error as if it where trying to find a field named "conditions".
>
> > On Mar 29, 8:50 pm, brian  wrote:
> >> You can modify $paginate temporarily from within a method.
>
> >> On Sun, Mar 29, 2009 at 9:38 PM, timtrice  wrote:
>
> >> > I have the following Find query to retrieve search results from my DB:
>
> >> >                        $this->set(
> >> >                                'results',
> >> >                                $this->Feed->FeedContent->find(
> >> >                                        'all',
> >> >                                        array(
> >> >                                                'conditions' => 'MATCH( 
> >> > name, keywords, description, encoded )
> >> > AGAINST ( \'' . $keyword . '\')',
> >> >                                                'fields' => '*, MATCH( 
> >> > name, keywords, description, encoded )
> >> > AGAINST( \'' . $keyword . '\' ) AS score '
> >> >                                        )
> >> >                                )
> >> >                        );
>
> >> > I'd like to paginate the results but I absolutely cannot find a way
> >> > without generating errors.  I can't alter my paginate array I
> >> > immediately declared in my Controller because that array is also
> >> > controlling other actions I have set up perfectly.  I also do not want
> >> > to throw this code into another model as I see it as way too much
> >> > hassle to relate that Controller to the ones I have set up now.
>
> >> > Does anyone know about where I can find what I need to get this query
> >> > paginated?  I hate to have to write additional coding to do what
> >> > hoepfully will be easier than it seems with Cake.
>
> >> > 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: How destroy sessions after close browser windows

2009-03-30 Thread John Andersen

Ok, then I understand :) That is a scenario you can't catch, as you
don't get any information that the user has closed the window.

Used timed sessions, so that if the user is inactive for more than X
minutes, the session becomes invalid and the user must log in again!

Use session renew when a user logs in, so that the session used for
accessing the site as a visitor (not logged in user) and the session
used when the user is logged in, is not the same. Avoids session
hijacking!

Hope this helps you on the way,
   John

On Mar 30, 12:19 pm, Petr Vytlačil  wrote:
> Hi, I this know but I dont know how destroy session when user close
> windows.
> THX
>
> On 30 Bře, 11:10, John Andersen  wrote:
>
> > Use session destroy as stated in the CakePHP documentation 
> > athttp://book.cakephp.org/view/404/destroy
> > Enjoy,
> >    John
>
> > On Mar 30, 11:49 am, Petr Vytlačil  wrote:
>
> > > Hi i need destry sessions after close browser windows. I need logout
> > > user from admin section when he close browser windows. If now close
> > > browser windows and startup browser, he can go to admin section. I use
> > > CakePHP 1.2.
>
> > > THX
--~--~-~--~~~---~--~~
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread keyurvaghani

Hello Miles,

I have one more alternate way to prevent hidden control without doing
any kind of  directly changes into libarary helper file (form.php).

that is ...

 we can make out own custom helper with similar kind of function with
applied condition for not generating hidden while displaying multiple
checkboxes

for that we have to follow steps as below:

 1. make php helper file on location app/views/helpers/

 2. Make Helper Class like Helper and extends Helper as
base class.

class MultipleCheckboxHelper extends Helper { }

3. include required helpers by defining  var $helpers = array
('Html','Form'); into custom helper class.

4. here we need Html and Form so define $helpers array variable as
shown above.

5. Now, just copy select Function from Form.php (cake library helper
file) and paste it over here.

6. Rename function name and take for conflict naming conventions with
another existing function name

7. Find and Replace $this-> TO $this->Form->

8. Replace line where hidden element will be generated with $style
condition as below:

function selectMultiple($fieldName, $options = array(), $selected =
null, $attributes = array(), $showEmpty = '') {
 
 
if($style!='checkbox'){
  $select[] = $this->Form->hidden(null, array('value' => '', 'id'
=> null, 'secure' => false));
}
 .
 .

}

9. Open controller file where you need to use this helper and include
this custom helpers by defining array variable as below:

var $helpers = array('Form','Html','Javascript','MultipleCheckbox');

10. call method  from custom helpers into view files (.ctp / .thml) as
below:

"  Create Lead");
e($multipleCheckbox->selectMultiple
('ProfilePermissionsMaster.permission',$options1,NULL,array
('multiple'=>'checkbox' , 'separator'=>'  ','value'=>'1')));

 $options2=array(2=>"   Approve/Reject Lead");
 e($multipleCheckbox->selectMultiple
('ProfilePermissionsMaster.permission',$options2,NULL,array
('multiple'=>'checkbox' , 'separator'=>'  ','value'=>'2')));

?>

Note: we have to call helper methods with object name with small case
of first word like $multipleCheckbox->method( )


Please let me your view which is correct way that i should have to
follow

which is the most standard way as per cakephp rule or its MVC
structure.

Thanks and Regards,
Keyur.

On Mar 30, 2:39 pm, keyurvaghani  wrote:
> Hi Miles,
>
>   Thanks for your needful help.
>
>   But currently i am developing company product through pure cakephp
> 1.2  standards and i have to follow its conventions during whole
> development cycle.
>
>  currently i have created multiple check boxes using $form->select()
> with 'multiple'=>'checkbox' options.
>
>  For these reasons, i have three alternate for this solution in which
> i will prevent to generate these hidden controls while displaying
> multiple check boxes as below:
>
>  (1) First way is pass extra boolean parameter say $showHidden=true /
> false
>
>      based on above parameter i will hide line no#: 1190 from file
> cake library helper "form.php".
>      this line is executed from "select" Function.
>
>  (2) Second way is that in same file "form.php" and "select" Function
> on line No: 1187,
>
>      the variable $style get its value based on 'multiple' key and
> value attributes if it is 'checkbox' then stored same value otherwise
> null.
>
>     so i can use this $style variable as conditional variable for
> generating hidden control or not.
>
>   Means instead line no: 1190 as below:
>    $select[] = $this->hidden(null, array('value' => '', 'id' => null,
> 'secure' => false));
>
>   i will change it as below:
>
>   if($style!='checkbox'){
>
>          $select[] = $this->hidden(null, array('value' => '', 'id' =>
> null, 'secure' => false));
>
> }
>
>  (3) Third way is alternate way of above but in different way.
>
>     If we don't want any changes directly to "select" Function of
> Form.php library helper file, Then
>
>     - Just copy this "select" Function and Paste Above or below this
> function.
>     - Now, rename this function from "select" To say it "selectMultiple
> ( )" function.
>    - Then, put/change above line no:1190 with a condition of $style as
> displayed on 2nd way.
>
>  i can apply any of one among above alternatives through this way it
> will not auto generate hidden for multiple check boxes and post values
> with correct array that i want.
>
>  But even though i think this not standard way that i should follow.
>
>  so please let me know your ideas
>
> Best Regards,
> Keyur Vaghani.
> 
>
> On Mar 30, 12:11 pm, Miles J  wrote:
>
> > The only alternative is doing it manually.
>
> > 
>
> > You are unable to do it with the form helper.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, s

Re: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread keyurvaghani

Hi Miles,

  Thanks for your needful help.

  But currently i am developing company product through pure cakephp
1.2  standards and i have to follow its conventions during whole
development cycle.

 currently i have created multiple check boxes using $form->select()
with 'multiple'=>'checkbox' options.

 For these reasons, i have three alternate for this solution in which
i will prevent to generate these hidden controls while displaying
multiple check boxes as below:

 (1) First way is pass extra boolean parameter say $showHidden=true /
false

 based on above parameter i will hide line no#: 1190 from file
cake library helper "form.php".
 this line is executed from "select" Function.

 (2) Second way is that in same file "form.php" and "select" Function
on line No: 1187,

 the variable $style get its value based on 'multiple' key and
value attributes if it is 'checkbox' then stored same value otherwise
null.

so i can use this $style variable as conditional variable for
generating hidden control or not.

  Means instead line no: 1190 as below:
   $select[] = $this->hidden(null, array('value' => '', 'id' => null,
'secure' => false));

  i will change it as below:

  if($style!='checkbox'){

 $select[] = $this->hidden(null, array('value' => '', 'id' =>
null, 'secure' => false));
}


 (3) Third way is alternate way of above but in different way.

If we don't want any changes directly to "select" Function of
Form.php library helper file, Then

- Just copy this "select" Function and Paste Above or below this
function.
- Now, rename this function from "select" To say it "selectMultiple
( )" function.
   - Then, put/change above line no:1190 with a condition of $style as
displayed on 2nd way.


 i can apply any of one among above alternatives through this way it
will not auto generate hidden for multiple check boxes and post values
with correct array that i want.

 But even though i think this not standard way that i should follow.

 so please let me know your ideas

Best Regards,
Keyur Vaghani.


On Mar 30, 12:11 pm, Miles J  wrote:
> The only alternative is doing it manually.
>
> 
>
> You are unable to do it with the form helper.
--~--~-~--~~~---~--~~
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 destroy sessions after close browser windows

2009-03-30 Thread Petr Vytlačil

Hi, I this know but I dont know how destroy session when user close
windows.
THX

On 30 Bře, 11:10, John Andersen  wrote:
> Use session destroy as stated in the CakePHP documentation 
> athttp://book.cakephp.org/view/404/destroy
> Enjoy,
>    John
>
> On Mar 30, 11:49 am, Petr Vytlačil  wrote:
>
> > Hi i need destry sessions after close browser windows. I need logout
> > user from admin section when he close browser windows. If now close
> > browser windows and startup browser, he can go to admin section. I use
> > CakePHP 1.2.
>
> > THX
--~--~-~--~~~---~--~~
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 destroy sessions after close browser windows

2009-03-30 Thread John Andersen

Use session destroy as stated in the CakePHP documentation at
http://book.cakephp.org/view/404/destroy
Enjoy,
   John

On Mar 30, 11:49 am, Petr Vytlačil  wrote:
> Hi i need destry sessions after close browser windows. I need logout
> user from admin section when he close browser windows. If now close
> browser windows and startup browser, he can go to admin section. I use
> CakePHP 1.2.
>
> THX
--~--~-~--~~~---~--~~
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: Setting Layout for Scaffolding?

2009-03-30 Thread John Andersen

As far as I can understand from the documentation, you just replace
the default layout with your own.
The default layout can be found in  the "app/views/layout" folder.

Enjoy,
   John

On Mar 30, 10:42 am, bbf  wrote:
> I've searched the groups and Google and can't find an answer for this.
>
> How do I set a different layout for the scaffolding?
>
> Thanks for your help!
--~--~-~--~~~---~--~~
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: Paginate Find All Results

2009-03-30 Thread Flipflops

p.s. meant to say I've used this approcah in a number of situations
and it works well for me.

On Mar 30, 9:10 am, Flipflops  wrote:
> Hi
>
> Have you come across this 
> articlehttp://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-...
> ?
>
> I think the approach outlined in it might be worth looking at, in
> essence just build all your relationships inside paginate, as if it
> were just a bit of SQL...
>
> On Mar 30, 2:38 am, timtrice  wrote:
>
> > I have the following Find query to retrieve search results from my DB:
>
> >                         $this->set(
> >                                 'results',
> >                                 $this->Feed->FeedContent->find(
> >                                         'all',
> >                                         array(
> >                                                 'conditions' => 'MATCH( 
> > name, keywords, description, encoded )
> > AGAINST ( \'' . $keyword . '\')',
> >                                                 'fields' => '*, MATCH( 
> > name, keywords, description, encoded )
> > AGAINST( \'' . $keyword . '\' ) AS score '
> >                                         )
> >                                 )
> >                         );
>
> > I'd like to paginate the results but I absolutely cannot find a way
> > without generating errors.  I can't alter my paginate array I
> > immediately declared in my Controller because that array is also
> > controlling other actions I have set up perfectly.  I also do not want
> > to throw this code into another model as I see it as way too much
> > hassle to relate that Controller to the ones I have set up now.
>
> > Does anyone know about where I can find what I need to get this query
> > paginated?  I hate to have to write additional coding to do what
> > hoepfully will be easier than it seems with Cake.
>
> > 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
-~--~~~~--~~--~--~---



How destroy sessions after close browser windows

2009-03-30 Thread Petr Vytlačil

Hi i need destry sessions after close browser windows. I need logout
user from admin section when he close browser windows. If now close
browser windows and startup browser, he can go to admin section. I use
CakePHP 1.2.

THX
--~--~-~--~~~---~--~~
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: New Install - Where is the Dispatch

2009-03-30 Thread Martin Westin


> Fatal error: Class 'Dispatcher' not found in /var/www/vhosts/
> shakethembones.com/httpdocs/index.php on line 87

I could be wrong but that line is for a CakePHP 1.2 application (for
1.1 I have it at line 81)


> http://book.cakephp.org/view/308/Installing-CakePHPunder `Advanced
> Setup: Alternative Installation Options`. I have the tmp dir with 777,
> and my include paths, openbase dir etc in a vhost file contain the
> cake lib, app and webroot just to take them off the radar in terms of
> permissions.

And those instructions are for 1.1. So you may be having problems from
trying to follow the wrong guide.
This is for 1.2:
http://book.cakephp.org/view/35/Advanced-Installation




--~--~-~--~~~---~--~~
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: Hosting Migration Problem - The requested address was not found on this server

2009-03-30 Thread Martin Westin


Is the problem with actual html files of with CakePHP urls?

Cake uses mod_rewrite to manage pretty (meaningful) urls. Problems
like this (certainly if the urls are for Cake) usually have one of two
sources.

A configuration problem in Apache. Your site should be allowed to set
these rewrites but sometimes Apache is set to not read ".htaccess"
files in your site folders. The vhost in Apache should have "Allow
Override" set.

A missing ".htaccess" file (or two). When you move a website hidden
files sometimes get left behind. Macs do this constantly but an FTP-
client can also leave one of these files behind of you are not
careful.

/Martin


On Mar 29, 3:10 pm, jmdesign  wrote:
> Actually I may have spoken to soon...
>
> The URL's site-wide are incorrect, where they should be (for 
> example)http://www.websitehost.com/folder/index.htmlthey 
> arehttp://www.websitehost.com/index.html.
>
> Can anyone point me to where i need to go to configure this (assuming
> it's a simple thing to do)?
>
> Many thanks,
>
> James
--~--~-~--~~~---~--~~
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: Paginate Find All Results

2009-03-30 Thread Flipflops

Hi

Have you come across this article
http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/
?

I think the approach outlined in it might be worth looking at, in
essence just build all your relationships inside paginate, as if it
were just a bit of SQL...



On Mar 30, 2:38 am, timtrice  wrote:
> I have the following Find query to retrieve search results from my DB:
>
>                         $this->set(
>                                 'results',
>                                 $this->Feed->FeedContent->find(
>                                         'all',
>                                         array(
>                                                 'conditions' => 'MATCH( name, 
> keywords, description, encoded )
> AGAINST ( \'' . $keyword . '\')',
>                                                 'fields' => '*, MATCH( name, 
> keywords, description, encoded )
> AGAINST( \'' . $keyword . '\' ) AS score '
>                                         )
>                                 )
>                         );
>
> I'd like to paginate the results but I absolutely cannot find a way
> without generating errors.  I can't alter my paginate array I
> immediately declared in my Controller because that array is also
> controlling other actions I have set up perfectly.  I also do not want
> to throw this code into another model as I see it as way too much
> hassle to relate that Controller to the ones I have set up now.
>
> Does anyone know about where I can find what I need to get this query
> paginated?  I hate to have to write additional coding to do what
> hoepfully will be easier than it seems with Cake.
>
> 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: Security white paging (blackholes) on certain pages

2009-03-30 Thread Lamiunto

Are you using $form->end() ?
Also, if you want to populate your fields with Javascript, look for
form ID's that represent the model and field you're trying to find, so
if you're trying to edit the hidden "username" field in for the User
model, the field ID would be UserUsername, you could just use $
('UserUsername').value = '...' if you're using Prototype.

Remember when using the security component you must use the form
helper for all of your forms, most of the time this isn't a problem
because you can specify all kinds of information about your fields
quite easily with the form helper. I haven't come across any situation
yet where the form helper doesn't work correctly. Remember to start
forms with $form->create() and end them with $form->end().

On Mar 30, 2:22 pm, Miles J  wrote:
> It seems even if I use form helper, I still have the same problem.
>
> https://trac.cakephp.org/ticket/6254
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Setting Layout for Scaffolding?

2009-03-30 Thread bbf

I've searched the groups and Google and can't find an answer for this.

How do I set a different layout for the scaffolding?



Thanks for your help!
--~--~-~--~~~---~--~~
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: Cake PHP 1.2 - Need Help For Posting Mulitple Checkboxes

2009-03-30 Thread Miles J

The only alternative is doing it manually.



You are unable to do it with the form helper.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---