Re: Containable relations reset

2009-11-03 Thread John Andersen

DISREGARD, just saw the real issue, not at the User hasMany, but at
the Author hasMany!
Yes, I see the same problem!
Enjoy,
   John

On Nov 4, 8:47 am, John Andersen  wrote:
> Using 1.2.5 too, can't recreate the issue.
>
> User hasMany Author hasMany Article, Ebook
[snip]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Containable relations reset

2009-11-03 Thread John Andersen

Using 1.2.5 too, can't recreate the issue.

User hasMany Author hasMany Article, Ebook
[code]
  debug($this->User->hasMany);
  debug(
  $this->User->find('first',array(
 'contain'=>array(
'Author' => array(
   'Article' => array('fields' => array('id') )
)
 )
  ))
  );
  debug($this->User->hasMany);
[/code]

Shows the same state of hasMany before and afther the find.

Please show the code that defines how your models are related!

The ticket is closed as fixed!
Enjoy,
   John

On Nov 3, 10:37 pm, lightglitch  wrote:
> Hi,
>
> I'm having an error using Containable, my problem is already describe
> inhttps://trac.cakephp.org/ticket/4988but the explanation of the
> problem is not very clear.
>
> So if we have the models:
>
> 1 - Node hasMany NodeTemplate
> 2 - NodeTemplate HasMany TextContent, AssetContent
>
>  When executing the following code:
>
>         pr($this->Node->NodeTemplate->hasMany);
>         $this->Node->find('first',array(
>                                     'contain'=>array(
>                                             'NodeTemplate' => array(
>
> 'TextContent'=>array('fields'=>array('id'))
>                                                     )
>                                         )
>                                 ));
>         pr($this->Node->NodeTemplate->hasMany);
>
> The hasMany NodeTemplate break and looses the connection to
> AssetContent.
>
> After some debugging I did found out that the problem is in the
> configuration of the TextContent in the contain.
>
> If you try:
>
>         pr($this->Node->NodeTemplate->hasMany);
>         $this->Node->find('first',array(
>                                     'contain'=>array(
>                                             'NodeTemplate' => array(
>                                                         'TextContent'
>                                                     )
>                                         )
>                                 ));
>         pr($this->Node->NodeTemplate->hasMany);
>
> OR
>
>         pr($this->Node->NodeTemplate->hasMany);
>         $this->Node->find('first',array(
>                                     'contain'=>array(
>                                             'NodeTemplate' => array(
>
> 'TextContent'=>array('OtherModel')
>                                                     )
>                                         )
>                                 ));
>         pr($this->Node->NodeTemplate->hasMany);
>
> It works ok.
>
> if you use any parameter that is not a associated Model name like
> fields, conditions, order, etc it doesn't work and breaks the
> associations of the NodeTemplate by losing the one that is not used in
> the contain.
>
> Can anyone confirm this behavior? I'm using 1.2.5 version of cake.
>
> Thx in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hot out of the oven CakePHP 1.3 alpha

2009-11-03 Thread Miles J

Awesome work guys, pretty stoked to try it out!
Keep up the good work :p

On Nov 3, 10:10 pm, George H  wrote:
> Great work guys!
>
> On Nov 4, 4:28 pm, mark_story  wrote:
>
> > The CakePHP development team is happy to release the alpha build of
> > CakePHP 1.3.  We've been hard at work improving upon the already great
> > 1.2 and implementing new features to ease development and increase the
> > flexibility of CakePHP.  There have been a number of changes to
> > existing features and its recommended that you review the migration
> > guide[1] for changes in existing classes and features.  Also checkout
> > the new features guides[2] for the new features introduced in 1.3. As
> > the 1.3 code branch stabilizes, methods that are currently deprecated
> > and generating errors will be removed.  It is therefore important to
> > update the necessary methods to their new names.
>
> > If you would like to help with the ongoing development of 1.3, you can
> > do so in a number of ways.  Firstly filing clear and concise tickets
> > for any issues with new or existing code helps get the issues
> > resolved.  You can also contribute by forking the CakePHP project on
> > code.cakephp.org and implementing features and test cases in your
> > forks.  This speeds up development as cherry picking commits is faster
> > and easier than applying patches.
>
> > The future roadmap places CakePHP 1.3, as a stepping stone towards the
> > also in development CakePHP 2.0 branch which will feature a mostly
> > backwards compatible API. The CakePHP 2.0 branch can be found 
> > athttp://code.cakephp.org/cakephp2
>
> > Finally, we'd like to thank the community for their ongoing support
> > and contributions in making CakePHP as great as it is.
>
> > Download a packaged release, [3]
> > Read the changelog [4]
>
> > [1]http://code.cakephp.org/wiki/1.3/migration-guide
> > [2]http://code.cakephp.org/wiki/1.3/new-features
> > [3]http://cakeforge.org/frs/?group_id=23&release_id=452
> > [4]http://code.cakephp.org/wiki/changelog/1_3_0-alpha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hot out of the oven CakePHP 1.3 alpha

2009-11-03 Thread George H

Great work guys!

On Nov 4, 4:28 pm, mark_story  wrote:
> The CakePHP development team is happy to release the alpha build of
> CakePHP 1.3.  We've been hard at work improving upon the already great
> 1.2 and implementing new features to ease development and increase the
> flexibility of CakePHP.  There have been a number of changes to
> existing features and its recommended that you review the migration
> guide[1] for changes in existing classes and features.  Also checkout
> the new features guides[2] for the new features introduced in 1.3. As
> the 1.3 code branch stabilizes, methods that are currently deprecated
> and generating errors will be removed.  It is therefore important to
> update the necessary methods to their new names.
>
> If you would like to help with the ongoing development of 1.3, you can
> do so in a number of ways.  Firstly filing clear and concise tickets
> for any issues with new or existing code helps get the issues
> resolved.  You can also contribute by forking the CakePHP project on
> code.cakephp.org and implementing features and test cases in your
> forks.  This speeds up development as cherry picking commits is faster
> and easier than applying patches.
>
> The future roadmap places CakePHP 1.3, as a stepping stone towards the
> also in development CakePHP 2.0 branch which will feature a mostly
> backwards compatible API. The CakePHP 2.0 branch can be found 
> athttp://code.cakephp.org/cakephp2
>
> Finally, we'd like to thank the community for their ongoing support
> and contributions in making CakePHP as great as it is.
>
> Download a packaged release, [3]
> Read the changelog [4]
>
> [1]http://code.cakephp.org/wiki/1.3/migration-guide
> [2]http://code.cakephp.org/wiki/1.3/new-features
> [3]http://cakeforge.org/frs/?group_id=23&release_id=452
> [4]http://code.cakephp.org/wiki/changelog/1_3_0-alpha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to include a view in another view

2009-11-03 Thread John Andersen

You extract the part that you would like to use in more than one
place, and implement that part as an element.
Then include the element in each place that you would like to see it.
Enjoy,
   John

On Nov 4, 6:34 am, abc  wrote:
> Hi all,
>
> I have an add.ctp file, which will enable the user to add new entries,
> there is another view.ctp file which will list all the existing
> entries from the database.
> How would I include these existing entries within the add view page,
> So that user should be able to view the existing entries at the bottom
> of the page when he is making a new entry from add page?
>
> Thanking 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Trivia quiz model relationship

2009-11-03 Thread John Andersen

Actually you will have 3 tables:
questions, answers and answers_questions

Something like the following:
[questions]
id
question
answer_id <- the correct answer

[answers]
id
answer

[answers_questions]
id
answer_id
question_id

Observe that I changed the relation between the Question and the
Answer for the correct Answer, so that Question belongsTo Answer - not
the other way around. This I saw only when I tried to define the
actual tables above.

Whether or not you can bake this, I have no idea, I always create my
models and tables by hand or in another tool.
Enjoy,
   John

On Nov 3, 8:04 pm, mufti ali  wrote:
> Hi john, thanks for your useful solution.
> So, in this case we have 2 tables on my database.
> 1. questions
> 2. answers
>
> questions hasAndBelongsToMany answers
> Answer hasAndBelongsToMany questions
> questions hasOne answers
> answers belongsTo questions
>
> There is no troble or conflict when questions hasAndBelongsToMany
> answers but also questions hasOne answers?
>
> Anyway i will try to baking this tables;
>
> Thanks
>
>
>
> On Tue, Nov 3, 2009 at 8:02 PM, John Andersen  wrote:
>
> > Question hasMany optional Answer
> > Question hasOne correct Answer
>
> > What you then need is only the models to define the trivias:
> > Question hasAndBelongsToMany Answer
> > Answer hasAndBelongsToMany Question
> > Question hasOne Answer
> > Answer belongsTo Question
>
> > Do observe that there are two associations between Answer and
> > Question. CakePHP can handle that, you just have to define it!
>
> > When a user is going to give the solution to each question, you would
> > need:
> > User hasMany Solution
> > Solution belongsTo User
> > Solution belongsTo Question
> > Solution belongsTo Answer
>
> > Enjoy,
> >   John
>
> > On Nov 3, 7:58 am, mupet  wrote:
> >> Hi, i will create trivia quiz application using cakePHP,  i have
> >> trouble on designing model reationship.
> >> In this case i have question, answers and correct answer.
> >> which is  One question have 3 optional answers but have only 1 correct
> >> answers. How to design model relationship?
>
> >> Thanks and regards
>
> --
> Mufti Ali
> 087831163105http://wordtaps.comhttp://blogfreakz.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp.org hacked?

2009-11-03 Thread Larry E. Masters aka PhpNut
Wow people relax... We are a group of developers that enjoy releasing this
framework and also like to have a little fun after all the talk of this
project dying. This was a great in your face "We are still here statement".

Thanks for all your support...

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Nov 3, 2009 at 11:17 PM, Josh K  wrote:

>
> I agree. This theme has me worried.  Halloween is past anyway.
>
> On Nov 3, 2:50 pm, on24  wrote:
> > Hmmm, I just don't like this "funny" theme. My first thought was
> > "CakePHP gone?! Too bad. Let's check Code Igniter then". Serious
> > things like frameworks should not try to be funny. I really can't
> > promote a halloween framework to my colleagues.
> >
>

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



Hot out of the oven CakePHP 1.3 alpha

2009-11-03 Thread mark_story

