Re: Alterar created e modified

2008-02-16 Thread Thiago Paes
Porque você não faz a mão então? direto no código... acho que seria a
solução mais prática né?

Abs,
Thiago

2008/2/16 Henrique de Castro [EMAIL PROTECTED]:

 Salve galera..

 Estou com uma situação um tanto quanto peculiar, estou modelando um banco
 de dados e preciso seguir alguns padrões de nomeclatura adotados pela
 empresa, e nesses padrões os campos created e modified precisariam de nomes
 diferentes. Então queria saber se é possível alterar no Cake o funcionamento
 deles, talvez algum mapeamento no model. Pelo core eu até achei onde é feito
 isso, mas não seria uma boa prática alterar o core do framework. Os campos
 ficariam com os nomes dt_modified e dt_created. Alguma sugestão?

 Att.,
 Henrique de Castro

 



-- 

Thiago Paes - www.thiagopaes.com.br - Linuxer: #224062

--~--~-~--~~~---~--~~
Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português 
em Grupos do Google.
 Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL 
PROTECTED]
 Para ver mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-BR
-~--~~~~--~~--~--~---



Alterar created e modified

2008-02-16 Thread Henrique de Castro
Salve galera..

Estou com uma situação um tanto quanto peculiar, estou modelando um banco de
dados e preciso seguir alguns padrões de nomeclatura adotados pela empresa,
e nesses padrões os campos created e modified precisariam de nomes
diferentes. Então queria saber se é possível alterar no Cake o funcionamento
deles, talvez algum mapeamento no model. Pelo core eu até achei onde é feito
isso, mas não seria uma boa prática alterar o core do framework. Os campos
ficariam com os nomes dt_modified e dt_created. Alguma sugestão?

Att.,
Henrique de Castro

--~--~-~--~~~---~--~~
Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português 
em Grupos do Google.
 Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL 
PROTECTED]
 Para ver mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-BR
-~--~~~~--~~--~--~---



Re: Tradução do Cookbook

2008-02-16 Thread Juan Basso

Opa. É verdade, temos que migrar do manual.cakephp.com.br e passar
para o oficial: http://book.cakephp.org/pt

Notem o /pt. Ele significa que é a versão portuguesa. Eu já passei o
primeiro capítulo pra lá. Estarei enviando o restante durante a
semana.


Abraço a todos.


Juan Basso

On 15 fev, 19:21, TSassara [EMAIL PROTECTED] wrote:
 Olá pessoal!

 Acho que o esquema da tradução do cakePHP vai ter que mudar, não
 acham?

 http://bakery.cakephp.org/articles/view/what-s-up-docshttp://book.cakephp.org/
--~--~-~--~~~---~--~~
Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português 
em Grupos do Google.
 Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL 
PROTECTED]
 Para ver mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-BR
-~--~~~~--~~--~--~---



Re: DATABASE CONFIG dinâmico ...

2008-02-16 Thread Juan Basso

Se eu não me engano, você deve mexer no class ConnectionManager. Eu
nunca testei, mas é uma dica para começar a procura. ;)


Juan Basso

On 15 fev, 09:38, pamp_php [EMAIL PROTECTED] wrote:
   Gostaria de fazer apenas em tempo de execução, sem a necessidade de
 deixá-lo  gravado fisicamente.

   Att,

 On 14 fev, 21:06, Juan Basso [EMAIL PROTECTED] wrote:



  Você quer fazer isso on the fly (durante execução) ou quer que
  depois de feita uma vez o arquivo da classe você quer deixar ele
  gravado fisicamente?

  Juan Basso

  On 14 fev, 16:59, pamp_php [EMAIL PROTECTED] wrote:

   Meu problema é o seguinte:

        Tenho um método no meu MODEL, onde:

        1) Através da conexão default, crio um novo banco de dados (o
   nome do banco de dados é passado dinâmicamente para o meu método);
        2) Atribuo privilégios para um usuário, que também é recebido
   pelo método do meu MODEL.
        3) Preciso criar (com os parâmetros recebidos pelo método)  uma
   nova conexão  na classe DATABASE_CONFIG, ou pelo menos passar os
   parâmetros de conexão (host, login, password, database);
        4)  Tornar essa conexão default; ou setá-la em  $this-useDbConfig;

        5)  Executar instruções no banco de dados, através dessa
   conexão.

         Enfim, é isso.

         Se alguém puder me ajudar, agradeço.

         Paulo Augusto M. Pereira.- Ocultar texto entre aspas -

  - Mostrar texto entre aspas -- Ocultar texto entre aspas -

 - Mostrar texto entre aspas -
--~--~-~--~~~---~--~~
Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português 
em Grupos do Google.
 Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL 
PROTECTED]
 Para ver mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-BR
-~--~~~~--~~--~--~---



Re: i18n translation of related models

2008-02-16 Thread senser

I found a ticket open abot this problem here: 
https://trac.cakephp.org/ticket/3680.

It seems I'll have to wait for this enhancement, or write an extra
queries.

On Feb 15, 2:04 pm, senser [EMAIL PROTECTED] wrote:
 Hi,

 I'm using CakePHP to develop a multi-language CMS and have troubles
 with translate baheviour.

 For example I have model named Offer and related model Category as
 relation is Offer--belongsTo--Category. I set up i18n sql tables
 and using var $actAs in models translate the content, but when I try
 to fetch data form table Offers with relevant Category I just
 receive category_id, but not translated category content.

 I read this article in Frequent 
 Discussion:http://groups.google.com/group/cake-php/browse_thread/thread/889c63d3...
 and there is post were jitka says that translation makes hasMany
 relation to retrieve the content of relatede models (in my case -
 translated version of Category).

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



Re: More ACL and Auth confusion.

2008-02-16 Thread francky06l

If I understand correctly, you have an aro for admin and user and each
user has a parent aro (admin or user), am I right ?
Then you would set permissions at the group level.
Did you check your aro table ? Are the aro and their parent correct ?

You can have a look here :
http://www.cakephpforum.net/index.php?showtopic=27

On Feb 16, 2:22 am, FrenchEscapes [EMAIL PROTECTED] wrote:
  If you are using the cake1.2 beta distribution, there was a bug in the
  Auth that would make problems, Try with svn branch or nightly build.

 I have the latest svn revision, I keep updating incase it is a bug.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Beta Auth Component, Controller other than Users

