Migration from CakePHP 1.1.x to CakePHP 1.2.x - how to acces controller component from view?

2008-08-27 Thread Pizgin

Hi! Before was

$account = $this->controller->Session->read('Account');

On CakePHP 1.2.x this not work. Have error:

Undefined property:  View::$controller [APP/views/elements/cart.thtml,
line 3]

Tell me please how i can acces to controller component from the view?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: hasAndBelongsToMany - Pagination

2008-08-27 Thread Elmo

make sure you're not using version 1.2 stable. There were lots of
issues with HABTM relationships with that version. The version I found
works okay is the current RC, 1.2.0.7296 RC2

On Aug 27, 5:05 pm, lordojazz <[EMAIL PROTECTED]> wrote:
> I'm having problems in filtering results from the controller on
> hasAndBelongsToMany. Is there any other way to do this? can you please
> help me... I'm passing arguments on my controller, the argument then
> must be use to filter the results from hasAndBelongsToMany
> relationship.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SQL Server Express Connection

2008-08-27 Thread claryda

I figured this out. Being from the SQL Server full version camp I was
so used to port 1433. SQL Server Express since it can install multiple
instances on a machine uses Dynamic Ports. The port for your
particular SQL Server Instance can be found when enabling TCPIP. Just
right click, go to properties and the IP Address tab look at the
bottom of the dialog, there will be your dynamic port number.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to validate that a habtm has at least one association?

2008-08-27 Thread Joel Perras

>From your controller: debug($this->ModelName->hasOne) .
(You can substitute hasOne for whichever association that you're
looking for.)

>From here you can use count()/in_array()/array_values() to perform
whatever checks you might want on $this->ModelName-
>whateverAssociationYouWant.  Or you can get fancy and use the Cake
Set class.

Remember that when you are defining a model, you are creating a PHP
class with methods and member variables, so you can access them like
you would any other vanilla PHP class definition.

CakePHP is still PHP.

-Joel/jperras.

On Aug 27, 12:54 pm, MarcS <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have 2 models, Model1 and Model2.
> Is there a way that each Model1 is always associated with at least one
> Model2?
>
> I think I remember seeing this somewhere but I can't find it any more.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Need help on Open Source Subdomaining component I am trying to write

2008-08-27 Thread validkeys

Hey Guys,

I decided that it was time that I start trying to contribute to the OS
community. I have a very important project to me coming up and I am
going to be using subdomaing (company1.myapp.com, company2.myapp.com)
etc.

I wanted to write a component that could handle this instead of
copying and pasting a bunch of random broken code that I have found
all over the place into my bootstrap.php file

It is my first time trying to write something public and would really
like anyone's input on what I have done so far. I have written a lot
of notes and questions write in the code

Which can be found here: 
http://cakeforge.org/snippet/detail.php?type=snippet&id=225

The main goals are:

A) To include a component, like Auth, that automatically performs
functions without having to explicitly be called. Like finding if the
user is currently accessing the site via subdomain, if the subdomain
exists in the database, if they go to myapp.com where to send them,
allowing certain actions in the controller to not need Subdomain
validation, adding the subdomain company's id to the userScope array
in Auth (if the user is using Auth) to add additional login security..
The list goes on. What I have right now is working.

Anyone feedback would be greatly 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: radio buttons with form helper - lots of problems?

2008-08-27 Thread Mark (Germany)

thx for your answers

absolutly positive - adding the default value again everything is
fine.
the white screen i get them sometimes in connection with security
component,
and after some testing, it IS the security component.

@RichardAtHome:
the thing is, there are no logs at all! empty.. with debug = 2

and i think i know what is causing it.
the checkboxes have their "hidden" input field for a certain purpose.
for Cake (and its security component) mainly to recognize it as a
transfered form element.
as checkboxes (as well as my radio buttons) do not post any value at
all if not selected

so the radio buttons dont have any hidden fields - therefore
submitting a form with unselected radio
buttons
a) validation will not work on them (as cake thinks they are not
present in this form)
this is important to know - as it can cause major problems if the
content of the radio buttons triggers some things later on.
i had validation of some other fields linked to the selection of the
radio buttons. well, the problem now was, that none of them were
triggered.
so i had a bunch of "unvalidated" rows inserted into the database.
quite a security issue on some places maybe.
b) white screen of death with the security component, as the hash
value created for the form field (with the radio group) does not match
the
transmitted fields anymore. that was the problem i pointed out above.

What i did learn:
NEVER use radio buttons without hidden field for the default value
(hope this gets into cake core some time)
use a dummy default (as i did), or chose one of the existing ones as
default value.


One Question:

How can i use the Core Security Component without these white screens?
As pointed out above, no error logs, nothing.
this is not very convinient at all..

maybe some point there is a die() function invoked
but i would like to get a "normal" error page with a message - and not
just a dieing cake app :)




On 27 Aug., 11:17, RichardAtHome <[EMAIL PROTECTED]> wrote:
> What tram said... change the field to an Int. Mysql tinyint datatype
> has traditionally been used to store boolean data as MySQL doesn't
> have a boolean datatype.
>
> Alternatively, use a 1 byte char field.
>
> Or change your options to be
> null = Pending (the database default)
> 0 = Disapprove
> 1 = Approve
>
> Or use an enum. Note: enums are mysql specific and are not directly
> supported by cake. This doesn't mean you can't use them though (cake
> treats them as a standard varchar field). There are some behaviours
> out there that can help with enums.
>
> As to the white screen of death, check out the httpd error logs and
> the cake error logs (app/tmp/logs/error.log)
>
> On Aug 26, 11:45 pm, [EMAIL PROTECTED] wrote:
>
> > oh cmon you dont expect good anwers when you're bashing the fw like that ?
>
> > cake interprets int(1) as bool , its a design choice. you are welcome
> > to update the book.cakephp.org to reflect that.
>
> > "white screen of death" - sorry im not getting it with your code, you
> > sure the radio call is causing it ?
>
> > On 8/27/08, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
> > > oh my gosh
> > > cake again.. typical
>
> > > by using TINYINT(1) it is assumed that you have a checkbox toggle with
> > > 0 and 1 as values i guess.
> > > anyway, after changing it to TINYINT(2), this automagic correction is
> > > no longer active
> > > and my value now is -1 in the Database
> > > Where in the documentation did i miss that?
>
> > > Are there more of these automatic corrections where a normal cake user
> > > would not assume it?
>
> > > PS: about the white screen of death - anyway - are there any solutions
> > > to it?
> > > other than having to use a dummy "default"?
>
> > > thx mark
>
> > > On 26 Aug., 23:37, "Mark (Germany)" <[EMAIL PROTECTED]>
> > > wrote:
> > >> Well - CakePHP and Rapid Development can be two things that dont get
> > >> along with each other sometimes.. :)
> > >> i try for hours now...
>
> > >> first of all if you do not set a default value cake crashes completely
> > >> - white screen of death all of the sudden:
> > >> $form->input('status',array('type'=>'radio','options'=>array(1=>Disapprove',
>
> > >> 1=>'Approve'),'legend'=>false));
>
> > >> so i was forced (i really hate that - if i am forced to workaround
> > >> something) to add a dummy "pending" one:
> > >> $form->input('status',array('type'=>'radio','options'=>array(0=>'Pending',-1=>Disapprove',
>
> > >> 1=>'Approve'),'legend'=>false));
>
> > >> ok, so far so good, but
>
> > >> in the second code sample (i tried with both integer -1 0 1  and '-1'
> > >> '0' '-1'), the -1 always gets changed to 1 when saved to the database
> > >> - i debugged it and found out, that it is (inside of $this->data)
> > >> still -1 after validation and - i did not believe it - after having
> > >> saved the fields. so cake transformes it wrongly or something when
> > >> saving it.
>
> > >> the DB table setting is:
> > >> `status` tinyint(1) NOT NULL default '0' COMMENT '-1 dissa

Re: AD7six Upload Behaviour

2008-08-27 Thread José Pablo Orozco Marín

Now, in my Listing Model im using:

var $actsAs = array(
'ImageUpload' => array(
'fileField' => 'logo',
'allowedMime'=> array('image/jpeg', 'image/gif', 
'image/png', 'image/bmp'),
'allowedExt'=> array('jpeg', 'jpg', 'gif', 
'png', 'bmp'),
'allowedSize'=> '5',
'baseDir'=> '{APP}uploads',
'dirFormat'=> '{$class}/{$id}',
'fileFormat'=> '{$dir}/{$filename}',
'factoryMode'=> true
)
);

And i get the following errors:

Warning (2): mkdir() [http://php.net/function.mkdir]: Permission denied 
[CORE/cake/libs/folder.php, line 480]

Code | Context

$pathname="/my/httpdocs/app/uploads{$class}"
$mode="0755"
$nextPathname="/my/httpdocs/app"



*Query:* SELECT `Listing`.`id` FROM `mgc_listings` AS `Listing` WHERE 
`dir` = '{$class}/{$id}' AND `logo` = 'class_id_cmxform_divider.gif' LIMIT 1


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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



hasAndBelongsToMany - Pagination

2008-08-27 Thread lordojazz

I'm having problems in filtering results from the controller on
hasAndBelongsToMany. Is there any other way to do this? can you please
help me... I'm passing arguments on my controller, the argument then
must be use to filter the results from hasAndBelongsToMany
relationship.


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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: no database table

2008-08-27 Thread Abrar Arshad
On Wed, Aug 27, 2008 at 12:53 PM, BiraRai <[EMAIL PROTECTED]> wrote:

>
> How to does one tell cakephp controller not to use a database table?
>
>
> >
>   Re:

  so it means you dont want to use Model class,
 so you can do it by using it like this
 var $uses = array();
 it will not use any table for your controller.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: no database table

2008-08-27 Thread rtconner

var $uses = array()

On Aug 27, 1:53 pm, BiraRai <[EMAIL PROTECTED]> wrote:
> How to does one tell cakephp controller not to use a database table?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: AD7six Upload Behaviour

2008-08-27 Thread Josoroma

Hi AD7Six,

I was seeing your behaviors, they looks very cool and useful. I was
wondering how to use the upload and image_upload behaviors without
using the attachments table.
...can just be a file field in your products table, or a dedicated
'attachments' table...

My field is logo, im using the following actsAs in my Listing model.

var $actsAs = array(
'ImageUpload' => array(
'fileField' => 'logo',
'allowedMime'   => array('image/jpeg', 
'image/gif', 'image/png',
'image/bmp'),
'allowedExt'=> array('jpeg', 'jpg', 
'gif', 'png', 'bmp'),
'allowedSize'   => '5',
'allowedSizeUnits'  => 'MB',
'overwriteExisting' => true,
'autoCreateVersions'=> true,
'baseDir'   => 
'{APP}uploads',
'dirFormat' => '{class}',
'factoryMode'   => true
)
);


But i a get a lot of warnings.

Any help is welcome. Thank you.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake 1.2 Auth - Is someone logged in?

2008-08-27 Thread Kjell

Little hint:

You can add a $this->set into the AppController::beforeRender to
always read $this->Auth->user() and thus make its content available in
all views.

function beforeRender() {
   $this->set('auth', $this->Auth->user());
}

You can also do the same for your controllers, so you have that info
in all actions too

function beforeFilter() {
   $this->currentUser = $this->Auth->user();
   $this->isAuthed = !empty($this->currentUser);
}

And of course you could then use $this->currentUser for your
$this->set call instead of calling $this->Auth->user() again.

function beforeRender() {
   $this->set('auth', $this->currentUser);
   $this->set('isAuthed', $this->isAuthed);
}

In your views you can benefit from all that like so:





Happy baking :)

On Wed, Aug 27, 2008 at 9:23 PM, ar2oor <[EMAIL PROTECTED]> wrote:
>
> It's working on functions with $this->Auth->deny();
>
> but its not working on functions with $this->Auth->allow();
>
> ;/
>
> any ideas ?
>
> On 17 Sie, 12:36, francky06l <[EMAIL PROTECTED]> wrote:
>> The Auth login stores the user information in the Session  (with Auth
>> key).
>> The Auth->user() is actually a wrapper function to the session
>> Auth.User key.
>> The Auth logout function delete the informations from the session.
>>
>> Knowing this, you can use the Session component in controllers and the
>> session helper in views to detect the login status.
>>
>> in controllers:
>>
>> $this->Session->check('Auth.User.id') will return true if the user is
>> logged, you can also use $this->Auth->user('id').
>>
>> in views
>>
>> $session->check('Auth.User.id') will tell you if a user is logged, and
>> you can user $session->read('Auth.User') to retrieve the user's
>> information.
>>
>> hth
>>
>> On Aug 17, 2:31 am, "Bill Brisky" <[EMAIL PROTECTED]> wrote:
>>
>> > I'm starting off with Cake and enjoying it.  As confusing as the entire ACL
>> > world seems, I think I'm getting a grip on it.
>>
>> > One small current problem: How do you determine if someone is currently
>> > logged in?
>>
>> > Here is the situation:  I have a simple home page (pages/home.ctp) that
>> > simply that should display a "login" link (users/login) and if no one is
>> > currently logged in, a "logout" link (users/logout).  It seems simple 
>> > enough
>> > however, I can't seem to find a way to determine whether or not someone is
>> > logged in.
>>
>> > $loggedIn (Auth public variable as stated in docs) seems to always be false
>> > outside of actual Auth code.
>>
>> > $this->Auth->user() : After an initial login, this always seems to return a
>> > User object properly filled out, with the exception that person had 
>> > actually
>> > logged out.
>>
>> > So between an always false condition, and an always true condition, what
>> > does one do?  I have a feeling I'm missing something fundamental and will 
>> > be
>> > smacking my head on my desk after reading the solution.
>>
>> > More detail:
>>
>> > App_controller.php
>>
>> > Acl & Auth components in $components
>>
>> > Auth variables set in beforeFilter
>>
>> > Pages/Home.ctp
>>
>> > Typical Cake home page
>>
>> > Due to the lack of a controller (and thus a lack of access to data), I made
>> > a copy of the cake core pages_controller.php and moved it into my
>> > app/controllers directory.
>>
>> > Controllers/pages_controller.php
>>
>> > This is where I hope to set a variable (inside of display()) with login
>> > status and pass it to home.ctp.
>>
>> > Changes to this file are minimal: Added Auth & Session to $components.
>>
>> > Users_controller.php
>>
>> > Typical Auth login (no code) and logout (taken from examples).
>>
>> > Versions:
>>
>> > -  Windows XP
>>
>> > -  Xampp  v1.6.7
>>
>> > -  PHP v.5.2.6
>>
>> > -  Cake v1.2.0.7296rc2
>>
>> > Any and all help will be greatly appreciated.
>>
>> > B.
>>
>>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: no database table

2008-08-27 Thread clemos

http://manual.cakephp.org/view/66/models#usetable-436
please read the manual

On Wed, Aug 27, 2008 at 9:53 PM, BiraRai <[EMAIL PROTECTED]> wrote:
>
> How to does one tell cakephp controller not to use a database table?
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: no database table

2008-08-27 Thread Samuel DeVore

On Wed, Aug 27, 2008 at 12:53 PM, BiraRai <[EMAIL PROTECTED]> wrote:
>
> How to does one tell cakephp controller not to use a database table?

Controllers don't use database tables Models do.  See
http://book.cakephp.org/view/10/understanding-model-view-contr

but you might want a controller that doesn't use a Model (and hence a
db table) so see the section on Controller attributes.
http://book.cakephp.org/view/51/controller-attributes#components-helpers-and-uses-53

but essentially you will want to not $uses anything ;)


See the book in section on models

http://book.cakephp.org/view/66/models#usetable-436 section on
useTable covers how to have a model that is not DB backed

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



problem with multiple autocomplete

2008-08-27 Thread assaggaf

i got a proplem with make more than one autocomplete for the same
field
i cann't do this, it doesn't work:

echo $ajax->autoComplete('Product.name.1', array('controller' =>
'product', 'action' => 'autoComplete'));

the above code is not work!!!
how i can make autocomplete for m more than one product in the same
page ???


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



no database table

2008-08-27 Thread BiraRai

How to does one tell cakephp controller not to use a database table?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



problem with multiple autocomplete

2008-08-27 Thread assaggaf

Hi
i use auto complete and it work correctly with me
but when i try to make a multiple of its , it doesn't work

like:
echo $ajax->autoComplete('Product.name', array('controller' =>
'Product', 'action' => 'autoComplete'));

this code couldn't run

???

how i can do 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Do I have to change webroot config ? Cake Newbie

2008-08-27 Thread Sam Sherlock
editing views/pages/home.ctp might be a good place for you to start

The blog tutorial is simple. Since cake is MVC you'll have a model that gets
data from a corresponding table a controller that performs basic preparation
of that data and passes it to the view which then displays it

The blog tutorial introduces you to the way cake works and then you build
upon this using related models and using componants, helpers, behaviours etc

that said there is this - its a 1.1 tutorial though (but should work with
1.2)
http://deepbluespaces.blogspot.com/2008/05/cakephp-hello-world.html

2008/8/27 pmit <[EMAIL PROTECTED]>

>
> Thanks Chris, I think I will be able to make things work based on the
> advanced instalation.
> To quickly test my configuration is there a sort of a "Hello Cake
> World" program I could run
> after I try my setup to confirm it is working correctly ?
>
> I saw the Blog example in the book but would like something very
> simple to start with so
> I will be sure if I have problems that it is the configuration and not
> the code.
>
> Can you suggest anything of that sort.
>
> Thanks Charles.
>
> On Aug 26, 9:35 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> > On Mon, Aug 25, 2008 at 1:00 PM, pmit <[EMAIL PROTECTED]> wrote:
> > >  I am not clear about what to do next.
> > >  If I had to I could switch to development on a Mac but that would
> > > mean giving up the convenience of
> > >  developing on a laptop ?
> >
> > http://book.cakephp.org/view/32/installation
> >
> > --
> > Chris Hartjes
> > Motto for 2008: "Moving from herding elephants to handling snakes..."
> > @TheKeyBoard:http://www.littlehart.net/atthekeyboard
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please help me

2008-08-27 Thread Dardo Sordi Bogado

> the main problem is, that I don't have an accses to configuration
> files on the hosting, where I run my pages

Usually you don't need that.

Typical shared hosting setup:

/home/account/
  public_html <--- configured as document root
by hosting, put all the files in app/webroot here
  cake <--- cake core
  app <--- your app

Then edit public_html/index.php and adjust the constants.


> On Aug 27, 1:29 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> Try with a production setup: cake, app and webroot sepparated.
>>
>> On Tue, Aug 26, 2008 at 7:43 PM, lacithetemplar
>>
>>
>>
>> <[EMAIL PROTECTED]> wrote:
>>
>> > no, problem still remains :(
>>
>> > On Aug 26, 3:31 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>> >> may be try
>>
>> >> 
>> >> RewriteEngine on
>> >> RewriteRule/$ / [L]
>> >> RewriteRule^$/app/webroot/[L]
>> >> RewriteRule(.*) /app/webroot/$1[L]
>> >> 
>>
>> >> 2008/8/26 lacithetemplar <[EMAIL PROTECTED]>
>>
>> >> > so, can you help me to configure my .htaccess file?
>> >> > here is current configuration:
>>
>> >> > 
>> >> >   RewriteEngine on
>> >> >   RewriteRule^$ app/webroot/[L]
>> >> >   RewriteRule(.*) app/webroot/$1 [L]
>> >> > 
>>
>> >> > I don't know, where is problem, because at my localhost at home, it
>> >> > works fine
>>
>> >> > On Aug 26, 1:47 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> >> > > Then, your .htaccess are screwed, try accessing directly:
>> >> >http://mpw-test.netlife.sk/index.phpitgivesthe right page.
>>
>> >> > > Check your setup. This may help:
>> >> >http://book.cakephp.org/view/32/installation
>>
>> >> > > On Tue, Aug 26, 2008 at 5:05 AM, lacithetemplar
>>
>> >> > > <[EMAIL PROTECTED]> wrote:
>>
>> >> > > > it is fresh installation of cakephp, no changes in routes.php, only
>> >> > > > configured database.php
>>
>> >> > > > On Aug 25, 4:05 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> >> > > >> It seems like you screwed the routes, show us your
>> >> > APP/config/routes.php
>>
>> >> > > >> On Mon, Aug 25, 2008 at 6:41 AM, lacithetemplar
>>
>> >> > > >> <[EMAIL PROTECTED]> wrote:
>>
>> >> > > >> > Is here someone, who knows, how can I solve this problem with
>> >> > webroot
>> >> > > >> > athttp://mpw-test.netlife.sk/?
>> >> > > >> > thanks- Hide quoted text -
>>
>> >> > > >> - Show quoted text -- Hide quoted text -
>>
>> >> > > - Show quoted text -- Hide quoted text -
>>
>> >> - Show quoted text -- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake 1.2 Auth - Is someone logged in?

2008-08-27 Thread ar2oor

It's working on functions with $this->Auth->deny();

but its not working on functions with $this->Auth->allow();

;/

any ideas ?

On 17 Sie, 12:36, francky06l <[EMAIL PROTECTED]> wrote:
> The Auth login stores the user information in the Session  (with Auth
> key).
> The Auth->user() is actually a wrapper function to the session
> Auth.User key.
> The Auth logout function delete the informations from the session.
>
> Knowing this, you can use the Session component in controllers and the
> session helper in views to detect the login status.
>
> in controllers:
>
> $this->Session->check('Auth.User.id') will return true if the user is
> logged, you can also use $this->Auth->user('id').
>
> in views
>
> $session->check('Auth.User.id') will tell you if a user is logged, and
> you can user $session->read('Auth.User') to retrieve the user's
> information.
>
> hth
>
> On Aug 17, 2:31 am, "Bill Brisky" <[EMAIL PROTECTED]> wrote:
>
> > I'm starting off with Cake and enjoying it.  As confusing as the entire ACL
> > world seems, I think I'm getting a grip on it.
>
> > One small current problem: How do you determine if someone is currently
> > logged in?
>
> > Here is the situation:  I have a simple home page (pages/home.ctp) that
> > simply that should display a "login" link (users/login) and if no one is
> > currently logged in, a "logout" link (users/logout).  It seems simple enough
> > however, I can't seem to find a way to determine whether or not someone is
> > logged in.
>
> > $loggedIn (Auth public variable as stated in docs) seems to always be false
> > outside of actual Auth code.
>
> > $this->Auth->user() : After an initial login, this always seems to return a
> > User object properly filled out, with the exception that person had actually
> > logged out.
>
> > So between an always false condition, and an always true condition, what
> > does one do?  I have a feeling I'm missing something fundamental and will be
> > smacking my head on my desk after reading the solution.
>
> > More detail:
>
> > App_controller.php
>
> > Acl & Auth components in $components
>
> > Auth variables set in beforeFilter
>
> > Pages/Home.ctp
>
> > Typical Cake home page
>
> > Due to the lack of a controller (and thus a lack of access to data), I made
> > a copy of the cake core pages_controller.php and moved it into my
> > app/controllers directory.
>
> > Controllers/pages_controller.php
>
> > This is where I hope to set a variable (inside of display()) with login
> > status and pass it to home.ctp.
>
> > Changes to this file are minimal: Added Auth & Session to $components.
>
> > Users_controller.php
>
> > Typical Auth login (no code) and logout (taken from examples).
>
> > Versions:
>
> > -          Windows XP
>
> > -          Xampp  v1.6.7
>
> > -          PHP v.5.2.6
>
> > -          Cake v1.2.0.7296rc2
>
> > Any and all help will be greatly appreciated.
>
> > B.
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: is there a way to validate that a habtm has at least one association?

2008-08-27 Thread yaqoob

Hey,
I have a very similiar question so I wont create another thread:
I have Model1 which is associated HABTM with Model2 and Model3 (Firm
with Category and Subcategory), I'd like to validate that Firm has at
least one Category and one Subcategory.

And from the other side, how would I have to validate that Firm has at
most 2 Categories and 10 Subcategories? Is HABTM a proper relation in
that case? Or maybe I should put 12 foreign key fields in Firm
table... ?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Advanced searching with Paginator, HABTM

2008-08-27 Thread TonyP

I'm trying to create an advanced search page that can be used to
narrow results by several different fields including a few HABTM
tables.

Currently, I'm creating an array with all of the search conditions and
passing it to the paginator function. It worked great but I'm not sure
how to pass HABTM conditions in addition to my other find conditions.

I've had great success with one to many relationships but I can't
figure out many to many relationships.

Has anyone accomplished what I'm trying to describe? If so how?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread [EMAIL PROTECTED]

just an idea.

Try in beforeFilter of controller add next

if ($this->action == 'your json action name') {
  $this->RequestHandler->enabled = false;
}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread clemos

Hi

Maybe I'm missing something, but what he gets from his json queries is
only headers, no content.
So I guess his debug is already to 0, because otherwise the content
would at least be filled with the "" in the
end...
>From his first message, his problem is not about errors parsing the
JSON object with javascript, but rather about empty JSON pages...
That's why I advised him to put debug to 1 or 2, which is often what
you should do when your output is empty, because blank often hides
error messages...

+++
Clément

On Wed, Aug 27, 2008 at 6:19 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Add this to your view, because JSON can't be parsed if it presents any
> kind of text besides the JSON string and Cake presents it whe
> debugging is set to 2 or 1
> In your view
> echo $javascript->object($post);
> Configure::write('debug', 0);
> ?>
>
> This will disable the output from the debugging
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: best php mail engine smtp/pop for cake

2008-08-27 Thread ihti

try Zend_Mail
http://framework.zend.com/manual/en/zend.mail.html

On Aug 27, 6:31 pm, Yves <[EMAIL PROTECTED]> wrote:
> I've built an administration site in CAKE and would like to add simple
> email capability so emails sent and received are attached to the
> clients in the system. Not sure what the best route would be. Do I
> link it to a web-based mail client, or do I use a mail engine and put
> the viewing/creating/deleting of emails straight into my CAKE app?
> Requirements are:
>
> 1. Can receive emails by accessing an encrypted pop3 connection.
>
> 2. Can store emails in a database (with at least email address,
> subject and timestamp in separate fields from content)
>
> 2. Can send via encrypted smtp (not localhost) plain text emails and
> also store them in the database.
>
> 3. All sent and received emails are linked to a client table.
>
> Any advice would be very 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



is there a way to validate that a habtm has at least one association?

2008-08-27 Thread MarcS

Hi,

I have 2 models, Model1 and Model2.
Is there a way that each Model1 is always associated with at least one
Model2?

I think I remember seeing this somewhere but I can't find it any more.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using Console for Command Line (Cake Shell) Application

2008-08-27 Thread Rick

OK I got the args problem sorted out.  To get the args in a shell you
use $this->args.

However, I'd still like suggestions on the shell best practices for
code location.






On Aug 27, 9:33 am, Rick <[EMAIL PROTECTED]> wrote:
> I thought I would be able to use the 1.2 Console for a command line
> (cake shell) application that is closely associated with a web app.
> However afer a few hours of trying I was not able to figure out how to
> implement command line arguments the shell app.
>
> I tried something like
>
> cake appname argument
>
> which yielded something like "command missing".  Is it possible to run
> a generic app and send it command line arguments?
>
> What would be best practice for the application code?  All code in the
> vendor/shells directory?  I'm inclined to put the main() code in the
> app/... directories with only the main() in the shells directory to
> start the app.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



best php mail engine smtp/pop for cake

2008-08-27 Thread Yves

I've built an administration site in CAKE and would like to add simple
email capability so emails sent and received are attached to the
clients in the system. Not sure what the best route would be. Do I
link it to a web-based mail client, or do I use a mail engine and put
the viewing/creating/deleting of emails straight into my CAKE app?
Requirements are:

1. Can receive emails by accessing an encrypted pop3 connection.

2. Can store emails in a database (with at least email address,
subject and timestamp in separate fields from content)

2. Can send via encrypted smtp (not localhost) plain text emails and
also store them in the database.

3. All sent and received emails are linked to a client table.

Any advice would be very 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread [EMAIL PROTECTED]

Add this to your view, because JSON can't be parsed if it presents any
kind of text besides the JSON string and Cake presents it whe
debugging is set to 2 or 1
In your view
object($post);
Configure::write('debug', 0);
?>

This will disable the output from the debugging
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



User belongsTo Group problem?

2008-08-27 Thread Reza Muhammad

Hi,

I was trying to setup a relationship between User and Group through  
cake console. But I need help since there are strange things going on.

In my users table, I have these fields:
- id
- username
- password
- group_id

And, in my groups table, I have these fields:
- id
- name

I would like to have a one-to-many relationships between users and  
groups.  Meaning that Groups can have many users, and one user can  
belong to only one group
When I tried to build User Model through cake console, here's what I  
got:

Welcome to CakePHP v1.2.0.7296 RC2 Console
---
App : taxmate
Path: /Users/rezmuh/Sites/taxmate
---
Interactive Bake Shell
---
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[Q]uit
What would you like to Bake? (D/M/V/C/P/Q)
 > M
---
Bake Model
Path: /Users/rezmuh/Sites/taxmate/models/
---
Possible Models based on your current database:
1. Group
2. User
Enter a number from the list above, type in the name of another model,  
or 'q' to exit
[q] > 2
Would you like to supply validation criteria for the fields in your  
model? (y/n)
[y] > n
Would you like to define model associations (hasMany, hasOne,  
belongsTo, etc.)? (y/n)
[y] > y
One moment while the associations are detected.
---
None found.
Would you like to define some additional model associations? (y/n)
[n] > n


A similar weird message of "None found" shows up when I tried build  
Group Model.

Is this expected? Doesn't CakePHP allow me to have this type of  
relationship by default? Or would it work if I wrote var $hasMany =  
array(...) in Group Model and var $belongsTo = array(...) in User  
Model by hand?

Thank you for your help :)
-Reza

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Large $_POST variables crashing Controller startup