The CakePHP development team is happy to release the alpha build of
CakePHP 1.3.  We've been hard at work improving upon the already great
1.2 and implementing new features to ease development and increase the
flexibility of CakePHP.  There have been a number of changes to
existing features and its recommended that you review the migration
guide[1] for changes in existing classes and features.  Also checkout
the new features guides[2] for the new features introduced in 1.3. As
the 1.3 code branch stabilizes, methods that are currently deprecated
and generating errors will be removed.  It is therefore important to
update the necessary methods to their new names.

If you would like to help with the ongoing development of 1.3, you can
do so in a number of ways.  Firstly filing clear and concise tickets
for any issues with new or existing code helps get the issues
resolved.  You can also contribute by forking the CakePHP project on
code.cakephp.org and implementing features and test cases in your
forks.  This speeds up development as cherry picking commits is faster
and easier than applying patches.

The future roadmap places CakePHP 1.3, as a stepping stone towards the
also in development CakePHP 2.0 branch which will feature a mostly
backwards compatible API. The CakePHP 2.0 branch can be found at
http://code.cakephp.org/cakephp2

Finally, we'd like to thank the community for their ongoing support
and contributions in making CakePHP as great as it is.

Download a packaged release, [3]
Read the changelog [4]


[1] http://code.cakephp.org/wiki/1.3/migration-guide
[2] http://code.cakephp.org/wiki/1.3/new-features
[3] http://cakeforge.org/frs/?group_id=23&release_id=452
[4] http://code.cakephp.org/wiki/changelog/1_3_0-alpha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp.org hacked?

2009-11-03 Thread Josh K

I agree. This theme has me worried.  Halloween is past anyway.

On Nov 3, 2:50 pm, on24  wrote:
> Hmmm, I just don't like this "funny" theme. My first thought was
> "CakePHP gone?! Too bad. Let's check Code Igniter then". Serious
> things like frameworks should not try to be funny. I really can't
> promote a halloween framework to my colleagues.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Paginator Jump to Page text box

2009-11-03 Thread Josh K

I'm using the paginator helper in CakePHP to both sort columns and
move between pages. I've modified $paginator->counter() in the Cake
libs to echo something like "Viewing page  of 167.  I want to allow my users to jump to any
page by typing it in the textbox counter and pressing enter. Here's my
code:

http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

$strippn = preg_replace('/\/page:[0-9]\d{0,11}/','',$url);

 ?>

function append(pn) {
pn.action = '' + pn.pagenumber.value;
}


  counter(); ?>


The above solution works with the paginator, but there's got to be
something better that isn't as "dirty".  Any ideas? Maybe something
like this is already built into the paginator?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to include a view in another view

2009-11-03 Thread abc

Hi all,

I have an add.ctp file, which will enable the user to add new entries,
there is another view.ctp file which will list all the existing
entries from the database.
How would I include these existing entries within the add view page,
So that user should be able to view the existing entries at the bottom
of the page when he is making a new entry from add page?

Thanking 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How can I update another model from current model?

2009-11-03 Thread djo26

Hi everyone, I have Posts that have Votes, and the Vote has a
percentage.  Every time a new Vote is added I want to calculate the
average percentage of all Votes of that particular Post and update the
Post average percentage. Besides a custom query I have no idea how to
do this in my model. Anyone else on here know?  I'm relatively new to
this so it might be simple, but I'm not sure how to do it right now.

Any help is appreciated.
thanks, dan

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



Re: cakephp.org hacked?

2009-11-03 Thread on24

Hmmm, I just don't like this "funny" theme. My first thought was
"CakePHP gone?! Too bad. Let's check Code Igniter then". Serious
things like frameworks should not try to be funny. I really can't
promote a halloween framework to my colleagues.

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



Re: Installation question - Windows/Apache

2009-11-03 Thread Simon

its simple just drop  all the cake files into cakewebsite1 and
cakewebsite2  folder and go form there http://localhost/cakewebsite1

On Nov 3, 8:38 am, "Ryan P."  wrote:
> I want to play with Cake in a Windows environment where I have Apache
> installed without affecting my ability to still develop sites without
> Cake.  With Apache running, I can build websites within the "C:
> \Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs"
> folder.  What I would like to do is add a folder within htdocs called
> cakeapps (or whatever), and have Cake installed within that folder.
> So ideally I would like to have a structure like this:
>
> C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
> \website1
> C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
> \website2
> C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
> \cakeapps\cakewebsite1
> C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
> \cakeapps\cakewebsite2
>
> where website1 and website2 do not use Cake, but cakewebsite1 and
> cakewebsite2 do use Cake.  I've tried reading the manual in Cake for
> Advanced Installations, but unfortunately that didn't help me (or was
> over my head).  Does anybody have any suggestions or know of any more
> detailed tutorials for installations?  I really appreciate it!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Two Auth problems never found sloutions for it

2009-11-03 Thread Simon

anybody ??

On Nov 3, 6:46 am, Simon  wrote:
> well i tired it in my login function dosent seem to work it keeps
> login me in my email is not active
>
> if ($this->Auth->user('email_active') == '0') {
>                       $this->Session->destroy();
>                       $this->redirect(array('controller' => 'users',
> 'action' => 'not_active'));
>                   }
>
> On Nov 2, 7:04 pm, Robert P  wrote:
>
>
>
> > He doesn't need to. Auth redirects only come into play on login,
> > logout and when the user isn't authorised. Presumable Dave has allowed
> > unauthorised access to
> > RegistrationsController::pending_email_confirmation()
>
> > On Nov 3, 6:47 am, Simon  wrote:
>
> > > did you set auth redirect to false ??
>
> > > On Nov 2, 2:37 pm, "Dave"  wrote:
>
> > > > For #2 in my login function I have
>
> > > > if ($this->Auth->user('confirmed') == '0') {
> > > >                       $this->Session->destroy();
> > > >                       $this->redirect(array('controller' => 
> > > > 'registrations',
> > > > 'action' => 'pending_email_confirmation'));
> > > >                   }
> > > > Dave
>
> > > > -Original Message-
> > > > From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On 
> > > > Behalf
> > > > Of Simon
> > > > Sent: November-02-09 6:49 PM
> > > > To: CakePHP
> > > > Subject: Two Auth problems never found sloutions for it
>
> > > > 1. is save the last login without the auth redirect = to false 2. if the
> > > > email is not verified redirect them
>
> > > > if you have any sloutions please share- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is this EVIL in cake?

2009-11-03 Thread AD7six



On 3 nov, 23:00, "lacenaepro...@gmail.com" 
wrote:
> Thanks for the replies but nowHOW CAN I ACCESS THE MODEL FROM
> WITHIN THE COMPONENT?

you seem to have accidentally written most of your message(s) in
capital letters.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Containable relations reset

2009-11-03 Thread lightglitch

Hi,

I'm having an error using Containable, my problem is already describe
in https://trac.cakephp.org/ticket/4988 but the explanation of the
problem is not very clear.

So if we have the models:

1 - Node hasMany NodeTemplate
2 - NodeTemplate HasMany TextContent, AssetContent


 When executing the following code:

pr($this->Node->NodeTemplate->hasMany);
$this->Node->find('first',array(
'contain'=>array(
'NodeTemplate' => array(
 
'TextContent'=>array('fields'=>array('id'))
)
)
));
pr($this->Node->NodeTemplate->hasMany);


The hasMany NodeTemplate break and looses the connection to
AssetContent.

After some debugging I did found out that the problem is in the
configuration of the TextContent in the contain.

If you try:

pr($this->Node->NodeTemplate->hasMany);
$this->Node->find('first',array(
'contain'=>array(
'NodeTemplate' => array(
'TextContent'
)
)
));
pr($this->Node->NodeTemplate->hasMany);

OR

pr($this->Node->NodeTemplate->hasMany);
$this->Node->find('first',array(
'contain'=>array(
'NodeTemplate' => array(
 
'TextContent'=>array('OtherModel')
)
)
));
pr($this->Node->NodeTemplate->hasMany);


It works ok.

if you use any parameter that is not a associated Model name like
fields, conditions, order, etc it doesn't work and breaks the
associations of the NodeTemplate by losing the one that is not used in
the contain.

Can anyone confirm this behavior? I'm using 1.2.5 version of cake.

Thx in advance.







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



Re: Is this EVIL in cake?

2009-11-03 Thread lacenaepro...@gmail.com

Thanks for the replies but nowHOW CAN I ACCESS THE MODEL FROM
WITHIN THE COMPONENT?




Dario



On 3 Nov, 18:35, Miles J  wrote:
> Or you could just do it in the AppController::beforeFilter().
>
> On Nov 3, 7:52 am, "euromark (munich)" 
> wrote:
>
>
>
> > there are some components that work that way
> > its not really evil...
> > in some cases this would be the appropriate way actually
>
> > On 3 Nov., 14:47, "lacenaepro...@gmail.com" 
> > wrote:
>
> > > SORRY, RETYPE AGAIN, I PRESSED THE SUBMIT BUTTON!!
>
> > > HI,
>
> > > I'm building a component that automatically sets the locale data
> > > member of a translate behaviour.
>
> > > In the action I look for the lang param, then call the component
> > > method.
>
> > > I'd like the component to set the locale data member in order to
> > > avoid
> > > to do that in ANY action.
>
> > > Something like that:
>
> > > // --- component class
> > > function initialize(&controller, .) {
> > >   // HERE I SAVE THE CONTROLLER INSTANCE
> > >   $this->controller = $controller;
> > >   
>
> > > }
>
> > > function doSomething() {
> > >   // HERE I WANT TO ACCESS THE MODEL AND SET THE LOCALE
> > >   $mod = $this->controller->.
> > >   $model->locale = $mySavedLocale;
>
> > > }
>
> > > IS THIS EVIL IN CAKE. IS THERE ANOTHER MVC ORIENTED METHOD?
>
> > > THANKS!!
>
> > > On 3 Nov, 14:44, "lacenaepro...@gmail.com" 
> > > wrote:
>
> > > > HI,
>
> > > > I'm building a component that automatically sets the locale data
> > > > member of a translate behaviour.
>
> > > > In the action I look for the lang param, then call the component
> > > > method.
>
> > > > I'd like the component to set the locale data member in order to avoid
> > > > to do that in ANY action.
>
> > > > Something like that:
>
> > > > // --- component class
> > > > function initialize(&controller, .) {
> > > >   // HERE I SAVE THE CONTROLLER INSTANCE
> > > >   $this->controller = $controller;
> > > >   
>
> > > > }
>
> > > > function doSomething() {
>
> > > > }- Nascondi testo citato
>
> > > > - Mostra testo citato -- Nascondi testo citato
>
> - Mostra testo citato -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Mod_rewrite No idea

