Re: setFlash() doesn't wotk with me on WAMP

2010-12-19 Thread Ahmed - CakePHP

This is the Controller code:

set('posts', $this->Post->find('all', array('order' =>
array('id DESC';
}

function add() {
if (!empty($this->data)) {
$this->Post->create();
if ($this->Post->save($this->data)) {
$this->Session->setFlash('The post has been added 
successfully.');
$this->reDirect(array('action' => 'index'));
} else {
$this->Session->setFlash('The post has not been added
successfullt');
}
}
}
}
?>


On Dec 20, 10:02 am, Amit Badkas  wrote:
> Hi,
>
> Have you followed the blog tutorial exactly? If you can show me the code
> written by you, that would be helpful to go ahead to solve the problem.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Mon, Dec 20, 2010 at 12:18 PM, Ahmed - CakePHP 
> wrote:
>
>
>
> > Any help here ?!?!?!
>
> > On Dec 19, 10:07 am, Ahmed - CakePHP  wrote:
> > > You said:
> > > "Make sure you have declared both the Session Component and the
> > > Session Helper in your app_controller."
>
> > > How to do that ?!?!
> > > What shill I do exactly Jeremy ?
>
> > > On Dec 19, 12:27 am, Jeremy Burns | Class Outfit
>
> > >  wrote:
> > > > Make sure you have declared both the Session Component and the Session
> > Helper in your app_controller. setFlash only places the message into the
> > session. To show it, use echo $this->Session->flash() in a view, element or
> > layout.
>
> > > > Jeremy Burns
> > > > Class Outfit
>
> > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > > > On 18 Dec 2010, at 16:13, Ahmed - CakePHP wrote:
>
> > > > > Hello,
>
> > > > > I am very very very new on CakePHP.
> > > > > I tried to do a blog using the CakePHP. I did it :).
> > > > > but I found a problem:
> > > > > when I want to use "$this->Session->setFlash("Write whatever");"
>
> > > > > it doesn't work.
> > > > > I don't see the sentences that I write inside setFlash. They doesn't
> > > > > occur when I run the code/functions.
>
> > > > > I am using the local server "WAMP"
>
> > > > > Can you please tell me what is the problem ?
>
> > > > > Regards,
> > > > > Ahmed
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others with their CakePHP related questions.
>
> > > > > You received this message because you are subscribed to the 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.comFor
> > > > >  more options, visit this group athttp://
> > groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: setFlash() doesn't wotk with me on WAMP

2010-12-19 Thread Amit Badkas
Hi,

Have you followed the blog tutorial exactly? If you can show me the code
written by you, that would be helpful to go ahead to solve the problem.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Mon, Dec 20, 2010 at 12:18 PM, Ahmed - CakePHP wrote:

>
> Any help here ?!?!?!
>
>
> On Dec 19, 10:07 am, Ahmed - CakePHP  wrote:
> > You said:
> > "Make sure you have declared both the Session Component and the
> > Session Helper in your app_controller."
> >
> > How to do that ?!?!
> > What shill I do exactly Jeremy ?
> >
> > On Dec 19, 12:27 am, Jeremy Burns | Class Outfit
> >
> >  wrote:
> > > Make sure you have declared both the Session Component and the Session
> Helper in your app_controller. setFlash only places the message into the
> session. To show it, use echo $this->Session->flash() in a view, element or
> layout.
> >
> > > Jeremy Burns
> > > Class Outfit
> >
> > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
> >
> > > On 18 Dec 2010, at 16:13, Ahmed - CakePHP wrote:
> >
> > > > Hello,
> >
> > > > I am very very very new on CakePHP.
> > > > I tried to do a blog using the CakePHP. I did it :).
> > > > but I found a problem:
> > > > when I want to use "$this->Session->setFlash("Write whatever");"
> >
> > > > it doesn't work.
> > > > I don't see the sentences that I write inside setFlash. They doesn't
> > > > occur when I run the code/functions.
> >
> > > > I am using the local server "WAMP"
> >
> > > > Can you please tell me what is the problem ?
> >
> > > > Regards,
> > > > Ahmed
> >
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> others with their CakePHP related questions.
> >
> > > > You received this message because you are subscribed to the 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.comFor
> > > >  more options, visit this group athttp://
> groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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 problem or misunderstanding.

2010-12-19 Thread Shinya Koizumi
For 1.2.8, How do I enabled that again? I am already using this for another
control, but don't remember
How I did it.

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of James K
Sent: Sunday, December 19, 2010 7:24 PM
To: CakePHP
Subject: Re: session problem or misunderstanding.

Do you have the Session component enabled for the controller? If you
debug out $this->Session you should get a debug out of the object. If
you're getting nothing, it could also be that you have debug turned
off in your core.php config file.

On Dec 19, 9:40 pm, cake-learner  wrote:
> I am trying to pass a variale with session but without success for a
> while.
> within the same controller i go $this -> Session -> write( 'id', 1 );
> $this -> Session -> read( 'id' );
>
> i gotta nothing and empty when i go debug( $this -> Session );
> I tried with $_SESSION so i guess within the same controller i can't
> pass with session?
>
> I have this line $helpers = array( 'Session' ) in the controller and
> there are already some controllers using session.

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

You received this message because you are subscribed to the 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Register Function--Hashing Password and Auto-login Causes Password Validation Disabled in Register Page

2010-12-19 Thread John Maxim
My Register page:

Please fill out the form below to register an account.
create('User', array('action' => 'register'));?>

input('first_name');
echo $form->input('last_name');
echo $form->input('username');
echo $form->input('email');
echo $form->input('password');
?>

end('Register');?>



My knownusers page:


tableHeaders(array_keys($knownusers[0]['User']));

foreach ($knownusers as $thisuser)
{
echo $html->tableCells($thisuser['User']);
}

?>



**

Is it something I have to add in both register and knownusers page ?

On Dec 20, 2:47 pm, John Maxim  wrote:
> If I removed the Auth component from the controller pager, I can view
> my register and knownusers page.
>
> But that defeats the reason of hashing password using Auth component.
>
> On Dec 20, 2:45 pm, John Maxim  wrote:
>
> > I included this built-in in my controller:
>
> > var $components = array('Auth');
>
> > so now my controller looks like this:
>
> > class UsersController extends AppController
> > {
>
> >         var $name = 'Users';
>
> >     var $helpers = array('Html', 'Form' );
>
> >         var $components = array('Auth');
>
> >     function register()
> >         {
> >                   if (!empty($this->data))
> >                   {
> >                                 if ($this->User->save($this->data))
> >                                 {
> >                                   $this->Session->setFlash('Your 
> > registration information was
> > accepted.');
> >                                 }
> >                   }
> >         }
>
> >         function knownusers()
> >         {
>
> >                 $this->set('knownusers',
> >                 $this->User->find('all', array('order' => array('User.id 
> > DESC')),
> > array('fields' => array('User.id', 'User.username', 'User.first_name',
> > 'User.last_name')))
> >                 );
> >         }
>
> >         function login()
> >     {
>
> >     }
>
> >         function logout() {
> >         $this->redirect($this->Auth->logout());
> >         }
>
> > }
>
> > ***
>
> > I can't view my register and knownusers page now, it redirects me to
> > login page.
>
> > My login page is as follow:
>
> >  >     echo $session->flash('auth');
> >     echo $this->Form->create('User', array('action' => 'login'));
> >     echo $this->Form->input('username');
> >     echo $this->Form->input('password');
> >     echo $this->Form->end('Login');
> >    ?>
>
> > Why is it redirected each time I view register and knownusers
> > page ...to login page ?
>
> > How do I know if the hash password is already working now ?? since I
> > can't register ..?
>
> > On Dec 20, 11:25 am, John Maxim  wrote:
>
> > > My controller is here:
>
> > > class UsersController extends AppController
> > > {
>
> > >         var $name = 'Users';
>
> > >     var $helpers = array('Html', 'Form' );
>
> > >     function register()
> > >         {
> > >                   if (!empty($this->data))
> > >                   {
> > >                                 if ($this->User->save($this->data))
> > >                                 {
> > >                                   $this->Session->setFlash('Your 
> > > registration information was
> > > accepted.');
> > >                                 }
> > >                   }
> > >         }
>
> > > Do I add this in?:
>
> > > var $components = array('Auth');
>
> > > or can I add into   var $helpers = array('Html', 'Form',
> > > 'Auth' );    ?
>
> > > Sorry my password validation is here:
>
> > > 'password' => array(
> > >                         'notEmpty' => array(
> > >                                 'rule' => 'notEmpty',
> > >                                 'message' => 'This field cannot be 
> > > blank.',
> > >                                 'last' => true,
> > >                         ),
>
> > > ***
>
> > > and no, I didn't get any error, the only problem was the validation
> > > for password can't be triggered after I used the code I posted from
> > > the first post (NEW). After editing back to my (OLD) code it works
> > > fine now except with no HASHING and AUTO-LOGIN feature.
>
> > > Can you point me to AUTO-LOGIN coding ? how should I go about? I'm
> > > still not done with hashing yet, as I'm not sure how to use AUTH
> > > component.
>
> > > On Dec 20, 3:10 am, cricket  wrote:
>
> > > > On Sun, Dec 19, 2010 at 2:07 AM, John Maxim  wrote:
> > > > > What are Auth component ?
>
> > > >http://book.cakephp.org/view/1250/Authentication
>
> > > > Just note that Auth will hash your password for you, so there's no
> > > > need to cal md5().
>
> > > > > My validation rules are here:
>
> > > > There's no password validation there. What, exactly, is the problem
> > > > you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group,

Re: setFlash() doesn't wotk with me on WAMP

2010-12-19 Thread Ahmed - CakePHP

Any help here ?!?!?!


On Dec 19, 10:07 am, Ahmed - CakePHP  wrote:
> You said:
> "Make sure you have declared both the Session Component and the
> Session Helper in your app_controller."
>
> How to do that ?!?!
> What shill I do exactly Jeremy ?
>
> On Dec 19, 12:27 am, Jeremy Burns | Class Outfit
>
>  wrote:
> > Make sure you have declared both the Session Component and the Session 
> > Helper in your app_controller. setFlash only places the message into the 
> > session. To show it, use echo $this->Session->flash() in a view, element or 
> > layout.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > On 18 Dec 2010, at 16:13, Ahmed - CakePHP wrote:
>
> > > Hello,
>
> > > I am very very very new on CakePHP.
> > > I tried to do a blog using the CakePHP. I did it :).
> > > but I found a problem:
> > > when I want to use "$this->Session->setFlash("Write whatever");"
>
> > > it doesn't work.
> > > I don't see the sentences that I write inside setFlash. They doesn't
> > > occur when I run the code/functions.
>
> > > I am using the local server "WAMP"
>
> > > Can you please tell me what is the problem ?
>
> > > Regards,
> > > Ahmed
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the 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 
> > > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Register Function--Hashing Password and Auto-login Causes Password Validation Disabled in Register Page

2010-12-19 Thread John Maxim
If I removed the Auth component from the controller pager, I can view
my register and knownusers page.

But that defeats the reason of hashing password using Auth component.

On Dec 20, 2:45 pm, John Maxim  wrote:
> I included this built-in in my controller:
>
> var $components = array('Auth');
>
> so now my controller looks like this:
>
> class UsersController extends AppController
> {
>
>         var $name = 'Users';
>
>     var $helpers = array('Html', 'Form' );
>
>         var $components = array('Auth');
>
>     function register()
>         {
>                   if (!empty($this->data))
>                   {
>                                 if ($this->User->save($this->data))
>                                 {
>                                   $this->Session->setFlash('Your registration 
> information was
> accepted.');
>                                 }
>                   }
>         }
>
>         function knownusers()
>         {
>
>                 $this->set('knownusers',
>                 $this->User->find('all', array('order' => array('User.id 
> DESC')),
> array('fields' => array('User.id', 'User.username', 'User.first_name',
> 'User.last_name')))
>                 );
>         }
>
>         function login()
>     {
>
>     }
>
>         function logout() {
>         $this->redirect($this->Auth->logout());
>         }
>
> }
>
> ***
>
> I can't view my register and knownusers page now, it redirects me to
> login page.
>
> My login page is as follow:
>
>      echo $session->flash('auth');
>     echo $this->Form->create('User', array('action' => 'login'));
>     echo $this->Form->input('username');
>     echo $this->Form->input('password');
>     echo $this->Form->end('Login');
>    ?>
>
> Why is it redirected each time I view register and knownusers
> page ...to login page ?
>
> How do I know if the hash password is already working now ?? since I
> can't register ..?
>
> On Dec 20, 11:25 am, John Maxim  wrote:
>
> > My controller is here:
>
> > class UsersController extends AppController
> > {
>
> >         var $name = 'Users';
>
> >     var $helpers = array('Html', 'Form' );
>
> >     function register()
> >         {
> >                   if (!empty($this->data))
> >                   {
> >                                 if ($this->User->save($this->data))
> >                                 {
> >                                   $this->Session->setFlash('Your 
> > registration information was
> > accepted.');
> >                                 }
> >                   }
> >         }
>
> > Do I add this in?:
>
> > var $components = array('Auth');
>
> > or can I add into   var $helpers = array('Html', 'Form',
> > 'Auth' );    ?
>
> > Sorry my password validation is here:
>
> > 'password' => array(
> >                         'notEmpty' => array(
> >                                 'rule' => 'notEmpty',
> >                                 'message' => 'This field cannot be blank.',
> >                                 'last' => true,
> >                         ),
>
> > ***
>
> > and no, I didn't get any error, the only problem was the validation
> > for password can't be triggered after I used the code I posted from
> > the first post (NEW). After editing back to my (OLD) code it works
> > fine now except with no HASHING and AUTO-LOGIN feature.
>
> > Can you point me to AUTO-LOGIN coding ? how should I go about? I'm
> > still not done with hashing yet, as I'm not sure how to use AUTH
> > component.
>
> > On Dec 20, 3:10 am, cricket  wrote:
>
> > > On Sun, Dec 19, 2010 at 2:07 AM, John Maxim  wrote:
> > > > What are Auth component ?
>
> > >http://book.cakephp.org/view/1250/Authentication
>
> > > Just note that Auth will hash your password for you, so there's no
> > > need to cal md5().
>
> > > > My validation rules are here:
>
> > > There's no password validation there. What, exactly, is the problem
> > > you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Register Function--Hashing Password and Auto-login Causes Password Validation Disabled in Register Page

2010-12-19 Thread John Maxim
I included this built-in in my controller:

var $components = array('Auth');

so now my controller looks like this:

class UsersController extends AppController
{

var $name = 'Users';

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

var $components = array('Auth');

function register()
{
  if (!empty($this->data))
  {
if ($this->User->save($this->data))
{
  $this->Session->setFlash('Your registration 
information was
accepted.');
}
  }
}

function knownusers()
{

$this->set('knownusers',
$this->User->find('all', array('order' => array('User.id 
DESC')),
array('fields' => array('User.id', 'User.username', 'User.first_name',
'User.last_name')))
);
}

function login()
{

}

function logout() {
$this->redirect($this->Auth->logout());
}



}

***

I can't view my register and knownusers page now, it redirects me to
login page.

My login page is as follow:

flash('auth');
echo $this->Form->create('User', array('action' => 'login'));
echo $this->Form->input('username');
echo $this->Form->input('password');
echo $this->Form->end('Login');
   ?>


Why is it redirected each time I view register and knownusers
page ...to login page ?

How do I know if the hash password is already working now ?? since I
can't register ..?



On Dec 20, 11:25 am, John Maxim  wrote:
> My controller is here:
>
> class UsersController extends AppController
> {
>
>         var $name = 'Users';
>
>     var $helpers = array('Html', 'Form' );
>
>     function register()
>         {
>                   if (!empty($this->data))
>                   {
>                                 if ($this->User->save($this->data))
>                                 {
>                                   $this->Session->setFlash('Your registration 
> information was
> accepted.');
>                                 }
>                   }
>         }
>
> Do I add this in?:
>
> var $components = array('Auth');
>
> or can I add into   var $helpers = array('Html', 'Form',
> 'Auth' );    ?
>
> Sorry my password validation is here:
>
> 'password' => array(
>                         'notEmpty' => array(
>                                 'rule' => 'notEmpty',
>                                 'message' => 'This field cannot be blank.',
>                                 'last' => true,
>                         ),
>
> ***
>
> and no, I didn't get any error, the only problem was the validation
> for password can't be triggered after I used the code I posted from
> the first post (NEW). After editing back to my (OLD) code it works
> fine now except with no HASHING and AUTO-LOGIN feature.
>
> Can you point me to AUTO-LOGIN coding ? how should I go about? I'm
> still not done with hashing yet, as I'm not sure how to use AUTH
> component.
>
> On Dec 20, 3:10 am, cricket  wrote:
>
> > On Sun, Dec 19, 2010 at 2:07 AM, John Maxim  wrote:
> > > What are Auth component ?
>
> >http://book.cakephp.org/view/1250/Authentication
>
> > Just note that Auth will hash your password for you, so there's no
> > need to cal md5().
>
> > > My validation rules are here:
>
> > There's no password validation there. What, exactly, is the problem
> > you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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 CakePHP on a Zeus Server

2010-12-19 Thread James K
Ah Zeus, my old nemesis.

If it's shared hosting, I don't think you can implement the rewrite
file yourself. I had to go through an extremely frustrating song and
dance where I had to send the rewrite script to the hosting company's
support, they'd set the rules up, I'd find out I did something wrong
or it wasn't working the way I wanted, and then repeat.

Good luck!

On Dec 18, 2:16 pm, WhyNotSmile  wrote:
> I'm currently setting up a site and and being made to use a host which
> has Zeus rather than Apache.  They provide a very basic example of how
> to convert an htaccess file to a 'rewrite.script' file, but don't say
> much about what to do with the file once you have it, and don't
> provide much in the way of examples.
>
> Has anyone else come across this, and can you tell me what I should be
> doing?
>
> I came across this thread:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/78146f5b...
>
> which has some stuff that looks helpful, but doesn't say where I
> should put the code, except that it's not in the htaccess file!
>
> This is driving me crazy!  I'd appreciate any help.  Even if you've
> tried and given up, that would be good to know, as it would help me
> build my case for moving to a better host (the guy I work for seems to
> have a knack for finding the most obscurely-configured hosts on the
> web!).
>
> Thanks,
> Sharon

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Register Function--Hashing Password and Auto-login Causes Password Validation Disabled in Register Page

2010-12-19 Thread John Maxim
My controller is here:

class UsersController extends AppController
{

var $name = 'Users';

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

function register()
{
  if (!empty($this->data))
  {
if ($this->User->save($this->data))
{
  $this->Session->setFlash('Your registration 
information was
accepted.');
}
  }
}

Do I add this in?:

var $components = array('Auth');

or can I add into   var $helpers = array('Html', 'Form',
'Auth' );?

Sorry my password validation is here:

'password' => array(
'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'This field cannot be blank.',
'last' => true,
),

***

and no, I didn't get any error, the only problem was the validation
for password can't be triggered after I used the code I posted from
the first post (NEW). After editing back to my (OLD) code it works
fine now except with no HASHING and AUTO-LOGIN feature.

Can you point me to AUTO-LOGIN coding ? how should I go about? I'm
still not done with hashing yet, as I'm not sure how to use AUTH
component.



On Dec 20, 3:10 am, cricket  wrote:
> On Sun, Dec 19, 2010 at 2:07 AM, John Maxim  wrote:
> > What are Auth component ?
>
> http://book.cakephp.org/view/1250/Authentication
>
> Just note that Auth will hash your password for you, so there's no
> need to cal md5().
>
> > My validation rules are here:
>
> There's no password validation there. What, exactly, is the problem
> you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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 problem or misunderstanding.

2010-12-19 Thread James K
Do you have the Session component enabled for the controller? If you
debug out $this->Session you should get a debug out of the object. If
you're getting nothing, it could also be that you have debug turned
off in your core.php config file.

On Dec 19, 9:40 pm, cake-learner  wrote:
> I am trying to pass a variale with session but without success for a
> while.
> within the same controller i go $this -> Session -> write( 'id', 1 );
> $this -> Session -> read( 'id' );
>
> i gotta nothing and empty when i go debug( $this -> Session );
> I tried with $_SESSION so i guess within the same controller i can't
> pass with session?
>
> I have this line $helpers = array( 'Session' ) in the controller and
> there are already some controllers using session.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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 problem or misunderstanding.

2010-12-19 Thread georgeman
did you try to echo var_dump($_SESSION);  ?

On Dec 19, 9:40 pm, cake-learner  wrote:
> I am trying to pass a variale with session but without success for a
> while.
> within the same controller i go $this -> Session -> write( 'id', 1 );
> $this -> Session -> read( 'id' );
>
> i gotta nothing and empty when i go debug( $this -> Session );
> I tried with $_SESSION so i guess within the same controller i can't
> pass with session?
>
> I have this line $helpers = array( 'Session' ) in the controller and
> there are already some controllers using session.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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


FormHelper Problem

2010-12-19 Thread georgeman
I built a simple contact request form using FormHelper. The form is
located on 'pages/contact' and the form action is located on
'contact_requests/add'. The form handler will email the request to the
address set by the administrator, and will save a copy of the request
to the database.

To create the form I wrote the following:

Form->create('ContactRequest', array('url' =>
array('controller' => 'contact_requests', 'action' => 'add')); ?>

When I click submit, instead of being brought to 'contact_requests/
add' I am brought to 'contact_requests/'. I have tried to write the
url in the form of address and this didn't help. The only other info I
can give is the first few times I tested the form it worked as
expected, but after a few times, the new (wrong) behavior came along
and won't go away.

Here is the rest of the code for the form. Does anyone know what the
problem could be?

Form->create('ContactRequest', array('url' =>
'http://localhost/trial/contact_requests/add', 'div' => false));?>
Form->input('ContactRequest.name', array('label' =>
'Name:', 'type' => 'text', 'maxLength' => '50', 'div' => false));?>
Form->input('ContactRequest.email', array('label' =>
'Email:', 'type' => 'text', 'maxLength' => '50', 'placeholder' =>
'y...@email.com', 'div' => false));?>
Form->input('ContactRequest.phone', array('label' =>
'Phone:', 'type' => 'tel', 'maxLength' => '13', 'placeholder' => 'XXX-
XXX-', 'div' => false));?>
Form->input('ContactRequest.ext', array('label' =>
'Extension:', 'type' => 'text', 'name' => 'ext', 'maxLength' => '5',
'div' => false));?>
Form->label('Message:');?>
Form->textarea('ContactRequest.message',
array('maxLength' => '100', 'wrap' => 'soft', 'placeholder' =>
'maximum 100 characters', 'div' => false));?>
Form->button('Submit');?>
Form->end();?>








Form->input('ContactRequest.name', array('label' =>
'Name:', 'type' => 'text', 'maxLength' => '50', 'div' => false));?>
Form->input('ContactRequest.email', array('label' =>
'Email:', 'type' => 'text', 'maxLength' => '50', 'placeholder' =>
'y...@email.com', 'div' => false));?>
Form->input('ContactRequest.phone', array('label' =>
'Phone:', 'type' => 'tel', 'maxLength' => '13', 'placeholder' => 'XXX-
XXX-', 'div' => false));?>
Form->input('ContactRequest.ext', array('label' =>
'Extension:', 'type' => 'text', 'name' => 'ext', 'maxLength' => '5',
'div' => false));?>
Form->label('Message:');?>
Form->textarea('ContactRequest.message',
array('maxLength' => '100', 'wrap' => 'soft', 'placeholder' =>
'maximum 100 characters', 'div' => false));?>
Form->button('Submit');?>
Form->end();?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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


session problem or misunderstanding.

2010-12-19 Thread cake-learner
I am trying to pass a variale with session but without success for a
while.
within the same controller i go $this -> Session -> write( 'id', 1 );
$this -> Session -> read( 'id' );

i gotta nothing and empty when i go debug( $this -> Session );
I tried with $_SESSION so i guess within the same controller i can't
pass with session?

I have this line $helpers = array( 'Session' ) in the controller and
there are already some controllers using session.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Cake PHP Migration Problems

2010-12-19 Thread Kevando
I found what my problem was.

I had an .htaccess file above the root directory and that was causing
the issue. Once I removed that and restarted MAMP, it worked fine.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Cake PHP Migration Problems

2010-12-19 Thread Kevando
Cricket,

Thanks for the explanation, but I am still having the same problem..

My .htaccess files are exactly as you listed and I am still getting
the "max internal redirects" in my apache logs.

My instance of cakephp worked fine for me when I tested the setup with
one model. However...

When I deleted that model,controller and views - I recreated it
(through bake), along with several other models. Now I get this max
redirects error.

Any thoughts?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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


alternative $ajax->remoteTimer in CakePHP 1.3

2010-12-19 Thread Luke Z
Hello,
how can I rewrite part of my view using $ajax->remoteTimer (http://
book.cakephp.org/view/627/remoteTimer) in CakePHP 1.3? I know I need
to using helpers Html and Js but how can I use them in this case?

Thank you
Lukas

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Register Function--Hashing Password and Auto-login Causes Password Validation Disabled in Register Page

2010-12-19 Thread cricket
On Sun, Dec 19, 2010 at 2:07 AM, John Maxim  wrote:
> What are Auth component ?

http://book.cakephp.org/view/1250/Authentication

Just note that Auth will hash your password for you, so there's no
need to cal md5().

> My validation rules are here:

There's no password validation there. What, exactly, is the problem
you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Skip duplicate data with cake

2010-12-19 Thread cricket
On Sun, Dec 19, 2010 at 5:36 AM, Cruisine  wrote:
> i'm sorry.perhaps i couldn't mention the prolem properly because of my
> english is very bad.
> actually i know how to make the hbtm table. and i've done with the
> table. what i actually want is i want to make HTML table which only
> show one "Name" (from 2 similar name)so it could be more user
> friendly than i provide 2 same name.
> i only want to show a display in my browser like this :
> ==
> name     requirements
> ---
>             |   visa
> sam       -
>             |   passport
> --
>
> rather than:
> =
> name     requirments
> -
> sam      |     visa
> -
> sam      |     passport
> 
>
> so, i only ask about methodology to make a display like that.  not in
> databse but in cakephp view.

What are the models and associations involved? And what does the data
look like now? Try adding debug($data) in your view (or whatever your
data variable is called).

If you do a find() or paginate() on Person (or whatever the model is)
you should get an array like:

array(
0 => array(
'Person' => array(
'name' => ...
...
),
'Requirement' => array(
0 => array(
'name' => 'Visa',
...
),
1 => array(
'name' => 'Passport',
...
)
)
),
1 => array(
'Person' => array(
'name' => ...
...
),
'Requirement' => array(
0 => array(
'name' => 'Visa',
...
),
1 => array(
'name' => 'Passport',
...
)
)
)
);

I'm assuming you have a model Requirement with a 'name' field.

In the view:

foreach ($data as $d)
{
echo $d['Person']['name'];

foreach ($d['Requirement'] as $requirement)
{
echo $requirement['name']

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: dropdown select with lastname and firstname

2010-12-19 Thread eldorado2768
Tried it and it works great! Thanks.

On Dec 17, 5:26 pm, cricket  wrote:
> On Fri, Dec 17, 2010 at 6:25 PM, eldorado2768
>
>
>
>  wrote:
> > I am having a lot of difficulty understanding how to get my select box
> > to display properly. I have a table called owners and a related table
> > called buildings with the owner_id as the foreign key. I figured out
> > how cakephp looks for a field called name and then if it doesn't find
> > it will just default to listing the id in the option select box. What
> > I want to display is the last_name + "," + first_name and list them
> > alphabetically by last name.
>
> > I figured out that the find() command could help me accomplish this.
> > Using cake bake console I created the default controllers for
> > buildings and owners. In the add() and edit() functions in the
> > building controller, I found the following find() command:
>
> > $owners = $this->Building->Owner->find('list');
>
> > Using just this command pulls up the id only in the drop down. I am
> > trying to get the first and last name to show so I modified it to be:
>
> > $owners = $this->Building->Owner->find('list',
> >                   array('fields' =>
> > array('Owner.id','Owner.last_name','Owner.first_name')),
> >                   array('order' => array('Owner.last_name ASC'))
> >                   );
>
> > In the view file, I just have the following form command:
>
> > echo $form->input('owner_id');
>
> > The result is kind of strange. I have 2 records for owners:
> > Mitch Friedman
> > Bob Miller
>
> > I am having somewhat of a success since the two owners are listed but
> > they are stacked on top of each other so the dropdown looks like this:
> > Mitch
> > Friedman
> > Bob
> > Miller
>
> > Anyone have any suggestions on how to at least get the names to
> > display properly? Ideally I would like to see  last_name + "," +
> > first_name but if I can end up with a normal looking list that isn't
> > stacked up like they are, that would be good enough.
>
> You can create a virtual field[1] in the model.
>
> public $virtualFields = array(
>     'full_name' => 'CONCAT(User.last_name, ", ", User.first_name)'
> );
>
> Then, I believe (haven't tried this) that you could specify full_name
> as the model's display field:
>
> public $displayField = 'full_name';
>
> $owners = $this->Building->Owner->find(
>     'list',
>     array(
>         'order' => array('Owner.last_name' => 'ASC')
>     )
> );
>
> [1]http://book.cakephp.org/view/1608/Virtual-fields

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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: Skip duplicate data with cake

2010-12-19 Thread Cruisine
i'm sorry.perhaps i couldn't mention the prolem properly because of my
english is very bad.
actually i know how to make the hbtm table. and i've done with the
table. what i actually want is i want to make HTML table which only
show one "Name" (from 2 similar name)so it could be more user
friendly than i provide 2 same name.
i only want to show a display in my browser like this :
==
name requirements
---
 |   visa
sam   -
 |   passport
--

rather than:
=
name requirments
-
sam  | visa
-
sam  | passport


so, i only ask about methodology to make a display like that.  not in
databse but in cakephp view.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the 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