2008-08-27 Thread David

Hi there

Could it be something to do with your php.ini's post_max_size
directive value?

David

On Aug 27, 4:55 pm, neverlosty <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having an issue where I'm trying to post a very large (1M) string
> through http $_POST
>
> For some reason when cake is starting up, in
> cake/libs/controller/controller.php
> [line 387]  $this->Component->init($this);
>
> After that it just dies. When I try to debug the Component.php
> function init, it does not get called.
> This only happens when there is an excessively large $_POST.
>
> Has anyone ever had this issue?
>
> cheers,
> Tony.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Schema Could Not Be Loaded

2008-08-27 Thread blockedmind

Thanks a lot.

On 27 Ağustos, 17:09, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
wrote:
> This tells that you are outside your app dir, and you are not telling
> cake where it is:
>
> > Welcome to CakePHP v1.2.0.7296 RC2 Console
> > ---
> > App : console
> > Path: D:/Wamp/www/mysite/cake/console
> > ---
>
> Remember to specify the path to the app folder if you are outside of it.
>
> 1. In your app dir:
>
> $ /path/to/cake/console/cake schema run create DbAcl
>
> 2. Ouside your app dir:
>
> $ /path/to/cake/console/cake -app /path/to/app/dir schema run create DbAcl
>
> On Wed, Aug 27, 2008 at 6:55 AM, blockedmind <[EMAIL PROTECTED]> wrote:
>
> > D:\Wamp\www\mysite\cake\console>cake schema run help
>
> > Welcome to CakePHP v1.2.0.7296 RC2 Console
> > ---
> > App : console
> > Path: D:/Wamp/www/mysite/cake/console
> > ---
> > Cake Schema Shell
> > ---
> > Error: schema.php could not be loaded
>
> > I'd like to cake schema run create DbAcl. But I get this error with
> > every command realted schema.
> > What causes this? How can I resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Large $_POST variables crashing Controller startup

2008-08-27 Thread neverlosty

Hi,

I'm having an issue where I'm trying to post a very large (1M) string
through http $_POST

For some reason when cake is starting up, in
cake/libs/controller/controller.php
[line 387]  $this->Component->init($this);

After that it just dies. When I try to debug the Component.php
function init, it does not get called.
This only happens when there is an excessively large $_POST.

Has anyone ever had this issue?

cheers,
Tony.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->loginError

2008-08-27 Thread luigi7up

Of course I haven't

thnx it works.