2009-11-03 Thread kangur91

Hi. I've got problem with mod rewrite. When i put my app into remote
server i get

Warning: include(cake/bootstrap.php) [function.include]: failed to
open stream: No such file or directory in /home3/kaczano/public_html/
ajax1/app/webroot/index.php on line 81

I done sudo chmod 777 -R, fur sure. But still didn't work. I have
enabled mod_rewrite on server but I don't have permission to change
AllowOverride All

/ajax1/.htaccess
<->

   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]

<->
/ajax1/app/.htaccess


RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 
<>
 /ajax1/app/webroot/.htaccess


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


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



Installation question - Windows/Apache

2009-11-03 Thread Ryan P.

I want to play with Cake in a Windows environment where I have Apache
installed without affecting my ability to still develop sites without
Cake.  With Apache running, I can build websites within the "C:
\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs"
folder.  What I would like to do is add a folder within htdocs called
cakeapps (or whatever), and have Cake installed within that folder.
So ideally I would like to have a structure like this:

C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
\website1
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
\website2
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
\cakeapps\cakewebsite1
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
\cakeapps\cakewebsite2

where website1 and website2 do not use Cake, but cakewebsite1 and
cakewebsite2 do use Cake.  I've tried reading the manual in Cake for
Advanced Installations, but unfortunately that didn't help me (or was
over my head).  Does anybody have any suggestions or know of any more
detailed tutorials for installations?  I really appreciate it!

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



rename?

2009-11-03 Thread Dave
Can someone help me with just a quick re-naming of a file?
 
I edit an image but it always returns the same image before it was edited I
guess because its caching the image. I have tried everything with cache and
give up.
 
So after editing the image i want to assign it a new name and return that to
the view.
 
So it will always be a new file name after each edit.
 
592254896.jpg to rand() + the original extension.
 
Thanks,
 
Dave

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



Cache Class for Console.

2009-11-03 Thread Dérico Filho

Hi,


I wanted to do this:

class LocalShell extends Shell {
function gc(){
Cache::write('test','hello world','short');
}
}

where "short" is one of my cache configurations.

But the console returns:
PHP Fatal error:  Call to a member function init() on a non-object in /
mnt/dados3/xpgplus/www.123i.xpg.com.br/cake/libs/cache.php on line 195

Fatal error: Call to a member function init() on a non-object in /mnt/
dados3/xpgplus/www.123i.xpg.com.br/cake/libs/cache.php on line 195

What am I doing wrong?

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



Lots of queries to pull up user photos and their comments

2009-11-03 Thread centr0

my models:

user hasmany comment
profile hasmany comment
user hasone profile
user hasone photo

comment belongsto user
profile belongsto user
photo belongsto user

what im trying to do is pull up profile information and the profiles
comments.

here is my index() and its find():
function index($url = null) {
$this->Profile->recursive = -1;

/*
*
*/
$profile = $this->Profile->find('first', array(
'conditions' => array('Profile.url' => $url),
'contain' => array(
'User' => array(
'fields' => array(
'User.id','User.name'
),
'Photo' => array(
'fields' => array(

'Photo.thumbnail','Photo.image'
)
)
),
'Comment' => array(
'User' => array(
'fields' => array(
'User.name'
),
'Photo' => array(
'fields' => array(
'Photo.thumbnail'
)
)
)
)
)
));
$this->set('profile', $profile);
}

this function takes its function arg and finds the appropriate profile
ie. /profiles/index/centroscape

Everything returns correctly without error i get exactly what i want,
but once the query gets to the Photo part, it queries multiple times
for photos with different ids.  if there is a way to avoid 1 query per
photo please let me know.  I dont think there is.

imagine a profile with 50-80 comments.  its kind of scary.  also, this
is my first time implementing containable behavior. any tips other
than my question are welcome!


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



Re: WSOD on large number of elements in a form

2009-11-03 Thread Tonu Tusk

PROBLEM SOLVED!

there was a default ruleset running for mod_security that I have to
admit I do not know lots about.

disabling it has shown it to be the problem so now I just need to re-
enable it and dig into learning how that all works.

Many thanks for the help guys.

cheers
BREWER


On Nov 3, 4:30 pm, Tonu Tusk  wrote:
> OK, so I put everything back to "normal" in my cake app. and ran
> through the problematic procedure again to get some log readouts.
>
> Live HTTP Headers firefox plugin gives me the following related to the
> call
>
> http://.com/stock/addUnits/8
>
> GET /stock/addUnits/8 HTTP/1.1
>
> Host: .com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.15)
> Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15
>
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
> *;q=0.8
>
> Accept-Language: en-gb,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
>
> Referer:http://.com/stock/admin
>
> Cookie: CAKEPHP=
>
> HTTP/1.x 200 OK
>
> Date: Tue, 03 Nov 2009 16:02:23 GMT
>
> Server: Apache
>
> X-Powered-By: PHP/5.2.9
>
> P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
>
> Set-Cookie: CAKEPHP= expires=Tue, 10-Nov-2009 16:02:32 GMT; path=/
>
> Set-Cookie: CAKEPHP= expires=Tue, 10-Nov-2009 16:02:32 GMT; path=/
>
> Vary: Accept-Encoding
>
> Content-Encoding: gzip
>
> Keep-Alive: timeout=2, max=99
>
> Connection: Keep-Alive
>
> Transfer-Encoding: chunked
>
> Content-Type: text/html
>
> --
>
> http://.com/bugs
>
> POST /bugs HTTP/1.1
>
> Host: .com
>
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.15)
> Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15
>
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
> *;q=0.8
>
> Accept-Language: en-gb,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
>
> Referer:http://.com/stock/addUnits/8
>
> Cookie: CAKEPHP=
>
> Content-Type: application/x-www-form-urlencoded
>
> Content-Length: 76674
>
> post data omitted
> HTTP/1.x 200 OK
>
> The bottom line of my apache access log is...
>
> XXX.XXX.XXX.XXX - - [03/Nov/2009:08:02:23 -0800] "GET /stock/addUnits/
> 8 HTTP/1.1" 200 22799 "http://.com/stock/admin"; "Mozilla/5.0 (X11;
> U; Linux x86_64; en-GB; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04
> (jaunty) Firefox/3.0.15"
>
> but there is no sign of apache receiving the POST request.
>
> I have also tried the same actions in Opera, and it is showing me
> "Error - connection closed by remote server"
>
> as I say, it is just strange because I can post the exact data to a
> php script that lives outside the mod_rewrite / cake app but on the
> same server
> and I can post the data to a cake install living on a different
> hosting site, but posting to a cake app installed on dreamhost (and I
> have tried on 2 seaprate hosting spaces on 2 separate servers)
> just bombs out like this.
>
> as you can see, the post data is ~ 77k and I have checked it to be
> intact, although it has '[' and ']' encoded as %5B and %5D
> There are around 500 input  boxes and 1500 hidden values in the form -
> is this too many?
> Is 77kb post size too large and is there any way that  the char
> encoding or Doctypes could be messing with this?
>
> Any more suggestions before I start shouting at Dreamhost?
>
> cheers
> BREWER
>
> On Nov 3, 11:51 am, John Andersen  wrote:
>
> > Is the environment at your production site and your development site
> > the same?
>
> > Could you create a dummy application, with only the problematic form/
> > view, and test it?
>
> > If the issue is still there, can you provide the dummy application or
> > the view for us to test?
>
> > Enjoy,
> >    John
>
> > On Nov 3, 1:45 pm, Tonu Tusk  wrote:
>
> > > OK - if this also helps anyone to offer any suggestions, here is what
> > > I have just done.
>
> > > 1) generated a smaller (tested working) form with what seems to be
> > > acceptable to cake
> > > 2) Altered the main index.php entry file to just echo a message and
> > > then exit
> > > 3) uploaded this to the site
> > > 4) Posted the generated form from step  1)
> > > 5) This corrcetly used the altered index file to display the message I
> > > have set
>
> > > 6) Revert the index.php file back to how it was to enable cake to work
> > > 7) Generated a large problematic form
> > > 8) Uploaded the revised index.php with just the echo message and exit
> > > command
> > > 9) Post the form from step 7)
> > > 10) White screen - i.e this does not seem to even be accessing
> > > index.php !
>
> > > I guess this then suggests that it is a mod_rewrite / apache issue,
> > > but hard to track down as it is
> > > the shared host that I need to be running production on and so will be
> > > hard (and maybe pointless) to try and
> > > replic

Re: save sensitive information

2009-11-03 Thread WyriHaximus

Personally I handle such information as I would like my own
information to be handled and that's secure as possible even for a
small site/company etc etc. It's still personal information that in
the wrong hands can do way to much damage.

On Nov 3, 4:54 pm, "euromark (munich)" 
wrote:
> yeah
> i found 2 behaviours later on by searching with other filters
>
> but one question remains
> how important would that be for a simple online shop?
>
> On 3 Nov., 12:45, WyriHaximus  wrote:
>
> > Did you take a look at this piece of 
> > code?http://bakery.cakephp.org/articles/view/cryptable-behavior
>
> > On Nov 3, 10:30 am, "euromark (munich)" 
> > wrote:
>
> > > i was wondering how to save sensitive information of users
> > > like cc number or bank data?
> > > my guess is they should not be saved as plain "chars" but encrypted in
> > > such a way that if the db is ever going to be hacked the retrieved
> > > data would be useless to anyone without the correct "key"
>
> > > passwords usually are stored sha1-hashed as you dont intend to revert
> > > that (and cant)
> > > but with the above examples you need to
>
> > > is there some kind of behaviour to automatically cipher and save or
> > > decrypt and read record data?
> > > i stumpled uopn Security::cipher() for that matter
>
> > > and how save would that be?
> > > could you re-build the original string from a given ciphered one with
> > > a modern computer? or would it be pointless for "everyday hackers"?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Trivia quiz model relationship