2008-02-16 Thread Rod D.

Still some issues... Good Grief!

Well looking at the Form helper code, I have found that I had to hard
code the form definition in the view.  No worries, it now calls /
echere/login like it is supposed to.

Now, after entering the username and password and clicking the login
button I gegtg the following:
Fatal error:  Call to undefined method stdClass::validates() in C:\www
\app\controllers\echere_controller.php on line 33

The line referred to is:
if ( $this-User-validates() ) {

So, this code use to work when I used the Users controller, but now
with the new name it does not.

I have already included the EcHere controller code in my initial post
above.

Again, the concept is I would like to use the EcHere controller
instead of Users controller, and still use the Users table and model.

Any ideas?

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



Re: 1.2 Beta Auth Component, Controller other than Users

2008-02-16 Thread Rod D.



Rod D. wrote:
 Still some issues... Good Grief!

 Well looking at the Form helper code, I have found that I had to hard
 code the form definition in the view.  No worries, it now calls /
 echere/login like it is supposed to.

 Now, after entering the username and password and clicking the login
 button I gegtg the following:
 Fatal error:  Call to undefined method stdClass::validates() in C:\www
 \app\controllers\echere_controller.php on line 33

 The line referred to is:
   if ( $this-User-validates() ) {

 So, this code use to work when I used the Users controller, but now
 with the new name it does not.

 I have already included the EcHere controller code in my initial post
 above.

 Again, the concept is I would like to use the EcHere controller
 instead of Users controller, and still use the Users table and model.

 Any ideas?Found the issue.  It was a typo in the model.  At some point I 
 misspelled the work array in the setting of the $validate var.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: More ACL and Auth confusion.

2008-02-16 Thread FrenchEscapes

My aros look like this:

Admin (Group)
  --User1
Customer (group)
  --User2

The only permmisions granted are to the Admin group. User1 can access
everything as it should. User2 can't access any actions except the
pages controller which I have allowed so that is fine but it can
also access all of the User controller actions which I have not $this-
Auth-allow(); ed.

acos:

root
  --activities
---view
---edit

  --users
---view
---edit

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



Re: Send E-mail

2008-02-16 Thread dandreta

And how can I do this?
Any another suggestion or help?

On 15 feb, 21:26, Wayne Fay [EMAIL PROTECTED] wrote:
 First off, make a little test.php plain PHP file that verifies that
 you can send email using PHP's built-in email 
 functionality:http://us2.php.net/mail

 Then make a little test in a Cake controller that you can call
 directly which does the same thing. Then you can worry about the
 emailcomponent etc.

 Wayne

 On 2/15/08, dandreta [EMAIL PROTECTED] wrote:



  Hi!
  I am developing my application with Cake 1.2 and I want to have send e-
  mails functionality.
  Inside pages folder, I have the view to send e-mail with the basic
  fields: Destination, Subject and Message(body). I have been reading
  about EmailComponent in Bakery's article
  (http://bakery.cakephp.org/articles/view/brief-overview-of-the-new-
  emailcomponent) but I have not managed to apply it because e-mail does
  not send. Simply I want to be able to send e-mails with text only.
  How I can do it?
  Do you Know any link or tutorial where it explains?
  Have I configure anything to be able to send e-mails?
  Thanks and regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: redirecting users from domain.com to www.domain.com

2008-02-16 Thread Thiago Paes
Hi,

you can try put this lines in your Apache configuration, (ex.:
/etc/apache/sites-enable/default):


RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]

It's more fast than a function/method ;)

[]'s

Thiago Paes


On Feb 16, 2008 12:57 PM, Manu0310 [EMAIL PROTECTED] wrote:


 Hi,
 I want to be able to redirect users who hit my site from mysite.com to
 www.mysite.com. I know this can be achieved with a 301 redirect
 specified in the .htaccess file.

 I have tried a few techniques and nothing seems to work with cakePHP.

 Has anyone solved this problem or had a similar issue?
 I use a lot of ajax calls and it is important that users hit
 www.mysite.com
 when they try to access it without the www.

 Thanks


-- 

Thiago Paes - www.thiagopaes.com.br - Linuxer: #224062

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



Re: redirecting users from domain.com to www.domain.com

2008-02-16 Thread Manu0310

Looks good... but would I be able to put that in my .htaccess files?I
don't have full access to the server with the hosting solution I am
on. :)



On Feb 16, 10:02 am, Thiago Paes [EMAIL PROTECTED] wrote:
 Hi,

 you can try put this lines in your Apache configuration, (ex.:
 /etc/apache/sites-enable/default):

 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^mysite.com
 RewriteRule ^(.*)$http://www.mysite.com/$1[R=permanent,L]

 It's more fast than a function/method ;)

 []'s

 Thiago Paes

 On Feb 16, 2008 12:57 PM, Manu0310 [EMAIL PROTECTED] wrote:



  Hi,
  I want to be able to redirect users who hit my site from mysite.com to
 www.mysite.com. I know this can be achieved with a 301 redirect
  specified in the .htaccess file.

  I have tried a few techniques and nothing seems to work with cakePHP.

  Has anyone solved this problem or had a similar issue?
  I use a lot of ajax calls and it is important that users hit
 www.mysite.com
  when they try to access it without the www.

  Thanks

 --
 
 Thiago Paes -www.thiagopaes.com.br- Linuxer: #224062
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: redirecting users from domain.com to www.domain.com

2008-02-16 Thread Thiago Paes
Probably yes...

On Feb 16, 2008 1:08 PM, Manu0310 [EMAIL PROTECTED] wrote:


 Looks good... but would I be able to put that in my .htaccess files?I
 don't have full access to the server with the hosting solution I am
 on. :)



 On Feb 16, 10:02 am, Thiago Paes [EMAIL PROTECTED] wrote:
  Hi,
 
  you can try put this lines in your Apache configuration, (ex.:
  /etc/apache/sites-enable/default):
 
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^mysite.com
  RewriteRule ^(.*)$http://www.mysite.com/$1[R=permanent,L]
 
  It's more fast than a function/method ;)
 
  []'s
 
  Thiago Paes
 
  On Feb 16, 2008 12:57 PM, Manu0310 [EMAIL PROTECTED] wrote:
 
 
 
   Hi,
   I want to be able to redirect users who hit my site from mysite.com to
  www.mysite.com. I know this can be achieved with a 301 redirect
   specified in the .htaccess file.
 
   I have tried a few techniques and nothing seems to work with cakePHP.
 
   Has anyone solved this problem or had a similar issue?
   I use a lot of ajax calls and it is important that users hit
  www.mysite.com
   when they try to access it without the www.
 
   Thanks
 
  --
  
  Thiago Paes -www.thiagopaes.com.br- Linuxer: #224062
 



-- 

Thiago Paes - www.thiagopaes.com.br - Linuxer: #224062

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



redirecting users from domain.com to www.domain.com

2008-02-16 Thread Manu0310

Hi,
I want to be able to redirect users who hit my site from mysite.com to
www.mysite.com. I know this can be achieved with a 301 redirect
specified in the .htaccess file.

I have tried a few techniques and nothing seems to work with cakePHP.

Has anyone solved this problem or had a similar issue?
I use a lot of ajax calls and it is important that users hit www.mysite.com
when they try to access it without the www.

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



Another problem with checkboxes, help!

2008-02-16 Thread Biscazziere

Hi, I'm quite new to CakePhp.
I have this question: I have a simple Post model and I want to
delete Post by a list of checkboxes.
This is the code in class PostsController:

function delete($id = null){

if(!empty($this-data)){

print_r($this-data['Post']);


}

}


I know that I need to loop through the received array, so my View look
like this:

td?php echo $post['Post']['created']; ?/td
td
?php echo $html-checkbox('Post/id', '', array(value =
$post['Post']['id'])); ?
/td

But the ouput of the print_r() is: Array ( [id] = 2 )
I can't get access to all checkboxes values, but only one!

Thanks!



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



Session problems with external application

2008-02-16 Thread rafael bonifaz

We have a problem that we have to share a session between cakephp and
a pure php application. Php is configure to use the session of php so
that the session can be share between php and the external
application.

Some how we loose the session and it is something unpredicatble. Do
you know where I can see the logs of how we are loosing the session. I
do not know how to debug this, I would appreciate some suggestions.

Greetings,

Rafael

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



Re: setFlash('foo')

2008-02-16 Thread Samuel DeVore

probably because you wrapped it in an echo or a short tag, it auto echos

don't
?php echo $this-Session-setFlash('foo'); ?
don't
?= $this-Session-setFlash('foo'); =?

do

?php $this-Session-setFlash('foo'); ?

it returns 'true' or 1

Sam D

On Feb 16, 2008 5:31 AM, herc [EMAIL PROTECTED] wrote:

 Any idea why my $this-Session-setFlash('foo'); outputs Foo 1 in my
 view? :)
 CODE:
 div id=flashMessage class=messagefoo/div1

 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: redirecting users from domain.com to www.domain.com

2008-02-16 Thread Manu0310

Hey guys I finally solved this.
Thanks Thiago for your help, you pointed me in the right direction, so
here is the code to place in your .htaccess file:

RewriteCond %{HTTP_HOST} ^dealque.com$
RewriteRule ^(.*)$ http://www.dealque.com/$1 [R=301,L]

Basically the same code you gave me just added a $ at the end of first
expression.

Thanks again.


On Feb 16, 10:10 am, Thiago Paes [EMAIL PROTECTED] wrote:
 Probably yes...

 On Feb 16, 2008 1:08 PM, Manu0310 [EMAIL PROTECTED] wrote:





  Looks good... but would I be able to put that in my .htaccess files?I
  don't have full access to the server with the hosting solution I am
  on. :)

  On Feb 16, 10:02 am, Thiago Paes [EMAIL PROTECTED] wrote:
   Hi,

   you can try put this lines in your Apache configuration, (ex.:
   /etc/apache/sites-enable/default):

   RewriteEngine on
   RewriteCond %{HTTP_HOST} ^mysite.com
   RewriteRule ^(.*)$http://www.mysite.com/$1[R=permanent,L]

   It's more fast than a function/method ;)

   []'s

   Thiago Paes

   On Feb 16, 2008 12:57 PM, Manu0310 [EMAIL PROTECTED] wrote:

Hi,
I want to be able to redirect users who hit my site from mysite.com to
   www.mysite.com. I know this can be achieved with a 301 redirect
specified in the .htaccess file.

I have tried a few techniques and nothing seems to work with cakePHP.

Has anyone solved this problem or had a similar issue?
I use a lot of ajax calls and it is important that users hit
   www.mysite.com
when they try to access it without the www.

Thanks

   --
   
   Thiago Paes -www.thiagopaes.com.br-Linuxer: #224062

 --
 
 Thiago Paes -www.thiagopaes.com.br- Linuxer: #224062
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session-setFlash()

2008-02-16 Thread Samuel DeVore

wow you echoed again ;)

On Feb 16, 2008 7:20 AM, herc [EMAIL PROTECTED] wrote:

 Any idea why my $this-Session-setFlash('foo'); outputs Foo 1 in my
 view? :)
 CODE:
 div id=flashMessage class=messagefoo/div1

 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: Schema Types

2008-02-16 Thread the_woodsman

I think the only way selects are autogenerated by forms is from
foreign keys, and checkboxes are generated for 'booleans'.

It would be nice if radios and checkboxes were autogenerated from
enums and sets, but these aren't supported out the box.

Have no fear though - you can pass different parameters to the form-
input method, or use form-radio etc, to specify the input type.

(If you're still using scaffolding, look into bake to create real
files for your views for you to customise).

On Feb 16, 12:36 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 What are all the different schema types (for use in the model)?

 I only know of string and text.

 What type do you use for radio or select?

 e.g.- model:

 var $_schema = array(
 'firstName' = array('type' = 'string', 'length' = 30),
 'lastName'  = array('type' = 'string', 'length' = 30),
 'email' = array('type' = 'string', 'length' 
 = 30),
 'msg'   = array('type' = 'text')
 );
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component - Should authError be displayed if session times out?

2008-02-16 Thread EchoChargen

Hello -
Using 1.2 beta release 6311 with Auth component.  I've set the session
timeout to 60 seconds for testing (core.php high setting).  I'm able
to login and get redirected  correctly to loginRedirect().  If I sit
on a protected page and let the session time out, I get redirected
back to the login page, but there is no flash message.  I would expect
authError to be displayed in this situation.
In the case of a request to a page the current user is not authorized
for, redirection to the login page happens and authError is
displayed.  For instance a request to /admin/users by a non-admin
user.

