Re: user authentication example...login redirects

2008-02-09 Thread MonkeyGirl

 The 'allowEmpty' key should be assigned a boolean value.

Ah, thank you. That makes sense. So I've replaced this:

  var $validate = array(
'name' = array(
  'required' = VALID_NOT_EMPTY
)
  );

With this now:

  var $validate = array(
'name' = array(
  array(
'message' = 'required',
'allowEmpty' = FALSE
  )
)
  );

Is that right? (I know it technically works, I just want to make sure
I'm doing it the proper way).

Thank you,
Zoe.
--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-09 Thread duRqoo

var $validate = array(
'name' = array(
'rule' = array('custom', VALID_NOT_EMPTY),
'message' = 'Can\'t be empty'
)
);

This is how i deal with not empty values. VALID_NOT_EMPTY may be
deprecated, but still it's just a constat so i can replace it with
whatever regexp i want. AFAIK 'allowEmpty' is false by default and
it's checked before rule description, and if u dont specify rule key
in field validation array it will default to 'blank'. In your example
Zoe field name will always invalidate because it can't be empty,
thanks to 'allowEmpty', but rule defaulted to 'blank' expecting it to
be empty.

On 9. Feb, 09:36 h., MonkeyGirl [EMAIL PROTECTED] wrote:
  The 'allowEmpty' key should be assigned a boolean value.

 Ah, thank you. That makes sense. So I've replaced this:

   var $validate = array(
 'name' = array(
   'required' = VALID_NOT_EMPTY
 )
   );

 With this now:

   var $validate = array(
 'name' = array(
   array(
 'message' = 'required',
 'allowEmpty' = FALSE
   )
 )
   );

 Is that right? (I know it technically works, I just want to make sure
 I'm doing it the proper way).

 Thank you,
 Zoe.
--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-08 Thread Siebren Bakker
also, in regards to the second error, make sure in your model-validate
array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which
should clear out that error.

On Feb 8, 2008 7:15 AM, MonkeyGirl [EMAIL PROTECTED] wrote:


  The code i have creates my user and puts it into the database just
  fine..but after that, nothing happens... no flash, no redirect.

 Have you made a login() function in /app/controllers/
 users_controller.php? It looks like you've got the creation of new
 users sorted, but you now need to let them log in, which is really a
 separate process. You need to get the login method working next, then
 you can worry about making it happen automatically once someone's
 signed up.

 This is something I want to explain in my guide soon, but for now try
 looking into $this-Session in the controller. That's what you can use
 to store the information about the user who's logging in, so it
 remembers them as they move around the site.

 Hope that helps,
 Zoe.
 



-- 
In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s+: a19 C UL++ P L++
!E W++ N(-) o? K? w(+) O? M-- V?
PS+ PE Y- PGP- t+ 5? X- R tv--
b++ Di D+ G+ e h! r y-
--END GEEK CODE BLOCK--

--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-08 Thread MonkeyGirl

 also, in regards to the second error, make sure in your model-validate
 array, that you have apostrophes around the words 'VALID_NOT_EMPTY', which
 should clear out that error.

Will it? I thought VALID_NOT_EMPTY *was* a constant, not a literal
string.

I've also heard on someone's blog that it's now depreciated, but with
no clue as to what by. I know there's a bunch of new validation types
such as credit card in the new system, but I can't seem to find not
empty anymore. Is this depreciated or not?

Thanks,
Zoe.
--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-08 Thread MonkeyGirl

 The code i have creates my user and puts it into the database just
 fine..but after that, nothing happens... no flash, no redirect.

Have you made a login() function in /app/controllers/
users_controller.php? It looks like you've got the creation of new
users sorted, but you now need to let them log in, which is really a
separate process. You need to get the login method working next, then
you can worry about making it happen automatically once someone's
signed up.

This is something I want to explain in my guide soon, but for now try
looking into $this-Session in the controller. That's what you can use
to store the information about the user who's logging in, so it
remembers them as they move around the site.

Hope that helps,
Zoe.
--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-08 Thread Siebren Bakker
in 1.2, it is required to be set in a string, or you could use the following
validation rule:

allowEmpty The 'allowEmpty' key should be assigned a boolean value. If '
allowEmpty' is false, data passed to the model's save() method must include
the field and a non-empty data value for that field. This rule is only
enforced when the field index is present in the supplied data array.
 The default value of 'allowEmpty' is false.


On Feb 8, 2008 7:32 AM, MonkeyGirl [EMAIL PROTECTED] wrote:


  also, in regards to the second error, make sure in your model-validate
  array, that you have apostrophes around the words 'VALID_NOT_EMPTY',
 which
  should clear out that error.

 Will it? I thought VALID_NOT_EMPTY *was* a constant, not a literal
 string.

 I've also heard on someone's blog that it's now depreciated, but with
 no clue as to what by. I know there's a bunch of new validation types
 such as credit card in the new system, but I can't seem to find not
 empty anymore. Is this depreciated or not?

 Thanks,
 Zoe.
 



-- 
In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s+: a19 C UL++ P L++
!E W++ N(-) o? K? w(+) O? M-- V?
PS+ PE Y- PGP- t+ 5? X- R tv--
b++ Di D+ G+ e h! r y-
--END GEEK CODE BLOCK--

--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-07 Thread Siebren Bakker
try using the full path in the login redirect, i.e.
$this-redirect('/users/login');
you also should add the 'true' tag, if you are using CakePHP1.2, to
automatically call the exit() function after the redirect.
i.e.
$this-redirect('/users/login', true);

Hope this helps!

On Feb 7, 2008 5:43 PM, polomasta [EMAIL PROTECTED] wrote:


 i've been trying to implement that scattered examples of user
 registration/authentication systems and without much success. I know
 it's due to my lack of sKiLLz or whatever, but I could use some help.

 The code i have creates my user and puts it into the database just
 fine..but after that, nothing happens... no flash, no redirect. I
 can't figure it out. here is my register code in the users_controller:

 function register() {
if (!empty($this-data)) {
if ($this-data['User']['password'] == $this-Auth-
 password($this-data['User']['password_confirm'])) {
$this-User-create();
$this-User-save($this-data);
$this-redirect('login');
}
}
}

 what am I doing wrong?
 



-- 
In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s+: a19 C UL++ P L++
!E W++ N(-) o? K? w(+) O? M-- V?
PS+ PE Y- PGP- t+ 5? X- R tv--
b++ Di D+ G+ e h! r y-
--END GEEK CODE BLOCK--

--~--~-~--~~~---~--~~
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: user authentication example...login redirects

2008-02-07 Thread polomasta

no luck yet, I tried this as well:

$this-redirect(array('controller'='users','action'='login'));

 I'm also getting these things in the debug area...

Warning (512): /var/www/html/bradsCakeApp/app/tmp/cache/ is not
writable [CORE/cake/libs/cache/file.php, line 263]

Notice (8): Use of undefined constant VALID_NOT_EMPTY - assumed
'VALID_NOT_EMPTY' [CORE/cake/dispatcher.php, line 508]

Warning (2): Cannot modify header information - headers already sent
by (output started at /var/www/html/bradsCakeApp/cake/basics.php:194)
[CORE/cake/libs/controller/controller.php, line 546]

I've double checked all my files for extra whitespace at the end of
files and can't find anything. I'm not sure what else to try. Really
appreciate any additional help.

_brad


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