2009-11-03 Thread mufti ali

Hi john, thanks for your useful solution.
So, in this case we have 2 tables on my database.
1. questions
2. answers

questions hasAndBelongsToMany answers
Answer hasAndBelongsToMany questions
questions hasOne answers
answers belongsTo questions

There is no troble or conflict when questions hasAndBelongsToMany
answers but also questions hasOne answers?

Anyway i will try to baking this tables;

Thanks


On Tue, Nov 3, 2009 at 8:02 PM, John Andersen  wrote:
>
> Question hasMany optional Answer
> Question hasOne correct Answer
>
> What you then need is only the models to define the trivias:
> Question hasAndBelongsToMany Answer
> Answer hasAndBelongsToMany Question
> Question hasOne Answer
> Answer belongsTo Question
>
> Do observe that there are two associations between Answer and
> Question. CakePHP can handle that, you just have to define it!
>
> When a user is going to give the solution to each question, you would
> need:
> User hasMany Solution
> Solution belongsTo User
> Solution belongsTo Question
> Solution belongsTo Answer
>
> Enjoy,
>   John
>
>
> On Nov 3, 7:58 am, mupet  wrote:
>> Hi, i will create trivia quiz application using cakePHP,  i have
>> trouble on designing model reationship.
>> In this case i have question, answers and correct answer.
>> which is  One question have 3 optional answers but have only 1 correct
>> answers. How to design model relationship?
>>
>> Thanks and regards
> >
>



-- 
Mufti Ali
087831163105
http://wordtaps.com
http://blogfreakz.com

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



Re: How to prevent Cross Site Foreign Script Attacks on your actions.

2009-11-03 Thread Miles J

You dont. You turn it into a button or submit form, then post the data
to the action and then do the processing. Or you do an AJAX call.

On Nov 3, 5:08 am, "j0n4s.h4rtm...@googlemail.com"
 wrote:
> I don't entirely understand. How could I fill up $_POSTS by using
> $html->link?
>
> On Nov 3, 12:32 am, Miles J  wrote:
>
> > Well in most cases then not, if your on, says a users profile, you
> > would submit to that page. Within that page you would check if a
> > $_POST exists and then perform the add friend logic.
>
> > On Nov 2, 8:44 am, Jonas Hartmann 
> > wrote:
>
> > > Given someone mails you a link with html images that tries to 
> > > fetchhttp://domain.tld/users/add_friend/5
> > >   - now the user is logged into a web client that fetches that URL.
>
> > > How do you protect your cake application to not modify data. HTML wise  
> > > this should be a PUT or POST method not a GET method, but how do I  
> > > tell cakephp to ignore GET requests?
> > > How do I furthermore setup the link in my application's view ($html-
> > >  >link()) to use PUT or POST instead of GET? Will this be possible  
> > > without a ?
>
> > > Any tips?
>
> > > King regards
> > >   ionas82
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Mod_rewrite No idea

2009-11-03 Thread Mateusz Kaczanowski
Okay. I solve that. just update my cakephp verison. I don't know why but
it's working

2009/11/3 kangur91 

>
> Hi. I've got problem with mod rewrite. When i put my app into remote
> server i get
>
> Warning: include(cake/bootstrap.php) [function.include]: failed to
> open stream: No such file or directory in /home3/kaczano/public_html/
> ajax1/app/webroot/index.php on line 81
>
> I done sudo chmod 777 -R, fur sure. But still didn't work. I have
> enabled mod_rewrite on server but I don't have permission to change
> AllowOverride All
>
> /ajax1/.htaccess
> <->
> 
>   RewriteEngine on
>   RewriteRule^$ app/webroot/[L]
>   RewriteRule(.*) app/webroot/$1 [L]
> 
> <->
> /ajax1/app/.htaccess
>
> 
>RewriteEngine on
>RewriteRule^$webroot/[L]
>RewriteRule(.*) webroot/$1[L]
>  
> <>
>  /ajax1/app/webroot/.htaccess
>
> 
>RewriteEngine On
>RewriteCond %{REQUEST_FILENAME} !-d
>RewriteCond %{REQUEST_FILENAME} !-f
>RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
> 
>
> Please help!!
> >
>


-- 
Pozdrawiam, Mateusz Kaczanowski

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



Re: Is this EVIL in cake?

2009-11-03 Thread Miles J

Or you could just do it in the AppController::beforeFilter().

On Nov 3, 7:52 am, "euromark (munich)" 
wrote:
> there are some components that work that way
> its not really evil...
> in some cases this would be the appropriate way actually
>
> On 3 Nov., 14:47, "lacenaepro...@gmail.com" 
> wrote:
>
> > SORRY, RETYPE AGAIN, I PRESSED THE SUBMIT BUTTON!!
>
> > HI,
>
> > I'm building a component that automatically sets the locale data
> > member of a translate behaviour.
>
> > In the action I look for the lang param, then call the component
> > method.
>
> > I'd like the component to set the locale data member in order to
> > avoid
> > to do that in ANY action.
>
> > Something like that:
>
> > // --- component class
> > function initialize(&controller, .) {
> >   // HERE I SAVE THE CONTROLLER INSTANCE
> >   $this->controller = $controller;
> >   
>
> > }
>
> > function doSomething() {
> >   // HERE I WANT TO ACCESS THE MODEL AND SET THE LOCALE
> >   $mod = $this->controller->.
> >   $model->locale = $mySavedLocale;
>
> > }
>
> > IS THIS EVIL IN CAKE. IS THERE ANOTHER MVC ORIENTED METHOD?
>
> > THANKS!!
>
> > On 3 Nov, 14:44, "lacenaepro...@gmail.com" 
> > wrote:
>
> > > HI,
>
> > > I'm building a component that automatically sets the locale data
> > > member of a translate behaviour.
>
> > > In the action I look for the lang param, then call the component
> > > method.
>
> > > I'd like the component to set the locale data member in order to avoid
> > > to do that in ANY action.
>
> > > Something like that:
>
> > > // --- component class
> > > function initialize(&controller, .) {
> > >   // HERE I SAVE THE CONTROLLER INSTANCE
> > >   $this->controller = $controller;
> > >   
>
> > > }
>
> > > function doSomething() {
>
> > > }- Nascondi testo citato
>
> > > - Mostra testo citato -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is this EVIL in cake?

2009-11-03 Thread Amit

http://filchiprogrammer.wordpress.com/2008/08/27/followthemanual/

On Nov 3, 4:32 pm, AD7six  wrote:
> On 3 nov, 23:00, "lacenaepro...@gmail.com" 
> wrote:
>
> > Thanks for the replies but nowHOW CAN I ACCESS THE MODEL FROM
> > WITHIN THE COMPONENT?
>
> you seem to have accidentally written most of your message(s) in
> capital letters.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Find question

2009-11-03 Thread Celso

Hello Everybody!
I have this models:

http://picasaweb.google.com.br/celsowm/Screenshots#5399915797002091778

And i need retrieve this:

 Proprietario.nome , Veiculo.placa , sum (Infracoes.pontuacao) as
pontos

Proprietario "hasMany" Veiculo
Veiculo "habBelongsToMany" Infracoes


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



Re: WSOD on large number of elements in a form

2009-11-03 Thread Tonu Tusk

OK, so I put everything back to "normal" in my cake app. and ran
through the problematic procedure again to get some log readouts.

Live HTTP Headers firefox plugin gives me the following related to the
call

http://.com/stock/addUnits/8



GET /stock/addUnits/8 HTTP/1.1

Host: .com

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.15)
Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8

Accept-Language: en-gb,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

Referer: http://.com/stock/admin

Cookie: CAKEPHP=



HTTP/1.x 200 OK

Date: Tue, 03 Nov 2009 16:02:23 GMT

Server: Apache

X-Powered-By: PHP/5.2.9

P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"

Set-Cookie: CAKEPHP= expires=Tue, 10-Nov-2009 16:02:32 GMT; path=/

Set-Cookie: CAKEPHP= expires=Tue, 10-Nov-2009 16:02:32 GMT; path=/

Vary: Accept-Encoding

Content-Encoding: gzip

Keep-Alive: timeout=2, max=99

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/html

--

http://.com/bugs



POST /bugs HTTP/1.1

Host: .com

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.15)
Gecko/2009102815 Ubuntu/9.04 (jaunty) Firefox/3.0.15

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8

Accept-Language: en-gb,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

Referer: http://.com/stock/addUnits/8

Cookie: CAKEPHP=

Content-Type: application/x-www-form-urlencoded

Content-Length: 76674

post data omitted
HTTP/1.x 200 OK



The bottom line of my apache access log is...


XXX.XXX.XXX.XXX - - [03/Nov/2009:08:02:23 -0800] "GET /stock/addUnits/
8 HTTP/1.1" 200 22799 "http://.com/stock/admin"; "Mozilla/5.0 (X11;
U; Linux x86_64; en-GB; rv:1.9.0.15) Gecko/2009102815 Ubuntu/9.04
(jaunty) Firefox/3.0.15"


but there is no sign of apache receiving the POST request.

I have also tried the same actions in Opera, and it is showing me
"Error - connection closed by remote server"

as I say, it is just strange because I can post the exact data to a
php script that lives outside the mod_rewrite / cake app but on the
same server
and I can post the data to a cake install living on a different
hosting site, but posting to a cake app installed on dreamhost (and I
have tried on 2 seaprate hosting spaces on 2 separate servers)
just bombs out like this.

as you can see, the post data is ~ 77k and I have checked it to be
intact, although it has '[' and ']' encoded as %5B and %5D
There are around 500 input  boxes and 1500 hidden values in the form -
is this too many?
Is 77kb post size too large and is there any way that  the char
encoding or Doctypes could be messing with this?

Any more suggestions before I start shouting at Dreamhost?

cheers
BREWER


On Nov 3, 11:51 am, John Andersen  wrote:
> Is the environment at your production site and your development site
> the same?
>
> Could you create a dummy application, with only the problematic form/
> view, and test it?
>
> If the issue is still there, can you provide the dummy application or
> the view for us to test?
>
> Enjoy,
>    John
>
> On Nov 3, 1:45 pm, Tonu Tusk  wrote:
>
> > OK - if this also helps anyone to offer any suggestions, here is what
> > I have just done.
>
> > 1) generated a smaller (tested working) form with what seems to be
> > acceptable to cake
> > 2) Altered the main index.php entry file to just echo a message and
> > then exit
> > 3) uploaded this to the site
> > 4) Posted the generated form from step  1)
> > 5) This corrcetly used the altered index file to display the message I
> > have set
>
> > 6) Revert the index.php file back to how it was to enable cake to work
> > 7) Generated a large problematic form
> > 8) Uploaded the revised index.php with just the echo message and exit
> > command
> > 9) Post the form from step 7)
> > 10) White screen - i.e this does not seem to even be accessing
> > index.php !
>
> > I guess this then suggests that it is a mod_rewrite / apache issue,
> > but hard to track down as it is
> > the shared host that I need to be running production on and so will be
> > hard (and maybe pointless) to try and
> > replicate this on my dev server.
>
> > Could the doctype affect the way that apache / mod_rewrite module
> > handles this?
>
> > As mentioned in an earlier post, I can setup a target for the
> > problematic  post data  that just vardumps the post variable and that
> > is handled on the same server (but outside of the cake htaccess
> > jurasdiction) and this works fine.
>
> > Any more insight would be helpful.
>
> > cheers
> > BREWER
>
> > On Nov 2, 9:52 pm, Tonu Tusk  wrote:
>
> > > I also set the upload_max_filesize and post_max_size to 128M
> > > and the available memory size

ACL issue

2009-11-03 Thread kwameda...@gmail.com

Please help me resolve this ACL issue. I'm going through the tutorial
"10.2.6 An Automated tool for creating ACOs"
(http://book.cakephp.org/view/647/An-Automated-tool-for-creating-
ACOs)
and getting stuck with the following error message when creating the
ACOs by running the

build_acl():

Fatal error: Call to a member function node() on a non-object in C:
\wamp\www\xchange\app\controllers\users_controller.php on line 92

Awaiting any help you can offer

Thnx,

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



ACL issue

2009-11-03 Thread samuel darko
Please help me resolve this ACL issue. I'm going through the tutorial
"10.2.6 An Automated tool for creating ACOs" getting stuck with the
following error message when creating the ACOs by running the build_acl():

*Fatal error*: Call to a member function node() on a non-object in *
C:\wamp\www\xchange\app\controllers\users_controller.php* on line *92*

Awaiting any help you can offer

Thnx,

Sam

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



Re: save sensitive information

2009-11-03 Thread euromark (munich)

yeah
i found 2 behaviours later on by searching with other filters

but one question remains
how important would that be for a simple online shop?


On 3 Nov., 12:45, WyriHaximus  wrote:
> Did you take a look at this piece of 
> code?http://bakery.cakephp.org/articles/view/cryptable-behavior
>
> On Nov 3, 10:30 am, "euromark (munich)" 
> wrote:
>
> > i was wondering how to save sensitive information of users
> > like cc number or bank data?
> > my guess is they should not be saved as plain "chars" but encrypted in
> > such a way that if the db is ever going to be hacked the retrieved
> > data would be useless to anyone without the correct "key"
>
> > passwords usually are stored sha1-hashed as you dont intend to revert
> > that (and cant)
> > but with the above examples you need to
>
> > is there some kind of behaviour to automatically cipher and save or
> > decrypt and read record data?
> > i stumpled uopn Security::cipher() for that matter
>
> > and how save would that be?
> > could you re-build the original string from a given ciphered one with
> > a modern computer? or would it be pointless for "everyday hackers"?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is this EVIL in cake?

2009-11-03 Thread euromark (munich)

there are some components that work that way
its not really evil...
in some cases this would be the appropriate way actually


On 3 Nov., 14:47, "lacenaepro...@gmail.com" 
wrote:
> SORRY, RETYPE AGAIN, I PRESSED THE SUBMIT BUTTON!!
>
> HI,
>
> I'm building a component that automatically sets the locale data
> member of a translate behaviour.
>
> In the action I look for the lang param, then call the component
> method.
>
> I'd like the component to set the locale data member in order to
> avoid
> to do that in ANY action.
>
> Something like that:
>
> // --- component class
> function initialize(&controller, .) {
>   // HERE I SAVE THE CONTROLLER INSTANCE
>   $this->controller = $controller;
>   
>
> }
>
> function doSomething() {
>   // HERE I WANT TO ACCESS THE MODEL AND SET THE LOCALE
>   $mod = $this->controller->.
>   $model->locale = $mySavedLocale;
>
> }
>
> IS THIS EVIL IN CAKE. IS THERE ANOTHER MVC ORIENTED METHOD?
>
> THANKS!!
>
> On 3 Nov, 14:44, "lacenaepro...@gmail.com" 
> wrote:
>
> > HI,
>
> > I'm building a component that automatically sets the locale data
> > member of a translate behaviour.
>
> > In the action I look for the lang param, then call the component
> > method.
>
> > I'd like the component to set the locale data member in order to avoid
> > to do that in ANY action.
>
> > Something like that:
>
> > // --- component class
> > function initialize(&controller, .) {
> >   // HERE I SAVE THE CONTROLLER INSTANCE
> >   $this->controller = $controller;
> >   
>
> > }
>
> > function doSomething() {
>
> > }- Nascondi testo citato
>
> > - Mostra testo citato -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: WSOD on large number of elements in a form

2009-11-03 Thread Tonu Tusk

Hi OK there - I know I am not providing you with the information you
require BUT, I have done some more tests with post "targets"

I have a separate hosting account with this host (dreamhost) so I just
used a working cakephp  url on an entirely separate hosting account,
(different server) to try and post my problem form data to.
result: White screen
As I have already pointed out though, it allowed me to post the form
to a normal php script that is not being touched by any rewrite rules
(I have used the standard .htaccess from the latest cake release)

I do however have more sites hosted with other hosting companies which
too have cakephp apps running on them.

I have tried to use a working url on cake on a completely different
host, and the web page loads - I am not trying to do anything with the
posted data, but as mentioned before, trying to post this back on to
any of
my dreamhost accounts with cake installed and hence through the
rewrite rules in .htaccess is just causing  white screens.

This sounds to me like a dreamhost / apache / issue, but I'll try and
post some html later that someone might want to test for me on a
different post target.

cheers
BREWER


On Nov 3, 11:51 am, John Andersen  wrote:
> Is the environment at your production site and your development site
> the same?
>
> Could you create a dummy application, with only the problematic form/
> view, and test it?
>
> If the issue is still there, can you provide the dummy application or
> the view for us to test?
>
> Enjoy,
>    John
>
> On Nov 3, 1:45 pm, Tonu Tusk  wrote:
>
> > OK - if this also helps anyone to offer any suggestions, here is what
> > I have just done.
>
> > 1) generated a smaller (tested working) form with what seems to be
> > acceptable to cake
> > 2) Altered the main index.php entry file to just echo a message and
> > then exit
> > 3) uploaded this to the site
> > 4) Posted the generated form from step  1)
> > 5) This corrcetly used the altered index file to display the message I
> > have set
>
> > 6) Revert the index.php file back to how it was to enable cake to work
> > 7) Generated a large problematic form
> > 8) Uploaded the revised index.php with just the echo message and exit
> > command
> > 9) Post the form from step 7)
> > 10) White screen - i.e this does not seem to even be accessing
> > index.php !
>
> > I guess this then suggests that it is a mod_rewrite / apache issue,
> > but hard to track down as it is
> > the shared host that I need to be running production on and so will be
> > hard (and maybe pointless) to try and
> > replicate this on my dev server.
>
> > Could the doctype affect the way that apache / mod_rewrite module
> > handles this?
>
> > As mentioned in an earlier post, I can setup a target for the
> > problematic  post data  that just vardumps the post variable and that
> > is handled on the same server (but outside of the cake htaccess
> > jurasdiction) and this works fine.
>
> > Any more insight would be helpful.
>
> > cheers
> > BREWER
>
> > On Nov 2, 9:52 pm, Tonu Tusk  wrote:
>
> > > I also set the upload_max_filesize and post_max_size to 128M
> > > and the available memory size to 256M
>
> > > Probably not going to make the shared host happy, but phpinfo is
> > > reporting these values as having been set.
>
> > > It's a mystery.
>
> > > I am going to try and replicate the problem on a clean install to try
> > > and track it down.
>
> > > On Nov 2, 7:52 pm, Dragos Chiriac  wrote:
>
> > > >http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
> > > > upload_max_filesize and post_max_size in your php.ini file.
> > > > Each name/value is limited to 1024 characters, if the form type is not
> > > > multipart.
> > > > Also look at memory size available for script ... the default 16M is not
> > > > enough, as cake itself uses about 6-9 of them for a not very complex
> > > > app. Notice that on certain distros the ini files for cli and apache
> > > > module are different, and that you need to restart apache after every
> > > > change. I suppose you use apache.
> > > > Also notice that certain browsers (cough, ie, cough) , in my experience,
> > > > have a hard time and break your post data if using many inputs and not
> > > > setting a multipart form.
>
> > > > Considering WSOD, is probably to have with your server (apache)
> > > > settings. Can you try to post the form to a simple php that's  > > > print_r($_POST) ?>ing the form data ?, with reporting E_ALL ?
>
> > > > #tail -f the error.log file of the server to see realtime what's the
> > > > server saying about your attempt.
>
> > > > Dragos
>
> > > > Tonu Tusk wrote:
> > > > > Hi, This is going to sounds a bit vague to start with, but I basically
> > > > > have a form that has a lot of input boxes in it
> > > > > ( > 500 text input boxes) and when this is posting back to the
> > > > > controller I get the WSOD.
>
> > > > > I have turned off all of my actual processing code in my controller
> > > > > and it did all work with a smaller

cakephp -> cache -> formhelper inside ->

2009-11-03 Thread hansi meier

in all my views i have a login/register (cake)form.
statement like this:
 if (user register) show hello else show registerform 

my question: how can i use the cacheengine with formhelper inside
 ?
please help!

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



Re: Cache View dose not work

2009-11-03 Thread hansi meier

same problem!
cakephp cache form.. (userlogin)
how can i use cache with a cakeform?



