Re: getting a 404 with Media View

2009-07-28 Thread JamesF

sounds like a permissions problem. who owns that directory? if you are
in a shell type "chown accountnameHere /htmldirectory/"
and check read/execute permissions. also a stray or
misconfigured .htaccess can cause these problems.

On Jul 28, 10:37 am, Stinkbug  wrote:
> I'm assuming this is an apache config problem, but I'm not sure what
> could be causing it.  Thought I'd just ask the community to see if
> anyone knew what the problem might be.
>
> I'm using the Media view to download files and have the files
> directory outside the webroot.  I'm getting a 404 Page cannot be found
> error when tring to download the file.  It works in out test
> envirnoment just fine, but when I move into production, I get this
> error.  Could it be an apache config problem, or an app problem?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: "approved" field for a model

2009-07-28 Thread park

Hi James,

You're absolutely right. I can't agree more on the fat model idea.

Your approach should definitely work, but I still need to dive into
controllers and make changes to find calls. And what's more, what
about the paginate things? What about containable queries that concern
this model...

I assume there should be a way to globally set this condition in the
scope of this particular model? Like setting conditions to
Model.approved = 1, which affects all queries, paginations as well as
containable.

Something like this one, but much simpler:
http://bakery.cakephp.org/articles/view/soft-delete-behavior

As for the admin part, maybe I can disable this condition on the fly
before whenever a query is made.

On Jul 29, 2:13 pm, JamesF  wrote:
> "It's an existing site, so I don't want to rewrite conditions for all
> find queries. "
>
> ahh thats why we should be using fat models instead of fat
> controllers.
>
> the most direct way to achieve this would be to put it in each find
> call.
>
> the best way would be to set up a function in your model, lets call it
> findApproved()
>
> so in you model you put
>
> function findApproved(){
>
>      $data = $this->find('all', array('conditions'=>array
> ('Model.approved'=>1,
> more conditions etc etc)));
>
>       return $data;
>
> }
>
> in your controller just put
> $this->Model->findApproved() in place of those old rusty controller
> find calls.
>
> On Jul 29, 1:38 am, park  wrote:
>
>
>
> > Hi,
>
> > Would like to add an "approved" field for a model. Users can only see
> > entries whose Model.approved = 1. Only in admin section can unapproved
> > entries be retrieved.
>
> > It's an existing site, so I don't want to rewrite conditions for all
> > find queries.
>
> > Is there a centralized method (presumably in Model) of achieving this?
>
> > Many thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cannot modify header information - headers already sent by

2009-07-28 Thread JamesF

don't use ?> to end a php file. just leave it out and you will solve
90% of these errors.

On Jul 28, 12:36 pm, Delberto  wrote:
> Problem solved. Seems there was a space in the webroot/index.php Quite
> frustrating.
>
> On Jul 28, 12:44 pm, Delberto  wrote:
>
> > Hello,
>
> > I am having a problem with my application. I have it running fine on
> > my local development machine. Yet when I put it on the server I get
> > this error "Cannot modify header information -headersalreadysent
> > by". I have checked the controllers and models for spaces before  > and after ?> but I cannot find any.
>
> > I am using Wamp on my local machine and the remote server is Linux
> > with PHP5 on it.
>
> > Any ideas would be appreciated as I have been nearly a day trying to
> > figure this out.
>
> > Cheers,
> >   Derek
--~--~-~--~~~---~--~~
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: Router URLs: hyphens instead of underscores

2009-07-28 Thread JamesF

congrats now you get to run str_replace on every url parsed by your
app. even worse when the codebase is upgraded your hack will be
difficult to maintain. basically you will have to recode it every time
you upgrade. best to leave the core ALONE.

you should really just be defining these routes in the router in the
first place with dashes

Router::connect('/my-links/*', array('controller' => 'my_controller',
'action' => 'my_links'));
);

you should be using verbose linking(reverse routing) in your views
echo $html->link('my link text', array('controller' =>
'my_controller', 'action' => 'my_links'));

more information about your "links" would be helpful in solving your
problem.

On Jul 27, 2:15 pm, Jamie  wrote:
> Alright, so what I just ended up doing was adding a bit of a hack to
> cake/libs/router.php and app/config/bootstrap.php.
>
> In the Router::url(), I changed the last line:
>
> return $output . $extension . $_this->queryString($q, array(),
> $escape) . $frag;
>
> To this:
>
> $url = str_replace('_', '-', $output . $extension . $_this->queryString
> ($q, array(), $escape) . $frag);
> return $url;
>
> Then I added this to the top of my bootstrap:
>
> $_GET['url'] = str_replace('-', '_', $_GET['url']);
>
> Total hack? You betcha. But it works for now.
>
> On Jul 27, 10:56 am, Jamie  wrote:
>
> > Yes, I know this issue has been raised in the past (a long while ago),
> > but there's been no satisfying answer yet.
>
> > Basically, best SEO practices say that we should be using hyphens
> > instead of underscores in our URLs, since search engines such as
> > Google have an easier time parsing "my-page", rather than "my_page",
> > as two separate words (and thus a distinct search term). Is it time
> > for Cake to look at allowing hyphens instead of underscores in URLs?
>
> > Before anyone says "OMG you can just do this" (as Nate suggested 
> > athttp://trac.cakephp.org/ticket/1727):
>
> > $_GET['url'] = str_replace("-", "_", $_GET['url']);
>
> > that's fine for parsing incoming URLs, but it doesn't even come close
> > to providing a solution since links generated by the Cake router (i.e.
> > via the HtmlHelper etc.) use underscores instead of hyphens, and
> > that's that. So for those of us who want to use hyphens instead of
> > dashes, we need to enter manual URLs instead of using Cake's routing
> > capabilities. So, sure, we can translate incoming links, but we can't
> > generate the proper links in the first place.
>
> > Has anyone thought of a solution? Is the Cake team contemplating
> > adding support for multiple URL separators? Any home brew hacks out
> > there?
>
> > - Jamie
--~--~-~--~~~---~--~~
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: Router URLs: hyphens instead of underscores

2009-07-28 Thread JamesF

congrats now you get to run str_replace on every url parsed by your
app.

you should really just be defining these routes in the router in the
first place with dashes

Router::connect('/my-links/*', array('controller' => 'my_controller',
'action' => 'my_links'));
);

you should be using verbose linking(reverse routing) in your views
echo $html->link('my link text', array('controller' =>
'my_controller', 'action' => 'my_links'));

more information about your "links" would be helpful in solving your
problem.

On Jul 27, 2:15 pm, Jamie  wrote:
> Alright, so what I just ended up doing was adding a bit of a hack to
> cake/libs/router.php and app/config/bootstrap.php.
>
> In the Router::url(), I changed the last line:
>
> return $output . $extension . $_this->queryString($q, array(),
> $escape) . $frag;
>
> To this:
>
> $url = str_replace('_', '-', $output . $extension . $_this->queryString
> ($q, array(), $escape) . $frag);
> return $url;
>
> Then I added this to the top of my bootstrap:
>
> $_GET['url'] = str_replace('-', '_', $_GET['url']);
>
> Total hack? You betcha. But it works for now.
>
> On Jul 27, 10:56 am, Jamie  wrote:
>
> > Yes, I know this issue has been raised in the past (a long while ago),
> > but there's been no satisfying answer yet.
>
> > Basically, best SEO practices say that we should be using hyphens
> > instead of underscores in our URLs, since search engines such as
> > Google have an easier time parsing "my-page", rather than "my_page",
> > as two separate words (and thus a distinct search term). Is it time
> > for Cake to look at allowing hyphens instead of underscores in URLs?
>
> > Before anyone says "OMG you can just do this" (as Nate suggested 
> > athttp://trac.cakephp.org/ticket/1727):
>
> > $_GET['url'] = str_replace("-", "_", $_GET['url']);
>
> > that's fine for parsing incoming URLs, but it doesn't even come close
> > to providing a solution since links generated by the Cake router (i.e.
> > via the HtmlHelper etc.) use underscores instead of hyphens, and
> > that's that. So for those of us who want to use hyphens instead of
> > dashes, we need to enter manual URLs instead of using Cake's routing
> > capabilities. So, sure, we can translate incoming links, but we can't
> > generate the proper links in the first place.
>
> > Has anyone thought of a solution? Is the Cake team contemplating
> > adding support for multiple URL separators? Any home brew hacks out
> > there?
>
> > - Jamie
--~--~-~--~~~---~--~~
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: "approved" field for a model

2009-07-28 Thread Dr. Loboto

You can try beforeFind model callback to add this condition to all
"find" calls. And set to true/false some model variable from
controller (true in admin section, false by default) to check in
beforeFind.

On Jul 29, 12:38 pm, park  wrote:
> Hi,
>
> Would like to add an "approved" field for a model. Users can only see
> entries whose Model.approved = 1. Only in admin section can unapproved
> entries be retrieved.
>
> It's an existing site, so I don't want to rewrite conditions for all
> find queries.
>
> Is there a centralized method (presumably in Model) of achieving this?
>
> Many thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Add Jar files in cakephp

2009-07-28 Thread Dr. Loboto

Place it into /app/webroot and use absolute path in view (if I
understand your problem right).

On Jul 28, 5:13 pm, "PraDz Misc"  wrote:
> Hi
>
> I have an applet which is used for uploading the files to the server.
> when I run with a html file, its running perfectly fine since I have the jar 
> files in ../lib/all_jar_files
>
> when using that in CakePHP, how do I add all the jar files to make applet 
> work.
>
> thanks
>
> --- 
> -
> Pradheep Ayyanar, Team Leader
> ---
--~--~-~--~~~---~--~~
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: Moving nested if statements out of the view.

2009-07-28 Thread JamesF

create a helper for you form error logic
lets call it ErrorsHelper

http://book.cakephp.org/view/98/Helpers

you can move all you logic in the helper and call it like so:
echo $errors->getErrors($this->ModelName->invalidFields())

you might have to play with it but helpers are the mothod of choice
for moving bulky logic out of the view


On Jul 28, 10:39 am, Shaun  wrote:
> I prefer to display form validation errors at the top of the form
> rather than under each form field.  I would also like to display only
> one error at a time.  I have the following code at the top of my form:
>
>  if ($form->isFieldError('user_username')){
>         echo $form->error('user_username');} elseif 
> ($form->isFieldError('user_password')) {
>
>         echo $form->error('user_password');} elseif 
> ($form->isFieldError('user_given_name')) {
>
>         echo $form->error('user_given_name');} elseif 
> ($form->isFieldError('user_surname')) {
>
>         echo $form->error('user_surname');} elseif 
> ($form->isFieldError('user_email')) {
>
>         echo $form->error('user_email');}
>
> ?>
>
> How can I move the nested if statements out of my view?  Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Set user variables

2009-07-28 Thread JamesF

is $this->Auth->user('id') really that difficult to call?

--~--~-~--~~~---~--~~
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: "approved" field for a model

2009-07-28 Thread JamesF

"It's an existing site, so I don't want to rewrite conditions for all
find queries. "

ahh thats why we should be using fat models instead of fat
controllers.

the most direct way to achieve this would be to put it in each find
call.

the best way would be to set up a function in your model, lets call it
findApproved()

so in you model you put

function findApproved(){

 $data = $this->find('all', array('conditions'=>array
('Model.approved'=>1,
more conditions etc etc)));

  return $data;

}

in your controller just put
$this->Model->findApproved() in place of those old rusty controller
find calls.

On Jul 29, 1:38 am, park  wrote:
> Hi,
>
> Would like to add an "approved" field for a model. Users can only see
> entries whose Model.approved = 1. Only in admin section can unapproved
> entries be retrieved.
>
> It's an existing site, so I don't want to rewrite conditions for all
> find queries.
>
> Is there a centralized method (presumably in Model) of achieving this?
>
> Many thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: "approved" field for a model

2009-07-28 Thread JamesF

"It's an existing site, so I don't want to rewrite conditions for all
find queries. "

ahh thats why we should be using fat models instead of fat
controllers.

the most direct way to achieve this would be to put it in each find
call.

the best way would be to set up a function in your model, lets call it
findApproved()

so in you model you put

function findApproved(){

 $this->find('all', array('conditions'=>array('Model.approved'=>1,
more conditions etc etc)));


}

On Jul 29, 1:38 am, park  wrote:
> Hi,
>
> Would like to add an "approved" field for a model. Users can only see
> entries whose Model.approved = 1. Only in admin section can unapproved
> entries be retrieved.
>
> It's an existing site, so I don't want to rewrite conditions for all
> find queries.
>
> Is there a centralized method (presumably in Model) of achieving this?
>
> Many thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: delete post AND unlink image

2009-07-28 Thread JamesF

well you won't be adapting $this->Model->del() i hope but what you
could do is this:

..in your controller action:

//if record was deleted succesfully
if($this->Model->delete($this->Model->id))
{
 //if image unlinks succesfully
if(unlink($image))
{
 //success
}

else
{
//image failed to unlink
}
}
//else record did not delete
else
{
   //record failed to delete
}

i personally would stuff this logic into my model and call it like
this:
$this->Model->myDeleteFunction($data)

you would have to change every reference to $this->Model->function()
to $this->function()
when using the code in the model.

that would allow you to reuse to logic in any controller that uses the
associated models thus keeping your controllers nice and skinny.

On Jul 28, 9:03 pm, bberg  wrote:
> hi
> i have a "posts" table with an image field.
> it stores just the filename as a varchar of course.
> how can i adapt the "delete" action so it also unlinks the image?
> thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake + IIS + MSSQL? Should I bother?

2009-07-28 Thread JamesF

cake shouldn't need anything special to run on IIS, just make sure
your core config is set up for mssql

there might be some url routing issues with .htaccess that are
specific to IIS of which I cannot comment since i work with apache.

On Jul 29, 12:49 am, Menkes  wrote:
> I am a long time PHP advocate living in an IIS + MSSQL world. I have
> always coded by hand because most everything PHP was *NIX based.
>
> I'd like to move to a stable framework. I was checking out symfony and
> while I liked what they showed, the fact is nearly every single action
> required research then modification to get it to play nice with IIS
> and MSSQL.
>
> What about Cake? Please only answer if you have actually developed an
> application using Cake + IIS + MSSQL. If you feel the need to bash
> what I am using, go get in line...but be silent ;)
>
> Thanks,
>
>  - Scott
--~--~-~--~~~---~--~~
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: Implement jQuery UI into CakePHP application