On Aug 27, 12:40 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Have you added the code to your view to display the error?
>
> http://book.cakephp.org/view/564/displaying-auth-error-messages
>
> On Aug 27, 10:22 am, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > My
> > $this->Auth->loginError ='Invalid username or password';
> > won't show on login.ctp view
>
> > This is what I have in app_controller:
> >         var $components = array('Acl','Auth');
>
> >                 function beforeFilter(){
> >                         //Mijenja hash funkciju auth komponente iz 
> > defaultne u md5
> >                         Security::setHash('md5');
> >                         $this->Auth->fields = array('username' => 
> > 'username', 'password' =>
> > 'password');
> >                         $this->Auth->loginAction = array('controller' => 
> > 'users', 'action'
> > => 'login');
> >                         //$this->Auth->loginRedirect = array('controller' 
> > => 'users',
> > 'action' => 'index');
> >                         $this->Auth->loginError ='Invalid username or 
> > password';
> >                         $this->Auth->logoutRedirect = '/';
> >                         $this->Auth->authorize = 'controller';
>
> >                 }
>
> >                 /*When authorize is set to 'controller',
> >                 you'll need to add a method called isAuthorized() to your
> > controller.
> >                 This method allows you to do some more
> >                 authentication checks and then return either true or 
> > false.*/
>
> >                 function isAuthorized() {
> >                         return true;
> >                 }
> > In users_controller my login() is empty because Auth component
> > automagic
>
> > and when I debug my session with debug($_SESSION); I see that error is
> > sent, but it si always set - even when I call users/login action for
> > the first time (I mean without submiting wrong data)?!?!:
> > Array
> > (
> >     [Config] => Array
> >         (
> >             [userAgent] => 0f8a6ac2e2c891dce1f3f114fdaad715
> >             [time] => 1219830026
> >             [rand] => 32701
> >             [timeout] => 10
> >         )
>
> >     [Message] => Array
> >         (
> >             [auth] => Array
> >                 (
> >                     [message] => Invalid username or password
> >                     [layout] => default
> >                     [params] => Array
> >                         (
> >                         )
>
> >                 )
>
> >         )
>
> > How can I get this login error working?
>
> > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread RichardAtHome

Quote:
One thing I came across was the fact that the columns for created &
updated should be of the type datetime and Null should be set to
'null' and not 'not null'

Oops, forgot to mention that :-(

On Aug 27, 4:21 pm, teknoid <[EMAIL PROTECTED]> wrote:
> Makes sense that it works like that...
>
> how/where are you modifying the data if you are just doing a read()?
>
> On Aug 27, 5:02 am, "Marc Schuetze" <[EMAIL PROTECTED]> wrote:
>
> > According to the docs 'modified' and 'updated' are both ok.
> > I tried this with 'modified' as well and it was the same result
>
> > When I do $this->create(array(.)) and that array doesn't contain
> > an update field then everything is fine and cake sets the update field
> > properly.
> > However, when I do
> > $this->read(null,$id) the model's data array will contain the update
> > field and it seems like I'll then have to manually unset it if I want
> > to update the time in the field.
> > If I don't do that cake will not fill the update field with a new
> > value but will use the value that is is the model's data array
>
> > On Wed, Aug 27, 2008 at 10:58 AM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> > > The automagic fields should be called created and modified (not
> > > updated). You don't need to do anything else.
>
> > > On Aug 27, 8:29 am, MarcS <[EMAIL PROTECTED]> wrote:
> > >> Hi,
>
> > >> I just noticed that my 'updated' field won't update when I update
> > >> data.
> > >> I tried around for a while and then noticed that it won't update when
> > >> the 'update' field is included in the Model's data array.
> > >> But when I load data using Model::read(null,$id) the date fields are
> > >> obviously always included in the Model's data. Do I then need to
> > >> always manually unset them before saving?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread teknoid

Makes sense that it works like that...

how/where are you modifying the data if you are just doing a read()?

On Aug 27, 5:02 am, "Marc Schuetze" <[EMAIL PROTECTED]> wrote:
> According to the docs 'modified' and 'updated' are both ok.
> I tried this with 'modified' as well and it was the same result
>
> When I do $this->create(array(.)) and that array doesn't contain
> an update field then everything is fine and cake sets the update field
> properly.
> However, when I do
> $this->read(null,$id) the model's data array will contain the update
> field and it seems like I'll then have to manually unset it if I want
> to update the time in the field.
> If I don't do that cake will not fill the update field with a new
> value but will use the value that is is the model's data array
>
> On Wed, Aug 27, 2008 at 10:58 AM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> > The automagic fields should be called created and modified (not
> > updated). You don't need to do anything else.
>
> > On Aug 27, 8:29 am, MarcS <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> I just noticed that my 'updated' field won't update when I update
> >> data.
> >> I tried around for a while and then noticed that it won't update when
> >> the 'update' field is included in the Model's data array.
> >> But when I load data using Model::read(null,$id) the date fields are
> >> obviously always included in the Model's data. Do I then need to
> >> always manually unset them before saving?
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread clemos

Hi

As always, you should start by setting debug level to 2 in your
config/core.php, to see if there's any error displayed...

++
Clément

On Wed, Aug 27, 2008 at 2:36 PM, Jonathan <[EMAIL PROTECTED]> wrote:
>
> I did this http://www.pagebakers.nl/2007/06/05/using-json-in-
> cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers
> blog to get JSON working with my installation of CakePHP.
>
> Almost everything seems to be working fine. When I go to 
> http://localhost/mkb/index
> I get the page like normal and when I go to index.json I get a
> download dialog. I'm getting my JSON headers when I make a call with
> JQuery as well so it seems to be sending the JSON right.
>
> The problem is when I tried to get content with the JSON. I can't get
> it to give me any content, only the headers.
>
> Here's my javascript:
>
> $(document).ready(function() {
>$('.post').click(function(event) {
>event.preventDefault();
>var postId = $(this).children('.id').text();
>var postUrl = 'posts/view/post.json?='+postId+'';
>//inject a DIV container after the clicked title
>$(this).append('');
>
>$.getJSON(postUrl, function(data) {
>$('div[class="postContent 
> post'+postId+'"]').append(data);
>});
>
>//hide the post content of titles that do not have that same 
> id as
> the one clicked.
>$('.post').filter(function() {
>return $(this).children('.id').text() != postId;
>}).children('.postContent').css('display', 'none');
>});
> });
>
>
> Here's the headers I get back:
> Response Headers
> DateWed, 27 Aug 2008 12:35:14 GMT
> Server  Apache/2.2.8 (Win32) PHP/5.2.6
> X-Powered-ByPHP/5.2.6
> P3P CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
> Set-Cookie  CAKEPHP=deleted; expires=Tue, 28-Aug-2007 12:35:14 GMT;
> path=/mkb CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> CAKEPHP=49d5o6b48nf83q8q12lle0pt41; path=/mkb
> CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> Content-Length  2
> Keep-Alive  timeout=5, max=100
> Connection  Keep-Alive
> Content-Typetext/x-json; charset=UTF-8
> Request Headers
> Hostlocalhost
> User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1)
> Gecko/2008070208 Firefox/3.0.1
> Accept  application/json, text/javascript, */*
> Accept-Language en-us,en;q=0.5
> Accept-Encoding gzip,deflate
> Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive  300
> Connection  keep-alive
> X-Requested-WithXMLHttpRequest
> Referer http://localhost/mkb/
> Cookie  CAKEPHP=49d5o6b48nf83q8q12lle0pt41;
> CAKEPHP=02sc14jclvued57ghlaprj0j11
>
>
> Here's the View in the app:
> echo $javascript->object($post);
> ?>
>
> Any help would be awesome!
>
> Thanks Guys.
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Do I have to change webroot config ? Cake Newbie

2008-08-27 Thread pmit

Thanks Chris, I think I will be able to make things work based on the
advanced instalation.
To quickly test my configuration is there a sort of a "Hello Cake
World" program I could run
after I try my setup to confirm it is working correctly ?

I saw the Blog example in the book but would like something very
simple to start with so
I will be sure if I have problems that it is the configuration and not
the code.

Can you suggest anything of that sort.

Thanks Charles.

On Aug 26, 9:35 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 1:00 PM, pmit <[EMAIL PROTECTED]> wrote:
> >  I am not clear about what to do next.
> >  If I had to I could switch to development on a Mac but that would
> > mean giving up the convenience of
> >  developing on a laptop ?
>
> http://book.cakephp.org/view/32/installation
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please help me

2008-08-27 Thread lacithetemplar

the main problem is, that I don't have an accses to configuration
files on the hosting, where I run my pages
On Aug 27, 1:29 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Try with a production setup: cake, app and webroot sepparated.
>
> On Tue, Aug 26, 2008 at 7:43 PM, lacithetemplar
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > no, problem still remains :(
>
> > On Aug 26, 3:31 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> >> may be try
>
> >> 
> >>     RewriteEngine on
> >>     RewriteRule    /$ / [L]
> >>     RewriteRule    ^$    /app/webroot/    [L]
> >>     RewriteRule    (.*) /app/webroot/$1    [L]
> >> 
>
> >> 2008/8/26 lacithetemplar <[EMAIL PROTECTED]>
>
> >> > so, can you help me to configure my .htaccess file?
> >> > here is current configuration:
>
> >> > 
> >> >   RewriteEngine on
> >> >   RewriteRule    ^$ app/webroot/    [L]
> >> >   RewriteRule    (.*) app/webroot/$1 [L]
> >> > 
>
> >> > I don't know, where is problem, because at my localhost at home, it
> >> > works fine
>
> >> > On Aug 26, 1:47 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> > > Then, your .htaccess are screwed, try accessing directly:
> >> >http://mpw-test.netlife.sk/index.phpitgivesthe right page.
>
> >> > > Check your setup. This may help:
> >> >http://book.cakephp.org/view/32/installation
>
> >> > > On Tue, Aug 26, 2008 at 5:05 AM, lacithetemplar
>
> >> > > <[EMAIL PROTECTED]> wrote:
>
> >> > > > it is fresh installation of cakephp, no changes in routes.php, only
> >> > > > configured database.php
>
> >> > > > On Aug 25, 4:05 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> > > >> It seems like you screwed the routes, show us your
> >> > APP/config/routes.php
>
> >> > > >> On Mon, Aug 25, 2008 at 6:41 AM, lacithetemplar
>
> >> > > >> <[EMAIL PROTECTED]> wrote:
>
> >> > > >> > Is here someone, who knows, how can I solve this problem with
> >> > webroot
> >> > > >> > athttp://mpw-test.netlife.sk/?
> >> > > >> > thanks- Hide quoted text -
>
> >> > > >> - Show quoted text -- Hide quoted text -
>
> >> > > - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread David

Have you tried setting the header content-type to text/javascript,
rather than the text/x-json that you've got?

David

On Aug 27, 1:36 pm, Jonathan <[EMAIL PROTECTED]> wrote:
> I did this http://www.pagebakers.nl/2007/06/05/using-json-in-
> cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers
> blog to get JSON working with my installation of CakePHP.
>
> Almost everything seems to be working fine. When I go 
> tohttp://localhost/mkb/index
> I get the page like normal and when I go to index.json I get a
> download dialog. I'm getting my JSON headers when I make a call with
> JQuery as well so it seems to be sending the JSON right.
>
> The problem is when I tried to get content with the JSON. I can't get
> it to give me any content, only the headers.
>
> Here's my javascript:
>
> $(document).ready(function() {
>         $('.post').click(function(event) {
>                 event.preventDefault();
>                 var postId = $(this).children('.id').text();
>                 var postUrl = 'posts/view/post.json?='+postId+'';
>                 //inject a DIV container after the clicked title
>                 $(this).append('');
>
>                 $.getJSON(postUrl, function(data) {
>                         $('div[class="postContent 
> post'+postId+'"]').append(data);
>                 });
>
>                 //hide the post content of titles that do not have that same 
> id as
> the one clicked.
>                 $('.post').filter(function() {
>                         return $(this).children('.id').text() != postId;
>                 }).children('.postContent').css('display', 'none');
>         });
>
> });
>
> Here's the headers I get back:
> Response Headers
> Date    Wed, 27 Aug 2008 12:35:14 GMT
> Server  Apache/2.2.8 (Win32) PHP/5.2.6
> X-Powered-By    PHP/5.2.6
> P3P     CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
> Set-Cookie      CAKEPHP=deleted; expires=Tue, 28-Aug-2007 12:35:14 GMT;
> path=/mkb CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> CAKEPHP=49d5o6b48nf83q8q12lle0pt41; path=/mkb
> CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> Content-Length  2
> Keep-Alive      timeout=5, max=100
> Connection      Keep-Alive
> Content-Type    text/x-json; charset=UTF-8
> Request Headers
> Host    localhost
> User-Agent      Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1)
> Gecko/2008070208 Firefox/3.0.1
> Accept  application/json, text/javascript, */*
> Accept-Language en-us,en;q=0.5
> Accept-Encoding gzip,deflate
> Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive      300
> Connection      keep-alive
> X-Requested-With        XMLHttpRequest
> Refererhttp://localhost/mkb/
> Cookie  CAKEPHP=49d5o6b48nf83q8q12lle0pt41;
> CAKEPHP=02sc14jclvued57ghlaprj0j11
>
> Here's the View in the app:
>          echo $javascript->object($post);
> ?>
>
> Any help would be awesome!
>
> Thanks Guys.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Show errormessages

2008-08-27 Thread mark_story

On Aug 26, 12:05 pm, worthy <[EMAIL PROTECTED]> wrote:
> I have the exact same problem but i am assigning the errormessages in
> the view and not in the model.
>
> Lets say i have 2 validation rules required, length for the field
> title.
>
> var $validate = array (
> 'title' => array(
> 'required' => array('rule'=> VALID_NOT_EMPTY),
> 'length'   => array('rule'=>array('maxLength',100))
> )
> );
>
> If i now give the form helper the error array with those 2 conditions
> in the view like this
>
> input('titel', array( 'error' =>
> array(
> 'required'=>'Bitte 
> dieses Feld ausfüllen',
> 'length'  =>'Das Feld 
> darf nicht mehr als 100 Zeichen
> enthalten'
> )
> )
> );?>
>
> there won't be displayed any of those error messages and even the
> default error messages are not displayed.
>
> I hope somebody can tell me why und help me out with this.
>
> Thanks in advance
> worthy
>
> On 25 Aug., 19:32, Jim-Bingo <[EMAIL PROTECTED]> wrote:
>
> > How do I show the errormessages that I specified in the model? like
> > this:  'message' => 'An errormessage'

You spelt title differently between the field and the validation
array.  I don't know if what is posted is the same as your view and
model code.  But that would make it not work.

-Mark
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Schema Could Not Be Loaded

2008-08-27 Thread Dardo Sordi Bogado

This tells that you are outside your app dir, and you are not telling
cake where it is:

> Welcome to CakePHP v1.2.0.7296 RC2 Console
> ---
> App : console
> Path: D:/Wamp/www/mysite/cake/console
> ---


Remember to specify the path to the app folder if you are outside of it.

1. In your app dir:

$ /path/to/cake/console/cake schema run create DbAcl

2. Ouside your app dir:

$ /path/to/cake/console/cake -app /path/to/app/dir schema run create DbAcl



On Wed, Aug 27, 2008 at 6:55 AM, blockedmind <[EMAIL PROTECTED]> wrote:
>
> D:\Wamp\www\mysite\cake\console>cake schema run help
>
> Welcome to CakePHP v1.2.0.7296 RC2 Console
> ---
> App : console
> Path: D:/Wamp/www/mysite/cake/console
> ---
> Cake Schema Shell
> ---
> Error: schema.php could not be loaded
>
> I'd like to cake schema run create DbAcl. But I get this error with
> every command realted schema.
> What causes this? How can I resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Schema Could Not Be Loaded

2008-08-27 Thread Dardo Sordi Bogado

http://book.cakephp.org/view/467/defining-permissions-cake-s-da

cake schema help
cake schema run create DbAcl



On Wed, Aug 27, 2008 at 6:55 AM, blockedmind <[EMAIL PROTECTED]> wrote:
>
> D:\Wamp\www\mysite\cake\console>cake schema run help
>
> Welcome to CakePHP v1.2.0.7296 RC2 Console
> ---
> App : console
> Path: D:/Wamp/www/mysite/cake/console
> ---
> Cake Schema Shell
> ---
> Error: schema.php could not be loaded
>
> I'd like to cake schema run create DbAcl. But I get this error with
> every command realted schema.
> What causes this? How can I resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Association recursive hasMany

2008-08-27 Thread Guillaume

$this->Model1->contain(array('Model2"=>"Model3"); should work.

$this->Model1->contain( 'Model2.Model3'); too

http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings

Guillaume
--
http://cherryonthe.popnews.com


On 27 août, 14:49, vj <[EMAIL PROTECTED]> wrote:
> I have 3 Models having following association:
>
> Model1 hasMany Model2
> Model2 belongsTo Model1
> Model2 hasMany Model3
> Model3 belongsTo Model2
>
> I had primary key value of Model1 and want to retrieve All Information
> from Model3.
>
> But
> $this->Model1->contain( 'Model2',
>                                     'Model2.Model3'
>                                  )
>
> won't give me Data from Model3,Instead it shows blank array.
>
> Can any one resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Using Console for Command Line (Cake Shell) Application

2008-08-27 Thread Rick

I thought I would be able to use the 1.2 Console for a command line
(cake shell) application that is closely associated with a web app.
However afer a few hours of trying I was not able to figure out how to
implement command line arguments the shell app.

I tried something like

cake appname argument

which yielded something like "command missing".  Is it possible to run
a generic app and send it command line arguments?

What would be best practice for the application code?  All code in the
vendor/shells directory?  I'm inclined to put the main() code in the
app/... directories with only the main() in the shells directory to
start the app.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: JQuery + JSON

2008-08-27 Thread Dardo Sordi Bogado

Have you added Javascript to the helpers array? And maybe you can
paste some code at bin.cakephp.org...

On Wed, Aug 27, 2008 at 9:36 AM, Jonathan <[EMAIL PROTECTED]> wrote:
>
> I did this http://www.pagebakers.nl/2007/06/05/using-json-in-
> cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers
> blog to get JSON working with my installation of CakePHP.
>
> Almost everything seems to be working fine. When I go to 
> http://localhost/mkb/index
> I get the page like normal and when I go to index.json I get a
> download dialog. I'm getting my JSON headers when I make a call with
> JQuery as well so it seems to be sending the JSON right.
>
> The problem is when I tried to get content with the JSON. I can't get
> it to give me any content, only the headers.
>
> Here's my javascript:
>
> $(document).ready(function() {
>$('.post').click(function(event) {
>event.preventDefault();
>var postId = $(this).children('.id').text();
>var postUrl = 'posts/view/post.json?='+postId+'';
>//inject a DIV container after the clicked title
>$(this).append('');
>
>$.getJSON(postUrl, function(data) {
>$('div[class="postContent 
> post'+postId+'"]').append(data);
>});
>
>//hide the post content of titles that do not have that same 
> id as
> the one clicked.
>$('.post').filter(function() {
>return $(this).children('.id').text() != postId;
>}).children('.postContent').css('display', 'none');
>});
> });
>
>
> Here's the headers I get back:
> Response Headers
> DateWed, 27 Aug 2008 12:35:14 GMT
> Server  Apache/2.2.8 (Win32) PHP/5.2.6
> X-Powered-ByPHP/5.2.6
> P3P CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
> Set-Cookie  CAKEPHP=deleted; expires=Tue, 28-Aug-2007 12:35:14 GMT;
> path=/mkb CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> CAKEPHP=49d5o6b48nf83q8q12lle0pt41; path=/mkb
> CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
> Content-Length  2
> Keep-Alive  timeout=5, max=100
> Connection  Keep-Alive
> Content-Typetext/x-json; charset=UTF-8
> Request Headers
> Hostlocalhost
> User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1)
> Gecko/2008070208 Firefox/3.0.1
> Accept  application/json, text/javascript, */*
> Accept-Language en-us,en;q=0.5
> Accept-Encoding gzip,deflate
> Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive  300
> Connection  keep-alive
> X-Requested-WithXMLHttpRequest
> Referer http://localhost/mkb/
> Cookie  CAKEPHP=49d5o6b48nf83q8q12lle0pt41;
> CAKEPHP=02sc14jclvued57ghlaprj0j11
>
>
> Here's the View in the app:
> echo $javascript->object($post);
> ?>
>
> Any help would be awesome!
>
> Thanks Guys.
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



JQuery + JSON

2008-08-27 Thread Jonathan

I did this http://www.pagebakers.nl/2007/06/05/using-json-in-
cakephp-12/"Using JSON in CakePHP 1.2> tutorial from the Pagebakers
blog to get JSON working with my installation of CakePHP.

Almost everything seems to be working fine. When I go to 
http://localhost/mkb/index
I get the page like normal and when I go to index.json I get a
download dialog. I'm getting my JSON headers when I make a call with
JQuery as well so it seems to be sending the JSON right.

The problem is when I tried to get content with the JSON. I can't get
it to give me any content, only the headers.

Here's my javascript:

$(document).ready(function() {
$('.post').click(function(event) {
event.preventDefault();
var postId = $(this).children('.id').text();
var postUrl = 'posts/view/post.json?='+postId+'';
//inject a DIV container after the clicked title
$(this).append('');

$.getJSON(postUrl, function(data) {
$('div[class="postContent 
post'+postId+'"]').append(data);
});

//hide the post content of titles that do not have that same id 
as
the one clicked.
$('.post').filter(function() {
return $(this).children('.id').text() != postId;
}).children('.postContent').css('display', 'none');
});
});


Here's the headers I get back:
Response Headers
DateWed, 27 Aug 2008 12:35:14 GMT
Server  Apache/2.2.8 (Win32) PHP/5.2.6
X-Powered-ByPHP/5.2.6
P3P CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Set-Cookie  CAKEPHP=deleted; expires=Tue, 28-Aug-2007 12:35:14 GMT;
path=/mkb CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
CAKEPHP=49d5o6b48nf83q8q12lle0pt41; path=/mkb
CAKEPHP=mvn519u59tk7kapp9asr4scq91; path=/mkb
Content-Length  2
Keep-Alive  timeout=5, max=100
Connection  Keep-Alive
Content-Typetext/x-json; charset=UTF-8
Request Headers
Hostlocalhost
User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1)
Gecko/2008070208 Firefox/3.0.1
Accept  application/json, text/javascript, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  300
Connection  keep-alive
X-Requested-WithXMLHttpRequest
Referer http://localhost/mkb/
Cookie  CAKEPHP=49d5o6b48nf83q8q12lle0pt41;
CAKEPHP=02sc14jclvued57ghlaprj0j11


Here's the View in the app:
object($post);
?>

Any help would be awesome!

Thanks Guys.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Association recursive hasMany

2008-08-27 Thread vj

I have 3 Models having following association:

Model1 hasMany Model2
Model2 belongsTo Model1
Model2 hasMany Model3
Model3 belongsTo Model2

I had primary key value of Model1 and want to retrieve All Information
from Model3.

But
$this->Model1->contain( 'Model2',
'Model2.Model3'
 )

won't give me Data from Model3,Instead it shows blank array.

Can any one resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Class XML :: Error on function toArray

2008-08-27 Thread Dardo Sordi Bogado

trac.cakephp.org

On Wed, Aug 27, 2008 at 7:04 AM, MBmax <[EMAIL PROTECTED]> wrote:
>
> It's also happening with Set::reverse($xml)
>
> ;-(
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please help me

2008-08-27 Thread Dardo Sordi Bogado

Try with a production setup: cake, app and webroot sepparated.

On Tue, Aug 26, 2008 at 7:43 PM, lacithetemplar
<[EMAIL PROTECTED]> wrote:
>
> no, problem still remains :(
>
> On Aug 26, 3:31 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>> may be try
>>
>> 
>> RewriteEngine on
>> RewriteRule/$ / [L]
>> RewriteRule^$/app/webroot/[L]
>> RewriteRule(.*) /app/webroot/$1[L]
>> 
>>
>> 2008/8/26 lacithetemplar <[EMAIL PROTECTED]>
>>
>>
>>
>>
>>
>> > so, can you help me to configure my .htaccess file?
>> > here is current configuration:
>>
>> > 
>> >   RewriteEngine on
>> >   RewriteRule^$ app/webroot/[L]
>> >   RewriteRule(.*) app/webroot/$1 [L]
>> > 
>>
>> > I don't know, where is problem, because at my localhost at home, it
>> > works fine
>>
>> > On Aug 26, 1:47 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> > > Then, your .htaccess are screwed, try accessing directly:
>> >http://mpw-test.netlife.sk/index.phpitgives the right page.
>>
>> > > Check your setup. This may help:
>> >http://book.cakephp.org/view/32/installation
>>
>> > > On Tue, Aug 26, 2008 at 5:05 AM, lacithetemplar
>>
>> > > <[EMAIL PROTECTED]> wrote:
>>
>> > > > it is fresh installation of cakephp, no changes in routes.php, only
>> > > > configured database.php
>>
>> > > > On Aug 25, 4:05 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> > > >> It seems like you screwed the routes, show us your
>> > APP/config/routes.php
>>
>> > > >> On Mon, Aug 25, 2008 at 6:41 AM, lacithetemplar
>>
>> > > >> <[EMAIL PROTECTED]> wrote:
>>
>> > > >> > Is here someone, who knows, how can I solve this problem with
>> > webroot
>> > > >> > athttp://mpw-test.netlife.sk/?
>> > > >> > thanks- Hide quoted text -
>>
>> > > >> - Show quoted text -- Hide quoted text -
>>
>> > > - Show quoted text -- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread oleonav

One thing I came across was the fact that the columns for created &
updated should be of the type datetime and Null should be set to
'null' and not 'not null'

Hope this helps.

Olav

On Aug 27, 11:02 am, "Marc Schuetze" <[EMAIL PROTECTED]> wrote:
> According to the docs 'modified' and 'updated' are both ok.
> I tried this with 'modified' as well and it was the same result
>
> When I do $this->create(array(.)) and that array doesn't contain
> an update field then everything is fine and cake sets the update field
> properly.
> However, when I do
> $this->read(null,$id) the model's data array will contain the update
> field and it seems like I'll then have to manually unset it if I want
> to update the time in the field.
> If I don't do that cake will not fill the update field with a new
> value but will use the value that is is the model's data array
>
> On Wed, Aug 27, 2008 at 10:58 AM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> > The automagic fields should be called created and modified (not
> > updated). You don't need to do anything else.
>
> > On Aug 27, 8:29 am, MarcS <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> I just noticed that my 'updated' field won't update when I update
> >> data.
> >> I tried around for a while and then noticed that it won't update when
> >> the 'update' field is included in the Model's data array.
> >> But when I load data using Model::read(null,$id) the date fields are
> >> obviously always included in the Model's data. Do I then need to
> >> always manually unset them before saving?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread AussieFreelancer

I may be wrong here, but I think I may have resolved the issue... the
security I had tried on medium and low also, but that had no impact.
This time, I have set the sessions to 'cake' as opposed to 'php' and
in the last few minutes, it has logged me in and not kicked me out
yet... time will tell, but it looks like there may have been a config
setting with the host php that was conflicting or something...

On Aug 27, 6:38 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
> I had exactly this issue before but setting the security setting from
> High to Medium fixed it for me.
>
> Check your httpd error logs for any warnings about missing files/
> images etc.
>
> On Aug 27, 11:23 am, AussieFreelancer
>
> <[EMAIL PROTECTED]> wrote:
> > ok, so no whitespace, but still not sure what is causing it.. still
> > the same issue, doesn't seem to like the sessions very much and kicks
> > me out randomly... has no-one had this before?
>
> > On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > > Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> > > On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
> > > <[EMAIL PROTECTED]> wrote:
>
> > > > Hmm, I changed it from High to Medium with no effect, and also to Low
> > > > without having any effect either... I will double check the links for
> > > > non-existent files, this could be something to do with it, as if i
> > > > press refresh a couple of times quickly it logs me out, not sure this
> > > > is what is happening every time, but I know that refreshing twice fast
> > > > certainly does it...
>
> > > > So no known issues with sessions and Zeus or anything like that?
>
> > > > Thanks
>
> > > > Patrick
>
> > > > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > > > wrote:
> > > >> This is probably not server-specific, but on one application I was
> > > >> building it took me ages to realise why sometimes I was getting logged
> > > >> out and other times not. I eventually realised that I had a CSS link
> > > >> that was pointing at a non-existent file, and this caused the page to
> > > >> continue trying to load it in the background. If I cancelled the page
> > > >> loading prematurely by clicking on a link and visiting another page, I
> > > >> would stay logged in. But if I allowed the page to complete its
> > > >> loading, it would log me out. When I corrected the broken link it
> > > >> behaved fine again.
>
> > > >> That was not using the latest release so perhaps newer versions are
> > > >> OK.
>
> > > >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> > > >> wrote:
>
> > > >> > Hello, I have a client who's website is hosted on a server powered by
> > > >> > zeus instead of apache. I have already run into issues with the
> > > >> > rewrite which are now resolved, but there seems to also be an issue
> > > >> > with the Auth components...
>
> > > >> > I have an administration panel as a plugin, which works on other
> > > >> > sites, but for some reason, on this particular site, it randomly 
> > > >> > kicks
> > > >> > the user out. Sometimes I can't even get to one page without it
> > > >> > kicking me out, other times i can update 5 things and then it will
> > > >> > kick me out... does anyone know why this is? I have security set to
> > > >> > low, I thought that maybe it was to do with that but doesn't seem to
> > > >> > have made a difference...
>
> > > >> > Would love to hear any suggestions on how to resolve this as the 
> > > >> > admin
> > > >> > panel isnt really usable until it is fixed..
>
> > > >> > Thanks
>
> > > >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->loginError

2008-08-27 Thread RichardAtHome

Have you added the code to your view to display the error?

http://book.cakephp.org/view/564/displaying-auth-error-messages



On Aug 27, 10:22 am, luigi7up <[EMAIL PROTECTED]> wrote:
> My
> $this->Auth->loginError ='Invalid username or password';
> won't show on login.ctp view
>
> This is what I have in app_controller:
>         var $components = array('Acl','Auth');
>
>                 function beforeFilter(){
>                         //Mijenja hash funkciju auth komponente iz defaultne 
> u md5
>                         Security::setHash('md5');
>                         $this->Auth->fields = array('username' => 'username', 
> 'password' =>
> 'password');
>                         $this->Auth->loginAction = array('controller' => 
> 'users', 'action'
> => 'login');
>                         //$this->Auth->loginRedirect = array('controller' => 
> 'users',
> 'action' => 'index');
>                         $this->Auth->loginError ='Invalid username or 
> password';
>                         $this->Auth->logoutRedirect = '/';
>                         $this->Auth->authorize = 'controller';
>
>                 }
>
>                 /*When authorize is set to 'controller',
>                 you'll need to add a method called isAuthorized() to your
> controller.
>                 This method allows you to do some more
>                 authentication checks and then return either true or false.*/
>
>                 function isAuthorized() {
>                         return true;
>                 }
> In users_controller my login() is empty because Auth component
> automagic
>
> and when I debug my session with debug($_SESSION); I see that error is
> sent, but it si always set - even when I call users/login action for
> the first time (I mean without submiting wrong data)?!?!:
> Array
> (
>     [Config] => Array
>         (
>             [userAgent] => 0f8a6ac2e2c891dce1f3f114fdaad715
>             [time] => 1219830026
>             [rand] => 32701
>             [timeout] => 10
>         )
>
>     [Message] => Array
>         (
>             [auth] => Array
>                 (
>                     [message] => Invalid username or password
>                     [layout] => default
>                     [params] => Array
>                         (
>                         )
>
>                 )
>
>         )
>
> How can I get this login error working?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread RichardAtHome

I had exactly this issue before but setting the security setting from
High to Medium fixed it for me.

Check your httpd error logs for any warnings about missing files/
images etc.

On Aug 27, 11:23 am, AussieFreelancer
<[EMAIL PROTECTED]> wrote:
> ok, so no whitespace, but still not sure what is causing it.. still
> the same issue, doesn't seem to like the sessions very much and kicks
> me out randomly... has no-one had this before?
>
> On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> > On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Hmm, I changed it from High to Medium with no effect, and also to Low
> > > without having any effect either... I will double check the links for
> > > non-existent files, this could be something to do with it, as if i
> > > press refresh a couple of times quickly it logs me out, not sure this
> > > is what is happening every time, but I know that refreshing twice fast
> > > certainly does it...
>
> > > So no known issues with sessions and Zeus or anything like that?
>
> > > Thanks
>
> > > Patrick
>
> > > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > > wrote:
> > >> This is probably not server-specific, but on one application I was
> > >> building it took me ages to realise why sometimes I was getting logged
> > >> out and other times not. I eventually realised that I had a CSS link
> > >> that was pointing at a non-existent file, and this caused the page to
> > >> continue trying to load it in the background. If I cancelled the page
> > >> loading prematurely by clicking on a link and visiting another page, I
> > >> would stay logged in. But if I allowed the page to complete its
> > >> loading, it would log me out. When I corrected the broken link it
> > >> behaved fine again.
>
> > >> That was not using the latest release so perhaps newer versions are
> > >> OK.
>
> > >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> > >> wrote:
>
> > >> > Hello, I have a client who's website is hosted on a server powered by
> > >> > zeus instead of apache. I have already run into issues with the
> > >> > rewrite which are now resolved, but there seems to also be an issue
> > >> > with the Auth components...
>
> > >> > I have an administration panel as a plugin, which works on other
> > >> > sites, but for some reason, on this particular site, it randomly kicks
> > >> > the user out. Sometimes I can't even get to one page without it
> > >> > kicking me out, other times i can update 5 things and then it will
> > >> > kick me out... does anyone know why this is? I have security set to
> > >> > low, I thought that maybe it was to do with that but doesn't seem to
> > >> > have made a difference...
>
> > >> > Would love to hear any suggestions on how to resolve this as the admin
> > >> > panel isnt really usable until it is fixed..
>
> > >> > Thanks
>
> > >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Schema Could Not Be Loaded

2008-08-27 Thread blockedmind

D:\Wamp\www\mysite\cake\console>cake schema run help

Welcome to CakePHP v1.2.0.7296 RC2 Console
---
App : console
Path: D:/Wamp/www/mysite/cake/console
---
Cake Schema Shell
---
Error: schema.php could not be loaded

I'd like to cake schema run create DbAcl. But I get this error with
every command realted schema.
What causes this? How can I resolve 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to join two tables of two different databases

2008-08-27 Thread sree


Hi Majna,
   Thanks for ur reply. but persistent connections in database.php
were set to false and the association is hasOne for my tables.

I am placing my code here ,

 Tables : coupons (in AAA database), Retailers(in BBB database)

Coupon Model:

class Coupon extends AppModel
{
public $useTable = 'coupons';
public $useDbConfig = 'AAA';
public $primaryKey = 'coupon_id'; // id is the field name in the
database
public $hasOne=array(
//  join coupons_map which is 
in same database as coupons
'CouponsMap' => array(
'className' => 'CouponsMap',
'foreignKey' => false,
'conditions' => 
'Coupon.coupon_id=CouponsMap.coupon_id',
'type' => 'INNER'
),
   // joins retailer table
which is in another database
'Retailer' => array(
'className' => 'Retailer',
'foreignKey' => false,
'conditions' => 
'Coupon.retid=Retailer.retid',
'type' => 'INNER'
)
);
}

Retailer Model:

class Retailer extends AppModel
{
public $useTable = 'retailers';
public $useDbConfig = 'BBB';
public $primaryKey = 'retid'; // id is the field name in the database
}

* $useDbConfig variables are set  in database.php with their
respective details.

when execute this i m getting a query which is only bringing Retailer
columns without joining it with Coupon table.

I hope u got my problem.

Thanks,
Sreekanth


On Aug 27, 1:57 pm, majna <[EMAIL PROTECTED]> wrote:
> http://groups.google.com/group/cake-php/browse_thread/thread/d33b55ff...
> - Do not use persistent connections in database config
> - HABTM associations wont work here
>
> On Aug 27, 9:25 am, sree <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I am unable to join two tables of two different databases.I ll explain
> > in detail.
>
> > i have coupons table in AAA database n retailers tables in BBB
> > database .i have join these two tables.as following
>
> > AAA.coupon.coupon_id=BBB.retailer.coupon_id
>
> > i have created two models Coupon n Retailer with respective database
> > table n dbconfig details in them.
>
> > Please help me.
>
> > Thanks inadvance.
>
> > sreekanth
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component on Zeus Hosting

2008-08-27 Thread AussieFreelancer

ok, so no whitespace, but still not sure what is causing it.. still
the same issue, doesn't seem to like the sessions very much and kicks
me out randomly... has no-one had this before?

On Aug 7, 9:46 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Also check for whitespace:http://bin.cakephp.org/view/1837474952
>
> On Thu, Aug 7, 2008 at 4:35 AM, AussieFreelancer
>
>
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > Hmm, I changed it from High to Medium with no effect, and also to Low
> > without having any effect either... I will double check the links for
> > non-existent files, this could be something to do with it, as if i
> > press refresh a couple of times quickly it logs me out, not sure this
> > is what is happening every time, but I know that refreshing twice fast
> > certainly does it...
>
> > So no known issues with sessions and Zeus or anything like that?
>
> > Thanks
>
> > Patrick
>
> > On Aug 6, 6:46 pm, acoustic_overdrive <[EMAIL PROTECTED]>
> > wrote:
> >> This is probably not server-specific, but on one application I was
> >> building it took me ages to realise why sometimes I was getting logged
> >> out and other times not. I eventually realised that I had a CSS link
> >> that was pointing at a non-existent file, and this caused the page to
> >> continue trying to load it in the background. If I cancelled the page
> >> loading prematurely by clicking on a link and visiting another page, I
> >> would stay logged in. But if I allowed the page to complete its
> >> loading, it would log me out. When I corrected the broken link it
> >> behaved fine again.
>
> >> That was not using the latest release so perhaps newer versions are
> >> OK.
>
> >> On Aug 6, 3:21 am, AussieFreelancer <[EMAIL PROTECTED]>
> >> wrote:
>
> >> > Hello, I have a client who's website is hosted on a server powered by
> >> > zeus instead of apache. I have already run into issues with the
> >> > rewrite which are now resolved, but there seems to also be an issue
> >> > with the Auth components...
>
> >> > I have an administration panel as a plugin, which works on other
> >> > sites, but for some reason, on this particular site, it randomly kicks
> >> > the user out. Sometimes I can't even get to one page without it
> >> > kicking me out, other times i can update 5 things and then it will
> >> > kick me out... does anyone know why this is? I have security set to
> >> > low, I thought that maybe it was to do with that but doesn't seem to
> >> > have made a difference...
>
> >> > Would love to hear any suggestions on how to resolve this as the admin
> >> > panel isnt really usable until it is fixed..
>
> >> > Thanks
>
> >> > Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Removing page execution time from bottom of page

2008-08-27 Thread evilbloodydemon



On Aug 24, 1:02 am, Aaron <[EMAIL PROTECTED]> wrote:
> At the bottom of every rendered page is an execution time (i.e.
> )  I have views that return json and this breaks the
> parsing.  How do I remove this?
>
> -Aaron

use layout without any other text.

in controller:
function return_json_etc()
{
...
//see /cake/libs/view/layouts/
$this->layout = 'ajax';
...
}

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-27 Thread shabba

I also had this problem its caused because your not allowing a certain
page. Action, my problem was that I had a element that was dynamically
loading data. Instead I created a new layout just for the login that
solved the problem. Here is what my app controller looks like.

class AppController extends Controller {

var $components = array('Auth');
/**
 * Load the Authentication
 *
 * @access public
 */
function beforeFilter(){
$this->layout = 'login';
$this->Auth->loginAction = array('controller' => 'users', 
'action'
=> 'login');
$this->Auth->loginRedirect = array('controller' => 'pages', 
'action'
=> 'home');
$this->Auth->logoutRedirect = '/users/login';
$this->Auth->allow('login');
$this->Auth->authorize = 'controller';
}

function isAuthorized() {
return true;
   }
}

On Aug 25, 8:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
> Ola, everyone...
>
> //Using RC2 version of CakePHP
>
> I'm building simple application that allows users to write articles.
> So there are their corresponding models and controllers.
>
> Few days ago I made custom Login/register part of application that
> writes username to session etc. but now I decided to use Auth
> component for this purpose.
> As soon as I define:
> var $components = array('Auth');
> in my users_controller or app_controller, application stops working.
> Firefox gives following error: "Firefox has detected that the server
> is redirecting the request for this address in a way that will never
> complete." So, some infinite loop occured definitely and I'm quite
> sure that I didn't cause it :)
>
> I found few posts about this problem but none of them resolves my
> problem.
>
> The weirdest thing,to me, is that error occurs as soon as I include
> Auth component; I don't even use one method of that class ?!?
> Also another confusing part with this problem is that my other
> controllers also stop working with same output eventhough component
> Auth is included only in users_controller. User model is in
> association with articles model but I think that articles_controller
> shoud with or without component Auth included in users_controller. Am
> I wrong?
>
> My database is USERS and has fields username and password and also
> there is a model for users table.
>
> Thanks in advance
>
> Luka

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Class XML :: Error on function toArray

2008-08-27 Thread MBmax

It's also happening with Set::reverse($xml)

;-(
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problems with the Bake (Windows Vista + Xampp + MinGW)

2008-08-27 Thread clemos

Hi Giulio

It looks more like a PHP cli issue, now, so here is not really the
right place to solve it.
Try searching for other ressources, like for example this one, which may help :
http://www.issociate.de/board/index.php?t=msg&rid=0&th=66769&goto=279183

++
Clément

On Wed, Aug 27, 2008 at 4:59 AM, giulio <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Please anybody can help me?...
>
> Thanks
>
> Giulio
>
>
>
> On 26 Ago, 03:38, giulio <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Thank you for your help, now i set the path correctly to the
>> environment so i can execute .php files.
>>
>> But i still have two problems with the paths and one with a .dll.
>>
>> When i type in my htdocs folder "cake bake c:\xampp\htdocs\blog" it
>> start to bake but before i have this warning
>>
>> PHP Warning : Unknow() : Unable to load dynamic library 'C:\xampp\php
>> \extensions\php_sqlite.dll'
>>
>> I tried to download the last versiono of php binaries for win and to
>> copy the dll in the php/exstension but the problems doesn't desappear.
>>
>> I'm usingxampp1.6.7 and the PHP Version 5.2.6
>>
>> The second path problem became when i digit bake inside the console
>> folder of the application, maybe i've to execute cake bake c:\xampp
>> \htdocs\blog from the htdocs folder?
>>
>> Thank you very much for you help
>>
>> Giulio
>>
>> On 25 Ago, 10:35, clemos <[EMAIL PROTECTED]> wrote:
>>
>> > Hi Giulio
>>
>> > I'm not really an expert with MinGW, but I guess you should either:
>> > - link your php.exe to /usr/bin/, with something like (assuming php is
>> > at c:\Program Files\PHP5):
>> > ln -s "/c/Program Files/PHP5/php.exe" /usr/bin/php.exe
>> > - add "c:\Program Files\PHP5\ to your PATH environnement variable
>> > (which is more "standard", as it will allow you to run php from the
>> > windows command as well):
>> > in windows go to My Computer > RightClick > properties > Advanced >
>> > Environment Variables > search for the variable called "PATH" in your
>> > user variable, and add ";c:\Program Files\PHP5;"
>>
>> > Both should work, but I'd prefer the second solution, because I
>> > "sometimes" use the windows command prompt...
>>
>> > 
>> > Clément
>>
>> > On Mon, Aug 25, 2008 at 3:31 AM, giulio <[EMAIL PROTECTED]> wrote:
>>
>> > > Hi clement,
>>
>> > > Thank you for your help, but i've not understood.
>>
>> > > Where i've to add the path to php.exe cli to my path environment
>> > > variable?
>>
>> > > Could you resume for me all the process?
>>
>> > > I know that this it's not acakephp issue, but a problem with the
>> > > environment, but i can find a solution.
>>
>> > > Thanks for the help.
>>
>> > > On 24 Ago, 19:05, clemos <[EMAIL PROTECTED]> wrote:
>> > >> Then you must also add the path to php.exe cli to your path
>> > >> environment variable.
>>
>> > >> +++
>> > >> Clément
>>
>> > >> On Sun, Aug 24, 2008 at 7:31 AM, giulio <[EMAIL PROTECTED]> wrote:
>>
>> > >> > If i writecake.bat it returns me the answer that php is not know as
>> > >> > command
>>
>> > >> > Thanks for the help
>>
>> > >> > Giulio
>>
>> > >> > On 24 Ago, 07:29, giulio <[EMAIL PROTECTED]> wrote:
>> > >> >> Hi,
>>
>> > >> >> I see the tutorial and i read a lot of articles on the web, but this
>> > >> >> not solve my problems.
>>
>> > >> >> I'm trying to configurecakephp on windows vista usingxampp.
>>
>> > >> >> I've added the path to the environment variable, and i tried to
>> > >> >> substitute with an updated version the mysqli.dll but it seems that
>> > >> >> windows doesn't recognise .php extension.
>>
>> > >> >> When i try to digitcake.php in my app/console folder, it opens a txt
>> > >> >> file like this
>>
>> > >> >> #!/usr/bin/php -q
>> > >> >> > > >> >> /* SVN FILE: $Id:cake.php 7296 2008-06-27 09:09:03Z gwoo $ */
>> > >> >> /**
>> > >> >>  * Command-line code generation utility to automate programmer 
>> > >> >> chores.
>> > >> >>  *
>> > >> >>  * Shell dispatcher class
>> > >> >>  *
>> > >> >>  * PHP versions 4 and 5
>> > >> >>  *
>> > >> >>  * CakePHP(tm) :  Rapid Development Framework 
>> > >> >> >
>> > >> >>  * Copyright 2005-2008,CakeSoftware Foundation, Inc.
>> > >> >>  *
>>
>> > >> >> Excuse me but i never work with CLI and this is one of the first time
>> > >> >> that i use windows vista, so please write to me all the things to do:
>> > >> >> adding environment variables etc etc...
>>
>> > >> >> Thanks Giulio
>>
>> > >> >> On 22 Ago, 04:26, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>>
>> > >> >> > On Thu, Aug 21, 2008 at 10:22 PM, giulio <[EMAIL PROTECTED]> wrote:
>>
>> > >> >> > > Thank you very much for the help.
>>
>> > >> >> > > Can i find also a text help insted of videos?... i've some 
>> > >> >> > > problems
>> > >> >> > > with my connection to see videos.
>>
>> > >> >> > I don't know of any off-hand, but you can probably find them via 
>> > >> >> > Google.
>>
>> > >> >> > --
>> > >> >> > Chris Hartjes
>> > >> >> > Motto for 2008: "Moving from herding elephants to handling 
>> > >> >> > snak

Class XML :: Error on function toArray

2008-08-27 Thread MBmax

Heey Cakers...

i have found a error in the XML class of CakePHP. I've the following
xml data


2
1
1
2


when i parse this data with the xml class to a array

$xml  = new XML($data);
$array = $xml->toArray();

i got a this array back

Array
(
[Lst] => Array
(
[name] => Address.city_s
[int] => Array
(
[value] => 1
[name] => Rotterdam
)

[Int] => Array
(
[0] => Array
(
[value] => 2
[name] => Amsterdam
)

[1] => Array
(
[value] => 1
[name] => Den Haag
)

[2] => Array
(
[value] => 2
[name] => Einhoven
)

)

)

)

Notice that the 3th element has got a different name and is put in a
different subarray. The strange part is that is allways the 3e elment
of a xml data.
I have looked in the source code of the XML class, but i can't find
the error.

Is there someone that could help me?? At the moment i'm stuck on this
error and not getting forward. Sorry for the bad englisch, that is
also a point i could make progress on.

Thank you in advance all ready

function toArray($object = null) {
665 if ($object === null) {
666 $object =& $this;
667 }
668 if (is_a($object, 'XmlNode')) {
669 $out = $object->attributes;
670 $multi = null;
671 foreach ($object->children as $child) {
672 $key = Inflector::camelize($child->name);
673 if (is_a($child, 'XmlTextNode')) {
674 $out['value'] = $child->value;
675 continue;
676 } elseif (isset($child->children[0]) &&
is_a($child->children[0], 'XmlTextNode')) {
677 $value = $child->children[0]->value;
678 if ($child->attributes) {
679 $value = array_merge(array('value' =>
$value), $child->attributes);
680 }
681 if (isset($out[$child->name])) {
682 if (!isset($multi)) {
683 $multi = array($key =>
array($out[$child->name]));
684 unset($out[$child->name]);
685 }
686 $multi[$key][] = $value;
687 } else {
688 $out[$child->name] = $value;
689 }
690 continue;
691 } else {
692 $value = $this->toArray($child);
693 }
694 if (!isset($out[$key])) {
695 $out[$key] = $value;
696 } else {
697 if (!is_array($out[$key]) || !isset($out[$key]
[0])) {
698 $out[$key] = array($out[$key]);
699 }
700 $out[$key][] = $value;
701 }
702 }
703 if (isset($multi)) {
704 $out = array_merge($out, $multi);
705 }
706 }
707 return $out;
708 }



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Class XML :: Error on function toArray

2008-08-27 Thread MBmax

Heey Cakers...

i have found a error in the XML class of CakePHP. I've the following
xml data


2
1
1
2


when i parse this data with the xml class to a array

$xml  = new XML($data);
$array = $xml->toArray();

i got a this array back

Array
(
[Lst] => Array
(
[name] => Address.city_s
[int] => Array
(
[value] => 1
[name] => Rotterdam
)

[Int] => Array
(
[0] => Array
(
[value] => 2
[name] => Amsterdam
)

[1] => Array
(
[value] => 1
[name] => Den Haag
)

[2] => Array
(
[value] => 2
[name] => Einhoven
)

)

)

)

Notice that the 3th element has got a different name and is put in a
different subarray. The strange part is that is allways the 3e elment
of a xml data.
I have looked in the source code of the XML class, but i can't find
the error.


function toArray($object = null) {
665 if ($object === null) {
666 $object =& $this;
667 }
668 if (is_a($object, 'XmlNode')) {
669 $out = $object->attributes;
670 $multi = null;
671 foreach ($object->children as $child) {
672 $key = Inflector::camelize($child->name);
673 if (is_a($child, 'XmlTextNode')) {
674 $out['value'] = $child->value;
675 continue;
676 } elseif (isset($child->children[0]) &&
is_a($child->children[0], 'XmlTextNode')) {
677 $value = $child->children[0]->value;
678 if ($child->attributes) {
679 $value = array_merge(array('value' =>
$value), $child->attributes);
680 }
681 if (isset($out[$child->name])) {
682 if (!isset($multi)) {
683 $multi = array($key =>
array($out[$child->name]));
684 unset($out[$child->name]);
685 }
686 $multi[$key][] = $value;
687 } else {
688 $out[$child->name] = $value;
689 }
690 continue;
691 } else {
692 $value = $this->toArray($child);
693 }
694 if (!isset($out[$key])) {
695 $out[$key] = $value;
696 } else {
697 if (!is_array($out[$key]) || !isset($out[$key]
[0])) {
698 $out[$key] = array($out[$key]);
699 }
700 $out[$key][] = $value;
701 }
702 }
703 if (isset($multi)) {
704 $out = array_merge($out, $multi);
705 }
706 }
707 return $out;
708 }

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: three level deep belongsTo

2008-08-27 Thread RichardAtHome

@wisecounselor

> never mind, sorry to bother you, knew this was a waste of time

Um, AD7six answered your question later on in his post. That is why he
asked you if you'd continued reading...

On Aug 25, 7:49 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> never mind, sorry to bother you, knew this was a waste of time.
>
> On Aug 25, 1:18 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Aug 25, 8:13 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > sorry, I think I follow, maybe more specific objects will help, I have
>
> > > Patient -> Diet Plans -> Diet Calendar Day
>
> > > So Patient hasMany diet plans with each Diet Plan having many Diet
> > > Calendar Days
>
> > > I need to draw a screen of all patients and loop through 2 weeks of
> > > the calendar, filling in details of each day for each patient, but I
> > > need to be able to filter this at times by Patient last name,
> > > sometimes by a field in Diet Calendar Days and other times in a field
> > > in the Diet Plan.  So they way I have it, I can't do Patient-
>
> > > >find('all',array('condition' => 'DietPlan.active' => 1));
>
> > > or
>
> > > Patient->find('all',array('condition' => 'DietPlanDay.exception' =>
> > > 1));
>
> > Did you stop reading at "why the abstract names?" ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Forms not associated to models - alternative to the Form core helper?

2008-08-27 Thread RichardAtHome

You may not think it now but your form IS related to a model ;-)

See Jonathan snooks example of a contact form:
http://snook.ca/archives/cakephp/contact_form_cakephp/

Jonathan creates a tableless model and defines the schema by hand.
That way you get all the benefit of cake's helpers (validation etc.)

On Aug 26, 5:29 pm, Enrique Delgado <[EMAIL PROTECTED]> wrote:
> Thanks Samuel and validkeys.
>
> Samuel, very true, I do like extending the functionality of CakePHP,
> that is probably one of the best ways to go when we need something
> more custom.
>
> This time, I had totally overlooked the regular Form helper methods
> like text(), password(), etc. Thanks validkeys for pointing this out.
> I was getting too caught up and spoiled by the input() automagic
> method, my bad.
>
> Using the regular methods works just fine.
>
> Thanks!
>
> On Aug 26, 11:15 am, validkeys <[EMAIL PROTECTED]>
> wrote:
>
> > Hey Enrique,
>
> > You could still use the regular forms:
>
> > create('Search',array('url' => '/search','type' =>
> > 'get')) ?>
>
> > text('query',array('type' => 'textarea')) ?>
>
> > end('Search!') ?>
>
> > On Aug 26, 11:45 am, Enrique Delgado <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi All,
>
> > > The core Form helper works great as long as you have a model behind
> > > it, but what about forms that are not related to a model?
>
> > > Is there any helpers that I can use in the view? Or do I just code
> > > plain HTML?
>
> > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



auth->loginError

2008-08-27 Thread luigi7up

My
$this->Auth->loginError ='Invalid username or password';
won't show on login.ctp view

This is what I have in app_controller:
var $components = array('Acl','Auth');

function beforeFilter(){
//Mijenja hash funkciju auth komponente iz defaultne u 
md5
Security::setHash('md5');
$this->Auth->fields = array('username' => 'username', 
'password' =>
'password');
$this->Auth->loginAction = array('controller' => 
'users', 'action'
=> 'login');
//$this->Auth->loginRedirect = array('controller' => 
'users',
'action' => 'index');
$this->Auth->loginError ='Invalid username or password';
$this->Auth->logoutRedirect = '/';
$this->Auth->authorize = 'controller';

}

/*When authorize is set to 'controller',
you'll need to add a method called isAuthorized() to your
controller.
This method allows you to do some more
authentication checks and then return either true or false.*/

function isAuthorized() {
return true;
}
In users_controller my login() is empty because Auth component
automagic

and when I debug my session with debug($_SESSION); I see that error is
sent, but it si always set - even when I call users/login action for
the first time (I mean without submiting wrong data)?!?!:
Array
(
[Config] => Array
(
[userAgent] => 0f8a6ac2e2c891dce1f3f114fdaad715
[time] => 1219830026
[rand] => 32701
[timeout] => 10
)

[Message] => Array
(
[auth] => Array
(
[message] => Invalid username or password
[layout] => default
[params] => Array
(
)

)

)

How can I get this login error working?


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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to test the database connection?

2008-08-27 Thread RichardAtHome

This is how Cake does it in the scaffold home page:

getDataSource('default');
?>

isConnected()):
echo '';
__('Cake is able to connect to the database.');
echo '';
else:
echo '';
__('Cake is NOT able to connect to the 
database.');
echo '';
endif;
?>




On Aug 26, 8:33 pm, aranworld <[EMAIL PROTECTED]> wrote:
> I wonder if we have the same web host ... Hostway perhaps?
>
> I am just in the middle of figuring this out as well and I came across
> the following code that I believe still works, however, I must warn
> you that I have not tested this out fully, but maybe this will at
> least put you in the right direction?
>
> $db =& ConnectionManager::getDataSource('default');
> if(empty($db->connection)){
>     // you don't have a connection
>
> }
>
> On Aug 26, 10:55 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > I use the php functions for connecting to the database and then
> > redirect if it fails to a static page, usually from bootstrap.php if I
> > find that it becomes a problem on a host.
>
> > Sam D
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > - its a fine line between a real question and an idiot
>
> >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-m...
>
> > On Tue, Aug 26, 2008 at 10:51 AM, bbf <[EMAIL PROTECTED]> wrote:
>
> > > My flaky webhost's MySQL process goes down randomly every few weeks.
>
> > > Cake doesn't throw an error, but instead gives a "Missing Table" error
> > > and displays a weird page (the layout nested 4 times).
>
> > > How and where would I test the db connection myself?
>
> > > (I want to show my own pretty "Temporarily down for maintenance" msg
> > > -- I know how to throw and show the error, I just don't know where to
> > > put the code that tests the connection)
>
> > > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: radio buttons with form helper - lots of problems?

2008-08-27 Thread RichardAtHome

What tram said... change the field to an Int. Mysql tinyint datatype
has traditionally been used to store boolean data as MySQL doesn't
have a boolean datatype.

Alternatively, use a 1 byte char field.

Or change your options to be
null = Pending (the database default)
0 = Disapprove
1 = Approve

Or use an enum. Note: enums are mysql specific and are not directly
supported by cake. This doesn't mean you can't use them though (cake
treats them as a standard varchar field). There are some behaviours
out there that can help with enums.

As to the white screen of death, check out the httpd error logs and
the cake error logs (app/tmp/logs/error.log)

On Aug 26, 11:45 pm, [EMAIL PROTECTED] wrote:
> oh cmon you dont expect good anwers when you're bashing the fw like that ?
>
> cake interprets int(1) as bool , its a design choice. you are welcome
> to update the book.cakephp.org to reflect that.
>
> "white screen of death" - sorry im not getting it with your code, you
> sure the radio call is causing it ?
>
> On 8/27/08, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > oh my gosh
> > cake again.. typical
>
> > by using TINYINT(1) it is assumed that you have a checkbox toggle with
> > 0 and 1 as values i guess.
> > anyway, after changing it to TINYINT(2), this automagic correction is
> > no longer active
> > and my value now is -1 in the Database
> > Where in the documentation did i miss that?
>
> > Are there more of these automatic corrections where a normal cake user
> > would not assume it?
>
> > PS: about the white screen of death - anyway - are there any solutions
> > to it?
> > other than having to use a dummy "default"?
>
> > thx mark
>
> > On 26 Aug., 23:37, "Mark (Germany)" <[EMAIL PROTECTED]>
> > wrote:
> >> Well - CakePHP and Rapid Development can be two things that dont get
> >> along with each other sometimes.. :)
> >> i try for hours now...
>
> >> first of all if you do not set a default value cake crashes completely
> >> - white screen of death all of the sudden:
> >> $form->input('status',array('type'=>'radio','options'=>array(1=>Disapprove',
>
> >> 1=>'Approve'),'legend'=>false));
>
> >> so i was forced (i really hate that - if i am forced to workaround
> >> something) to add a dummy "pending" one:
> >> $form->input('status',array('type'=>'radio','options'=>array(0=>'Pending',-1=>Disapprove',
>
> >> 1=>'Approve'),'legend'=>false));
>
> >> ok, so far so good, but
>
> >> in the second code sample (i tried with both integer -1 0 1  and '-1'
> >> '0' '-1'), the -1 always gets changed to 1 when saved to the database
> >> - i debugged it and found out, that it is (inside of $this->data)
> >> still -1 after validation and - i did not believe it - after having
> >> saved the fields. so cake transformes it wrongly or something when
> >> saving it.
>
> >> the DB table setting is:
> >> `status` tinyint(1) NOT NULL default '0' COMMENT '-1 dissap. 1
> >> approved',
> >> so neg. values should be no problem...
>
> >> and the query clearly shows that it is cake's "fault":
> >> UPDATE `role_applications` SET `id` = 2, `status` = 1, `check_text` =
> >> 'somehting', `adminonly_text` = 'whatever', `checked_by` = 1,
> >> `check_date` = '2008-08-26 23:34:29' WHERE `role_applications`.`id` =
> >> 2
>
> >> anyone an idea what is going on?
> >> how can i use negative values for radio buttons then?
>
> >> if this goes on, i wont have any project done by the end of next
> >> year..
> >> mark
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A find('list') question.

2008-08-27 Thread Michael

Thanks a lot for the quick responses.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Error Handling

2008-08-27 Thread [EMAIL PROTECTED]

I would make a my error handling.
I use CakePHP 1.13 (I have some old application).
I have create my app_error.php in app/.
But when I use $this->cakeError , it is always referred to the
error.php in cake core.
Do I mistake some to do this or is it not possible in cake 1.13?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread Marc Schuetze

According to the docs 'modified' and 'updated' are both ok.
I tried this with 'modified' as well and it was the same result

When I do $this->create(array(.)) and that array doesn't contain
an update field then everything is fine and cake sets the update field
properly.
However, when I do
$this->read(null,$id) the model's data array will contain the update
field and it seems like I'll then have to manually unset it if I want
to update the time in the field.
If I don't do that cake will not fill the update field with a new
value but will use the value that is is the model's data array

On Wed, Aug 27, 2008 at 10:58 AM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
> The automagic fields should be called created and modified (not
> updated). You don't need to do anything else.
>
> On Aug 27, 8:29 am, MarcS <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I just noticed that my 'updated' field won't update when I update
>> data.
>> I tried around for a while and then noticed that it won't update when
>> the 'update' field is included in the Model's data array.
>> But when I load data using Model::read(null,$id) the date fields are
>> obviously always included in the Model's data. Do I then need to
>> always manually unset them before saving?
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread RichardAtHome

The automagic fields should be called created and modified (not
updated). You don't need to do anything else.

On Aug 27, 8:29 am, MarcS <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just noticed that my 'updated' field won't update when I update
> data.
> I tried around for a while and then noticed that it won't update when
> the 'update' field is included in the Model's data array.
> But when I load data using Model::read(null,$id) the date fields are
> obviously always included in the Model's data. Do I then need to
> always manually unset them before saving?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to join two tables of two different databases

2008-08-27 Thread majna

http://groups.google.com/group/cake-php/browse_thread/thread/d33b55ffc108292a/a9cc3117b719b24c?lnk=gst&q=cross+database+joins#a9cc3117b719b24c
- Do not use persistent connections in database config
- HABTM associations wont work here



On Aug 27, 9:25 am, sree <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am unable to join two tables of two different databases.I ll explain
> in detail.
>
> i have coupons table in AAA database n retailers tables in BBB
> database .i have join these two tables.as following
>
> AAA.coupon.coupon_id=BBB.retailer.coupon_id
>
> i have created two models Coupon n Retailer with respective database
> table n dbconfig details in them.
>
> Please help me.
>
> Thanks inadvance.
>
> sreekanth
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OrderedBehavior - Order your lists in a TreeBehavior like manner, but only for one level.

2008-08-27 Thread alkemann

Version 2.1 with a few small updates to make it more php4 compatiable
and
make the tests use fixtures instead of tables. I hope people will find
this
behaviour helpfull. Happy baking.

http://code.google.com/p/alkemann/downloads/detail?name=orderedbehaviour.rar

alkemann

On 26 Aug, 16:11, alkemann <[EMAIL PROTECTED]> wrote:
> The versjon 2 of the behavior is ready and so is a test for it. I am
> hopeful
> that this time it will be considered valuable for the community. Since
> I don't
> seem to have publishing rights on the bakery anymore, I will mail it
> to Nate
> as he stated above.
>
> In the mean time, I put it up on a code.google.com page (man this must
> be the
> first thing that google has made that is sub par.. i dont like it).
>
> http://code.google.com/p/alkemann/downloads/detail?name=ordered.php
>
> (and test can be found here 
> :)http://code.google.com/p/alkemann/downloads/detail?name=ordered.test.php
>
> Alek
>
> PS. Thanks for the support in the meta chat. I think we both
> overreacted and
> in spirit of getting things done, I'd rather just move on to getting
> cool stuff
> made with the awesomeness of cake :)
>
> On 21 Aug, 15:24, villas <[EMAIL PROTECTED]> wrote:
>
> > @Alkemann.  It was good that Gwoo and Nate gave you their comments
> > and I hope that the article can be suitable  for the Bakery soon. Best
> > wishes with that.
>
> > @Tarique.  Hmm,  avoiding the central issue of publication to the
> > Bakery,  questioning someone's motives,  accusations of whining, and
> > cryptic allusions to windmills are fine then.  I welcome your point of
> > view and I started a new thread about the Bakery so that the subject
> > cannot possibly be OT there.
>
> > On Aug 21, 11:51 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > On Thu, Aug 21, 2008 at 4:10 PM, villas <[EMAIL PROTECTED]> wrote:
>
> > > > Finally,  no one asks you to join threads that irritate you. Your
> > > > dismissive EOT declaration simply suggests a haughty degree of self-
> > > > righteousness which is not going to helpAlkemannat all.
>
> > > No! the EOT is for the fact that this thread like several of the threads 
> > > you
> > > have participated in has gone off topic.
>
> > > Find a different windmill - I wont fall for it :)
>
> > > Tarique
>
> > > --
> > > =
> > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > PHP for E-Biz:http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Dynamic content - default.ctp

2008-08-27 Thread FannyCradock

Thank you, I'll take a look at those. I had been browsing through the
manual for a while, just didn't know what to look for.

On Aug 26, 11:16 pm, "Brett Wilton" <[EMAIL PROTECTED]> wrote:
> An element is probably the best way to go for this...
>
> http://book.cakephp.org/view/97/elements
>
> ---
> Brett Wiltonhttp://wiltonsoftware.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



New HABTM saving process in cake 1.2?

2008-08-27 Thread blablu

Hi,

I just updated to the new 1.2 RC2 release, I made the necessary
changes but I still have some trouble with saving habtm relations.

I have the two models German and English with the following relation:

German Model:
var $hasAndBelongsToMany = array(
'English' =>
array('className' => 'English',
'joinTable' => 
'englishes_germans',
'foreignKey' => 'german_id',
'associationForeignKey' => 
'english_id'
));


English Model:
var $hasAndBelongsToMany = array(
'German' =>
array('className' => 'German',
'joinTable' => 
'englishes_germans',
'foreignKey' => 'english_id',
'associationForeignKey' => 
'german_id'
),
);


In the database I have already a relation between German and English,
let's say a German entry "Abschlag" has two relations in the English
table: "damnum" and "discount".

Now I want delete the relations, that means for the $data array:

Array
(
[German] => Array
(
[id] => 1
)

[English] => Array
(
[English] => Array
(
)
)
)

Okay I do this with $this->German->save($data); but no changes in the
relation! Strange, because before the update this works perfectly. But
something I dont understand is, that if adding relations this way
works..

Is there a change in the new release or do I something wrong?

greets

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to join two tables of two different databases

2008-08-27 Thread sree

Hi all,

I am unable to join two tables of two different databases.I ll explain
in detail.

i have coupons table in AAA database n retailers tables in BBB
database .i have join these two tables.as following

AAA.coupon.coupon_id=BBB.retailer.coupon_id

i have created two models Coupon n Retailer with respective database
table n dbconfig details in them.

Please help me.

Thanks inadvance.

sreekanth

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread MarcS

Hi,

I just noticed that my 'updated' field won't update when I update
data.
I tried around for a while and then noticed that it won't update when
the 'update' field is included in the Model's data array.
But when I load data using Model::read(null,$id) the date fields are
obviously always included in the Model's data. Do I then need to
always manually unset them before saving?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---