On 9 Okt., 15:18, Simon  wrote:
> yes i did that too
>
> On Oct 9, 2:56 am, Marco  wrote:
>
> > Did you set Configure::Cache.check to true in core.php?
>
> > Marco
>
> > On Oct 8, 1:45 pm, Simon  wrote:
>
> > > i tired both
> > > element('logininfo', array('cache' => false)); ?>
> > > => this dosen't work at all
>
> > > in the element i tired  which i see no
> > > debug error even though i set the debug 2
> > > but when i see the view source page i get the errorr that i posted
> > > above
> > > thats wired problem that i cant figure out
> > > thank you
>
> > > On Oct 8, 9:29 am, Miles J  wrote:
>
> > > > Try playing the nocache tags in the element itself. You can also pass
> > > > an option to the element ofcache= false.
>
> > > > element('logininfo', array('cache' => false)); ?>
>
> > > > On Oct 8, 9:26 am, Simon  wrote:
>
> > > > > haven't tried to remove thecachehelper would  that make any
> > > > > difference ?
>
> > > > > sorry i just wrote the  twice in this post  but the code
> > > > > is like this see below in my layout
>
> > > > > 
> > > > > element('logininfo'); ?>
> > > > > 
>
> > > > > On Oct 8, 9:17 am, Miles J  wrote:
>
> > > > > > Do you get an error when we remove thecachehelper?
>
> > > > > > Also the code should be:
>
> > > > > > 
> > > > > > element('logininfo'); ?>
> > > > > > 
>
> > > > > > On Oct 8, 7:44 am, Simon  wrote:
>
> > > > > > > well in that element it has the login user info which you dont 
> > > > > > > wanna
> > > > > > >cache
> > > > > > > here is what i have in post controller
>
> > > > > > >  var $helpers = array('Cache');
>
> > > > > > > in my view  action i have this
>
> > > > > > > $this->cacheAction = '1 hour';
>
> > > > > > > then in my default layout i have this element which i put the
> > > > > > > 
> > > > > > > 
> > > > > > > element('logininfo'); ?>
> > > > > > > 
> > > > > > > then i get errorr which i can't see in the browser i did view 
> > > > > > > source
>
> > > > > > > this is the ouput of error
>
> > > > > > > 
> > > > > > > Notice > > > > > > b> (8): Undefined property: stdClass::$model 
> > > > > > > [CORE\cake\libs
> > > > > > > \view\helper.php, line 333]
> > > > > > > 
> > > > > > >  > > > > > > onclick='document.getElementById
> > > > > > > ("CakeErrorCode1").style.display = (document.getElementById
> > > > > > > ("CakeErrorCode1").style.display == "none" ? "" : 
> > > > > > > "none")'>Code |
> > > > > > > Context > > > > > > a>$entity  =       "User."
> > > > > > > $setScope       =       true
> > > > > > > $view   =       stdClass
> > > > > > > stdClass::$modelScope = false > > > > > > class="cake-code-dump" style="display: none;"> > > > > > > style="color:
> > > > > > > #00">} > > > > > > code>
> > > > > > > 
> > > > > > > 
> > > > > > > $model = $view->model;
> > > > > > > Helper::setEntity() - 
> > > > > > > CORE\cake\libs\view\helper.php,
> > > > > > > line 333
> > > > > > > FormHelper::create() - CORE\cake\libs\view\helpers\form.php, line 
> > > > > > > 122
> > > > > > > include - APP\views\elements\slide.ctp, line 9
> > > > > > > View::_render() - CORE\cake\libs\view\view.php, line 654
> > > > > > > View::element() - CORE\cake\libs\view\view.php, line 339
> > > > > > > include - APP\tmp\cache\views\new_recipes_category_Basics.php, 
> > > > > > > line
> > > > > > > 121
> > > > > > > View::renderCache() - CORE\cake\libs\view\view.php, line 483
> > > > > > > Dispatcher::cached() - CORE\cake\dispatcher.php, line 718
> > > > > > > Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 130
> > > > > > > [main] - APP\webroot\index.php, line 90
> > > > > > > 
> > > > > > > Notice > > > > > > b> (8): Undefined property: stdClass::$association 
> > > > > > > [CORE\cake
> > > > > > > \libs\view\helper.php, line 366]
> > > > > > > 
> > > > > > >  > > > > > > onclick='document.getElementById
> > > > > > > ("CakeErrorCode2").style.display = (document.getElementById
> > > > > > > ("CakeErrorCode2").style.display == "none" ? "" : 
> > > > > > > "none")'>Code |
> > > > > > > Context > > > > > > a>$entity  =       "User."
> > > > > > > $setScope       =       true
> > > > > > > $view   =       stdClass
> > > > > > > stdClass::$modelScope = false
> > > > > > > $model  =       null
> > > > > > > $hasField       =       false
> > > > > > > $sameScope      =       true
> > > > > > > $parts  =       array(
> > > > > > >         "User"
> > > > > > > ) > > > > > > style="display:
> > > > > > > none;">} > > > > > > code>
> > > > > > > 
> > > > > > > if (!
> > > > > > > $view->association && $parts[0] == 
> > > > > > > $view->field && $view->field != 
> > > > > > > $view->model) {
> > > > > > > Helper::setEntity() - 
> > > > > > > CORE\cake\libs\view\helper.php,
> > > > > > > line 366
> > > > > > > FormHelper::create() - CORE\cake\libs\view\helpers\form.php, line 
> > > > > > > 122
> > > > > > > include - APP\views\elements\slide.ctp, line 9

Re: Two Auth problems never found sloutions for it

2009-11-03 Thread Simon

well i tired it in my login function dosent seem to work it keeps
login me in my email is not active

if ($this->Auth->user('email_active') == '0') {
  $this->Session->destroy();
  $this->redirect(array('controller' => 'users',
'action' => 'not_active'));
  }

On Nov 2, 7:04 pm, Robert P  wrote:
> He doesn't need to. Auth redirects only come into play on login,
> logout and when the user isn't authorised. Presumable Dave has allowed
> unauthorised access to
> RegistrationsController::pending_email_confirmation()
>
> On Nov 3, 6:47 am, Simon  wrote:
>
>
>
> > did you set auth redirect to false ??
>
> > On Nov 2, 2:37 pm, "Dave"  wrote:
>
> > > For #2 in my login function I have
>
> > > if ($this->Auth->user('confirmed') == '0') {
> > >                       $this->Session->destroy();
> > >                       $this->redirect(array('controller' => 
> > > 'registrations',
> > > 'action' => 'pending_email_confirmation'));
> > >                   }
> > > Dave
>
> > > -Original Message-
> > > From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On 
> > > Behalf
> > > Of Simon
> > > Sent: November-02-09 6:49 PM
> > > To: CakePHP
> > > Subject: Two Auth problems never found sloutions for it
>
> > > 1. is save the last login without the auth redirect = to false 2. if the
> > > email is not verified redirect them
>
> > > if you have any sloutions please share- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is this EVIL in cake?

2009-11-03 Thread lacenaepro...@gmail.com

SORRY, RETYPE AGAIN, I PRESSED THE SUBMIT BUTTON!!

HI,

I'm building a component that automatically sets the locale data
member of a translate behaviour.


In the action I look for the lang param, then call the component
method.


I'd like the component to set the locale data member in order to
avoid
to do that in ANY action.


Something like that:


// --- component class
function initialize(&controller, .) {
  // HERE I SAVE THE CONTROLLER INSTANCE
  $this->controller = $controller;
  



}


function doSomething() {
  // HERE I WANT TO ACCESS THE MODEL AND SET THE LOCALE
  $mod = $this->controller->.
  $model->locale = $mySavedLocale;

}


IS THIS EVIL IN CAKE. IS THERE ANOTHER MVC ORIENTED METHOD?

THANKS!!






On 3 Nov, 14:44, "lacenaepro...@gmail.com" 
wrote:
> HI,
>
> I'm building a component that automatically sets the locale data
> member of a translate behaviour.
>
> In the action I look for the lang param, then call the component
> method.
>
> I'd like the component to set the locale data member in order to avoid
> to do that in ANY action.
>
> Something like that:
>
> // --- component class
> function initialize(&controller, .) {
>   // HERE I SAVE THE CONTROLLER INSTANCE
>   $this->controller = $controller;
>   
>
> }
>
> function doSomething() {
>
>
>
> }- Nascondi testo citato
>
> - Mostra testo citato -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Is this EVIL in cake?

2009-11-03 Thread lacenaepro...@gmail.com

HI,

I'm building a component that automatically sets the locale data
member of a translate behaviour.

In the action I look for the lang param, then call the component
method.

I'd like the component to set the locale data member in order to avoid
to do that in ANY action.

Something like that:

// --- component class
function initialize(&controller, .) {
  // HERE I SAVE THE CONTROLLER INSTANCE
  $this->controller = $controller;
  
}

function doSomething() {

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



Re: How to prevent Cross Site Foreign Script Attacks on your actions.

2009-11-03 Thread John Andersen

Look at the documentation at CakePHP

http://book.cakephp.org/view/55/The-Parameters-Attribute-params

This will describe where CakePHP stores the form data and the URL
data.

Enjoy,
   John

On Nov 2, 6:44 pm, Jonas Hartmann 
wrote:
> Given someone mails you a link with html images that tries to 
> fetchhttp://domain.tld/users/add_friend/5
>   - now the user is logged into a web client that fetches that URL.
>
> How do you protect your cake application to not modify data. HTML wise  
> this should be a PUT or POST method not a GET method, but how do I  
> tell cakephp to ignore GET requests?
> How do I furthermore setup the link in my application's view ($html-
>  >link()) to use PUT or POST instead of GET? Will this be possible  
> without a ?
>
> Any tips?
>
> King regards
>   ionas82
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to prevent Cross Site Foreign Script Attacks on your actions.

2009-11-03 Thread j0n4s.h4rtm...@googlemail.com

I don't entirely understand. How could I fill up $_POSTS by using
$html->link?

On Nov 3, 12:32 am, Miles J  wrote:
> Well in most cases then not, if your on, says a users profile, you
> would submit to that page. Within that page you would check if a
> $_POST exists and then perform the add friend logic.
>
> On Nov 2, 8:44 am, Jonas Hartmann 
> wrote:
>
> > Given someone mails you a link with html images that tries to 
> > fetchhttp://domain.tld/users/add_friend/5
> >   - now the user is logged into a web client that fetches that URL.
>
> > How do you protect your cake application to not modify data. HTML wise  
> > this should be a PUT or POST method not a GET method, but how do I  
> > tell cakephp to ignore GET requests?
> > How do I furthermore setup the link in my application's view ($html-
> >  >link()) to use PUT or POST instead of GET? Will this be possible  
> > without a ?
>
> > Any tips?
>
> > King regards
> >   ionas82
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Trivia quiz model relationship

2009-11-03 Thread John Andersen

Question hasMany optional Answer
Question hasOne correct Answer

What you then need is only the models to define the trivias:
Question hasAndBelongsToMany Answer
Answer hasAndBelongsToMany Question
Question hasOne Answer
Answer belongsTo Question

Do observe that there are two associations between Answer and
Question. CakePHP can handle that, you just have to define it!

When a user is going to give the solution to each question, you would
need:
User hasMany Solution
Solution belongsTo User
Solution belongsTo Question
Solution belongsTo Answer

Enjoy,
   John


On Nov 3, 7:58 am, mupet  wrote:
> Hi, i will create trivia quiz application using cakePHP,  i have
> trouble on designing model reationship.
> In this case i have question, answers and correct answer.
> which is  One question have 3 optional answers but have only 1 correct
> answers. How to design model relationship?
>
> Thanks and regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Some links to cakephp

2009-11-03 Thread mupet

http://www.jamesfairhurst.co.uk/, i like this site there is a lot of
tutorials from installing to some advance feature on cake

On Nov 2, 5:09 pm, Mohame Cherif BOUCHELAGHEM
 wrote:
> hi, you can use the bakery (http://bakery.cakephp.org/)  u will find
> tutorials and codes there , download this great free 
> ebookhttp://www.pseudocoder.com/free-cakephp-book/it is about tips and tricks 
> in
> cakephp
> or this links for cakephp core developers
>
> ->http://kevin.vanzonneveld.net/
> ->http://www.littlehart.net/atthekeyboard/
> ->http://cricava.com/blogs/mariano.php
> ->http://debuggable.com/
>
> and use github.org u can a lot of repos for plugings, helpers, behaviours,
> components or even projects like croogo cms or wildflower cms
>
> 2009/11/2 Simon 
>
>
>
> > Hii,
>
> > Plz Give me some useful links to refer the cakephp codes for my
> > project other than cakephp manual.
>
> > thanking you,
> >            Simon

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



Trivia quiz model relationship

2009-11-03 Thread mupet

Hi, i will create trivia quiz application using cakePHP,  i have
trouble on designing model reationship.
In this case i have question, answers and correct answer.
which is  One question have 3 optional answers but have only 1 correct
answers. How to design model relationship?

Thanks and regards

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



Re: WSOD on large number of elements in a form

2009-11-03 Thread John Andersen

Is the environment at your production site and your development site
the same?

Could you create a dummy application, with only the problematic form/
view, and test it?

If the issue is still there, can you provide the dummy application or
the view for us to test?

Enjoy,
   John

On Nov 3, 1:45 pm, Tonu Tusk  wrote:
> OK - if this also helps anyone to offer any suggestions, here is what
> I have just done.
>
> 1) generated a smaller (tested working) form with what seems to be
> acceptable to cake
> 2) Altered the main index.php entry file to just echo a message and
> then exit
> 3) uploaded this to the site
> 4) Posted the generated form from step  1)
> 5) This corrcetly used the altered index file to display the message I
> have set
>
> 6) Revert the index.php file back to how it was to enable cake to work
> 7) Generated a large problematic form
> 8) Uploaded the revised index.php with just the echo message and exit
> command
> 9) Post the form from step 7)
> 10) White screen - i.e this does not seem to even be accessing
> index.php !
>
> I guess this then suggests that it is a mod_rewrite / apache issue,
> but hard to track down as it is
> the shared host that I need to be running production on and so will be
> hard (and maybe pointless) to try and
> replicate this on my dev server.
>
> Could the doctype affect the way that apache / mod_rewrite module
> handles this?
>
> As mentioned in an earlier post, I can setup a target for the
> problematic  post data  that just vardumps the post variable and that
> is handled on the same server (but outside of the cake htaccess
> jurasdiction) and this works fine.
>
> Any more insight would be helpful.
>
> cheers
> BREWER
>
> On Nov 2, 9:52 pm, Tonu Tusk  wrote:
>
> > I also set the upload_max_filesize and post_max_size to 128M
> > and the available memory size to 256M
>
> > Probably not going to make the shared host happy, but phpinfo is
> > reporting these values as having been set.
>
> > It's a mystery.
>
> > I am going to try and replicate the problem on a clean install to try
> > and track it down.
>
> > On Nov 2, 7:52 pm, Dragos Chiriac  wrote:
>
> > >http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
> > > upload_max_filesize and post_max_size in your php.ini file.
> > > Each name/value is limited to 1024 characters, if the form type is not
> > > multipart.
> > > Also look at memory size available for script ... the default 16M is not
> > > enough, as cake itself uses about 6-9 of them for a not very complex
> > > app. Notice that on certain distros the ini files for cli and apache
> > > module are different, and that you need to restart apache after every
> > > change. I suppose you use apache.
> > > Also notice that certain browsers (cough, ie, cough) , in my experience,
> > > have a hard time and break your post data if using many inputs and not
> > > setting a multipart form.
>
> > > Considering WSOD, is probably to have with your server (apache)
> > > settings. Can you try to post the form to a simple php that's  > > print_r($_POST) ?>ing the form data ?, with reporting E_ALL ?
>
> > > #tail -f the error.log file of the server to see realtime what's the
> > > server saying about your attempt.
>
> > > Dragos
>
> > > Tonu Tusk wrote:
> > > > Hi, This is going to sounds a bit vague to start with, but I basically
> > > > have a form that has a lot of input boxes in it
> > > > ( > 500 text input boxes) and when this is posting back to the
> > > > controller I get the WSOD.
>
> > > > I have turned off all of my actual processing code in my controller
> > > > and it did all work with a smaller number of input boxes, but now it
> > > > just white screens.
>
> > > > As I mentioned, rewriting the controller code to just not even touch
> > > > the POSTed data but just to show some indication of status does not
> > > > affect things, there should be no (or next to no) processing of this
> > > > going on, but the controller definitely still works with exactly the
> > > > same code generating the forms, just a fewer number of inputs in the
> > > > form.
>
> > > > I have altered my php settings from 8M post memory to 128M as well as
> > > > massively upping the memory allowed for
> > > > php scripts but still white screen.
>
> > > > I don't know where to start I have tried chainging index.php in the
> > > > main entry call between generting the form and
> > > > posting it anywhere but again, I am just getting a whitescreen.
>
> > > > Any help at all to point me where to look next would be welcome. If I
> > > > can't debug cake then it will be a good couple of months work down the
> > > > pan and I'll have to choose another option for framework etc as I
> > > > can't waste any more time on bumbling around blindly.
>
> > > > 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 unsu

Re: save sensitive information

2009-11-03 Thread WyriHaximus

Did you take a look at this piece of code?
http://bakery.cakephp.org/articles/view/cryptable-behavior

On Nov 3, 10:30 am, "euromark (munich)" 
wrote:
> i was wondering how to save sensitive information of users
> like cc number or bank data?
> my guess is they should not be saved as plain "chars" but encrypted in
> such a way that if the db is ever going to be hacked the retrieved
> data would be useless to anyone without the correct "key"
>
> passwords usually are stored sha1-hashed as you dont intend to revert
> that (and cant)
> but with the above examples you need to
>
> is there some kind of behaviour to automatically cipher and save or
> decrypt and read record data?
> i stumpled uopn Security::cipher() for that matter
>
> and how save would that be?
> could you re-build the original string from a given ciphered one with
> a modern computer? or would it be pointless for "everyday hackers"?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: WSOD on large number of elements in a form

2009-11-03 Thread Tonu Tusk

OK - if this also helps anyone to offer any suggestions, here is what
I have just done.

1) generated a smaller (tested working) form with what seems to be
acceptable to cake
2) Altered the main index.php entry file to just echo a message and
then exit
3) uploaded this to the site
4) Posted the generated form from step  1)
5) This corrcetly used the altered index file to display the message I
have set

6) Revert the index.php file back to how it was to enable cake to work
7) Generated a large problematic form
8) Uploaded the revised index.php with just the echo message and exit
command
9) Post the form from step 7)
10) White screen - i.e this does not seem to even be accessing
index.php !

I guess this then suggests that it is a mod_rewrite / apache issue,
but hard to track down as it is
the shared host that I need to be running production on and so will be
hard (and maybe pointless) to try and
replicate this on my dev server.

Could the doctype affect the way that apache / mod_rewrite module
handles this?

As mentioned in an earlier post, I can setup a target for the
problematic  post data  that just vardumps the post variable and that
is handled on the same server (but outside of the cake htaccess
jurasdiction) and this works fine.

Any more insight would be helpful.

cheers
BREWER


On Nov 2, 9:52 pm, Tonu Tusk  wrote:
> I also set the upload_max_filesize and post_max_size to 128M
> and the available memory size to 256M
>
> Probably not going to make the shared host happy, but phpinfo is
> reporting these values as having been set.
>
> It's a mystery.
>
> I am going to try and replicate the problem on a clean install to try
> and track it down.
>
> On Nov 2, 7:52 pm, Dragos Chiriac  wrote:
>
> >http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
> > upload_max_filesize and post_max_size in your php.ini file.
> > Each name/value is limited to 1024 characters, if the form type is not
> > multipart.
> > Also look at memory size available for script ... the default 16M is not
> > enough, as cake itself uses about 6-9 of them for a not very complex
> > app. Notice that on certain distros the ini files for cli and apache
> > module are different, and that you need to restart apache after every
> > change. I suppose you use apache.
> > Also notice that certain browsers (cough, ie, cough) , in my experience,
> > have a hard time and break your post data if using many inputs and not
> > setting a multipart form.
>
> > Considering WSOD, is probably to have with your server (apache)
> > settings. Can you try to post the form to a simple php that's  > print_r($_POST) ?>ing the form data ?, with reporting E_ALL ?
>
> > #tail -f the error.log file of the server to see realtime what's the
> > server saying about your attempt.
>
> > Dragos
>
> > Tonu Tusk wrote:
> > > Hi, This is going to sounds a bit vague to start with, but I basically
> > > have a form that has a lot of input boxes in it
> > > ( > 500 text input boxes) and when this is posting back to the
> > > controller I get the WSOD.
>
> > > I have turned off all of my actual processing code in my controller
> > > and it did all work with a smaller number of input boxes, but now it
> > > just white screens.
>
> > > As I mentioned, rewriting the controller code to just not even touch
> > > the POSTed data but just to show some indication of status does not
> > > affect things, there should be no (or next to no) processing of this
> > > going on, but the controller definitely still works with exactly the
> > > same code generating the forms, just a fewer number of inputs in the
> > > form.
>
> > > I have altered my php settings from 8M post memory to 128M as well as
> > > massively upping the memory allowed for
> > > php scripts but still white screen.
>
> > > I don't know where to start I have tried chainging index.php in the
> > > main entry call between generting the form and
> > > posting it anywhere but again, I am just getting a whitescreen.
>
> > > Any help at all to point me where to look next would be welcome. If I
> > > can't debug cake then it will be a good couple of months work down the
> > > pan and I'll have to choose another option for framework etc as I
> > > can't waste any more time on bumbling around blindly.
>
> > > thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help doing this in CakePHP

2009-11-03 Thread schneimi

Hi,

if I understood you right, this could be what you need:

$result = $this->YourModel->find('all', array('group' => array
(domain_'id', 'search_engine_id'),
   'order'
=> 'MAX(created)'));

With pagination it should look like this:

$this->paginate['YourModel'] = array('group' => array(domain_'id',
'search_engine_id'),
'order' => 'MAX
(created)');
$this->paginate('YourModel');

In both cases you can get related data with the 'contain' option in
the array.

Hope this helps,

Michael

On 3 Nov., 00:29, Chad Casselman  wrote:
> I have a table that looks like:
>
> id      created         modified        domain_id       pages   
> search_engine_id
> 92      2009-11-02 14:32:11     2009-11-02 14:32:11     2       19990   3
> 90      2009-11-02 14:32:11     2009-11-02 14:32:11     2       725     1
> 89      2009-11-02 14:32:10     2009-11-02 14:32:10     1       1250    1
> 88      2009-11-02 10:00:07     2009-11-02 10:00:07     2       19995   3
> 87      2009-11-02 10:00:07     2009-11-02 10:00:07     1       9612    3
> 86      2009-11-02 10:00:07     2009-11-02 10:00:07     2       725     1
> 85      2009-11-02 10:00:07     2009-11-02 10:00:07     1       1250    1
> 84      2009-11-02 09:59:47     2009-11-02 09:59:47     2       19995   3
> 83      2009-11-02 09:59:47     2009-11-02 09:59:47     1       9609    3
> 82      2009-11-02 09:59:47     2009-11-02 09:59:47     2       725     1
> 81      2009-11-02 09:59:47     2009-11-02 09:59:47     1       1250    1
> 80      2009-11-02 09:59:39     2009-11-02 09:59:39     2       19995   3
> 79      2009-11-02 09:59:39     2009-11-02 09:59:39     1       9609    3
> 78      2009-11-02 09:59:39     2009-11-02 09:59:39     2       725     1
> 77      2009-11-02 09:59:39     2009-11-02 09:59:39     1       1250    1
>
> I have spent over half the day trying to figure out how to pull the
> last inserted row for each domain_id, search_engine_id pair in
> CakePHP.
>
> Can anyone help me figure out how to do this within CakePHP?
>
> I really appreciate your time.
> Chad
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



save sensitive information

2009-11-03 Thread euromark (munich)

i was wondering how to save sensitive information of users
like cc number or bank data?
my guess is they should not be saved as plain "chars" but encrypted in
such a way that if the db is ever going to be hacked the retrieved
data would be useless to anyone without the correct "key"

passwords usually are stored sha1-hashed as you dont intend to revert
that (and cant)
but with the above examples you need to

is there some kind of behaviour to automatically cipher and save or
decrypt and read record data?
i stumpled uopn Security::cipher() for that matter

and how save would that be?
could you re-build the original string from a given ciphered one with
a modern computer? or would it be pointless for "everyday hackers"?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How define HABTM with models without jointable

2009-11-03 Thread marco.rizze...@gmail.com

Hi
I have 2 models that haven't DB like datasource.
Now I would set a HABTM relation between these models ( I manage the
data to save with my create method in my datasource).
Now If I don't set a jointable when define HABTM  relation I get an
error.
How can I define a HABTM relation without jointable?
Many Thanks
Marco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-03 Thread red

Thanks Dr. Loboto for your answer - I've already done like that.
Function prepareToSaveAll that takes some array and returns converted.




On 3 Lis, 04:25, "Dr. Loboto"  wrote:
> I think you must convert array structure before save call. saveAll
> function determine the way must be used for actual save before
> beforeSave is called. So saveAll thinks that it should save one record
> of one structure, but then you change it to many records of other
> structure. So save fails. Make your own mySave method, convert array
> there and then call saveAll.
>
> On Nov 2, 4:04 pm, red  wrote:
>
>
>
> > Hi,
> > I've pasted code here:http://bin.cakephp.org/saved/52122
>
> > The problem is that the saveAll() doesn't work at all. Ok, it's
> > invoked and $this->data is modified, but saveAll() does not save any
> > records and debug($this->data) after success of saveAll() shows the
> > old structure of $this->data. What I'm doing wrong?
>
> > Please help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Helper or Model Function?

2009-11-03 Thread nurvzy

If you have to load a model into your helper (not recommended) you can
use

ClassRegistry::init('ModelName')->find(...);

API: http://api.cakephp.org/class/class-registry#method-ClassRegistryinit

But I agree with John, use requestAction if you need to pull in data
from a view.  Here's a thought, is there a way to pass in the needed
flag record to your view?  In your controller action, maybe something
like:

$this->set('showLink', $this->Model->find(/*conditions for specific
record*/));

Then in your view you could just:
 LINK 

-Nick


On Nov 2, 10:50 am, dtirer  wrote:
> Hi John, thanks for the info.  I'll give that a whirl
>
> A general question:  do helpers have access to Model data, or would
> you need to import the Model into the helper to access data like
> that?.
>
> Im just getting into Helpers, Components, etc so I'm trying to figure
> out when its best to use each
>
> On Nov 2, 12:25 pm, John Andersen  wrote:
>
> > Based on the information you provided (not enough):
>
> > One possible solution is to have a separate Element to create the
> > link, when the database contains the specific record.
> > The element will use requestAction to query the database for the
> > specific record, and display/not display the link depending on the
> > reply.
>
> > Turn on cache for the element, so that the requestAction is only used
> > once in each session.
>
> > Enjoy,
> >    John
>
> > On Nov 2, 5:40 pm, dtirer  wrote:
>
> > > So here's my scenario. On a particular page, I want to display a link.
> > > However, I only want to display this link if a particular record
> > > exists in the database.
>
> > > Firstly, do helpers have access to DB/Model info?
>
> > > If so, should I make a helper to check if the records exists in the
> > > DB?
>
> > > Whats the best way to do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp.org hacked?

2009-11-03 Thread nurvzy

Mark just said he's going to untwist our panties.  I, for one, am
aroused.

On Nov 2, 10:29 pm, mark_story  wrote:
> Yeah its partially a halloween design.
>
> For everyone with their panties in a twist, it will be changed back
> soon. We can all resume being _serious_ about a framework with many
> food based puns.
>
> -Mark
>
> On Nov 2, 7:23 am, Adrenalin  wrote:
>
> > I think that is funny, cakephp rockz ! ;)
>
> > On Mon, Nov 2, 2009 at 10:14 AM, Shadab Shaikh  wrote:
> > > Its look like horror film related website,probably due to celebration of
> > > Halloween, but the theme/graphics does not match with the purpose and
> > > concern of the website. Most weird graphics so far ! It should be changed
> > > asap !
>
> > > Shadab
>
> > > On Mon, Nov 2, 2009 at 1:33 PM, tobi_one  wrote:
>
> > >> Sorry for that multithread. I did not see any related thread, when
> > >> posting.
>
> > >> The "RIP" Cakephp graphics still feels weird to me, even though it
> > >> maybe halloween... But then, we don't celebrate Halloween over here!
>
> > >> Cheers,
> > >> tobi_one
>
> > >> On 1 Nov., 18:54, SERKAN TURAN  wrote:
> > >> > *Halloween* :)
>
> > >> > On Sun, Nov 1, 2009 at 7:44 PM, jacmoe  wrote:
>
> > >> > > Congratulations! :)
> > >> > > You just started the fifth thread on that subject.
> > >> > > No, the Cake devs put a lot of hard work into making us smile.
>
> > >> > > On Nov 1, 6:42 pm, tobi_one  wrote:
> > >> > > > What's wrong with the website?
>
> > >> > > > Looks like it has been hacked or is this a "funny" Halloween joke?
>
> > >> > > > Cheers,
> > >> > > > tobi_one
>
> > >> > --
> > >> > ST
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP + Python's scipy/numpy/matolab/etc?

2009-11-03 Thread Dr. Loboto

PHP and Python code cannot be "integrated". You can call your Python
code through exec() and exchange data by text/xml/whatever files. Or
just send initial data as param and output result.

On Nov 2, 12:43 pm, Josh  wrote:
> Hello,
>
> I've got a question about mixing languages in a project:
>
> I am using Cake on an App and it is going quite well. However, I now
> need to do some statistical analysis/curve fitting/advanced plotting/
> matrix manipulation/object difference calc/etc. In retrospect, I
> should have done this project in a python framework from the
> beginning, but I like Cake so I stuck with it. Now I am looking to get
> the functionality of scipy/numpy/matolab/etc APIs/modules. At this
> point, how best should I integrate these? Would it be easiest to make
> a bare bones API that returns the data/NLR formulas in perhaps a json
> or xml format?  I was thinking of using a python framework such as
> Django so as to be able to use its serializer and other tools. Any
> suggestions? Has anyone had to integrate code libraries from other
> languages in this way before?
>
> Please let me know if I'm wrong about PHP and if I've over looked
> libraries with functionality and stability that rival the python
> libraries I mentioned.
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---