2009-07-28 Thread JamesF

i take a bit of issue with your statements "hope someone can help me
out with this coz i cant design and code even
if my life depended on it. "  i personally don't understand what you
mean by it doesn't work. you should really dig a bit deeper and
troubleshoot your own code.

ex. 'I expected the accordion to work like this, but it does not."

step 1) is jquery accordian module loading correctly? is jquery
loaded? examine your source code
step 2) are there javascript errors? what do they tell me? maybe there
is a typo i missed in my $(document) function
step 3) is my html set up correctly with the right hooks for jquery to
select?

and finally a word of advice with jquery uido you really need to
use it?...including css and modules/effects you are adding an avg
300-500k to your webpage. you could just get a smaller accordion
plugin and a minified jquery build and call it a day.

i don't mean to be harsh but most of the folks around here really
appreciate when someone takes the time to research

On Jul 28, 1:19 pm, awh  wrote:
> I'm working on something during my free time and at the same time
> trying to learn. I read around and know that it is possible to
> implement jQuery UI into a CakePHP application and that it was
> supposed to be easy.
>
> Been mingling around for a while and still have no idea. Would
> appreciate if anyone could guide me on how to implement this. I'm
> using:-
>
> - jQuery UI 1.7.2 or I could move to jQuery UI 1.6 if needed.
> - CakePHP 1.2.3.8166
>
> Now, when i downloaded the zipped jQuery UI file, it includes
>
> - css dir (have ui - darkness dir here and an img folder inside it
> along with a jquery.css file)
> - development dir (a shit load of directories and files in here)
> - js dir (the jquery.js file seems to be in here)
> - index.html
>
> i followed the instructions here:-
>
> http://www.mail-archive.com/cake-...@googl...m/msg61671.html
>
> I have my jquery stuff set up like:
>
> webroot
> |_ js
>     |_ jquery
>          |_ jquery.js
>          |_ ui
>              |_ core.js
>              |_ accordion.js
>
> Then in my view I do:
>
> link(array("jquery/jquery.js","jquery/ui/
> core.js","jquery/ui/accordion.js"),false); ?>
>
> 
>
> [bad html removed] Put your accordion stuff here -->
>
> 
>
> 
>
> $(function () {
>
> $("#accordion").accordion({
>
> // options go here
>
> });
> });
>
> 
>
> but it didnt seem to work out for me.
>
> First thing is, where do i put all the files and folders in my cake
> dir?
>
> Second thing is, besides the view, do i need to load any components,
> helpers or the likes into my controller to be able to use this UI?
> would appreciate if someone could include the code for the view and
> contoller as im very much clueless.
>
> my cakephp app is just a fresh install with the "blog tutorial" setup
> on it only. trying to get this setup before moving onto other stuff.
> hope someone can help me out with this coz i cant design and code even
> if my life depended on 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
-~--~~~~--~~--~--~---



Cake + IIS + MSSQL? Should I bother?

2009-07-28 Thread Menkes

I am a long time PHP advocate living in an IIS + MSSQL world. I have
always coded by hand because most everything PHP was *NIX based.

I'd like to move to a stable framework. I was checking out symfony and
while I liked what they showed, the fact is nearly every single action
required research then modification to get it to play nice with IIS
and MSSQL.

What about Cake? Please only answer if you have actually developed an
application using Cake + IIS + MSSQL. If you feel the need to bash
what I am using, go get in line...but be silent ;)

Thanks,

 - Scott

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



Re: Cannot modify header information

2009-07-28 Thread betinho

salve seu model e controller com encoding ANSI

On 20 jul, 15:54, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have debug = 2 and I get
> Cannot modify header information
>
> turn debug to 0 and it works the way i want. Doing a redirect after login to
> redirect a user to appropriate area.
> No white space after closing ?>
> $this->Auth->autoRedirect = false;
>
> Ideas why this may be happeining?
>
> 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
-~--~~~~--~~--~--~---



multiple requests via ajax in cake

2009-07-28 Thread Fabrizio Marmitt

olá!
estou com um problema no cake ao fazer diversas solicitações do tipo
"post" com ajax no cake.

O que está acontecendo é o seguinte: tenho um validador de formulários
em js e ele faz um "post" em um arquivo php (cake) que responde "true"
ou "false" para o js. Quando a validação é feita individualmente,
ocorre perfeitamente, porém, quando faço várias validações ao mesmo
tempo, o arquivo php simplesmente não responde e imprime erros na
tela.

Penso que é algum problema nas "sessions" do cake, uma vez que a chave
muda a cada solicitação.

Desde já agradeço a ajuda.

--

hello!
I'm having some problems with "cake" to make several requests in the
same time with ajax.

Here is the thing: I have a validator of forms in js which makes a
"post" in a php file (cake) which responds "true" or "false" to it.
When validation is done individually, it's perfectly, but when I do
multiple validations in the same time, the php file simply does not
responds and prints some errors on the screen.

I think it is a problem in "session system" of the cake, since the id
of the session always changes with each request.

Since Now, I appreciate the help.

P.S. Sorry my bad english

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



delete post AND unlink image

2009-07-28 Thread bberg

hi
i have a "posts" table with an image field.
it stores just the filename as a varchar of course.
how can i adapt the "delete" action so it also unlinks the image?
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
-~--~~~~--~~--~--~---



"approved" field for a model

2009-07-28 Thread park

Hi,

Would like to add an "approved" field for a model. Users can only see
entries whose Model.approved = 1. Only in admin section can unapproved
entries be retrieved.

It's an existing site, so I don't want to rewrite conditions for all
find queries.

Is there a centralized method (presumably in Model) of achieving this?

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



Re: How do you insert an array into the database?

2009-07-28 Thread JamesF

yes just make sure your array is formatted to match your model.

$data = array('Model'=>array('field_one'=>'field_one_value',
'field_two'=>'field_two_value', ));

i like using pr($data) just to check out the formatting before going
live.
array(
[Model]
  array(
  [field_one] = field one value
  [field_two] = field two value
 )
)

if your data isn't formatted like this it wont save. and btw you
should do as @Miles J said and use $this->Model->save($data)
$this->controller->save() won't work (unless you created a function
called save in your controller for some odd reason [that function
would still need to use $this->Model->save()]).

sorry for all the verbosity




On Jul 28, 5:41 pm, Miles J  wrote:
> $data = array('columnName' => 'value');
>
> $this->Model->save($data);
>
> On Jul 28, 1:06 pm, RobS  wrote:
>
> > Ok so here's the scoop: I'm using a form to upload to a temp file that
> > gets parsed into an array. The array matches field for field the
> > database table it's going into.
>
> > How do I save to the database with this new array? I've tried all
> > sorts of $this->ControllerName->save() permutations and am coming up
> > dry. Any ideas?
>
> > Thanks,
> > Rob
--~--~-~--~~~---~--~~
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: keep hitting mysql memory limit, even in Cake Shell when exporting large xml file

2009-07-28 Thread JamesF

yes i realized this a few days after i had posted it. i just wonder
how much memory is too much to dedicate to a script.

On Jul 27, 7:29 pm, shabba  wrote:
> It seems like a PHP memory limit error rather than MySQL as Waither
> said, PHP on a standard install has a limit of 64mb, I never find this
> enough, especially dealing with largew datasets. Seting the memory
> limit to 128 should suffice, either in the actual file, or in the
> php.ini. Personally I raised the limit to 128mb for php and 512mb for
> MySQL.
>
> On Jul 26, 4:02 pm, JamesF  wrote:
>
> > i have paginated the results and no matter how i chunk it it still
> > fills up the mysqli result set and hits the memory limit. i need to be
> > able to flush the result set between each iteration.
>
> > On Jul 26, 6:33 am, Jaydeep Dave  wrote:
>
> > > You can try something like this in your shell
>
> > > 
> > > ...
> > > ..
>
> > > $page = 1;
>
> > > while(1) {
>
> > >          $records = $this->findAll("conditions' => array(bla bla bla),
> > > 'fields' => 'Model.*' ,'limit' => 50, 'page' => $page);
>
> > >          if($records) {
> > >               // Write Your XML in a File.
> > >          }else{
> > >                break;
> > >          }
>
> > >         $page = $page + 50;
>
> > > }
>
> > > This will help you a lot.
>
> > > Regards,
>
> > > Jaydeep Dave
>
> > > On Sun, Jul 26, 2009 at 1:41 AM, majna  wrote:
>
> > > > Try with :
> > > > $mysqli = ConnectionManager::getDataSource('default');
> > > > $mysqli->disconnect();
> > > > $mysqli->connect();
>
> > > > debug($mysqli->connected);
> > > > debug($mysqli->connection);
>
> > > > On Jul 26, 7:55 am, JamesF  wrote:
> > > > > MY PROBLEM:
> > > > > i am running into a wall with this one. basically i have a large xml
> > > > > file that i am rendering using XmlHelper. We are talking about a
> > > > > 25-50mb file. This is basically a product data feed. I have tried
> > > > > quite a few methods to overcome the memory limit but no luck.
>
> > > > > MY ERROR:
> > > > > Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to
> > > > > allocate 53 bytes) in /home/username/usr/cakedev/cake/libs/model/
> > > > > datasources/dbo/dbo_mysqli.php on line 402
>
> > > > > WHAT I HAVE DONE TO TRY AND FIX IT:
>
> > > > > 1) Initially i set this up to render through the web in one
> > > > > shotthis cause execution limit timeouts and memory errors.
>
> > > > > 2)I broke up the data requests in seperate chunks of 500 records using
> > > > > internal method calls, like $listings = $this->getListings($start_id,
> > > > > $limit); This caused the same problem
>
> > > > > 3) I set the whole thing up via the cake shell interface. It works
> > > > > great except for the fact that i keep running up against the same
> > > > > limit, even with staggered chunks of records in different method
> > > > > calls.
>
> > > > > MY GUESS:
> > > > > is that Cake is keeping an open connection with the database for the
> > > > > life of the script.
>
> > > > > MY SPECIFIC QUESTIONS:
> > > > > can i disconnect and reconnect from the database inside of the script?
> > > > > specifically can i do this in a cake shell script? will this solve my
> > > > > memory problem? am i going about this the wrong way entirely?
>
> > > > > thanks again anyone who has some advice!
>
> > > --
> > > Regards,
>
> > > Jaydeep Dave
> > > Mobile: +919898456445
> > > Email: jaydipd...@yahoo.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: jquery cakephp post data problem

2009-07-28 Thread brian

try it like this:

data: { ajax: true, id: selected }

You should see it in $this->params['form']['id']