Here is my code:
app_controller:
function beforeFilter(){
//Set up Auth Component
$this-Auth-loginAction = '/users/login';
$this-Auth-loginRedirect = array('controller' = 'users', 
'action'
= 'bouserview');

$this-Auth-fields = array('username' = 'email', 'password' =
'passwd');
$this-Auth-autoRedirect = false;
$this-Auth-loginError = 'Invalid e-mail / password 
combination.
Please try again';
$this-Auth-authError = 'Your session has expired or you are 
not
authorized to access that location!  Please log in again.';
$this-Auth-authorize = 'controller';
//  Only allow active users to login
$this-Auth-userScope = array('User.active' = 1); //user 
needs to
be active.
}

function isAuthorized() {
if (isset($this-params[Configure::read('Routing.admin')])) {
if ($this-Auth-user('admin') == 0) {
$this-Session-setFlash(You are not 
authorized to access that
location!);
$this-redirect($this-Auth-logout());
return false;
}
}
return true;
   }

users_controller:
function login() {
$this-disableCache();
if ($this-Auth-user()) {
//if the redirect was due to a failed /admin* page, 
then set
redirect to login page
if (stristr($this-Session-read('Auth.redirect'), 
'admin') ===
TRUE) {
$this-Session-write('Auth.redirect', 
'/users/login');
}
//set site_id in session
$this-User-restrict(array('Site' = array('fields' =
'Site.id')));
$site = 
$this-User-Site-findByUserId($this-Auth-user('id'));
$site_id = $site['Site']['id'];
$this-Session-write('site_id', $site_id);
$this-redirect($this-Auth-redirect());
}
}

function logout(){
$this-Session-setFlash(You've successfully logged out.);
//$this-redirect($this-Auth-logout());
$logOutUrl = $this-Auth-logout();
$this-redirect($logOutUrl);
}

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



Need a forgot password tutorial

2008-02-16 Thread Manu0310

Hey does any1 have a tutorial on how to create a simple forgot
password form.

One email form field that submits the user email, if in system, emails
the user with a reset hashed link.

Something like that would be great

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



CakePHP 1.2 Email Component works there but not here

2008-02-16 Thread Carl

I have a project that uses the cake email component. It works fine
when I upload the project to a shared server, but when I try to run
locally (under xampp's apache, mysql, mercury) I get an error message
saying:

553 We do not relay non-local mail, sorry.

I have phpnuke programs that use the mercury mailer successfully, but
I don't know what to tell the cake email component so that it does the
same thing. Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



formatting scaffolding created views

2008-02-16 Thread sixs
Hi,
I have created files using baking with a master and a detail table.. It 
displays all fields in the tables for master and detail.. I like that but I  
want to use the same process for display the master and detail  for a user with 
only a few fields showing.
What is the best approach to customize the files for one viewing and showing 
all the fields for editing , deleting, adding view.

Would you copy all files and place them in a separate folder?
Thanks 
JIm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unit and Functional Testing in Cake 1.1

2008-02-16 Thread Samuel DeVore

I would say that doing some searching would be in order, as I haven't
done model based testing on cake 1.1 in a long time.

maybe these (from a google test for cakephp unit test model)
http://cakebaker.42dh.com/2007/12/04/testing-with-partial-mock-objects/
also I think there are some tests in the core that you might be able
to look at but there has been some stuff written you may just need to
search for it
look here http://groups.google.com/group/cake-php/web/frequent-discussions
and if you are in a hurry and can't find what you need jump on the irc
channel and ask there, many people, most smarter then this old fart

On Feb 16, 2008 10:48 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Ok, I've got the test suite running, but I can't figure out how to
 include my models. I can do simple, non-model based tests ($this-
 assertTrue(1==1)) and they will pass, but I can't figure out how to
 do any model-based tests. For example, I would like to be able to do
 something like the following:

 $this-assertTrue($this-Product-responds()) or

 $product = new Product()
 $this-assertTrue($product-responds())

 I can't get either to work. Are there certain files I need to include.
 I tried including the actual model file, but then I get an error b/c
 the app model isn't included. The process of errors continues for each
 subsequent super-class not included.

 On Feb 16, 11:25 am, Samuel DeVore [EMAIL PROTECTED] wrote:
  you might be looking forhttp://cakeforge.org/projects/testsuite/
 
  On Feb 16, 2008 10:19 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 
 
   I know there is a built in test suite for Cake 1.2. I have an app
   built on 1.1, and I need to do testing for it's models and
   controllers. Is there a way to drop in Simpletest in the plugins
   directory, or has someone put a plugin together to do this?
 
   Please, someone point me in the right direction! Thanks in advance.
 
  --
  --
  (the old fart) the advice is free, the lack of crankiness will cost you
 
  - its a fine line between a real question and an idiot
 
  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/

 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: Send E-mail

2008-02-16 Thread Dardo Sordi Bogado

start here, http://us.php.net/manual/en/

On Feb 16, 2008 11:36 AM, dandreta [EMAIL PROTECTED] wrote:

 And how can I do this?
 Any another suggestion or help?

 On 15 feb, 21:26, Wayne Fay [EMAIL PROTECTED] wrote:
  First off, make a little test.php plain PHP file that verifies that
  you can send email using PHP's built-in email 
  functionality:http://us2.php.net/mail
 
  Then make a little test in a Cake controller that you can call
  directly which does the same thing. Then you can worry about the
  emailcomponent etc.
 
  Wayne
 

  On 2/15/08, dandreta [EMAIL PROTECTED] wrote:
 
 
 
   Hi!
   I am developing my application with Cake 1.2 and I want to have send e-
   mails functionality.
   Inside pages folder, I have the view to send e-mail with the basic
   fields: Destination, Subject and Message(body). I have been reading
   about EmailComponent in Bakery's article
   (http://bakery.cakephp.org/articles/view/brief-overview-of-the-new-
   emailcomponent) but I have not managed to apply it because e-mail does
   not send. Simply I want to be able to send e-mails with text only.
   How I can do it?
   Do you Know any link or tutorial where it explains?
   Have I configure anything to be able to send e-mails?
   Thanks and regards
 


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



Re: router param mystery

2008-02-16 Thread b logica

On Feb 16, 2008 1:21 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Cake 1.2.0.6311-beta

 The 'day' param in the following route is always passed as the same
 value as :month, regardless of the :day value in the URL.

 Router::connect('/events/:year/:month/:day',
 array('controller' = 'events', 'action' = 'view', 'day' = null),
 array(
 'year' = '[12][0-9]{3}',
 'month' = '(0[1-9]|1[012])',
 'day' = '(0[1-9]|[12][0-9]|3[01])'
 )
 );

 The first line in ViewsController::view() is:

 debug($this-params);

 produces:

 Array
 (
 [pass] = Array
 (
 [0] = 13
 [1] = 13
 )

 [named] = Array
 (
 )

 [year] = 2008
 [month] = 02
 [day] = 02
 [plugin] =
 [controller] = events
 [action] = view
 [form] = Array
 (
 )

 [url] = Array
 (
 [url] = events/2008/02/13/
 )

 [bare] = 0
 [webservices] =
 )

 If I remove 'day' = null I see this error:

 The action 2008 is not defined in controller EventsController


And I've just noticed that, if I remove the month regex from the route, like so:

Router::connect('/events/:year/:month/:day',
array('controller' = 'events', 'action' = 'view', 'day' = null),
array(
'year' = '[12][0-9]{3}',
'day' = '(0[1-9]|[12][0-9]|3[01])'
)
);

then it works:

Array
(
[pass] = Array
(
[0] = 13
)

[named] = Array
(
)

[year] = 2008
[month] = 02
[day] = 13
[plugin] =
[controller] = events
[action] = view
[form] = Array
(
)

[url] = Array
(
[url] = events/2008/02/13
)

[bare] = 0
[webservices] =
)

It seems the Route is applying the regex patterns in a really strange
way. The month matches against the day pattern and so it is set in
params[]. But it seems to me that it shouldn't because there is no
named pattern for month.

Is this a bug or a feature?

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



Re: Unit and Functional Testing in Cake 1.1

2008-02-16 Thread [EMAIL PROTECTED]

Ok, I've got the test suite running, but I can't figure out how to
include my models. I can do simple, non-model based tests ($this-
assertTrue(1==1)) and they will pass, but I can't figure out how to
do any model-based tests. For example, I would like to be able to do
something like the following:

$this-assertTrue($this-Product-responds()) or

$product = new Product()
$this-assertTrue($product-responds())

I can't get either to work. Are there certain files I need to include.
I tried including the actual model file, but then I get an error b/c
the app model isn't included. The process of errors continues for each
subsequent super-class not included.

On Feb 16, 11:25 am, Samuel DeVore [EMAIL PROTECTED] wrote:
 you might be looking forhttp://cakeforge.org/projects/testsuite/

 On Feb 16, 2008 10:19 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  I know there is a built in test suite for Cake 1.2. I have an app
  built on 1.1, and I need to do testing for it's models and
  controllers. Is there a way to drop in Simpletest in the plugins
  directory, or has someone put a plugin together to do this?

  Please, someone point me in the right direction! Thanks in advance.

 --
 --
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Paginator does not sort desc

2008-02-16 Thread Tomka

Hello.

I want to provide two buttons for each column in a table. The first
should sort the table asc by this colum, the second should sort desc.
Therefor I use the option direction.
But this option is not checked in the method paginator-sort. It
always sorts asc if the table was not sorted by this column before. Is
there a solution for my problem other than writing an own helper
extending the paginator?

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



Re: Schema Types

2008-02-16 Thread Dardo Sordi Bogado

Scaffolds views also can be customized.

On Feb 16, 2008 1:18 PM, the_woodsman [EMAIL PROTECTED] wrote:

 I think the only way selects are autogenerated by forms is from
 foreign keys, and checkboxes are generated for 'booleans'.

 It would be nice if radios and checkboxes were autogenerated from
 enums and sets, but these aren't supported out the box.

 Have no fear though - you can pass different parameters to the form-
 input method, or use form-radio etc, to specify the input type.

 (If you're still using scaffolding, look into bake to create real
 files for your views for you to customise).


 On Feb 16, 12:36 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  What are all the different schema types (for use in the model)?
 
  I only know of string and text.
 
  What type do you use for radio or select?
 
  e.g.- model:
 
  var $_schema = array(
  'firstName' = array('type' = 'string', 'length' = 30),
  'lastName'  = array('type' = 'string', 'length' = 
  30),
  'email' = array('type' = 'string', 
  'length' = 30),
  'msg'   = array('type' = 'text')
  );
 


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



Re: Send E-mail

2008-02-16 Thread b logica

On Feb 16, 2008 8:36 AM, dandreta [EMAIL PROTECTED] wrote:

 And how can I do this?
 Any another suggestion or help?

 On 15 feb, 21:26, Wayne Fay [EMAIL PROTECTED] wrote:
  First off, make a little test.php plain PHP file that verifies that
  you can send email using PHP's built-in email 
  functionality:http://us2.php.net/mail
 
  Then make a little test in a Cake controller that you can call
  directly which does the same thing. Then you can worry about the
  emailcomponent etc.
 
  Wayne
 


?php
/* fill in the following:
 */
$email_from = FROM_ADDRESS;
$email_sender = SENDER_ADDRESS;
$email_to = TO_ADDRESS;

$headers = From: ${email_from}\n
. Reply-To: ${email_sender}\n
. Return-Path: ${email_sender}\n
. 'Date: ' . date('r') . \n
. Content-Disposition: inline\n
. Content-Type: text/plain; charset=utf-8\n
. \n;

/* try setting the envelope sender if the first doesn't work
 */
$params = null;
//$params = -f${email_sender};

echo (mail($email_to, 'test mail', 'test, $headers, $params) ? 'sent'
: 'not sent');

?

read this carefully:
http://www.php.net/manual/en/function.mail.php

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



Re: CakePHP 1.2 Email Component works there but not here

2008-02-16 Thread Samuel DeVore

my guess is that you may need to use authenticated smtp methods

see http://book.cakephp.org/view/176/email and the $smtpOptions

On Feb 16, 2008 10:55 AM, Carl [EMAIL PROTECTED] wrote:

 I have a project that uses the cake email component. It works fine
 when I upload the project to a shared server, but when I try to run
 locally (under xampp's apache, mysql, mercury) I get an error message
 saying:

 553 We do not relay non-local mail, sorry.

 I have phpnuke programs that use the mercury mailer successfully, but
 I don't know what to tell the cake email component so that it does the
 same thing. Any ideas?
 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: Send E-mail

2008-02-16 Thread Samuel DeVore

you could also try using the smtpOptions in the email component

http://book.cakephp.org/view/176/email

Sam D

On Feb 16, 2008 11:20 AM, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:

 start here, http://us.php.net/manual/en/


 On Feb 16, 2008 11:36 AM, dandreta [EMAIL PROTECTED] wrote:
 
  And how can I do this?
  Any another suggestion or help?
 
  On 15 feb, 21:26, Wayne Fay [EMAIL PROTECTED] wrote:
   First off, make a little test.php plain PHP file that verifies that
   you can send email using PHP's built-in email 
   functionality:http://us2.php.net/mail
  
   Then make a little test in a Cake controller that you can call
   directly which does the same thing. Then you can worry about the
   emailcomponent etc.
  
   Wayne
  
 
   On 2/15/08, dandreta [EMAIL PROTECTED] wrote:
  
  
  
Hi!
I am developing my application with Cake 1.2 and I want to have send e-
mails functionality.
Inside pages folder, I have the view to send e-mail with the basic
fields: Destination, Subject and Message(body). I have been reading
about EmailComponent in Bakery's article
(http://bakery.cakephp.org/articles/view/brief-overview-of-the-new-
emailcomponent) but I have not managed to apply it because e-mail does
not send. Simply I want to be able to send e-mails with text only.
How I can do it?
Do you Know any link or tutorial where it explains?
Have I configure anything to be able to send e-mails?
Thanks and regards
  
 

 




-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: Auth Component - Should authError be displayed if session times out?

2008-02-16 Thread Baz
Nice catch.

Could be a bug, could someone with more experience check please? This is
what I've found:

I've debugged and haven't been able to find much, sorry. But this is what
happens to me:

   - I login normally
   - Sit and expire the session
   - Try to access somewhere and get redirected to login with NO MESSAGE
   - I login and get redirected to to Default location (not the auth.
   redirect. Place I was trying to access)

I tried debugging, but couldn't follow everything, but this is what it looks
like to the untrained eye?
Although session expires, Auth SEEMS to write flash message to old session?
So it no longer exists when we login?

Could someone with more experience confirm or should I just head over to
trac now?

On Feb 16, 2008 10:55 AM, EchoChargen [EMAIL PROTECTED] wrote:


 Hello -
 Using 1.2 beta release 6311 with Auth component.  I've set the session
 timeout to 60 seconds for testing (core.php high setting).  I'm able
 to login and get redirected  correctly to loginRedirect().  If I sit
 on a protected page and let the session time out, I get redirected
 back to the login page, but there is no flash message.  I would expect
 authError to be displayed in this situation.
 In the case of a request to a page the current user is not authorized
 for, redirection to the login page happens and authError is
 displayed.  For instance a request to /admin/users by a non-admin
 user.

 Here is my code:
 app_controller:
function beforeFilter(){
//Set up Auth Component
$this-Auth-loginAction = '/users/login';
$this-Auth-loginRedirect = array('controller' = 'users',
 'action'
 = 'bouserview');

$this-Auth-fields = array('username' = 'email',
 'password' =
 'passwd');
$this-Auth-autoRedirect = false;
$this-Auth-loginError = 'Invalid e-mail / password
 combination.
 Please try again';
$this-Auth-authError = 'Your session has expired or you
 are not
 authorized to access that location!  Please log in again.';
$this-Auth-authorize = 'controller';
//  Only allow active users to login
$this-Auth-userScope = array('User.active' = 1); //user
 needs to
 be active.
}

function isAuthorized() {
if (isset($this-params[Configure::read('Routing.admin')]))
 {
if ($this-Auth-user('admin') == 0) {
$this-Session-setFlash(You are not
 authorized to access that
 location!);
$this-redirect($this-Auth-logout());
return false;
}
}
return true;
   }

 users_controller:
function login() {
$this-disableCache();
if ($this-Auth-user()) {
//if the redirect was due to a failed /admin* page,
 then set
 redirect to login page
if (stristr($this-Session-read('Auth.redirect'),
 'admin') ===
 TRUE) {
$this-Session-write('Auth.redirect',
 '/users/login');
}
//set site_id in session
$this-User-restrict(array('Site' =
 array('fields' =
 'Site.id')));
$site =
 $this-User-Site-findByUserId($this-Auth-user('id'));
$site_id = $site['Site']['id'];
$this-Session-write('site_id', $site_id);
$this-redirect($this-Auth-redirect());
}
}

function logout(){
$this-Session-setFlash(You've successfully logged out.);
//$this-redirect($this-Auth-logout());
$logOutUrl = $this-Auth-logout();
$this-redirect($logOutUrl);
}

 Thanks for any help provided,
 Jeremy
 


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



Re: Need a forgot password tutorial

2008-02-16 Thread Baz
I have something that I'm using. I'm assuming that you are using the Auth
component?

On Feb 16, 2008 11:31 AM, Manu0310 [EMAIL PROTECTED] wrote:


 Hey does any1 have a tutorial on how to create a simple forgot
 password form.

 One email form field that submits the user email, if in system, emails
 the user with a reset hashed link.

 Something like that would be great

 Thanks
 


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



1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Rod D.

1.2 Beta Auth Component, Allowing root to be public
Cake: 1.2.0.6311 beta, Mysql: 5.0
Ok, I have come so far, and I think this is my last hurdle.  I can not
find the answer anywhere else, so here I am again.

Since I have put the code in my app controller, my main page now
requires login.  How do I allow the main page to be public for all
(no login required)?

The Allow method of the Auth component seems to only work for actions
on the current controller.  But I am talking about the root page.
(localhost).

Here is my simple app controller (and what I did to get the user name
available to the default layout).

?php
class AppController extends Controller {
var $components = array('Auth');

function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'echere', 
'action'
= 'login');
$this-Auth-loginRedirect = array('controller' = 'echere',
'action' = 'index');
$this-Auth-logoutRedirect = '/';
}

function beforeRender(){
$this-set('curUser', $this-Auth-user('username'));
}
}
?

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



Re: 1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Chris Hartjes

On Feb 16, 2008 3:30 PM, Rod D. [EMAIL PROTECTED] wrote:

 1.2 Beta Auth Component, Allowing root to be public
 Cake: 1.2.0.6311 beta, Mysql: 5.0
 Ok, I have come so far, and I think this is my last hurdle.  I can not
 find the answer anywhere else, so here I am again.

 Since I have put the code in my app controller, my main page now
 requires login.  How do I allow the main page to be public for all
 (no login required)?

Have you tried simply *not* using the Auth component in your root
and then specifying what other controllers need to use Auth?

More work, yes.  Achieves the goal, yes.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

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



Re: 1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Baz
I'm guessing your using the pages controller? Else I don't see what the
problem would be.

So, $this-Auth-allow('display');
should give you what you're looking for.

On Feb 16, 2008 2:30 PM, Rod D. [EMAIL PROTECTED] wrote:


 1.2 Beta Auth Component, Allowing root to be public
 Cake: 1.2.0.6311 beta, Mysql: 5.0
 Ok, I have come so far, and I think this is my last hurdle.  I can not
 find the answer anywhere else, so here I am again.

 Since I have put the code in my app controller, my main page now
 requires login.  How do I allow the main page to be public for all
 (no login required)?

 The Allow method of the Auth component seems to only work for actions
 on the current controller.  But I am talking about the root page.
 (localhost).

 Here is my simple app controller (and what I did to get the user name
 available to the default layout).

 ?php
 class AppController extends Controller {
var $components = array('Auth');

function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'echere',
 'action'
 = 'login');
$this-Auth-loginRedirect = array('controller' =
 'echere',
 'action' = 'index');
$this-Auth-logoutRedirect = '/';
}

function beforeRender(){
$this-set('curUser', $this-Auth-user('username'));
}
 }
 ?

 So, close, but so far.
 -Rodney
 


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



Re: 1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Rod D.

Chris, unfortunately I need you to elaborate.  One of the reasons I
have the code in the app controller, is of course so I won't need it
in the other controllers, but I have it there so I can allow the root
to show the user's name if they navigate back to the root after the
entered the private area of the site.  So then instead of showing a
login link on the root page, it would be changed to a logout link and
the user name would also be displayed.

I can do that, but because I did, now I can not make the root public.


Chris Hartjes wrote:
 On Feb 16, 2008 3:30 PM, Rod D. [EMAIL PROTECTED] wrote:
 
  1.2 Beta Auth Component, Allowing root to be public
  Cake: 1.2.0.6311 beta, Mysql: 5.0
  Ok, I have come so far, and I think this is my last hurdle.  I can not
  find the answer anywhere else, so here I am again.
 
  Since I have put the code in my app controller, my main page now
  requires login.  How do I allow the main page to be public for all
  (no login required)?

 Have you tried simply *not* using the Auth component in your root
 and then specifying what other controllers need to use Auth?

 More work, yes.  Achieves the goal, yes.

 --
 Chris Hartjes
 Internet Loudmouth
 Motto for 2008: Moving from herding elephants to handling snakes...
 @TheKeyBoard: http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Rod D.

Baz, let me give it a try.


Baz wrote:
 I'm guessing your using the pages controller? Else I don't see what the
 problem would be.

 So, $this-Auth-allow('display');
 should give you what you're looking for.

 On Feb 16, 2008 2:30 PM, Rod D. [EMAIL PROTECTED] wrote:

 
  1.2 Beta Auth Component, Allowing root to be public
  Cake: 1.2.0.6311 beta, Mysql: 5.0
  Ok, I have come so far, and I think this is my last hurdle.  I can not
  find the answer anywhere else, so here I am again.
 
  Since I have put the code in my app controller, my main page now
  requires login.  How do I allow the main page to be public for all
  (no login required)?
 
  The Allow method of the Auth component seems to only work for actions
  on the current controller.  But I am talking about the root page.
  (localhost).
 
  Here is my simple app controller (and what I did to get the user name
  available to the default layout).
 
  ?php
  class AppController extends Controller {
 var $components = array('Auth');
 
 function beforeFilter() {
 $this-Auth-loginAction = array('controller' = 'echere',
  'action'
  = 'login');
 $this-Auth-loginRedirect = array('controller' =
  'echere',
  'action' = 'index');
 $this-Auth-logoutRedirect = '/';
 }
 
 function beforeRender(){
 $this-set('curUser', $this-Auth-user('username'));
 }
  }
  ?
 
  So, close, but so far.
  -Rodney
  
 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 1.2 Beta Auth Component, Allowing root to be public

2008-02-16 Thread Chris Hartjes

On Feb 16, 2008 3:48 PM, Rod D. [EMAIL PROTECTED] wrote:

 That did it.  I had been trying '/' and other derivatives instead of
 'display'.

 Thanks again, and again, and again.  Both you and Chris hit me with
 responses instantly for my 3 different topics.

I did not immediately realize you were using the pages controller.
Once I figured that out, Baz's solution made total sense.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

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



How do I make the Folder class visible to a controller?

2008-02-16 Thread Carl

I need to instantiate a folder object. How do I make the class visible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I make the Folder class visible to a controller?

2008-02-16 Thread Sam Sherlock
uses ('folder');
$folder = new Folder();

- s

On 16/02/2008, Carl [EMAIL PROTECTED] wrote:


 I need to instantiate a folder object. How do I make the class visible?
 


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



Re: bake on linux error

2008-02-16 Thread [EMAIL PROTECTED]

Hi,

On Feb 10, 5:23 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,

 I'm new to cakePHP, and I'm trying to run thebakescript as the
 instructions in the manual and scereencast, but I keep getting the
 followingerror

 [EMAIL PROTECTED] ~]$ export PATH=$PATH:/var/www/cake/cake/console
 [EMAIL PROTECTED] ~]$ cake

 Hello juancho,

 CakePHP Console:
 This file has been loaded incorrectly and cannot continue.
 Please make sure that /cake/console is in your system path,
 and check the manual for the correct usage of this command.
 (http://manual.cakephp.org/)

 As you can see, the PATH variable is set ok so I don't get why it
 doesn't work. I'm missing something ?


Doing some digging on the source code of bake.php I see that the error
is on line 164 on this test:

if (!isset($this-args[0]) || !isset($this-params['working'])) {


It seems that $this-args[0] is undefined at this point but I don't
know why, not even what it's supposed to contain that parameter. ideas
of what's going wrong here ???

I'm on linux using 1.2.0.6311-beta.

Thanks,

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



using jquery and json on cakephp

2008-02-16 Thread mike

How do I send and process ajax request using jquery's .getJson() on
cakephp. I need to setup dynamic dropdown box? Thanks

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



Relations in cake: too may?

2008-02-16 Thread [EMAIL PROTECTED]

I have 3 models: hosts, offers, problems.

Hosts holds info about companies(e.g. GoDaddy)
Problems holds info about the problems (e.g. I need super host with
100TB/month)
Offers holds info about exact host offer for exact problem (e.g. It
would cost you 69USD), there may be many offers for single problem.

Question:
How to set associations correctly to make it possible to use $this -
Host - find (myCondition));?

By now i have

class Host extends AppModel
{
var $name = 'Host';
var $hasMany = array ( 'Offer = array ('className' = 'Offer'));
}

class Problem extends AppModel
{
var $name = 'Problem;
var $hasMany = array ( 'Offer = array ('className' = 'Offer'));
}

class Supply extends AppModel
{
var $name = 'Supply';
var $belongsTo = array('Host'  = array('className' = 'Host'),
 'Problem' = array('className' = 
'Problem') );
}


as i call  $this - Host - find (myCondition));
I EXPECT to get something like

Array
(
[Host] = Array
(
[id] = 69
[name] =GoDaay
)
[Offer] = Array
(
[0] = Array
(
[id] = 2
[name] = We can for 69USD
[host_id] = 69
[problem_id] =69
[Problem] = Array
(
[id] = 69
[name] = I need host
)
)

[1] = Array
(
[id] = 3
[name] = We can for 3USD
[host_id] = 69
[problem_id] =696
[Problem] = Array
(
[id] = 696
[name] = I need cheep host
)
)
)
)
)

but I GET

Array
(
[Host] = Array
(
[id] = 69
[name] =GoDaay
)
[Offer] = Array
(
[0] = Array
(
[id] = 2
[name] = We can for 69USD
[host_id] = 69
[problem_id] =69
[Problem] = Array
(
[id] = 69
[name] = I need host
[Offer] = array (
  [Problem] = problem again
)
)

[1] = Array
(
[id] = 3
[name] = We can for 3USD
[host_id] = 69
[problem_id] =696
[Problem] = Array
(
[id] = 696
[name] = I need cheep host
[Offer] = array (
   [Problem] = problem again
  )
)
)
)
)
)



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



IBM Cooking Websites Fast Series Part 2 Problem

2008-02-16 Thread wizardElite

In Part 2 of the IBM CakePHP series I'm having problems working with
Access Control Lists.

I've created the ACL tables and I'm stuck at defining defining groups

In my app directory the tutorial states within the terminal define
your groups with the following code.

php acl.php create aro 0 null Users
php acl.php create aro 0 null Dealers

When I do this I get the following response...

Could not open input file: acl.php

After some research I tried this...

../cake/console/cake acl create aro / Users

I then receive the following message...

Fatal error: Class 'String' not found in /Users/wizardelite/Sites/
ibmcake/cake/libs/model/datasources/dbo_source.php on line 1455


Can anyone help me with this?


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



How does Cakephp call header and footer and change colors, fonts?

2008-02-16 Thread sixs
Hi,
I want to change the format of the pages in my project that I created using 
Cakephp. Do I have lalyouts and templates?
I am probably missing something as I did in scaffolding?
Thanks for any help!

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



Re: How does Cakephp call header and footer and change colors, fonts?

2008-02-16 Thread Baz
Please, at least _glance_ at the manual before asking here.
http://book.cakephp.org/ for 1.2 beta
http://manual.cakephp.org for 1.1

On Feb 16, 2008 11:44 PM, sixs [EMAIL PROTECTED] wrote:

  Hi,
 I want to change the format of the pages in my project that I created
 using Cakephp. Do I have lalyouts and templates?
 I am probably missing something as I did in scaffolding?
 Thanks for any help!

 JIm

 


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



Re: using jquery and json on cakephp

2008-02-16 Thread bingo

Here are the things that I did to get my jquery, json, and ajax
working

1. I included this line in app/config/routes.php
   Router::parseExtensions('rss', 'json', 'xml');  //notice
json over there


2. Then, I created a folder named json in my views/post..so my views
folder structure look like this
views
 post
json
  message.ctp

In message.ctp, I am using this code to convert PHP array (that came
from controller) to json format

?php
echo $javascript-object($message);   //$message is the PHP array
?


3. Now, when I need to data in ajax format, I just add the extension
json to my controller-method call. So for the above method
message, my url look like this

So the url for the ajax call in this case is
  jQuery.ajax(http://localhost/site/post/message.json;,
function(){
  //add your function here
 });

This will be give you json data as output

The good thing with this approach is that if you remove json from
your url, you will get normal output. This assuming you have a file
message.ctp in views/post

hope this helps
Regards,


On Feb 16, 3:53 pm, mike [EMAIL PROTECTED] wrote:
 How do I send and process ajax request using jquery's .getJson() on
 cakephp. I need to setup dynamic dropdown box? Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



bindable: how to order parent model?

2008-02-16 Thread [EMAIL PROTECTED]

I understand how to set the ordering for the bound models, but how can
I set restrictions and also give an order for the main model?

for instance, I want to select all members whose last names begin with
a particular letter, binding ther profiles, restricted to email 
phone. But I'd like the members ordered by last_name. Bindable's
restrict syntax has a way to order, but only for the bound models, not
the main one. And it seems to be somehow interfering with the $order
param given to find() (although, looking at the bindable.php source, I
can't figure out why).

$conditions = array(
'conditions' = LOWER(SUBSTRING(last_name, 1, 1)) = '${letter}',
'restrict' = array('MemberProfile(email, telephone)')
);

$order = 'Member.last_name ASC';
$this-set('members', $this-Member-find('all', $conditions, null,
$order));

This selects everything fine except there's no ORDER BY clause.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---