On Tue, Jul 28, 2009 at 11:08 PM, stZen wrote:
>
> Though I was able to solve my immediate problem with GET, I would like
> to know how to do this using POST. Anyone has any idea?
>
>
> On Jul 6, 5:33 pm, stZen  wrote:
>> Martin,
>>
>> Thanks for responding.
>>
>> That worked! (using GET) I have been reading up some and looks like
>> its related
>> to mod_rewrite. If you have any ideas on getting POST working, please
>> let me know.
>>
>> On Jul 6, 12:39 am, Martin Radosta  wrote:
>>
>>
>>
>> > On 07/06/2009 12:48 AM, stZen wrote:
>>
>> > > Not using Auth and the security level is low..
>>
>> > > Thanks.
>>
>> > > On Jul 5, 10:01 pm, Miles J  wrote:
>>
>> > >> Are you using Auth at all?
>> > >> Also try setting your session security to medium or low if its not.
>>
>> > Try this and give us some feedback. If this works, we can try doing a post:
>>
>> > in the view
>>
>> >          $.ajax({
>> >                  type: "GET",
>> >                  url: 'categories/getIndications/' + selected,
>> > ...
>>
>> > In the controller
>>
>> > function getIndications($id) {
>>
>> >      $this->log("getindicator called".$id);
>> > 
>> > ...
>>
>> > Are you usingjquery1.3.2 ??
> >
>

--~--~-~--~~~---~--~~
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: oracle "find()"

2009-07-28 Thread rchavik

Not sure how cake handles this, but maybe you can workaround this
issue by creating a synonym in your cake schema to OCD.MACHINES?

create synonym machines for ocd.machines
/



On Jul 29, 9:56 am, pete123456  wrote:
> Hi,
> i im trying to query a table from "other users". is there a way to use the
> "find()" instead of doing a custom query.
>
> thanks
>
> pete
>
> WORKS
> $this->set('machines', $this->Machine->query("SELECT * FROM OCD.MACHINES"));
>
> ??? // not working because of the missing user "OCD"
> $this->set('machines', $this->Machine->find('all'));
> --
> View this message in 
> context:http://www.nabble.com/oracle-%22find%28%29%22-tp24711573p24711573.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: jquery cakephp post data problem

2009-07-28 Thread stZen

Though I was able to solve my immediate problem with GET, I would like
to know how to do this using POST. Anyone has any idea?


On Jul 6, 5:33 pm, stZen  wrote:
> Martin,
>
> Thanks for responding.
>
> That worked! (using GET) I have been reading up some and looks like
> its related
> to mod_rewrite. If you have any ideas on getting POST working, please
> let me know.
>
> On Jul 6, 12:39 am, Martin Radosta  wrote:
>
>
>
> > On 07/06/2009 12:48 AM, stZen wrote:
>
> > > Not using Auth and the security level is low..
>
> > > Thanks.
>
> > > On Jul 5, 10:01 pm, Miles J  wrote:
>
> > >> Are you using Auth at all?
> > >> Also try setting your session security to medium or low if its not.
>
> > Try this and give us some feedback. If this works, we can try doing a post:
>
> > in the view
>
> >          $.ajax({
> >                  type: "GET",
> >                  url: 'categories/getIndications/' + selected,
> > ...
>
> > In the controller
>
> > function getIndications($id) {
>
> >      $this->log("getindicator called".$id);
> > 
> > ...
>
> > Are you usingjquery1.3.2 ??
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



oracle "find()"

2009-07-28 Thread pete123456


Hi,
i im trying to query a table from "other users". is there a way to use the
"find()" instead of doing a custom query.

thanks

pete

WORKS
$this->set('machines', $this->Machine->query("SELECT * FROM OCD.MACHINES"));

??? // not working because of the missing user "OCD"
$this->set('machines', $this->Machine->find('all'));
-- 
View this message in context: 
http://www.nabble.com/oracle-%22find%28%29%22-tp24711573p24711573.html
Sent from the CakePHP mailing list archive at Nabble.com.


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



Re: Display months in datetime fields in german

2009-07-28 Thread ohcibi

okay, i didnt knew that..
but anyway, if another script uses setlocale you're running into the
same problem (the stringsubstitution expects monday, but gets lundi
und does nothing, so the user gets lundi at the end). so lets hope php
will do things better in the future 8-)

On Jul 29, 2:03 am, David Persson  wrote:
> I don't want to overemphasize this but you cannot safely use setlocale
> (). With some setups it might be OK to rely on it but in general I
> wouldn't recommend using it. As you can read in the warning message 
> athttp://php.net/setlocalethe function is maintained for the whole
> process not per thread. Which means that if you're running a
> multithreaded server and you're setting the locale at the very
> beginning and localize at the end when processing the response of a
> request sth like this might happen:
>
>      setlocale(LC_ALL, 'en_US')      strftime('%A')
>      |                               |
> A >---<
>
>         setlocale(LC_ALL, 'fr_FR')      strftime('%A')
>         |                               |
>   B >---<
>
> Assumed today is monday, the english speaking user gets 'lundi'
> instead of the expected 'monday'. Currently for something like
> localizing the month names, doing message translation is the better
> choice even though I see the limitations of it.
>
> - David
>
> On 28 Jul., 23:52, ohcibi  wrote:
>
>
>
> > you should _never_ do any stringsubstitutions for localizing month
> > names... _always_ use setlocale and maybe an extra helper for more
> > comfort. stringsubstitutions are an unnecessary extra task and may not
> > even work proper (e.g. if the php setup has another default language)
>
> > On Jul 28, 11:03 am, Piotr Kilczuk  wrote:
>
> > > Hello,
>
> > > > with "ger" it didn't work but when I changed the folder name to
> > > > "deu" (and also the value in Config.language of course) it worked like
> > > > a charme.
> > > > For some reason it seems that it has(!) to be named "deu"
> > > > anyway, thanks a lot!
>
> > > That's good. German has two ISO-639-2 codes, I thought you could use
> > > both, thanks for sharing your knowledge :)
>
> > > Regards,
> > > Piotr
--~--~-~--~~~---~--~~
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: internationalization in model

2009-07-28 Thread Dr. Loboto

With Model::invalidate() method reload you do not have such problems
at all.

On Jul 29, 12:17 am, tobi_one  wrote:
> Hi,
>
> I am using __() internationalization in my model as described here:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81a...
>
> It works great, but there is one problem. I set the language of the
> app in the beforefilter of the app_controller. Apparently the models
> are loaded before this and so the models always return the default
> language.
>
> Where do you guys set the language of the app? Especially if you are
> using the __contruct method as mentioned in the post from above.
>
> Thanks!
>
> Cheers,
> tobi_one
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Caching doesn't work with the routes

2009-07-28 Thread Sergei

Hello,

I'm using CakePHP 1.2.3 and it looks like caching routed actions
doesn't work at all.

I have a route:

Router::connect('/script/:site', array('controller' => 'projects',
'action' => 'js'), array('pass'=>array('site'),'site'=>'[A-Za-
z0-9]+'));

Router::parseExtensions('rss','js');

So this url is like "/script/name.js" is redirected to "projects/js"
action.

In projects controller i have a cacheAction:

var $cacheAction = array(
'js' => "1 hour", // action with route - doesn't work
'index' => "1 hour", // action without route - works
);

And it just doesn't cache anything. Caching actions *without* route,
like for example, projects/index, works.

Is it a bug or feature, and does it have a solution?

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



Re: Add Jar files in cakephp

2009-07-28 Thread Brett Wilton

Probably related to your path, you need to add the directory under
webroot, I wrote a bit about this sometime back

http://wiltonsoftware.com/posts/view/java-applet-not-running

Hope that helps.

-
http://wiltonsoftware.com

On Tue, Jul 28, 2009 at 10:13 PM, PraDz Misc wrote:
> Hi
>
> I have an applet which is used for uploading the files to the server.
> when I run with a html file, its running perfectly fine since I have the jar
> files in ../lib/all_jar_files
>
> when using that in CakePHP, how do I add all the jar files to make applet
> work.
>
> thanks
> 
> Pradheep Ayyanar, Team Leader
> ---
>
> >
>

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



ACO help for admin routing

2009-07-28 Thread Michael Gaiser
Ok, after taking several peoples advice to look into admin routing, I have
decided I want to go with that strategy. But my ACO's have only ever had the
controller name, not the actions. So if my User has access to my
LocationsController, then he would also have access to any admin_* functions
as well. So what I want to know is how do I set up my ACO's to point to
controller actions. I am using cake bakery with the command 'cake acl create
aco Site Locations' where site is Patent ACO and Locations is the name of my
controller. Currently that just gives basic access control at the controller
level, but I need to check against all the admin_* functions and be able to
deny anyone but an admin from using those. If I was to use 'cake acl create
aco Site Locations/admin_*' as an ACO, would that work? Is there something
else I need to do?

~Visceris

--~--~-~--~~~---~--~~
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: Official forum for CakePHP

2009-07-28 Thread abba bryant


Also, you can always use Nabble.com to view the groups in a threaded forum
style


Brendon Kozlowski wrote:
> 
> 
> @GravyFace: It only matters in that it was not what the original
> question had specifically asked for.  Since they mentioned
> "official" (specifically), I'd imagine they were probably searching
> for a CakePHP forum from the official CakePHP website and was unable
> to find one - because there is none.  That's not to say that the very
> active CakePHPForum.net website is not a great resource - it is.
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Official-forum-for-CakePHP-tp24419261p24710244.html
Sent from the CakePHP mailing list archive at Nabble.com.


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



Re: Display months in datetime fields in german

2009-07-28 Thread David Persson

> [...] the function is maintained [...]

[...] the information set by the function is maintained [...]
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



BreadCumbs text encoding

2009-07-28 Thread Benedikt R.

Hi!

I try to add following breadcrumb.
$html->addCrumb( 'Finanzämter', '/revenues' );

(It's german.) When I output the breadcrumbs on the page,
the chars get encoded the wrong way (I am using ISO-8859-1).
If I try to use HTML's special characters like ü - they get
printed as the look.

I am currently running with this code to support correct ouputs:
$html->addCrumb( utf8_decode('Finanzämter'), '/revenues' );

Some ideas why this happens?

Regards, Benedikt
--~--~-~--~~~---~--~~
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: Display months in datetime fields in german

2009-07-28 Thread David Persson

I don't want to overemphasize this but you cannot safely use setlocale
(). With some setups it might be OK to rely on it but in general I
wouldn't recommend using it. As you can read in the warning message at
http://php.net/setlocale the function is maintained for the whole
process not per thread. Which means that if you're running a
multithreaded server and you're setting the locale at the very
beginning and localize at the end when processing the response of a
request sth like this might happen:

 setlocale(LC_ALL, 'en_US')  strftime('%A')
 |   |
A >---<

setlocale(LC_ALL, 'fr_FR')  strftime('%A')
|   |
  B >---<

Assumed today is monday, the english speaking user gets 'lundi'
instead of the expected 'monday'. Currently for something like
localizing the month names, doing message translation is the better
choice even though I see the limitations of it.

- David

On 28 Jul., 23:52, ohcibi  wrote:
> you should _never_ do any stringsubstitutions for localizing month
> names... _always_ use setlocale and maybe an extra helper for more
> comfort. stringsubstitutions are an unnecessary extra task and may not
> even work proper (e.g. if the php setup has another default language)
>
> On Jul 28, 11:03 am, Piotr Kilczuk  wrote:
>
> > Hello,
>
> > > with "ger" it didn't work but when I changed the folder name to
> > > "deu" (and also the value in Config.language of course) it worked like
> > > a charme.
> > > For some reason it seems that it has(!) to be named "deu"
> > > anyway, thanks a lot!
>
> > That's good. German has two ISO-639-2 codes, I thought you could use
> > both, thanks for sharing your knowledge :)
>
> > Regards,
> > Piotr
>
>
--~--~-~--~~~---~--~~
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: Implement jQuery UI into CakePHP application

2009-07-28 Thread brian

You should remove the ".js" extension:

link(array("jquery/jquery","jquery/ui/core","jquery/ui/accordion"),false);
?>

There's no need for a component or anything special in the view.

On Tue, Jul 28, 2009 at 1:19 PM, awh wrote:
>
> I'm working on something during my free time and at the same time
> trying to learn. I read around and know that it is possible to
> implement jQuery UI into a CakePHP application and that it was
> supposed to be easy.
>
> Been mingling around for a while and still have no idea. Would
> appreciate if anyone could guide me on how to implement this. I'm
> using:-
>
> - jQuery UI 1.7.2 or I could move to jQuery UI 1.6 if needed.
> - CakePHP 1.2.3.8166
>
> Now, when i downloaded the zipped jQuery UI file, it includes
>
> - css dir (have ui - darkness dir here and an img folder inside it
> along with a jquery.css file)
> - development dir (a shit load of directories and files in here)
> - js dir (the jquery.js file seems to be in here)
> - index.html
>
> i followed the instructions here:-
>
> http://www.mail-archive.com/cake-...@googl...m/msg61671.html
>
> I have my jquery stuff set up like:
>
> webroot
> |_ js
>    |_ jquery
>         |_ jquery.js
>         |_ ui
>             |_ core.js
>             |_ accordion.js
>
> Then in my view I do:
>
> link(array("jquery/jquery.js","jquery/ui/
> core.js","jquery/ui/accordion.js"),false); ?>
>
> 
>
> [bad html removed] Put your accordion stuff here -->
>
> 
>
> 
>
> $(function () {
>
> $("#accordion").accordion({
>
> // options go here
>
> });
>
> });
>
> 
>
> but it didnt seem to work out for me.
>
> First thing is, where do i put all the files and folders in my cake
> dir?
>
> Second thing is, besides the view, do i need to load any components,
> helpers or the likes into my controller to be able to use this UI?
> would appreciate if someone could include the code for the view and
> contoller as im very much clueless.
>
> my cakephp app is just a fresh install with the "blog tutorial" setup
> on it only. trying to get this setup before moving onto other stuff.
> hope someone can help me out with this coz i cant design and code even
> if my life depended on 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: Display months in datetime fields in german

2009-07-28 Thread ohcibi

you should _never_ do any stringsubstitutions for localizing month
names... _always_ use setlocale and maybe an extra helper for more
comfort. stringsubstitutions are an unnecessary extra task and may not
even work proper (e.g. if the php setup has another default language)

On Jul 28, 11:03 am, Piotr Kilczuk  wrote:
> Hello,
>
> > with "ger" it didn't work but when I changed the folder name to
> > "deu" (and also the value in Config.language of course) it worked like
> > a charme.
> > For some reason it seems that it has(!) to be named "deu"
> > anyway, thanks a lot!
>
> That's good. German has two ISO-639-2 codes, I thought you could use
> both, thanks for sharing your knowledge :)
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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: Deleting items and items that "belongsTo"

2009-07-28 Thread Taff

Hey David,
thanks for the answer. I wanted a cascade. I'm finding it such a time
saver that such functionality is already "built in".

Awesome stuff :)

Taff

On Jul 28, 8:54 pm, DavidH  wrote:
> Taff, you don't say whther you want todeletethe items (i.e. cascade
> thedelete) or avoid deleting the items
>
> Either way it's controlled by the second parameter to thedelmethod.
> Seehttp://book.cakephp.org/view/690/delfor details.
>
> David
>
> On Jul 28, 7:43 pm, Taff  wrote:
>
> > is there a way to make
>
> > $this->Todolist->del($id)
>
> >automagicallydelete
>
> > Todoitems that had todolist_id relating to that list?
>
> > MytodolisthasMany todoitems and my todoitems belongstotodolist
>
> > Thanks for any pointers.
--~--~-~--~~~---~--~~
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 do you insert an array into the database?

2009-07-28 Thread Miles J

$data = array('columnName' => 'value');

$this->Model->save($data);

On Jul 28, 1:06 pm, RobS  wrote:
> Ok so here's the scoop: I'm using a form to upload to a temp file that
> gets parsed into an array. The array matches field for field the
> database table it's going into.
>
> How do I save to the database with this new array? I've tried all
> sorts of $this->ControllerName->save() permutations and am coming up
> dry. Any ideas?
>
> Thanks,
> Rob
--~--~-~--~~~---~--~~
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 do you insert an array into the database?

2009-07-28 Thread RobS

Ok so here's the scoop: I'm using a form to upload to a temp file that
gets parsed into an array. The array matches field for field the
database table it's going into.

How do I save to the database with this new array? I've tried all
sorts of $this->ControllerName->save() permutations and am coming up
dry. Any ideas?

Thanks,
Rob

--~--~-~--~~~---~--~~
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 HBTM tables. (included image)

2009-07-28 Thread Carlos Suarez Fontalvo

tnx david, i'll do that tonight. i hope this works. I think we all
need to do an example biblio of this really nasty troubles.

On Jul 28, 11:52 am, DavidH  wrote:
> Hi Carlos
>
> Why can't you follow the standard HABTM setup by inserting the names
> of you key columns where appropriate? Something like:
>
> class Modulo extends AppModel {
> 
> var $hasAndBelongsToMany = array(
>   'TipoUsuario' => array(
>     'classname' => 'TipoUsuario',
>     'foreignKey' => 'modulo', // The PK column in this model
>     'associationForeignKey' => 'tipousauario', // The PK column in the
> other model
>     'joinTable' => 'TipoUsuarioModulo'
>   )
> );
>
> In your TipoUsuario model you'll have a similar HABTM definition with
> the same joinTable; but the other fields replaced by their modulo
> equivalents.
>
> I hope this works for you.
>
> Regards
>
> David
>
> PS I hope I've spelt all the field names correctly.
>
> On Jul 28, 5:00 pm, Carlos Suarez Fontalvo
>
>  wrote:
> > Hello, tnx for the ans, but, i already put the images in my questions,
> > and about that, what i need is precisely that data (i need to know for
> > a HABTM relationship the jointable, foreignkey, assforkey) for doing
> > the rest.
>
> > I apreciate your help.
>
> > On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
>
> > > Hello,
>
> > > > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > > > tnx a lot.
>
> > > In this case I'm pretty sure that you have to define additional HABTM
> > > keys in TipoUsuario and Modulo - I mean:
> > > joinTable, foreignKey, associationForeignKey. Just get one model
> > > association working 1st, and then you'll get the pattern.
>
> > > HTH
>
> > > Regards,
> > > Piotr
--~--~-~--~~~---~--~~
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: afterFind() inconsistencies ?

2009-07-28 Thread iFeghali

sorry, Type *hasMany* Machine.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



afterFind() inconsistencies ?

2009-07-28 Thread iFeghali

Hello All,

I found myself stuck for a week in an issue that I would really
appreciate any kind of help. Thats my scenario:

Machine HABTM Service
Machine belongsTo Type
Type hasOne Machine
Machine hasMany MachineContact
MachineContact belongsTo Machine

Now I have Machine->afterFind() hypothetically defined as:



Recursive is set to 2 for everything. So far so good.

If I go to /services/view/someId I get:

Array
(
[0] => Array
(
machine attribs ...
[MachinesService] => Array
(
  ...
)
[Type] => Array
(
  ...
)
[MachineContact] => Array
(
[0] => Array
(
  ...
)

[1] => Array
(
  ...
)
)
)
)
Array
(
[0] => Array
(
[Machine] => the Array above
   )
)

First question, I do not understand why afterFind() was called twice.
In the SQL log there is only one query searching the machines table.
As I browsed cake's source I found that afterFind() in called in the
model layer and after that again at the DB layer. Did I get it right ?
If so, why is the reason for that ?

But the real issue comes when I go to /types/view/someId:

Array
(
[0] => Array
(
[Machine] => Array
(
 ...
)
)
)
Array
(
[0] => Array
(
[Machine] => Array
(
[0] => Array
(
   machine attribs...
[Type] => Array
(
 ...
)
[MachineContact] => Array
(
[0] => Array
(
 ...
)
)
[Service] => Array
(
[0] => Array
(
  ...
)
)
)
)
)
)

afterFind() is called twice again as [un]expected. The problem is,
this time, in the first run it didn't fetch any of the Machines
associated models, even though recursive is set to 2. Also, the array
is indexed by model name what doesn't happens in the first test.
Secondly, in the second run the machine array comes complete with all
the attributes plus the associated models, indexed by model name
again.

So, what did I missed here ?

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



Re: Deleting items and items that "belongsTo"

2009-07-28 Thread Taff

Hey David,
thanks for the answer. I wanted a cascade. I'm finding it such a time
saver that such functionality is already "built in".

Awesome stuff :)

Taff

On Jul 28, 8:54 pm, DavidH  wrote:
> Taff, you don't say whther you want todeletethe items (i.e. cascade
> thedelete) or avoid deleting the items
>
> Either way it's controlled by the second parameter to thedelmethod.
> Seehttp://book.cakephp.org/view/690/delfor details.
>
> David
>
> On Jul 28, 7:43 pm, Taff  wrote:
>
> > is there a way to make
>
> > $this->Todolist->del($id)
>
> >automagicallydelete
>
> > Todoitems that had todolist_id relating to that list?
>
> > MytodolisthasMany todoitems and my todoitems belongstotodolist
>
> > Thanks for any pointers.
--~--~-~--~~~---~--~~
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: SSL protect admin routes

2009-07-28 Thread toby1kenobi

Hi Brian & Piotr,

  Thanks for replying, much appreciated. Unfortunately the leading
slash makes no difference I'm afraid, one I'd already tried. And yes
Piotr, the login path is also in the admin routing.

  Any more tips anyone?

Toby

On Jul 28, 7:39 pm, "3lancer.eu"  wrote:
> Hello,
>
> >   I'm struggling with something I imagine is extremely easy, forcing
> > my admin routes to go over SSL. Am I even close?!
>
> Maybe you should consider forcing SSL connection at the login point as
> well (no need if you already aliased login operation with admin
> route).
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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: Weired cakePHP behavior!!

2009-07-28 Thread Miles J

Well you could also use the magic methods.

$this->Category->findById($id);
--~--~-~--~~~---~--~~
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: Remove "Strip "Welcome to CakePHP Console" from shell output

2009-07-28 Thread Piotr Kilczuk

Hi,

> Hi Piotr,
>
> Try to look into:
> cake/console/libs/shell.php
> and change the function _welcome , or just simply comment out the
> $this->_welcome() method call in the function startup()

Thanks, that was easy. :-)

I extended _welcome in my shell with no out/hr statements.


Regards,
Piotr

--~--~-~--~~~---~--~~
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: Remove "Strip "Welcome to CakePHP Console" from shell output

2009-07-28 Thread Hendry

Hi Piotr,

Try to look into:
cake/console/libs/shell.php
and change the function _welcome , or just simply comment out the
$this->_welcome() method call in the function startup()

Regards,
Hendry

On Wed, Jul 29, 2009 at 2:36 AM, 3lancer.eu wrote:
> I'd like to get rid off the welcome message as well as the folders
> info, as I don't need that everytime I run this task. Any good way to
> do that?

--~--~-~--~~~---~--~~
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: Deleting items and items that "belongsTo"

2009-07-28 Thread DavidH

Taff, you don't say whther you want to delete the items (i.e. cascade
the delete) or avoid deleting the items

Either way it's controlled by the second parameter to the del method.
See http://book.cakephp.org/view/690/del for details.

David

On Jul 28, 7:43 pm, Taff  wrote:
> is there a way to make
>
> $this->Todolist->del($id)
>
> automagically delete
>
> Todoitems that had todolist_id relating to that list?
>
> My todolist hasMany todoitems and my todoitems belongsto todolist
>
> Thanks for any pointers.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Deleting items and items that "belongsTo"

2009-07-28 Thread Taff

is there a way to make

$this->Todolist->del($id)

automagically delete

Todoitems that had todolist_id relating to that list?

My todolist hasMany todoitems and my todoitems belongsto todolist

Thanks for any pointers.
--~--~-~--~~~---~--~~
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: SSL protect admin routes

2009-07-28 Thread 3lancer.eu

Hello,

>   I'm struggling with something I imagine is extremely easy, forcing
> my admin routes to go over SSL. Am I even close?!

Maybe you should consider forcing SSL connection at the login point as
well (no need if you already aliased login operation with admin
route).


Regards,
Piotr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Remove "Strip "Welcome to CakePHP Console" from shell output

2009-07-28 Thread 3lancer.eu

Hello,

Typical output of one of my shells looks like:

 [H [2J
Welcome to CakePHP v1.2.3.8166 Console
---
App : app
Path: /home/piotr/www/poker/app
---
Tue, 28 Jul 2009 20:31:10 +0200
Updated 7 user records
---

I'd like to get rid off the welcome message as well as the folders
info, as I don't need that everytime I run this task. Any good way to
do that?

I'll be running this shell using Cron, command similar to:
cd /home/piotr/www/poker/app && ../cake/console/cake update_statuses
>> ./tmp/logs/cron_update_statuses.log

Thanks in advance for your suggestions.


Regards,
Piotr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Implement jQuery UI into CakePHP application

2009-07-28 Thread awh

I'm working on something during my free time and at the same time
trying to learn. I read around and know that it is possible to
implement jQuery UI into a CakePHP application and that it was
supposed to be easy.

Been mingling around for a while and still have no idea. Would
appreciate if anyone could guide me on how to implement this. I'm
using:-

- jQuery UI 1.7.2 or I could move to jQuery UI 1.6 if needed.
- CakePHP 1.2.3.8166

Now, when i downloaded the zipped jQuery UI file, it includes

- css dir (have ui - darkness dir here and an img folder inside it
along with a jquery.css file)
- development dir (a shit load of directories and files in here)
- js dir (the jquery.js file seems to be in here)
- index.html

i followed the instructions here:-

http://www.mail-archive.com/cake-...@googl...m/msg61671.html

I have my jquery stuff set up like:

webroot
|_ js
|_ jquery
 |_ jquery.js
 |_ ui
 |_ core.js
 |_ accordion.js

Then in my view I do:

link(array("jquery/jquery.js","jquery/ui/
core.js","jquery/ui/accordion.js"),false); ?>



[bad html removed] Put your accordion stuff here -->





$(function () {

$("#accordion").accordion({

// options go here

});

});



but it didnt seem to work out for me.

First thing is, where do i put all the files and folders in my cake
dir?

Second thing is, besides the view, do i need to load any components,
helpers or the likes into my controller to be able to use this UI?
would appreciate if someone could include the code for the view and
contoller as im very much clueless.

my cakephp app is just a fresh install with the "blog tutorial" setup
on it only. trying to get this setup before moving onto other stuff.
hope someone can help me out with this coz i cant design and code even
if my life depended on 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: $session->flash() in view displaying a 1

2009-07-28 Thread Taff

Thanks leafchild, that was indeed the issue. I missed the obvious :)

On Jul 27, 10:50 pm, leafchild  wrote:
> I think you don't need "echo"
>
> Just type:
> flash();  ?>
>
> I had this issue and after taking "echo" fixed the the issue.
>
> On Jul 27, 1:04 pm, Taff  wrote:
>
> > Hey,
>
> > I baked a controller with the following snippet:
>
> > $this->Session->setFlash(__('List has been saved', true));
>
> > Why the underscores, and what does true denote, I couldn't find a
> > reference anywhere?
>
> > Also in myview
>
> > echo $session->flash();
>
> > is returning List has been
> > saved1
>
> > After an evening of huntingwhere on earth is that 1 being
> > generated, and how do I do away with it?
>
> > Thanks for any pointers!
> > Taff
--~--~-~--~~~---~--~~
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: Set user variables

2009-07-28 Thread brian

Why not just use $this->Auth->user('whatever')? AppController loads
the Auth component, so any other controller can access it.

Also, AppController::beforeFilter() will still run if you do not have
beforeFilter() in your own controller. It will only *not* run if you
override beforeFilter() in your controller and fail to call the
parent's. So, there's no need to create your the method in a
controller if only to ensure AppController's version will be run. It
will run on its own.

On Tue, Jul 28, 2009 at 12:09 PM, Dave Maharaj ::
WidePixels.com wrote:
> I have a set of variables that are used throughout the app such as
>
> $auth = $this->Auth->user('id');
> $slug = $this->Auth->user('slug');
> $role = $this->Auth->user('role');
>
> and so on
>
> How can I define these in the app_controller beforeFilter so I can grab them
> from any controller using
>
> function beforeFilter()
>   {
>   parent::beforeFilter();
>    }
>
> or any other way that will work.
>
> 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
-~--~~~~--~~--~--~---



Re: SSL protect admin routes

2009-07-28 Thread brian

You're missing the initial slash:

RewriteCond %{REQUEST_URI} ^/admin(.*)$

On Tue, Jul 28, 2009 at 12:56 PM, toby1kenobi wrote:
>
> Hi there,
>
>  I'm struggling with something I imagine is extremely easy, forcing
> my admin routes to go over SSL. Am I even close?!
>
> RewriteCond %{HTTPS} !=on
> RewriteCond %{HTTP_HOST} ^mylive.domain.com
> RewriteCond %{REQUEST_URI} ^admin(.*)$
> RewriteRule .* https://mylive.domain.com%{REQUEST_URI} [L,R=301]
>
> I have this in the htacess file in webroot, which is what Apache is
> configured to serve the site out of. If I comment out the third line
> all traffic (to any URL) goes over SSL, so I feel like I must be
> nearly there...
>
>  Thanks in advance,
>
> Toby
> >
>

--~--~-~--~~~---~--~~
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 cakePhp and nested ajax form in firefox 3.5

2009-07-28 Thread brian

A form shouldn't contain another form. If it's crucial to your app,
try putting the child form in a pop-up layer (eg. Thickbox) so that
it's not actually nested in the markup.

On Tue, Jul 28, 2009 at 4:47 AM, portoalet wrote:
>
> Hi,
>
> Is it possible to have a nested ajax form in cakephp and firefox ?
> i.e.
>
> 
> $ajax->form(form1...)
>   table
>     row
>       $ajax->form(childForm_rowId)
>       $form->end(childForm_rowId)
>     endrow
>   end table
> $form->end
> 
>
> I found this works in IE7, but not in Firefox 3.5.1
> Firefox will omit the childForm declaration, so the child forms
> (childForm_rowId) will use the first form(form1) action when it is
> submitted, which is not what we want.
>
> Any idea how can I work around 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: getting a 404 with Media View

2009-07-28 Thread brian

MediaView::render() fires a 404 if ... you guessed it--the file cannot be found.

I had some similar trouble a while back (see link below). I placed a
die(debug($path)) line just before that check and eventually figured
out the problem is that is_dir() can use a relative path and it was
throwing things off. I'm sorry that I can't remember the details
better than that but I solved the problem by setting path param like
so:

'path' => APP.$result['ItemFile']['directory'].DS,

Although, if your app is working locally, perhaps the problem is
simply that apache doesn't have read permission on that directory. But
start with debugging the path to be sure it what you expect.

http://groups.google.com/group/cake-php/browse_thread/thread/0f648c149c67bdcd/ec1f52e6f593017a?lnk=raot&fwc=1


On Tue, Jul 28, 2009 at 10:37 AM, Stinkbug wrote:
>
> I'm assuming this is an apache config problem, but I'm not sure what
> could be causing it.  Thought I'd just ask the community to see if
> anyone knew what the problem might be.
>
> I'm using the Media view to download files and have the files
> directory outside the webroot.  I'm getting a 404 Page cannot be found
> error when tring to download the file.  It works in out test
> envirnoment just fine, but when I move into production, I get this
> error.  Could it be an apache config problem, or an app problem?
> >
>

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



Re: i18n and LIKE conditions

2009-07-28 Thread brian

Perhaps you could modify TranslateBehavior to look for a certain key
(eg. 'like') for this type of condition and rewrite the query to check
the appropriate table.

On Tue, Jul 28, 2009 at 8:55 AM, kicaj wrote:
>
> Hi,
>
> I create table products width: id, name, desc, created, modified...
> I use i18n and Translate Behavior to translate data
> Then I drop field name and desc form products table, because will be
> wroten in i18n table.
>
> Now when i want use conditions like this:
> Product.name LIKE => '%keyword%' i get message: Unknown column
> 'Product.name' in 'where clause'
>
> How I can repaire this problem, any solution?
> >
>

--~--~-~--~~~---~--~~
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: Set user variables

2009-07-28 Thread Dave Maharaj :: WidePixels.com

Thanks,

Sounds good.

Will give that a try.

Dave 

-Original Message-
From: tobi_one [mailto:tobias.h...@gmail.com] 
Sent: July-28-09 2:38 PM
To: CakePHP
Subject: Re: Set user variables


What I do, is to define methods in the app_controller, just like:

function userId() {
return $this->Session->read('Auth.User.id');
}

If you want to access the current userId in another controller then simply
call

$userid = $this->userId();

HTH

Cheers,
tobi_one

On Jul 28, 6:09 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a set of variables that are used throughout the app such as
>
> $auth = $this->Auth->user('id');
> $slug = $this->Auth->user('slug');
> $role = $this->Auth->user('role');
>
> and so on
>
> How can I define these in the app_controller beforeFilter so I can 
> grab them from any controller using
>
> function beforeFilter()
>       {
>           parent::beforeFilter();
>        }
>
> or any other way that will work.
>
> 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
-~--~~~~--~~--~--~---



internationalization in model

2009-07-28 Thread tobi_one

Hi,

I am using __() internationalization in my model as described here:

http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81acc043eef/6a49c6d9fdc6f158?lnk=st&q=#6a49c6d9fdc6f158

It works great, but there is one problem. I set the language of the
app in the beforefilter of the app_controller. Apparently the models
are loaded before this and so the models always return the default
language.

Where do you guys set the language of the app? Especially if you are
using the __contruct method as mentioned in the post from above.

Thanks!

Cheers,
tobi_one
--~--~-~--~~~---~--~~
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 Timeout when sending Ajax-Request?

2009-07-28 Thread brian

A timeout where? In Cake, or javascript? I don't kow about Prototype
(what Cake's AjaxHelper uses), but jQuery allows to set a timeout.

But you should ensure that you have debug set to 0, first of all. That
will always slow things down somewhat. Also, look into
caching--perhaps the problem is due to a very inefficient query. But,
without knowing more about your problem, there's not much more anyone
can say.

On Tue, Jul 28, 2009 at 3:21 AM, moe wrote:
>
> Does nobody know how to solve this problem?
> >
>

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



Re: Set user variables

2009-07-28 Thread tobi_one

What I do, is to define methods in the app_controller, just like:

function userId() {
return $this->Session->read('Auth.User.id');
}

If you want to access the current userId in another controller then
simply call

$userid = $this->userId();

HTH

Cheers,
tobi_one

On Jul 28, 6:09 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a set of variables that are used throughout the app such as
>
> $auth = $this->Auth->user('id');
> $slug = $this->Auth->user('slug');
> $role = $this->Auth->user('role');
>
> and so on
>
> How can I define these in the app_controller beforeFilter so I can grab them
> from any controller using
>
> function beforeFilter()
>       {
>           parent::beforeFilter();
>        }
>
> or any other way that will work.
>
> 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
-~--~~~~--~~--~--~---



Re: Email Component return path

2009-07-28 Thread tobi_one

Why not use

$this->Email->replyTo = 'jdai...@gmail.com';
$this->Email->from = 'Obiyoda ';

instead?

Cheers,
tobi_one

On Jul 28, 4:26 pm, Obiyoda  wrote:
> I can't seem to get the email component to set a correct return path
> in the header. I've tried setting $this->Email->return =
> 'someb...@somewhere.com' yet the email headers are showing the return
> paths as being www-d...@localhost instead of someb...@somewhere.com.
> I'm using ubuntu Jaunty with sendmail in my test environment if that
> helps at all but i've tried it on our production server and it gives
> me the same issues(also using sendmail).
--~--~-~--~~~---~--~~
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: bug? $html->addCrumb()

2009-07-28 Thread tobi_one

Hi,

I'm not sure I got your question right, but are you wondering that the
array starts empty with each page? If so, this is not a bug but a
feature. To add trails you will have to call addCrumb several times. I
also described this here:

http://www.tobman.com/blog/using-breadcrumbs-with-cakephp/

Cheers,
tobi_one

On Jul 28, 4:01 pm, leo  wrote:
> As this worked in an earlier release, and nobody has responded to my
> previous post, I'm wondering if this is maybe a bug. If so, I'll log
> it.
>
> Some time ago I used the bread crumb functionality of HtmlHelper
> without a great deal of difficulty.
>
> Now, a year or so on, I'm at it again. This time I'm developing in a
> full release: 1.2.3.8166 (previously it was RC2 or RC3) and it doesn't
> seem to
> work. I don't have access to my previous code for reference.
>
> The symptoms are that when I addCrumb, the $html->_crumbs array
> appears to be created afresh for each page visited. The crumbs array
> seems to be going out of
> scope.
>
> The following code fragment from an_element.ctp which is included by
> the layout, default.ctp:
>
> debug($html->_crumbs);
>         $html->addCrumb($this->name,$this->params['url']['url']);
> debug($html->_crumbs);
>
> always yields this, or similar, output as the site is navigated, i.e.
> an array with 0 or 1 elements:
>
> Array
> (
> )
>
> Array
> (
>     [0] => Array
>         (
>             [0] => Proposals
>             [1] => proposals/view/5
>             [2] =>
>         )
>
> )
>
> I'm a bit confused here and would appreciate any pointers to what I'm
> failing to do.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Moving nested if statements out of the view.

2009-07-28 Thread DavidH

Not sure if this is what you want to do; but in one place in my app
I've done some validation on an array of fields in my controller and
used the results of this to build a custom error message string that I
then set to the session:

if (!empty($this->data)) {
$err_msg = $this->_check_kpis($this->data);
if (strcmp($err_msg, "") != 0)
{
$this->Session->setFlash(__($err_msg, true));
}
else
{
  // Save the form
   }

before rendering the view again. The $err_msg that comes back from my
function call contains the customized message.

On Jul 28, 5:51 pm, brian  wrote:
> If you're concerned that the user won't immediately notice if there's
> an error (unlikely, as the form is redisplayed, but whatever) just add
> this at the top:
>
> if (!empty($form->validationErrors)) {
>
> and include a notice that there were errors and to check below (where
> the errors are displayed with each element). Displaying errors one at
> a time would be a huge waste of time for the user.
>
> On Tue, Jul 28, 2009 at 10:39 AM, Shaun wrote:
>
> > I prefer to display form validation errors at the top of the form
> > rather than under each form field.  I would also like to display only
> > one error at a time.  I have the following code at the top of my form:
>
> >  > if ($form->isFieldError('user_username')){
> >        echo $form->error('user_username');
> > } elseif ($form->isFieldError('user_password')) {
> >        echo $form->error('user_password');
> > } elseif ($form->isFieldError('user_given_name')) {
> >        echo $form->error('user_given_name');
> > } elseif ($form->isFieldError('user_surname')) {
> >        echo $form->error('user_surname');
> > } elseif ($form->isFieldError('user_email')) {
> >        echo $form->error('user_email');
> > }
> > ?>
>
> > How can I move the nested if statements out of my view?  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
-~--~~~~--~~--~--~---



SSL protect admin routes

2009-07-28 Thread toby1kenobi

Hi there,

  I'm struggling with something I imagine is extremely easy, forcing
my admin routes to go over SSL. Am I even close?!

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^mylive.domain.com
RewriteCond %{REQUEST_URI} ^admin(.*)$
RewriteRule .* https://mylive.domain.com%{REQUEST_URI} [L,R=301]

I have this in the htacess file in webroot, which is what Apache is
configured to serve the site out of. If I comment out the third line
all traffic (to any URL) goes over SSL, so I feel like I must be
nearly there...

  Thanks in advance,

Toby
--~--~-~--~~~---~--~~
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 HBTM tables. (included image)

2009-07-28 Thread DavidH

Hi Carlos

Why can't you follow the standard HABTM setup by inserting the names
of you key columns where appropriate? Something like:

class Modulo extends AppModel {

var $hasAndBelongsToMany = array(
  'TipoUsuario' => array(
'classname' => 'TipoUsuario',
'foreignKey' => 'modulo', // The PK column in this model
'associationForeignKey' => 'tipousauario', // The PK column in the
other model
'joinTable' => 'TipoUsuarioModulo'
  )
);

In your TipoUsuario model you'll have a similar HABTM definition with
the same joinTable; but the other fields replaced by their modulo
equivalents.

I hope this works for you.

Regards

David

PS I hope I've spelt all the field names correctly.


On Jul 28, 5:00 pm, Carlos Suarez Fontalvo
 wrote:
> Hello, tnx for the ans, but, i already put the images in my questions,
> and about that, what i need is precisely that data (i need to know for
> a HABTM relationship the jointable, foreignkey, assforkey) for doing
> the rest.
>
> I apreciate your help.
>
> On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
>
> > Hello,
>
> > > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > > tnx a lot.
>
> > In this case I'm pretty sure that you have to define additional HABTM
> > keys in TipoUsuario and Modulo - I mean:
> > joinTable, foreignKey, associationForeignKey. Just get one model
> > association working 1st, and then you'll get the pattern.
>
> > HTH
>
> > Regards,
> > Piotr
--~--~-~--~~~---~--~~
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: Moving nested if statements out of the view.

2009-07-28 Thread brian

If you're concerned that the user won't immediately notice if there's
an error (unlikely, as the form is redisplayed, but whatever) just add
this at the top:

if (!empty($form->validationErrors)) {

and include a notice that there were errors and to check below (where
the errors are displayed with each element). Displaying errors one at
a time would be a huge waste of time for the user.

On Tue, Jul 28, 2009 at 10:39 AM, Shaun wrote:
>
> I prefer to display form validation errors at the top of the form
> rather than under each form field.  I would also like to display only
> one error at a time.  I have the following code at the top of my form:
>
>  if ($form->isFieldError('user_username')){
>        echo $form->error('user_username');
> } elseif ($form->isFieldError('user_password')) {
>        echo $form->error('user_password');
> } elseif ($form->isFieldError('user_given_name')) {
>        echo $form->error('user_given_name');
> } elseif ($form->isFieldError('user_surname')) {
>        echo $form->error('user_surname');
> } elseif ($form->isFieldError('user_email')) {
>        echo $form->error('user_email');
> }
> ?>
>
> How can I move the nested if statements out of my view?  Thanks.
> >
>

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



Re: Cannot modify header information - headers already sent by

2009-07-28 Thread Delberto

Problem solved. Seems there was a space in the webroot/index.php Quite
frustrating.

On Jul 28, 12:44 pm, Delberto  wrote:
> Hello,
>
> I am having a problem with my application. I have it running fine on
> my local development machine. Yet when I put it on the server I get
> this error "Cannot modify header information -headersalreadysent
> by". I have checked the controllers and models for spaces before  and after ?> but I cannot find any.
>
> I am using Wamp on my local machine and the remote server is Linux
> with PHP5 on it.
>
> Any ideas would be appreciated as I have been nearly a day trying to
> figure this out.
>
> Cheers,
>   Derek
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Set user variables

2009-07-28 Thread Dave Maharaj :: WidePixels.com
I have a set of variables that are used throughout the app such as
 
$auth = $this->Auth->user('id');
$slug = $this->Auth->user('slug');
$role = $this->Auth->user('role');
 
and so on
 
How can I define these in the app_controller beforeFilter so I can grab them
from any controller using
 
function beforeFilter()
  {
  parent::beforeFilter();
   }
 
or any other way that will work.
 
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
-~--~~~~--~~--~--~---



Re: Problem with HBTM tables. (included image)

2009-07-28 Thread Carlos Suarez Fontalvo

Hello, tnx for the ans, but, i already put the images in my questions,
and about that, what i need is precisely that data (i need to know for
a HABTM relationship the jointable, foreignkey, assforkey) for doing
the rest.

I apreciate your help.

On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
> Hello,
>
> > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > tnx a lot.
>
> In this case I'm pretty sure that you have to define additional HABTM
> keys in TipoUsuario and Modulo - I mean:
> joinTable, foreignKey, associationForeignKey. Just get one model
> association working 1st, and then you'll get the pattern.
>
> HTH
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Building views for an extended HABTM

2009-07-28 Thread DavidH

Hi

I'm hoping someone will be able to put me out of my misery with this
HABTM problem I have because it's doing my head in.

I have an application to draw charts of key performance Indicators
(KPIs). A chart can have many KPIs and a KPI can appear on many
charts. So I have models:

Chart
Kpi

and a HABTM relationship between them using a join table called
charts_kpis. This all worked like a dream. I had a form that allowed
the user to specify their chart details (title, size etc) and select
which KPIs to display on the chart using checkboxes to select the
KPIs. It was cool!

The I started to add some additional attributes. For example a KPI can
be displayed in a different colour on each chart and the lines/bar can
be a different width. So I added some attributes to my charts_kpis
table which now has the structure:

id - PK
kpi_id - references kpis table
chart_id - references charts table
kpi_colour_id - references kpi_colours table. A model exists for this
and defines a hasMany relationship with charts_kpis table
width - width to display this KPI on this chart

Here I started to run into problems. In the end I dissolved the HABTM
relationship between charts and kpis and resorted to:

Chart hasMany ChartsKpi
ChartsKpi belongsTo Chart
Kpi hasMany ChartsKpi
ChartsKpi belongsTo Kpi

and, of course

KpiColour hasMany ChartsKpi
ChartsKpi belongsTo KpiColour

However the lengths I've had to go to to get the add/edit forms to
work (well, the edit form still isn't working right) leads me to think
that I've really gone about this the wrong way. What I want is a form
that allows the user to add/edit the chart details (in the charts
table) at the top and below this to select the KPIs that they want
(using a checkbox) and select the colour and set the width for the
KPIs they've selected. (This is very difficult to describe without a
picture). There's many more attributes to follow once I have this
'simple' case working.

Should I have been able to do this using the original HABTM
relationship?

Thanks in advance

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



understanding blackHoleCallback

2009-07-28 Thread Luke

Hi,

I am using the Security component, but would like to make sure that if
the security check fails, the User will get an Error message displayed
inside the Layout.

So, when I use just:

$this->Security->blackHole($this, 'You are not authorized to process
this request!');

I only get a blank white page with nothing else displayed. So I added:

$this->Security->blackHoleCallback = 'accessError';


With this, I now get the "You are not authorized to process this
request!" displayed, but it sits outside of my Layout, its actually
even outside the 

What am I doing wrong? If I understand right, than I would need a
function accessError() , but what do i need to add into this to make
sure it is all in one Layout? I look forward to any help, I have read
backwards and forwards through the www but could not find an answer.
Thanks a lot for your help.

Luke
--~--~-~--~~~---~--~~
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: Allow some html tags in Sanitize::html()

2009-07-28 Thread Arnau Alcázar Lleopart
On Tue, Jul 28, 2009 at 3:56 PM, euromark (munich) <
dereurom...@googlemail.com> wrote:

>
> or the htmlpurifier library


Html purifier is too heavy for what I want to do, and strip_tags() is not
enought secure. I'm going to user Sanitize::html() and bbcode.

--~--~-~--~~~---~--~~
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: SecurityComponent::requireAuth : when?

2009-07-28 Thread Lucas Costa

Hi Jaydeep. I think that's the requireLogin() method: "Sets the
actions that require a valid HTTP-Authenticated request."

The requireAuth() is supposed to "Sets the actions that require a
valid Security Component generated token.". I just don't see this
happening or if it is already happening without setting it.

Regards

On Jul 27, 4:13 pm, Jaydeep Dave  wrote:
> Hi Lucas,
> I think it blocks the page using "http authentication method" (similar to
> .htpasswd)
>
>
>
> On Mon, Jul 27, 2009 at 10:34 AM, Lucas Costa  wrote:
>
> > Hello fellows, I think there's a lack of examples of the use of
> > SecurityComponent's requireAuth method.
>
> > What is indeed the purpose of this method?
>
> > What vulnerabilities does it cover?
>
> > Is it or how is it related to the AuthComponent?
>
> > Could you give some examples of the right use?
>
> > Thank you all.
>
> > Lucas Costa
>
> --
> Regards,
>
> Jaydeep Dave
> Mobile: +919898456445
> Email: jaydipd...@yahoo.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 multilingual

2009-07-28 Thread djogo

Hey

I spent many time trying to figure out how to make i18n work... I'm
not following this topic realtime, but I'd like to post some tips that
would really had helped me back then:

- always use utf-8, no matter what's the language you're i18ng
- check if the locale is installed in your system. sometimes it's
lang.encoding, like pt_BR.UTF-8 instead of pt_BR
- do not use non-ascii (?) characters in the source code messages.
like, _("Tá certo") won't work with gettext. You'll probably want to
use _("Ta certo")
- for that reason, if your main language is not english or something
that doesn't use non-ascii characters, you'll need to "translate it"
if you want to display the correct words
- it's frustrating to try to change the .mo files real-time, as you'll
need to reload apache (or whatever) everytime. the reason is that
apache likes to keep .mo files cached, and won't reload it unless you
shut it down and start it again.

that's all I remember for now. hope it helps. fell free to contact me
pvtly.

dfcp

On Jul 28, 5:37 am, leop  wrote:
> I can't see what is causing the problem, but it is a warning rather
> than an error. It seems to indicate that the code executed okay, but
> the headers had already been sent. If you have copied & pasted the
> code, you may have picked up a space after the ?> in p28n.php (I see
> by swiping the code that there is one in my fragment).
>
> L
>
> On Jul 28, 7:29 am, Yannis  wrote:
>
> > Hi leop,
>
> > Thanks for the code. I've used it but I get the following error:
> > Warning (2): Cannot modify header information - headers already sent
> > by (output started at .../config/routes.php:49) [CORE/cake/libs/
> > controller/components/cookie.php, line 364]
>
> > If that rings any bell?!?!
>
> > Looks like the line that is causing this is the p28n.php:
> > $this->change(($this->Cookie->read('lang') ? $this->Cookie->read
> > ('lang') : 'eng'));
>
> > Have you had that?

--~--~-~--~~~---~--~~
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: using simple HTML form with cakePHP !

2009-07-28 Thread AD

hi,
you have to name your input right to get the data into $this->data. e.g.



greets
Andreas

Abraham Boray schrieb:
> I'm not usin' Form helper 4 some reason , and I'm working with a
> simple comment form ::
>
>
> /**form*/
>  
> 
> 
> 
> 
> class="button" value="Comment" />
>
>
> ///*My Model(Table) ,Fields names
> are ::///
>
>  -id
> -post_id
> -content
> -a_url
> -e_mail ...
>
> *And I'm doing an ajax
> call ::*/
>
> var data=$('#CommentForm').formSerialize();
> //I'm using a Form plugins to retrieve data from the form
> eg:e_mail...@cf.ma&
>
>   $.ajax({
>type: "POST",
>url: "comments/AddComment/",
>data: data,
>success: function(msg){
>  alert( "Data status: " + msg );
>}
>  });
>
> /***controller action==> AddComment **//
> function AddComment(){
>
>  $this->layout = 'ajax';
>
>   if ($this->RequestHandler->isAjax()) {
>if ($this->Comment->save($this->data)) {
> echo 'success';
>   }
>
>   Configure::write('debug', 0);
>   $this->autoRender = false;
>   exit();
>  } }
>
>
> The comment is not saved !! ,and I get no error ,I dnt get even the "
> echo 'success';" of the action !
> Firebug indicat that there is no error ,and the ajax call is
> performed !
>
> Thanks in advance , I hope find a solution
> Regards
> Abraham
>
>
>
>
> >
>
>   


--~--~-~--~~~---~--~~
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: A Search Behavior

2009-07-28 Thread iTodd

I have the same problem. Please can someone help? :)

Thanx for cakephp!

On 22 jul, 09:31, pola  wrote:
> Hi guys...
>
> I´am struggling to get that lucene thing implemented.
>
> I read the instructions 
> athttp://www.assembla.com/wiki/show/dF-Zfqzzur3yBfab7jnrAJ
>
> It looks like i can build the search_index:
>
> p...@tomahawk:~/stuff/werkbank/cake_1.2.3.8166/cake/console$ 
> ./cakesearchbuild_index -app /home/pola/stuff/werkbank/emmall/generator/
> trunk/output/
>
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File.php on line 268
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File.php on line 289
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File.php on line 290
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File/Memory.php on line 380
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File/Memory.php on line 401
> Notice: Hex number is too big: 0x1 in /home/pola/stuff/
> werkbank/emmall/generator/trunk/output/vendors/Zend/Search/Lucene/
> Storage/File/Memory.php on line 402
> 8.3
> Processing Category #16
> Processed Category #16
> 16.7
> ...
> ...
> ...
> Processing Category #28
> Processed Category #28
> 100.0
> Processing Category #29
> Processed Category #29
> Optimizing index...
> Optimized index.
>
> and the results in the dirs:
>
> @cake
> p...@tomahawk:~/stuff/werkbank/cake_1.2.3.8166/cake/console$ ls
> search_index/
> optimization.lock.file  _q.cfs  read.lock.file  read-lock-
> processing.lock.file  segments_17  segments.gen  write.lock.file
>
> @app
> p...@tomahawk:~/stuff/werkbank/emmall/generator/trunk/output/tmp$ ls
> search_index/
> read.lock.file  segments_1  segments.gen  write.lock.file
>
> But if i use the newest lucene stuff from zend i get notices like u
> see allthough above
> "Hex number is too big: 0x1 [APP/vendors/Zend/Search/Lucene/
> Storage/File.php, line 268]".
>
> If i use the lucene source fromhttp://thechaw.com/cakebook/its fine
> i dont get that notices.
>
> The Warning i allways get is
> "Undefined variable: Hits [APP/plugins/searchable/models/behaviors/
> searchable.php, line 213"]
>
> Anyways i dont get any results out of thatsearchfunction.
>
> $this->Model->search($query, $limit, $page)
> $this->Model->hits_count()
> $this->Model->terms();
>
> I reckon i just missed to adjust some tiny noob stuff!?
>
> Any Ideas or recommendations would be very helpful...
>
> Thanx a lot for cakephp.
>
> > It's already implemented & being used on the cookbook as a plugin:
> >http://thechaw.com/cakebook/source/plugins/searchable
> > It uses Lucene & the adapter from ZendFramework, and works well
> > enough.
> > -j.

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



Problem with cakePhp and nested ajax form in firefox 3.5

2009-07-28 Thread portoalet

Hi,

Is it possible to have a nested ajax form in cakephp and firefox ?
i.e.


$ajax->form(form1...)
   table
 row
   $ajax->form(childForm_rowId)
   $form->end(childForm_rowId)
 endrow
   end table
$form->end


I found this works in IE7, but not in Firefox 3.5.1
Firefox will omit the childForm declaration, so the child forms
(childForm_rowId) will use the first form(form1) action when it is
submitted, which is not what we want.

Any idea how can I work around 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
-~--~~~~--~~--~--~---



Moving nested if statements out of the view.

2009-07-28 Thread Shaun

I prefer to display form validation errors at the top of the form
rather than under each form field.  I would also like to display only
one error at a time.  I have the following code at the top of my form:

isFieldError('user_username')){
echo $form->error('user_username');
} elseif ($form->isFieldError('user_password')) {
echo $form->error('user_password');
} elseif ($form->isFieldError('user_given_name')) {
echo $form->error('user_given_name');
} elseif ($form->isFieldError('user_surname')) {
echo $form->error('user_surname');
} elseif ($form->isFieldError('user_email')) {
echo $form->error('user_email');
}
?>

How can I move the nested if statements out of my view?  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
-~--~~~~--~~--~--~---



getting a 404 with Media View

2009-07-28 Thread Stinkbug

I'm assuming this is an apache config problem, but I'm not sure what
could be causing it.  Thought I'd just ask the community to see if
anyone knew what the problem might be.

I'm using the Media view to download files and have the files
directory outside the webroot.  I'm getting a 404 Page cannot be found
error when tring to download the file.  It works in out test
envirnoment just fine, but when I move into production, I get this
error.  Could it be an apache config problem, or an app problem?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Email Component return path

2009-07-28 Thread Obiyoda

I can't seem to get the email component to set a correct return path
in the header. I've tried setting $this->Email->return =
'someb...@somewhere.com' yet the email headers are showing the return
paths as being www-d...@localhost instead of someb...@somewhere.com.
I'm using ubuntu Jaunty with sendmail in my test environment if that
helps at all but i've tried it on our production server and it gives
me the same issues(also using sendmail).
--~--~-~--~~~---~--~~
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: i18n and LIKE conditions

2009-07-28 Thread leop

That query won't work because, as you have described, the column name
does not exist on the table product. Without seeing your datamodel,
it's impossible to suggest a solution, but I suggest you look at using
'containable'.

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

2009-07-28 Thread leop

> Do I have to add something else to change the database locale?

No, I don't think so. That's all I have!

I can only suggest that you look carefully at the folder names and the
two or three letter acronyms to ensure that you have the correct ones
in the correct places.

Start with just two languages that have standard acronyms, e.g. en /
eng & es / spa.  That way you can be certain which goes where.
This page might help (it takes a while to load):
http://www.sil.org/iso639-3/codes.asp?order=scope&letter=%25

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



bug? $html->addCrumb()

2009-07-28 Thread leo

As this worked in an earlier release, and nobody has responded to my
previous post, I'm wondering if this is maybe a bug. If so, I'll log
it.

Some time ago I used the bread crumb functionality of HtmlHelper
without a great deal of difficulty.

Now, a year or so on, I'm at it again. This time I'm developing in a
full release: 1.2.3.8166 (previously it was RC2 or RC3) and it doesn't
seem to
work. I don't have access to my previous code for reference.

The symptoms are that when I addCrumb, the $html->_crumbs array
appears to be created afresh for each page visited. The crumbs array
seems to be going out of
scope.

The following code fragment from an_element.ctp which is included by
the layout, default.ctp:

debug($html->_crumbs);
$html->addCrumb($this->name,$this->params['url']['url']);
debug($html->_crumbs);

always yields this, or similar, output as the site is navigated, i.e.
an array with 0 or 1 elements:

Array
(
)

Array
(
[0] => Array
(
[0] => Proposals
[1] => proposals/view/5
[2] =>
)

)

I'm a bit confused here and would appreciate any pointers to what I'm
failing to do.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Allow some html tags in Sanitize::html()

2009-07-28 Thread euromark (munich)

or the htmlpurifier library

On 28 Jul., 11:47, majna  wrote:
> There is no way.
> Use PHP's strip_tags() and htmlentities() instead
>
> On Jul 28, 12:30 am, Arnau Alcázar Lleopart 
> wrote:
>
> > Does anybody knows if there is any way to allow some html tags in
> > function Sanitize::html()?
>
> > 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: Form fields repopulating with default data.

2009-07-28 Thread Shaun

I was using an input form with 'value' => ''.  I changed it to
"default => '' and it works like a charm.  Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: using simple HTML form with cakePHP !

2009-07-28 Thread Piotr Kilczuk

Hello,

How does the POST request look like then?


Regards,
Piotr

--~--~-~--~~~---~--~~
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: using simple HTML form with cakePHP !

2009-07-28 Thread euromark (munich)

what reason what that be justifying not using the form helper?
i cant see any :)


On 28 Jul., 14:28, Abraham Boray  wrote:
> I'm not usin' Form helper 4 some reason , and I'm working with a
> simple comment form ::
>
> /**form*/
>      
>     
>     
>     
>     
>     class="button" value="Comment" />
>
> ///*My Model(Table) ,Fields names
> are ::///
>
>  -id
> -post_id
> -content
> -a_url
> -e_mail ...
>
> *And I'm doing an ajax
> call ::*/
>
> var data=$('#CommentForm').formSerialize();
> //I'm using a Form plugins to retrieve data from the form
> eg:e_mail...@cf.ma&
>
>   $.ajax({
>    type: "POST",
>    url: "comments/AddComment/",
>    data: data,
>    success: function(msg){
>      alert( "Data status: " + msg );
>    }
>  });
>
> /***controller action==> AddComment **//
> function AddComment(){
>
>      $this->layout = 'ajax';
>
>         if ($this->RequestHandler->isAjax()) {
>          if ($this->Comment->save($this->data)) {
>             echo 'success';
>       }
>
>         Configure::write('debug', 0);
>         $this->autoRender = false;
>         exit();
>  } }
>
> The comment is not saved !! ,and I get no error ,I dnt get even the "
> echo 'success';" of the action !
> Firebug indicat that there is no error ,and the ajax call is
> performed !
>
> Thanks in advance , I hope find a solution
> Regards
> Abraham
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



i18n and LIKE conditions

2009-07-28 Thread kicaj

Hi,

I create table products width: id, name, desc, created, modified...
I use i18n and Translate Behavior to translate data
Then I drop field name and desc form products table, because will be
wroten in i18n table.

Now when i want use conditions like this:
Product.name LIKE => '%keyword%' i get message: Unknown column
'Product.name' in 'where clause'

How I can repaire this problem, any solution?
--~--~-~--~~~---~--~~
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: isUnique is generating an invalid query and I have no idea why :-(

2009-07-28 Thread rich...@home

Sorted it... I'd made a tiny modification to cake core (dbo_source) to
fix another issue.

Note to self: Serves you right!

On Jul 28, 11:25 am, "rich...@home"  wrote:
> Bit of an odd one this, and it has only started happening recently in
> an application I'm building...
>
> I'm using CakePHP 1.2.3.8166
>
> The following validation rule:
>
>         var $validate = array(
>                 "name"=>array(
>                         "required"=>array(
>                                 "rule"=>array("minLength", 1),
>                                 "message"=>"cannot be blank",
>                                 "required"=>true
>                         ),
>                         "unique"=>array(
>                                 "rule"=>"isUnique",
>                                 "message"=>"already exists"
>                         )
>                 )
>         );
>
> Produces the following (invalid) query when the form is validated:
>
> SELECT COUNT(*) AS `count` FROM `canvatex_textures` AS
> `CanvatexTexture`   WHERE `CanvatexTexture`.`name` IS ''
>
> (The 'IS' part is invalid - should be '=').
>
> This is happening across every model that checks for 'isUnique'.
>
> I've got a couple of other apps in development using the same version
> of Cake that don't exhibit this problem.
>
> I've cleared out the caches and come up blank.
>
> wtf have I broken?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



using simple HTML form with cakePHP !

2009-07-28 Thread Abraham Boray

I'm not usin' Form helper 4 some reason , and I'm working with a
simple comment form ::


/**form*/
 




   


///*My Model(Table) ,Fields names
are ::///

 -id
-post_id
-content
-a_url
-e_mail ...

*And I'm doing an ajax
call ::*/

var data=$('#CommentForm').formSerialize();
//I'm using a Form plugins to retrieve data from the form
eg:e_mail...@cf.ma&

  $.ajax({
   type: "POST",
   url: "comments/AddComment/",
   data: data,
   success: function(msg){
 alert( "Data status: " + msg );
   }
 });

/***controller action==> AddComment **//
function AddComment(){

 $this->layout = 'ajax';

if ($this->RequestHandler->isAjax()) {
 if ($this->Comment->save($this->data)) {
echo 'success';
  }

Configure::write('debug', 0);
$this->autoRender = false;
exit();
 } }


The comment is not saved !! ,and I get no error ,I dnt get even the "
echo 'success';" of the action !
Firebug indicat that there is no error ,and the ajax call is
performed !

Thanks in advance , I hope find a solution
Regards
Abraham




--~--~-~--~~~---~--~~
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 HBTM and ACL

2009-07-28 Thread womble

Think you want to look at the tutorial at the end of the Cake book/
doco, in particular the acts as requestor stuff

http://book.cakephp.org/view/641/Simple-Acl-controlled-Application

On Jul 28, 7:04 pm, Andraž  wrote:
> If I add in User model
> var $actsAs = array('Acl'=>'requester');
>
> Then I get this errors.
>
> Warning (512): Callback parentNode() not defined in Mrartist [CORE/
> cake/libs/model/behaviors/acl.php, line 62]
> Warning (512): Callback parentNode() not defined in Mrcompany [CORE/
> cake/libs/model/behaviors/acl.php, line 62]
> Warning (512): Callback parentNode() not defined in Songwriter [CORE/
> cake/libs/model/behaviors/acl.php, line 62]
>
> This is defined as
>
> var $hasAndBelongsToMany = array(
> 'Songwriter' => array(
> 'className' => 'Song',
> 'joinTable' => 'songwriters',
> 'foreignKey'=> 'user_id',
> 'associationForeignKey'=> 'song_id',
> 'unique'=> true),
> 'Songpublisher' => array(
> 'className' => 'Song',
> 'joinTable' => 'songpublishers',
> 'foreignKey'=> 'user_id',
> 'associationForeignKey'=> 'song_id',
> 'unique'=> true),
> 'Mrartist' => array(
> 'className' => 'MasterRecording',
> 'joinTable' => 'mrartists',
> 'foreignKey'=> 'user_id',
> 'associationForeignKey'=> 'mr_id',
> 'unique'=> true),
> 'Mrcompany' => array(
> 'className' => 'MasterRecording',
> 'joinTable' => 'mrcompanies',
> 'foreignKey'=> 'user_id',
> 'associationForeignKey'=> 'mr_id',
> 'unique'=> true),
> 'Affiliate' => array(
> 'className' => 'User',
> 'joinTable' => 'affiliations',
> 'foreignKey'=> 'user_id',
> 'associationForeignKey'=> 'affiliate_id',
> 'unique'=> true)
> );
>
> Strange is, because for some definitions I get errors and for othes
> there isn't any errors.
>
> Any hint how to resolve this isue?
>
> Regards Andraž
--~--~-~--~~~---~--~~
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: Weired cakePHP behavior!!

2009-07-28 Thread Abraham Boray

@Miles J : actually I dnt want to grab all the records ,just a
specific category with a known ID.
@phpcurious:Thanks , actually I guess that's the problem
"recursion" ,ill check the link out and see .

regards
Abraham

On Jul 28, 1:55 am, phpcurious  wrote:
> I noticed that in the frist part of your codes you indicated that you
> needed a recursion on the pagination, while the other, you only used
> read function which reads only a specific row with no recursion.
> That's just my guess where you are having trouble with.
> To know more about recursion,http://book.cakephp.org/view/439/recursive
>
> On Jul 28, 5:48 am, Abraham Boray  wrote:
>
> > I'm doing ajax call on some models ,and the 1st code seems to be
> > workin' , but the second one is not !
>
> > I'm simply retrievin' data from database and print it in JSON format :
>
> > this is my view :
> > echo $javascript->object($category);
>
> > this code work perfectly
> >  Configure::write('debug', 0);
> >            $this->layout = 'ajax';
> >            $this->RequestHandler->setContent('json', 'text/javascript');
> >            $this->RequestHandler->respondAs('json');
> >            $this->Category->recursive = 2;
> >            $this->set('category', $this->paginate());
>
> > this code won't work!!!
> > Configure::write('debug', 0);
> >            $this->layout = 'ajax';
> >            $this->RequestHandler->setContent('json', 'text/javascript');
> >            $this->RequestHandler->respondAs('json');
> >            $this->set('category', $this->Category->read(null, 1));//here I'm
> > just getting the record with the id 1
>
> > it's  little confusing 4 me how can the first code work and the second
> > one not
>
> > regards
> > Abraham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cannot modify header information - headers already sent by

2009-07-28 Thread Delberto

Hello,

I am having a problem with my application. I have it running fine on
my local development machine. Yet when I put it on the server I get
this error "Cannot modify header information - headers already sent
by". I have checked the controllers and models for spaces before  but I cannot find any.

I am using Wamp on my local machine and the remote server is Linux
with PHP5 on it.

Any ideas would be appreciated as I have been nearly a day trying to
figure this out.

Cheers,
  Derek
--~--~-~--~~~---~--~~
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 multilingual

2009-07-28 Thread Yannis

OK you were right!
There was a space after the ?> in routes.

- However: i10n works / i18n doesn't work.
Meaning the po messages change but the database locale is always eng.

-Your code for language change stays the same, meaning that english is
always the chosen lang

Do I have to add something else to change the database locale?

thanks


On Jul 28, 11:37 am, leop  wrote:
> I can't see what is causing the problem, but it is a warning rather
> than an error. It seems to indicate that the code executed okay, but
> the headers had already been sent. If you have copied & pasted the
> code, you may have picked up a space after the ?> in p28n.php (I see
> by swiping the code that there is one in my fragment).
>
> L
>
> On Jul 28, 7:29 am, Yannis  wrote:
>
>
>
> > Hi leop,
>
> > Thanks for the code. I've used it but I get the following error:
> > Warning (2): Cannot modify header information - headers already sent
> > by (output started at .../config/routes.php:49) [CORE/cake/libs/
> > controller/components/cookie.php, line 364]
>
> > If that rings any bell?!?!
>
> > Looks like the line that is causing this is the p28n.php:
> > $this->change(($this->Cookie->read('lang') ? $this->Cookie->read
> > ('lang') : 'eng'));
>
> > Have you had that?
--~--~-~--~~~---~--~~
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: validates() not working on all functions...

2009-07-28 Thread delocalizer

Are you setting your data to the model in the controller action before
validating/saving?
$this->Model->set($this->data);
$this->Model->save();
etc.

On Jul 28, 12:27 am, number9  wrote:
> I'm using a validates function in a model in order to validate image
> uploads. I want to validate the filetype, and also make it required.
>
> I know cake has built in validation for these, but I could never get
> it to work. The image upload component I am using uses an array,
> accessible via $this->data['Img']['pic'].
>
> The problem I am having, is that the /add/ function works great, but
> when I use the image field (Img.pic) on another function (/
> edit_image/) the validation function isn't applied.
>
> Here is the model code:
>
>         function validates()
>     {
>
>                 $image = $this->data['Img']['pic']['name'];
>                 // Grab the file extension:
>                 $path = pathinfo($image);
>                 $filetype = $path['extension'];
>
>                 if(!empty($image)) {
>
>                 if (($filetype != 'JPG') && ($filetype != 'jpg') && 
> ($filetype !=
> 'GIF') && ($filetype != 'gif') && ($filetype != 'JPEG') && ($filetype !
> = 'jpeg'))
>                         {
>             $this->invalidate('Img.pic');
>                         }
>                 }
>                 else {
>                         $this->invalidate('Img.pic');
>                 }
>
>         $errors = $this->invalidFields();
>         return count($errors) == 0;
>     }
>
> Is there something I have to include in the controller to make the
> above happen automatically?
>
> I would appreciate any guidance on this, I can include more code if
> requested.
>
> 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: Form fields repopulating with default data.

2009-07-28 Thread delocalizer

Is your field a 'select' type? How are you setting the default value?
>From memory, using 'selected'=>'value' forces the input view to show
initial 'value', but using 'default'=>'value' will only populate
'value' if data is not present for that field - so in the case of
failed validation (where data is returned to the view) the user-
entered value will stand.

On Jul 27, 11:54 pm, Shaun  wrote:
> I have a form field named user_first_name with no default value.  When
> a user named Fred completes this field correctly, but enters invalid
> data in another field such as user_password, user_first_name is
> automatically repopulated with "Fred" so Fred doesn't need to write
> his first name again.  Nice!
>
> However, I also have a form field named user_birth_year with a default
> value of "".  Fred enters a valid birth year, but an invalid
> password.  Rather than saving his correct birth year, the field is
> automatically repopulated with "".
>
> How can this be avoided?  Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bypassing Security Salt

2009-07-28 Thread Steppio

The best solution that i have found is located at the bottom of this
page, basically to disable security salting from with the Auth
component within the Password function:

http://www.mail-archive.com/cake-php@googlegroups.com/msg50946.html

hope it clears up someone else's confusion too, thank you to everybody
for your help with this, its very appreciated.

Ste

On Jul 28, 11:09 am, Steppio  wrote:
> Yeah its coming back non-encrypted, thanks for the heads up, do you
> know how i would apply just sha1 encryption to it from there?
>
> On Jul 28, 6:17 am, Andras Kende  wrote:
>
> > Yes, its overwrites cake's hashPassword function to not to salt the  
> > password put the code into usually user model
> > and see if the password is encrypted in the debug display...
>
> > Andras
>
> > On Jul 27, 2009, at 4:52 PM, Steppio wrote:
>
> > > @Miles J, thanks for the post but im using alot of cookies so i need
> > > the salt value set in core, just not used in the authentication
> > > process.
>
> > > @Andras Kende, thanks mate, do you know what it does?
>
> > > On Jul 27, 9:14 pm, Andras Kende  wrote:
> > >> Hello,
>
> > >> You could try in your model:
>
> > >>   function hashPasswords($data){
> > >>      return $data;
> > >>   }
>
> > >> Andras
>
> > >> On Jul 27, 2009, at 1:53 PM, Steppio wrote:
>
> > >>> Hi there,
> > >>> I was wondering if anybody knows a way to bypass the salting that  
> > >>> the
> > >>> Security component automatically gives to a password?
>
> > >>> The problem is that i have a database of old passwords and im
> > >>> converting the site into a CakePHP site, however when im trying to  
> > >>> log
> > >>> in to the new site the password being returned by the debugger  
> > >>> appears
> > >>> to have been salted and therefore doesnt conform to my original,  
> > >>> non-
> > >>> salted sha1 password.
>
> > >>> Any help would be greatly appreciated.
>
> > >>> Thank you!
>
> > >>> Steppio
--~--~-~--~~~---~--~~
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 inheirt form other controllers?

2009-07-28 Thread Grzegorz Pawlik


> *Fatal error*: Class 'LocationController' not found in *
> C:\wamp\www\theinconnu\app\controllers\locationmanager_controller.php* on
> line *6

It seems You are importing LocationmanagerController (in app::import),
but
extending class by LocationController, or making some similar
mistake.
Plus, controllers are supposed to be plural, like LocationsController
instead of LocationController  and so, maybe this is Your typo?

>
> *So for the parent controller name, do I use 'Location' or
> 'LocationController'?
>
> On Mon, Jul 27, 2009 at 12:31 PM, Graham Weldon 
> wrote:
>
>
>
> > Try something like:
>
> > if (!class_exists('ParentController')) {
> >     App::import('Controller', 'ParentController');
> > }
> > class ChildController extends ParentController {
> >     // Imeplement controller as normal
> > }
>
> > Cheers,
>
> > Graham Weldon
> > e. gra...@grahamweldon.com
> > p. +61 407 017 293
> > w.http://grahamweldon.com
>
> > On 27/07/2009, at 8:22 PM, Michael Gaiser wrote:
>
> > > I want to have my UserAdmin controller inherit from my User
> > > controller instead of AppController. but it cannot seem to find it.
> > > Is there a special way to do this in cake or can I just use and
> > > include statment? Thanks.
>
> > > ~MJG
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >