Re: Auth Component works in dev, but not in production

2016-02-02 Thread Christian Quispe
compartenos los log y debugs.



Enviado con MailTrack


Saludos

Christian Quispe

*Geek and Developer*
*Miembro: * *GDG Lima (Google Developer Group Lima)*

*Portafolio: www.oxicode.io
*

*¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores
constantemente...*


2016-01-20 4:58 GMT-05:00 Ricardo Escalon :

> I am getting a blank page when I try and use the Auth Component.
>
> The code is straight out of the blog tutorial.
>
>
> http://book.cakephp.org/3.0/en/tutorials-and-examples/blog-auth-example/auth.html
>
> It works in dev, but I get a blank page in production.
>
> Any ideas anyone?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at https://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Auth Component

2014-06-27 Thread Jeremy Burns : Class Outfit
What happens if, when you define $user, you also include (contain?) the Person 
and Company models and log in with that $user variable?

On 27 Jun 2014, at 00:57, Matt Myers spartac...@gmail.com wrote:

 I've been hitting my head over this for quite some time now. When I login 
 using the Auth Component as such:
 
 $this-Auth-login()
 
 It will login just fine and define the following authUser:
 
 User
 User.Person
 User.Company
 
 But when I login in another situation like so:
 
 $this-Auth-login($user['User'])
 
 This will log them in just fine, but define the following authUser:
 
 User
 
 * Without User.Person or User.Company
 
 Does anyone know why this is? How can I get the same behavior across the 
 board? I would like he User.Person and User.Company in both instances.
 
 Thanks in advance.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: Auth Component

2014-06-27 Thread Saran
Hi Matt,

You can check array $user['User'], there is company and person found?

After that we will check more.

Regards 
Saran 

-Original Message-
From: Matt Myers spartac...@gmail.com
Sent: ‎27-‎06-‎2014 12:46 PM
To: cake-php@googlegroups.com cake-php@googlegroups.com
Subject: Auth Component

I've been hitting my head over this for quite some time now. When I login using 
the Auth Component as such:

$this-Auth-login()

It will login just fine and define the following authUser:

User
User.Person
User.Company

But when I login in another situation like so:

$this-Auth-login($user['User'])

This will log them in just fine, but define the following authUser:

User

* Without User.Person or User.Company

Does anyone know why this is? How can I get the same behavior across the board? 
I would like he User.Person and User.Company in both instances.

Thanks in advance.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Auth Component Issues

2013-04-02 Thread Vinicius Dusso

 Ramon, 

 Which CakePHP's version are you using?

On Monday, April 1, 2013 4:55:32 PM UTC-3, Ramon José Silva wrote:

 Hi guys.

 Well, I trying to use the CakePHP on my own project, but I have a problem 
 with the Auth Component.

 I'm not using the password hash yet and not using the UsersController and 
 User Model, but I using Admin Model, AdminController and an Ajax, passing 
 the form data to the controller login method, but I can't login in my 
 system, the Auth always return false. I read the Docs trying to find 
 something that's help me, and saw in the Auth part that I can personalized 
 my form fields and tables to passing the data and everything works fine, 
 but it not work for me.

 If I use:

 $this-data = array() and passing all data that I receive with Ajax to my 
 Auth login, the login works fine, but not check if the User are subscribed 
 on my DB. In the Docs have something about that, but with I try to login 
 with the e-mail address and password that I registered, the Auth always 
 return false even my User really exists in my DB.

 This is my AdminController: http://pastebin.com/AvQQf6iw, 

 This is my App Controller: http://pastebin.com/B5XBwR5g, 

 This is my Ajax: http://pastebin.com/kQV7taWQ

 Now, if I use in my login method this line: 

 $query = $this-Admin-find('first', array('conditions' = 
 array('admin_email' = $this-data['admin_email'], 'admin_pass' = 
 $this-data['admin_pass'])));

 if($query == true){
   echo 'true'; 
 } else {
   echo 'Wrong User/Password';
 }

 I really find the user.

 Can anyone help me with this?

 Thanks Guys for the help anyway.





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Auth Component Issues

2013-04-02 Thread André Luis
Hi Ramon, actually it´s not a issue, you said you´re not using a password 
hash, but the Auth system always use one to retrieve the user information, 
so when you try to use $this-Auth-login() it hashes the password before 
find on table, so you should hash it with AuthComponent::password() at 
model´s beforeSave to save the correct password on table...

Em segunda-feira, 1 de abril de 2013 16h55min32s UTC-3, Ramon José Silva 
escreveu:

 Hi guys.

 Well, I trying to use the CakePHP on my own project, but I have a problem 
 with the Auth Component.

 I'm not using the password hash yet and not using the UsersController and 
 User Model, but I using Admin Model, AdminController and an Ajax, passing 
 the form data to the controller login method, but I can't login in my 
 system, the Auth always return false. I read the Docs trying to find 
 something that's help me, and saw in the Auth part that I can personalized 
 my form fields and tables to passing the data and everything works fine, 
 but it not work for me.

 If I use:

 $this-data = array() and passing all data that I receive with Ajax to my 
 Auth login, the login works fine, but not check if the User are subscribed 
 on my DB. In the Docs have something about that, but with I try to login 
 with the e-mail address and password that I registered, the Auth always 
 return false even my User really exists in my DB.

 This is my AdminController: http://pastebin.com/AvQQf6iw, 

 This is my App Controller: http://pastebin.com/B5XBwR5g, 

 This is my Ajax: http://pastebin.com/kQV7taWQ

 Now, if I use in my login method this line: 

 $query = $this-Admin-find('first', array('conditions' = 
 array('admin_email' = $this-data['admin_email'], 'admin_pass' = 
 $this-data['admin_pass'])));

 if($query == true){
   echo 'true'; 
 } else {
   echo 'Wrong User/Password';
 }

 I really find the user.

 Can anyone help me with this?

 Thanks Guys for the help anyway.





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Auth Component; Strange behavior

2013-03-11 Thread Pablito Pablito
Still learning Cake but maybe you have some code conflicting with auth on 
your AppController beforeFilter? Happened to me when trying out the Auth 
component. 

Pablo.

On Monday, March 11, 2013 6:15:02 AM UTC-3, CrotchFrog wrote:

 Using Cake 2.2.5

 My app is exhibiting a strange behavior in one of my controller/views. I 
 have $this-Auth-allowedActions = array('view', 'index'); defined in the 
 beforeFilter of one of my controllers. When an authenticated user navigates 
 to the index view, Auth Component does not work on that page. Removing 
 'index' from allowedActions gets Auth Component working but then does not 
 allow public access to that view. This is the only controller/view 
 exhibiting this behavior, all others work fine. 

 Any idea what could be going on here? 

 - ED 


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Auth Component; Strange behavior

2013-03-11 Thread lowpass
Define Auth Component does not work. If Auth is allowing access then
what else do you need? Could this be a routing issue? Are you using
admin prefixes?

(It's been a long day so I may well be missing something obvious here.)

On Mon, Mar 11, 2013 at 5:15 AM, Ed Propsner crotchf...@gmail.com wrote:
 Using Cake 2.2.5

 My app is exhibiting a strange behavior in one of my controller/views. I
 have $this-Auth-allowedActions = array('view', 'index'); defined in the
 beforeFilter of one of my controllers. When an authenticated user navigates
 to the index view, Auth Component does not work on that page. Removing
 'index' from allowedActions gets Auth Component working but then does not
 allow public access to that view. This is the only controller/view
 exhibiting this behavior, all others work fine.

 Any idea what could be going on here?

 - ED

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

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



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Auth Component; Strange behavior

2013-03-11 Thread CrotchFrog
Pablito was correct, there was a conflict in my code. I had a custom helper 
to handle ckeditor and it was causing the conflict. 

On Monday, March 11, 2013 7:56:19 PM UTC-4, cricket wrote:

 Define Auth Component does not work. If Auth is allowing access then 
 what else do you need? Could this be a routing issue? Are you using 
 admin prefixes? 

 (It's been a long day so I may well be missing something obvious here.) 

 On Mon, Mar 11, 2013 at 5:15 AM, Ed Propsner 
 crotc...@gmail.comjavascript: 
 wrote: 
  Using Cake 2.2.5 
  
  My app is exhibiting a strange behavior in one of my controller/views. I 
  have $this-Auth-allowedActions = array('view', 'index'); defined in 
 the 
  beforeFilter of one of my controllers. When an authenticated user 
 navigates 
  to the index view, Auth Component does not work on that page. Removing 
  'index' from allowedActions gets Auth Component working but then does 
 not 
  allow public access to that view. This is the only controller/view 
  exhibiting this behavior, all others work fine. 
  
  Any idea what could be going on here? 
  
  - ED 
  
  -- 
  Like Us on FaceBook https://www.facebook.com/CakePHP 
  Find us on Twitter http://twitter.com/CakePHP 
  
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  CakePHP group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to cake-php+u...@googlegroups.com javascript:. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/cake-php?hl=en. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Auth component deleting Session data for no reason.

2013-01-08 Thread Pedro Fortes Gallego
Hello cricket, its solved and fixed all above.

Could you add me to gmail-chat? fortesgall...@gmail.com. Thanks you.

El domingo, 6 de enero de 2013 23:32:35 UTC+1, cricket escribió:

 On Sat, Jan 5, 2013 at 3:08 PM, Pedro Fortes Gallego 
 fortes...@gmail.com javascript: wrote: 
  
  Is there any form to catch php fatal errors? 

 Have a look at register_shutdown_function() 

  i heard that if you left a blank space after ? tag, it can causes a 
 fatal error. 

 More likely it will cause the dreaded Headers already sent warning. 
 That's because of the way that PHP buffers output. The charaters after 
 the closing tags will be sent to the client immediately, so that when 
 PHP tries to send the normal page headers out afterwards it will cause 
 problems. 

 The best solution for that is to leave out the ? in all your PHP 
 files; it's not required. The interpreter will then deal with it 
 correctly. 


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Auth component deleting Session data for no reason.

2013-01-06 Thread lowpass
On Sat, Jan 5, 2013 at 3:08 PM, Pedro Fortes Gallego
fortesgall...@gmail.com wrote:

 Is there any form to catch php fatal errors?

Have a look at register_shutdown_function()

 i heard that if you left a blank space after ? tag, it can causes a fatal 
 error.

More likely it will cause the dreaded Headers already sent warning.
That's because of the way that PHP buffers output. The charaters after
the closing tags will be sent to the client immediately, so that when
PHP tries to send the normal page headers out afterwards it will cause
problems.

The best solution for that is to leave out the ? in all your PHP
files; it's not required. The interpreter will then deal with it
correctly.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Auth component deleting Session data for no reason.

2013-01-05 Thread Pedro Fortes Gallego
Hello, im solving that, thanks you very much.

Is there any form to catch php fatal errors? i heard that if you left a 
blank space after ? tag, it can causes a fatal error.

Trying yo depurate in local ... but im spending a lot of time in this 
stupid thing :(

Thanks you for your time.

El viernes, 4 de enero de 2013 03:50:30 UTC+1, cricket escribió:

 On Thu, Jan 3, 2013 at 6:02 AM, Pedro Fortes Gallego 
 fortes...@gmail.com javascript: wrote: 
  Hello, 
  
  Im using auth component and cofiguring it in my AppController, just cake 
  documentain say. 
  
  class AppController extends Controller { 
  
  ... 
  public function beforeFilter() { 
  $this-Auth-allow('login', 'index', 'forgotPassword'); 

 This should be in the UsersController, not AppController. And you 
 shouldn't include login in the allow() call. (I know, it's not 
 intuitive.) 

  white screen with no error and no debug info (trying debug to 2 - 3 and 
  still no info). Im using a hoting, so its hard to access to apache log 
 ... 

 A white screen means a fatal PHP error, so Cake doesn't have the 
 chance to log anything. Does your hosting account include an admin 
 panel with access to the server logs? 

  ?php 
  class CategorysController extends AppController { 

 It should be CategoriesController. 

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

 If these two helpers are commonly used you can put this in 
 AppController and leave it out of all of your other controllers. 

  public $uses = array ('Category', 'Sp', 'SpsSpsPart', 'SpsPart'); 

 Are the Sp, SpsSpsPart, and SpsPart models associated with each other? 
 And are any of them associated with Category? If so, you can remove 
 this entire $uses var and chain your model calls like, eg. 
 $this-Category-Sp-SpsPart-doSomething() 

 But it doesn't even look like you're calling methods on those other 
 classes, anyway. 

  // public $components = array('Session', 'Auth'); 

 This is not necessary here because you declared it in AppController, 
 which is the parent of this controller. 

  public function beforeFilter() { 
  
  parent::beforeFilter(); 
  $this-layout = 'login'; 

 Are you sure you want the login layout for categories? 


  public function addCategory ($sp, $spPart, $parent = 0) { 
  
  if ($this-request-is('post')) { 
  $this-Category-set($this-data); 
  
  if ($this-Category-validates()) { 
  $category = array ( 
  'sp_id' =  $sp, 
  'parent_id' = $parent, 
  'sps_part_id' = $spPart, 
  'name' = $this-data['Category']['nombre'], 
  'l_name' = $this-data['Category']['nombrelatin'], 
  'description' = 
 $this-data['Category']['descripcion'] 
  ); 

 You've got this a little bit backwards. 

 public function add($sp_id, $sps_part_id, $parent_id = 0) { 

 if ($this-request-is('post')) { 
  
 $this-data['Category']['sp_id'] = $sp_id; 
 $this-data['Category']['sps_part_id'] = $sps_part_id; 
 $this-data['Category']['parent_id'] = $parent_id; 
 // etc ... 
  
 $this-Category-set($this-data); 
  
 if ($this-Category-validates()) { 
 if ($this-Category-save()) { 


 Better: set the sp_id, sps_part_id, and parent_id as view variables 
 and create hidden form fields for them. They'll be in the data array 
 when it is submitted. 


  public function showCategory ($sp, $spPart, $parent = null) { 
  if ($parent == null) { 
  $category = $this-Category-find('all', array ( 
  'fields' = array('Category.id', 'Category.sp_id', 
  'Category.parent_id', 'Category.sps_part_id', 'Category.name', 
  'Category.l_name', 'Category.description'), 
  'conditions' = array('Category.sp_id = ' .$sp . ' AND 
  Category.sps_part_id = ' . $spPart.' AND Category.parent_id = 0'), 

 'conditions' = array( 
 'Category.sp_id' = $sp, 
 'Category.sps_part_id' = $spPart, 
 'Category.parent_id' = $parent 
 ) 


  }else { 
  
  $category = $this-Category-find('threaded', array ( 
  'conditions' = array('Category.parent_id = ' .$parent) 


  'conditions' = array('Category.parent_id' = $parent) 


  public function edit ($sp, $spPart, $id) { 
  
  $category = $this-Category-find('first', array ( 
  'fields' = array('Category.id, Category.sp_id, 
  Category.sps_part_id, Category.parent_id, Category.name, 
 Category.l_name, 
  Category.description'), 
  'conditions' = array ( 
  'Category.sp_id'= $sp, 
  'Category.sps_part_id' = $spPart, 
  'Category.id' = $id 
  )) 
  ); 
  
  

Re: Auth component deleting Session data for no reason.

2013-01-03 Thread lowpass
On Thu, Jan 3, 2013 at 6:02 AM, Pedro Fortes Gallego
fortesgall...@gmail.com wrote:
 Hello,

 Im using auth component and cofiguring it in my AppController, just cake
 documentain say.

 class AppController extends Controller {

 ...
 public function beforeFilter() {
 $this-Auth-allow('login', 'index', 'forgotPassword');

This should be in the UsersController, not AppController. And you
shouldn't include login in the allow() call. (I know, it's not
intuitive.)

 white screen with no error and no debug info (trying debug to 2 - 3 and
 still no info). Im using a hoting, so its hard to access to apache log ...

A white screen means a fatal PHP error, so Cake doesn't have the
chance to log anything. Does your hosting account include an admin
panel with access to the server logs?

 ?php
 class CategorysController extends AppController {

It should be CategoriesController.

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

If these two helpers are commonly used you can put this in
AppController and leave it out of all of your other controllers.

 public $uses = array ('Category', 'Sp', 'SpsSpsPart', 'SpsPart');

Are the Sp, SpsSpsPart, and SpsPart models associated with each other?
And are any of them associated with Category? If so, you can remove
this entire $uses var and chain your model calls like, eg.
$this-Category-Sp-SpsPart-doSomething()

But it doesn't even look like you're calling methods on those other
classes, anyway.

 // public $components = array('Session', 'Auth');

This is not necessary here because you declared it in AppController,
which is the parent of this controller.

 public function beforeFilter() {

 parent::beforeFilter();
 $this-layout = 'login';

Are you sure you want the login layout for categories?


 public function addCategory ($sp, $spPart, $parent = 0) {

 if ($this-request-is('post')) {
 $this-Category-set($this-data);

 if ($this-Category-validates()) {
 $category = array (
 'sp_id' =  $sp,
 'parent_id' = $parent,
 'sps_part_id' = $spPart,
 'name' = $this-data['Category']['nombre'],
 'l_name' = $this-data['Category']['nombrelatin'],
 'description' = $this-data['Category']['descripcion']
 );

You've got this a little bit backwards.

public function add($sp_id, $sps_part_id, $parent_id = 0) {

if ($this-request-is('post')) {

$this-data['Category']['sp_id'] = $sp_id;
$this-data['Category']['sps_part_id'] = $sps_part_id;
$this-data['Category']['parent_id'] = $parent_id;
// etc ...

$this-Category-set($this-data);

if ($this-Category-validates()) {
if ($this-Category-save()) {


Better: set the sp_id, sps_part_id, and parent_id as view variables
and create hidden form fields for them. They'll be in the data array
when it is submitted.


 public function showCategory ($sp, $spPart, $parent = null) {
 if ($parent == null) {
 $category = $this-Category-find('all', array (
 'fields' = array('Category.id', 'Category.sp_id',
 'Category.parent_id', 'Category.sps_part_id', 'Category.name',
 'Category.l_name', 'Category.description'),
 'conditions' = array('Category.sp_id = ' .$sp . ' AND
 Category.sps_part_id = ' . $spPart.' AND Category.parent_id = 0'),

'conditions' = array(
'Category.sp_id' = $sp,
'Category.sps_part_id' = $spPart,
'Category.parent_id' = $parent
)


 }else {

 $category = $this-Category-find('threaded', array (
 'conditions' = array('Category.parent_id = ' .$parent)


 'conditions' = array('Category.parent_id' = $parent)


 public function edit ($sp, $spPart, $id) {

 $category = $this-Category-find('first', array (
 'fields' = array('Category.id, Category.sp_id,
 Category.sps_part_id, Category.parent_id, Category.name, Category.l_name,
 Category.description'),
 'conditions' = array (
 'Category.sp_id'= $sp,
 'Category.sps_part_id' = $spPart,
 'Category.id' = $id
 ))
 );

 $this-set('category', $category);

Everything above should come AFTER the if ($this-request-is('post'))
block. You don't want to fetch the data if the form has been posted.

 public function result ($sp, $part, $parent = 0) {

 $category = $this-Category-find('all', array (
 'fields' = array('Category.id', 'Category.sp_id',
 'Category.parent_id', 'Category.sps_part_id', 'Category.name',
 'Category.l_name', 'Category.description'),
 'conditions' = array('Category.sp_id = ' .$sp . ' AND
 Category.sps_part_id = ' . $part.' AND Category.parent_id = 

Re: Auth component doesn't set session variables !

2012-11-10 Thread SPH92
I have the same problem,

and change the order of components, but nothing change.

if i put $this-Session-read(); , it's work but display a message error 
for regenerate_id session

public function login() {
if ($this-request-is('post')) {
//$this-Session-read();
if ($this-Auth-login()) {
$this-redirect($this-Auth-redirect());

Le jeudi 31 mars 2011 21:11:28 UTC+2, damien durant a écrit :

 i will try.

 In fact it's strange. Because i don't touch anything and it works from my 
 home computers.
 It doesn't from my work, maybe because of proxy setting but it's weird.

 On Thu, Mar 31, 2011 at 8:42 PM, cricket zijn.d...@gmail.comjavascript:
  wrote:

 On Thu, Mar 31, 2011 at 10:43 AM, damien d 
 damien...@gmail.comjavascript: 
 wrote:
  Hi,
 
  I have trouble with the Auth component.
 
  I try something really simple :
   - I create a user db (with name,password field)
   - I use a appcontroler with this code :
 
  var $components = array(Session,Auth);
 function beforeFilter() {
 $this-Auth-fields = array('username' = 'name',
  'password' = 'password');
 $this-Auth-loginAction = array('controller' =
  'users', 'action' = 'login');
 $this-Auth-loginRedirect = array('controller' = 
 'discs', 'action'
  = 'hello');
 $this-Auth-logoutRedirect = '/';
 $this-Auth-loginError = 'Invalid name / password
  combination.  Please try again';
 }
 
   - I got a classic login.ctp
   - and in my discs_controller :
 
  function beforeFilter() {
 $this-Auth-allow(*);
 parent::beforeFilter();
 }
 
 
  The issue is, when i log through the login page, i am correctly
  redirected, but on the redirect page the Auth variable aren't set.
  Here is the content of $session-read() on hello.ctp, after login.
  ($session-read('Auth.User') is empty);
 
  Array ( [Config] = Array ( [userAgent] = [time] = 1301618408
  [timeout] = 10 ) )
 
 
  I see there is some trouble with some fix on the net so i :
   - Configure::write('Session.checkAgent', false);
   - Configure::write('Security.level', 'low');
  in core.php but without any success.

 Try putting Auth before Session in the $components array.

 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+u...@googlegroups.com javascript: For more options, visit 
 this group at http://groups.google.com/group/cake-php




 -- 
 Damien Durant
  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Auth component WITHOUT ACL blocks every controller action

2012-04-19 Thread jeremyharris
I would not recommend this for a couple of reasons:

1. isAuthorized expects a boolean back,  $this-Auth-user() returns null 
(falsey) or an array (truthy). This could break in the future.
2. It allows everyone in everywhere if they are just logged in (I guess 
that's okay if that's the intended functionality).

On Tuesday, April 17, 2012 11:13:53 PM UTC-7, muka wrote:

  Probably a more correct way could be

 function isAuthorized(){
   return $this-Auth-user();
 }


 Il 18/04/2012 00:24, jeremyharris ha scritto: 

 Setting $this-Auth-authorize = array('Controller'); tells the 
 AuthComponent where to run the `isAuthorized()` method, in this case, the 
 Controller. You can find more info here:   
 http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-controllerauthorize
  

 On Tuesday, April 17, 2012 2:45:56 PM UTC-7, DigitalDude wrote: 

 Hey, 

 h as I changed the code to the snippet of stork, it gave me a ... 
 function isAuthorized() on a non-object (auth-component line 52). 

 When I added the code of luca capra, everything is working as 
 expected. All actions that are not allowed by $this-Auth-allow() 
 within beforeFilter-functions of my controllers are blocked when not 
 logged in. When logged in, I can use those actions. 

 Thank you very much, both of you. It's still weird about the error 
 with the auth-component and the isAuthorized() function, but as it now 
 works I will go deeper into the code of the Auth component later. 

 If anyone has an explanation for this, it would be great to discuss 
 it! 

 Again, thank you very much, that saved me a lot of time! 

 Regards, 

 DD 



 On 17 Apr., 16:03, stork lubomir.st...@gmail.com wrote: 
   $this-Auth-authorize = 'controllers'; 
  
   $this-Auth-authorize = array('Controller');

 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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

  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component in requestAction

2012-04-19 Thread lowpass
You allow actions in the controller, not views or elements.

On Thu, Apr 19, 2012 at 8:32 AM, Jackson Bicalho
jacksonbica...@gmail.com wrote:
 I have one element in a view using requestAction.

 This view is permitted in Auth, but is blocked because it is call
 requestAction can not afford it.

 Does anyone know how to reach her at Auth. EX:

 $ this- Auth- allow ('element / bláblábláblá')

 thank you

 Translated by Google (en | en)

 --
 Jackson Bicalho
 jacksonbica...@gmail.com
 jacksonbicalho.com.br
 ..

 Luango - Sistemas e serviços para Internet
 www.luango.com.br

 Precisando de ajuda?
 Acesse:
 suporte.luango.com.br

 Acompanhe nosso Blog:
 blog.luango.com.br

 ..
 cont...@luango.com.br

 Horário de atendimento:
  - De segunda a sexta:
  - - das 8:00 as 12:00
  - - das 13:30 as 18:00



 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org Check out the new CakePHP Questions site
 http://ask.cakephp.org and help others with their CakePHP related questions.


 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component WITHOUT ACL blocks every controller action

2012-04-18 Thread luca capra

Probably a more correct way could be

function isAuthorized(){
  return $this-Auth-user();
}


Il 18/04/2012 00:24, jeremyharris ha scritto:
Setting $this-Auth-authorize = array('Controller'); tells the 
AuthComponent where to run the `isAuthorized()` method, in this case, 
the Controller. You can find more info here: 
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-controllerauthorize 



On Tuesday, April 17, 2012 2:45:56 PM UTC-7, DigitalDude wrote:

Hey,

h as I changed the code to the snippet of stork, it gave me a
...
function isAuthorized() on a non-object (auth-component line 52).

When I added the code of luca capra, everything is working as
expected. All actions that are not allowed by $this-Auth-allow()
within beforeFilter-functions of my controllers are blocked when not
logged in. When logged in, I can use those actions.

Thank you very much, both of you. It's still weird about the error
with the auth-component and the isAuthorized() function, but as it
now
works I will go deeper into the code of the Auth component later.

If anyone has an explanation for this, it would be great to discuss
it!

Again, thank you very much, that saved me a lot of time!

Regards,

DD



On 17 Apr., 16:03, stork lubomir.st...@gmail.com wrote:
  $this-Auth-authorize = 'controllers';

  $this-Auth-authorize = array('Controller');

--
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and 
help others with their CakePHP related questions.



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


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



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


Re: Auth component WITHOUT ACL blocks every controller action

2012-04-17 Thread luca capra


Il 17/04/2012 15:13, DigitalDude ha scritto:

Hey,


I have a little problem with the Auth component. Normally I use it
together with ACL, everything works finde. Now I have a really small
Project and I just want to have some authentication without ACL tables
or different roles.
...
What am I missing here? I do NOT want to use $this-Auth-allow()
because it makes the actions accessible for EVERYONE and that is what
I am trying to cover...



I think this should works:

// AppController::beforeFilter()

if($this-Auth-user())

  $this-Auth-allow();

else

  $this-Auth-deny();


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



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


Re: Auth component WITHOUT ACL blocks every controller action

2012-04-17 Thread stork


 $this-Auth-authorize = 'controllers'; 


 $this-Auth-authorize = array('Controller'); 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component WITHOUT ACL blocks every controller action

2012-04-17 Thread DigitalDude
Hey,

h as I changed the code to the snippet of stork, it gave me a ...
function isAuthorized() on a non-object (auth-component line 52).

When I added the code of luca capra, everything is working as
expected. All actions that are not allowed by $this-Auth-allow()
within beforeFilter-functions of my controllers are blocked when not
logged in. When logged in, I can use those actions.

Thank you very much, both of you. It's still weird about the error
with the auth-component and the isAuthorized() function, but as it now
works I will go deeper into the code of the Auth component later.

If anyone has an explanation for this, it would be great to discuss
it!

Again, thank you very much, that saved me a lot of time!

Regards,

DD



On 17 Apr., 16:03, stork lubomir.st...@gmail.com wrote:
  $this-Auth-authorize = 'controllers';

  $this-Auth-authorize = array('Controller');

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component WITHOUT ACL blocks every controller action

2012-04-17 Thread jeremyharris
Setting $this-Auth-authorize = array('Controller'); tells the 
AuthComponent where to run the `isAuthorized()` method, in this case, the 
Controller. You can find more info here:   
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-controllerauthorize
 

On Tuesday, April 17, 2012 2:45:56 PM UTC-7, DigitalDude wrote:

 Hey, 

 h as I changed the code to the snippet of stork, it gave me a ... 
 function isAuthorized() on a non-object (auth-component line 52). 

 When I added the code of luca capra, everything is working as 
 expected. All actions that are not allowed by $this-Auth-allow() 
 within beforeFilter-functions of my controllers are blocked when not 
 logged in. When logged in, I can use those actions. 

 Thank you very much, both of you. It's still weird about the error 
 with the auth-component and the isAuthorized() function, but as it now 
 works I will go deeper into the code of the Auth component later. 

 If anyone has an explanation for this, it would be great to discuss 
 it! 

 Again, thank you very much, that saved me a lot of time! 

 Regards, 

 DD 



 On 17 Apr., 16:03, stork lubomir.st...@gmail.com wrote: 
   $this-Auth-authorize = 'controllers'; 
  
   $this-Auth-authorize = array('Controller');

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component CakePHP 2.0

2012-02-13 Thread Alexandre Leprêtre
Hi Ahmed, thanks a lot for your help.

My array looks like this now, but it doesn't work better.

public $components = array(
'Acl',
'Auth' = array(
'authorize' = array(
'Actions' = array('actionPath' = 
'controllers')
),
'authenticate ' = array(
'Form' = array(
'Fields' = array(
'username' = 'email_address',
'password' = 'password'
)
)
)
),
'Session'
);

I'm still being kicked when I try to log in.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component CakePHP 2.0

2012-02-13 Thread Alexandre Leprêtre
It actually worked with 'fields'. thanks for your help :)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component CakePHP 2.0

2012-02-11 Thread Ahmed garhy
Hello,

you may try to Fields variable in Auth array.

instead of :

'authentificate' = array(
'Form' = array(
'username' = 'email_address',
'password' = 'password'
)
)

try this:

'authentificate' = array(
'Form' = array(
'Fields' = array(
'username' = 'email_address',
'password' = 'password'
)
)
   )

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component CakePHP 2.0

2012-02-11 Thread Ahmed garhy
one more correction, it's authenticate not authentificate. good luck

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component problem

2012-01-12 Thread Glauco Custódio
I have followed this tutorial and now it's working!

Thank you.

On 11 jan, 14:14, Tilen Majerle tilen.maje...@gmail.com wrote:
 http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-examp...
 check this
 it was some changes created :)
 --
 Lep pozdrav, Tilen Majerlehttp://majerle.eu

 2012/1/11 Glauco Custódio glauco.custo...@gmail.com







  Hi there, I am migrating my base app from 1.3x to 2.0.5. I have copied
  a lot of my code and I am changing where is necessary...

  Auth component is configured, but it is allowing any username/password
  to log in and message of invalid username is not appearing.

  Link to my code:http://bin.cakephp.org/view/416619310

  Please help me, thank you.

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component problem

2012-01-11 Thread Tilen Majerle
http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html
check this
it was some changes created :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/1/11 Glauco Custódio glauco.custo...@gmail.com

 Hi there, I am migrating my base app from 1.3x to 2.0.5. I have copied
 a lot of my code and I am changing where is necessary...

 Auth component is configured, but it is allowing any username/password
 to log in and message of invalid username is not appearing.

 Link to my code: http://bin.cakephp.org/view/416619310

 Please help me, thank you.

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component troubles

2011-12-27 Thread luca capra

Hi,
I think there is nothing wrong in your code, but probably your missing 
something like


public function login(){

if ($this-Auth-login()) {
$this-redirect($this-Auth-redirect());
} else {
$this-Session-setFlash(__('Invalid username or password, try 
again'));
}   
}



in your User controller.

You could use that declaration in app controller, which is more compact:

class AppController extends Controller {

var $components = array(
 'Auth' =  array(
  'fields'=array(
'username' =  'email',
'password' =  'password'
   ),
   'loginError' =  Wrong!
  )
);

function beforeFilter() {
}
}

Hope this help

Luca


Il 27/12/2011 08:01, Clint ha scritto:

class AppController extends Controller {

 var $components = array('Auth');

 function beforeFilter() {
 $this-Auth-fields = array(
 'username' =  'email',
 'password' =  'password'
 );
 $this-Auth-loginError = Wrong!;
 }



--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



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


Re: Auth component troubles

2011-12-27 Thread Clint

Thanks for your suggestions Luca.

After looking at my code again this morning, I discovered my mistake. 
Somehow I'd given App_Controller a ctp extension.. doh! Explains why it 
wasn't being read.


Clint



Hi,
I think there is nothing wrong in your code, but probably your missing 
something like


public function login(){

if ($this-Auth-login()) {
$this-redirect($this-Auth-redirect());
} else {
$this-Session-setFlash(__('Invalid username or password, 
try again'));

}   }


in your User controller.

You could use that declaration in app controller, which is more compact:

class AppController extends Controller {

var $components = array(
 'Auth' =  array(
  'fields'=array(
'username' =  'email',
'password' =  'password'
   ),
   'loginError' =  Wrong!
  )
);

function beforeFilter() {
}
}

Hope this help

Luca


Il 27/12/2011 08:01, Clint ha scritto:

class AppController extends Controller {

 var $components = array('Auth');

 function beforeFilter() {
 $this-Auth-fields = array(
 'username' =  'email',
 'password' =  'password'
 );
 $this-Auth-loginError = Wrong!;
 }





--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



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


Re: Auth component not returning user data on manual login (CakePHP 2.0.3)

2011-11-28 Thread Pratz_
Ah, that did the trick. Thanks!

On Nov 28, 12:43 pm, elitalon elita...@gmail.com wrote:
 According to documentation (http://api20.cakephp.org/class/auth-
 component#method-AuthComponentlogin) if you login a user with a custom
 array, only the information in that array is populated in
 AuthComponent. Thus, if you want to retrieve the ID you must ensure
 that the ID is present in `$data['User]`.

 If you're manually login a user after creating it in a POST request
 you can use this after saving the user:

     $this-request-data['User']['id'] = $this-User-id;
     $this-Auth-login($this-request-data['User']);

 On Nov 28, 7:08 am, Pratz_ pratyushmit...@gmail.com wrote:







  I tried doing: $this-Auth-login($data['User']);
  It too successfully logins the user, but the user data is still not
  accessible via Auth component.

  $this-Auth-user('id') still returns NULL.

  On Nov 25, 12:01 pm, elitalon elita...@gmail.com wrote:

   If `$data` is an array built like as if it was the result of a
   `find('first')`, i.e. indexed by your user model name, try using

       `$this-Auth-login($data['User'])`

   instead of

       `$this-Auth-login($data)`

   On Nov 24, 7:42 am,Pratz_pratyushmit...@gmail.com wrote:

Hi,
I have been trying to manually login a user in version 2.0.3 using:
$this-Auth-login($data).

Though it successfully logins the user, and can read user data through
$this-Session-read('Auth.User.id'), the Auth Component does not
return the user data. $this-Auth-user('id') returns NULL.

Thus login through cookies [using remember me] or automatic logging in
of a newly created user does not work.

May be I am doing something wrong, please provide some leads.

Thanks,
   Pratz_

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component not returning user data on manual login (CakePHP 2.0.3)

2011-11-27 Thread Pratz_
I tried doing: $this-Auth-login($data['User']);
It too successfully logins the user, but the user data is still not
accessible via Auth component.

$this-Auth-user('id') still returns NULL.


On Nov 25, 12:01 pm, elitalon elita...@gmail.com wrote:
 If `$data` is an array built like as if it was the result of a
 `find('first')`, i.e. indexed by your user model name, try using

     `$this-Auth-login($data['User'])`

 instead of

     `$this-Auth-login($data)`

 On Nov 24, 7:42 am,Pratz_pratyushmit...@gmail.com wrote:







  Hi,
  I have been trying to manually login a user in version 2.0.3 using:
  $this-Auth-login($data).

  Though it successfully logins the user, and can read user data through
  $this-Session-read('Auth.User.id'), the Auth Component does not
  return the user data. $this-Auth-user('id') returns NULL.

  Thus login through cookies [using remember me] or automatic logging in
  of a newly created user does not work.

  May be I am doing something wrong, please provide some leads.

  Thanks,
 Pratz_

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component not returning user data on manual login (CakePHP 2.0.3)

2011-11-27 Thread elitalon
According to documentation (http://api20.cakephp.org/class/auth-
component#method-AuthComponentlogin) if you login a user with a custom
array, only the information in that array is populated in
AuthComponent. Thus, if you want to retrieve the ID you must ensure
that the ID is present in `$data['User]`.

If you're manually login a user after creating it in a POST request
you can use this after saving the user:

$this-request-data['User']['id'] = $this-User-id;
$this-Auth-login($this-request-data['User']);

On Nov 28, 7:08 am, Pratz_ pratyushmit...@gmail.com wrote:
 I tried doing: $this-Auth-login($data['User']);
 It too successfully logins the user, but the user data is still not
 accessible via Auth component.

 $this-Auth-user('id') still returns NULL.

 On Nov 25, 12:01 pm, elitalon elita...@gmail.com wrote:







  If `$data` is an array built like as if it was the result of a
  `find('first')`, i.e. indexed by your user model name, try using

      `$this-Auth-login($data['User'])`

  instead of

      `$this-Auth-login($data)`

  On Nov 24, 7:42 am,Pratz_pratyushmit...@gmail.com wrote:

   Hi,
   I have been trying to manually login a user in version 2.0.3 using:
   $this-Auth-login($data).

   Though it successfully logins the user, and can read user data through
   $this-Session-read('Auth.User.id'), the Auth Component does not
   return the user data. $this-Auth-user('id') returns NULL.

   Thus login through cookies [using remember me] or automatic logging in
   of a newly created user does not work.

   May be I am doing something wrong, please provide some leads.

   Thanks,
  Pratz_

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component not returning user data on manual login (CakePHP 2.0.3)

2011-11-24 Thread elitalon
If `$data` is an array built like as if it was the result of a
`find('first')`, i.e. indexed by your user model name, try using

`$this-Auth-login($data['User'])`

instead of

`$this-Auth-login($data)`

On Nov 24, 7:42 am, Pratz_ pratyushmit...@gmail.com wrote:
 Hi,
 I have been trying to manually login a user in version 2.0.3 using:
 $this-Auth-login($data).

 Though it successfully logins the user, and can read user data through
 $this-Session-read('Auth.User.id'), the Auth Component does not
 return the user data. $this-Auth-user('id') returns NULL.

 Thus login through cookies [using remember me] or automatic logging in
 of a newly created user does not work.

 May be I am doing something wrong, please provide some leads.

 Thanks,
 Pratz_

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component problem

2011-11-14 Thread phpMagpie
Which version of Cake you using?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component problem

2011-11-14 Thread phpMagpie
$this-Auth-fields = array('username' = 'email', 'password' = 
'password'); // no capital F

HTH, Paul

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component and admin routing confusion

2011-11-11 Thread phpMagpie
Not sure how an unsuccessful login (you say you stay on login page
with error message) and creating a different login for admins and non-
admins are related.

If auth replies with 'wrong combinisation of username/password' then
the credentials you supplied were wrong, not matter which login form
you use.

For treating admins and non-admins differently check if an admin
prefix exists in $this-params and amend your Auth setup accordingly
(do this in app_controller):

if(isset($this-params['prefix']['admin'])) {
  $this-Auth-userScope['UserGroup.id'] = 1; // my admin group
  $this-layout = 'admin'; // use admin layout
  // other admin related stuff
}

HTH, Paul.

On Nov 10, 12:33 pm, driss bounouar.dr...@gmail.com wrote:
 Hi
 I worked a lot with the auth component and the routing but I'm still
 confused whether the 2 complement or there's ways to work with everyone
 alone. Here's my case and the problem I always get when working with the 2
 together:
 I use the auth component and let's say I want to create the backoffice for
 the admin so I add the admin routing
 the auth component I used like it is I use the table users and everything
 folowing the book so as predicted when I try to open mysite/admin/users it
 redirects me to my login page in mysite/users/login but entring the right
 combinisation of username and password doesn't take any were I stay in the
 same login page whitout any flash message telling me wrong combinisation of
 username/password
 so my question is :can I work with the admin routing alone but must give me
 the login logout actions for the admin??
 if not how can i work with the 2 ??
 if there's any pertinent tutorial out there that will help please write it
 ??
 thank you all

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component and admin routing confusion

2011-11-11 Thread driss bounouar
Thank you for helping but I'm sorry I can't use your help right now I've
lost my laptop which  contain everything :(  bad luck I need to get a new
one then try the things You said thank you any way

On Fri, Nov 11, 2011 at 10:15 AM, phpMagpie p...@webbedit.co.uk wrote:

 Not sure how an unsuccessful login (you say you stay on login page
 with error message) and creating a different login for admins and non-
 admins are related.

 If auth replies with 'wrong combinisation of username/password' then
 the credentials you supplied were wrong, not matter which login form
 you use.

 For treating admins and non-admins differently check if an admin
 prefix exists in $this-params and amend your Auth setup accordingly
 (do this in app_controller):

 if(isset($this-params['prefix']['admin'])) {
  $this-Auth-userScope['UserGroup.id'] = 1; // my admin group
  $this-layout = 'admin'; // use admin layout
  // other admin related stuff
 }

 HTH, Paul.

 On Nov 10, 12:33 pm, driss bounouar.dr...@gmail.com wrote:
  Hi
  I worked a lot with the auth component and the routing but I'm still
  confused whether the 2 complement or there's ways to work with everyone
  alone. Here's my case and the problem I always get when working with the
 2
  together:
  I use the auth component and let's say I want to create the backoffice
 for
  the admin so I add the admin routing
  the auth component I used like it is I use the table users and everything
  folowing the book so as predicted when I try to open mysite/admin/users
 it
  redirects me to my login page in mysite/users/login but entring the right
  combinisation of username and password doesn't take any were I stay in
 the
  same login page whitout any flash message telling me wrong combinisation
 of
  username/password
  so my question is :can I work with the admin routing alone but must give
 me
  the login logout actions for the admin??
  if not how can i work with the 2 ??
  if there's any pertinent tutorial out there that will help please write
 it
  ??
  thank you all

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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




-- 
Driss Bounouar
Élève ingénieur d’état à l’École Nationale des Sciences Appliquées d'Agadir
(promotion 2012)
numéro de tel: 0676749213
profil facebook :driss.bounouar http://www.facebook.com/driss.bounouar
follow me on Twitter :driss http://wefollow.com/furiousdr
Website :http://openmind.isgreat.org http://openmind.isgreat.org/home

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component: Unable to login You are not authorized to access that location. message displayed

2011-10-15 Thread Ed Propsner
Seems like the Auth Component is keeping you out  try adding this to the
beforeFilter() in your controller:

$this-Auth-allowedActions = array('updateuserprofile');

HTH
- Ed

On Fri, Oct 14, 2011 at 11:46 PM, DK techi dk.te...@gmail.com wrote:

 I have a table named userinformations . I want to use emailid and
 password fields as login credentials for my site.
 Have added the below codes in respective files.

  But when I login I am in same login page with a message You are not
 authorized to access that location.


 app/app_controller.php

 class AppController extends Controller {

var $components = array('Auth','Session');

function beforeFilter() {
$this-Auth-userModel = 'Userinformation';
Security::setHash(md5);
$this-Auth-fields = array('username' = 'emailid',
 'password' =
 'password');
$this-Auth-loginAction = array('controller' =
 'Userinformations',
 'action' = 'login');
$this-Auth-loginRedirect = array('controller' =
 'Userinformations', 'action' = 'updateuserprofile');
//sign up  is a page which don't requires to login
$this-Auth-allow('signup');
$this-Auth-authorize = 'controller';
$this-Auth-logoutRedirect = '/';

}
function isAuthorized() {

return true;

}

 }

 Model - userinformation

 class Userinformation extends Appmodel
 {
var $name='Userinformation';
var $primaryKey = 'userid';

.
.
.
.
.
.
.
 function hashPasswords($data){
 if(isset($this-data['Userinformation']['password'])){
$this-data['Userinformation']['password']= md5($this-
 data['Userinformation']['password']);
return $data;
 }
 return $data;
 }
 function beforeSave() {
 $this-hashPasswords(NULL,TRUE);
 return TRUE;
 }
 }

 Controller -  UserinformationsController

function login(){

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

 view - userinformations/login.ctp

 ?php

 echo $this-Session-flash('auth');
 echo $form-create('userinformation', array('action' = 'login'));
 echo $form-input('user.username');
 echo $form-input('user.password');
 echo $form-end('Login');

 ?

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component in cakephp 2.0.0-aplha

2011-05-26 Thread Tilen Majerle
Mark, thank you soo much for this.

Now all works perfect :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/5/26 mark_story mark.st...@gmail.com

 One possible problem could be that many of the public properties you
 are trying to use no longer exist.

 userModel
 userScope
 loginError
 loginRedirect

 All these properties are gone now.  You also have to call Auth-
 login() in your controller, that magic was removed.  I tried to
 detail most of the changes in
 http://cakephp.lighthouseapp.com/projects/42648/20-auth-guide
 if there is something that is still unclear, I'd be happy to update
 the docs, as I doubt you'll be the only person to have these issues.

 -Mark

 On May 24, 2:06 pm, MaJerle.Eu tilen.maje...@gmail.com wrote:
  Hi to all, expecially to CakePHP developer, Mark Story...
 
  this is more question for you Mark, probably you are only who knows
  what is my problem, so, in cakephp = 2.0.0-dev this code works
  perfect...
 
  my code is in image, link belowhttp://i55.tinypic.com/2j2i236.png
 
  {{{
  this is my custom component, where i have configured authentication
 
  and AppController::isAdminAction() is my own method, to check if is
  admin action, it looks in params to check...
 
  }}}
 
  ...but now, on 2.0.0-alpha this code works good only in 1 way, so...
  if user doesn't have access to some action, then he is redirected to
  login page, and message You don't have access to this page. Please
  log in! IS displayed.
 
  But when i click on login button on this page, page is refreshed but
  nothing happend, no error message, no redirect, i check my
  UsersController::admin_login and i make pr($this-request-data) but
  there is no data,
  in beforeFilter there was data, but password was not hashed
  automatically...
 
  so what i have to do, if i want that my auth component work on 2.0.0-
  alpha version
 
  PS: i check AuthComponent file and read all manual before property is
  declared and all, but i don't understand anything...
 
  Thanks to all, who knows how to resolve my problem...:)

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth Component in cakephp 2.0.0-aplha

2011-05-25 Thread mark_story
One possible problem could be that many of the public properties you
are trying to use no longer exist.

userModel
userScope
loginError
loginRedirect

All these properties are gone now.  You also have to call Auth-
login() in your controller, that magic was removed.  I tried to
detail most of the changes in 
http://cakephp.lighthouseapp.com/projects/42648/20-auth-guide
if there is something that is still unclear, I'd be happy to update
the docs, as I doubt you'll be the only person to have these issues.

-Mark

On May 24, 2:06 pm, MaJerle.Eu tilen.maje...@gmail.com wrote:
 Hi to all, expecially to CakePHP developer, Mark Story...

 this is more question for you Mark, probably you are only who knows
 what is my problem, so, in cakephp = 2.0.0-dev this code works
 perfect...

 my code is in image, link belowhttp://i55.tinypic.com/2j2i236.png

 {{{
 this is my custom component, where i have configured authentication

 and AppController::isAdminAction() is my own method, to check if is
 admin action, it looks in params to check...

 }}}

 ...but now, on 2.0.0-alpha this code works good only in 1 way, so...
 if user doesn't have access to some action, then he is redirected to
 login page, and message You don't have access to this page. Please
 log in! IS displayed.

 But when i click on login button on this page, page is refreshed but
 nothing happend, no error message, no redirect, i check my
 UsersController::admin_login and i make pr($this-request-data) but
 there is no data,
 in beforeFilter there was data, but password was not hashed
 automatically...

 so what i have to do, if i want that my auth component work on 2.0.0-
 alpha version

 PS: i check AuthComponent file and read all manual before property is
 declared and all, but i don't understand anything...

 Thanks to all, who knows how to resolve my problem...:)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component doesn't set session variables !

2011-03-31 Thread cricket
On Thu, Mar 31, 2011 at 10:43 AM, damien d damien.dur...@gmail.com wrote:
 Hi,

 I have trouble with the Auth component.

 I try something really simple :
  - I create a user db (with name,password field)
  - I use a appcontroler with this code :

 var $components = array(Session,Auth);
        function beforeFilter() {
                $this-Auth-fields = array('username' = 'name',
 'password' = 'password');
                $this-Auth-loginAction = array('controller' =
 'users', 'action' = 'login');
                $this-Auth-loginRedirect = array('controller' = 'discs', 
 'action'
 = 'hello');
                $this-Auth-logoutRedirect = '/';
                $this-Auth-loginError = 'Invalid name / password
 combination.  Please try again';
        }

  - I got a classic login.ctp
  - and in my discs_controller :

 function beforeFilter() {
                $this-Auth-allow(*);
                parent::beforeFilter();
        }


 The issue is, when i log through the login page, i am correctly
 redirected, but on the redirect page the Auth variable aren't set.
 Here is the content of $session-read() on hello.ctp, after login.
 ($session-read('Auth.User') is empty);

 Array ( [Config] = Array ( [userAgent] = [time] = 1301618408
 [timeout] = 10 ) )


 I see there is some trouble with some fix on the net so i :
  - Configure::write('Session.checkAgent', false);
  - Configure::write('Security.level', 'low');
 in core.php but without any success.

Try putting Auth before Session in the $components array.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component doesn't set session variables !

2011-03-31 Thread damien durant
i will try.

In fact it's strange. Because i don't touch anything and it works from my
home computers.
It doesn't from my work, maybe because of proxy setting but it's weird.

On Thu, Mar 31, 2011 at 8:42 PM, cricket zijn.digi...@gmail.com wrote:

 On Thu, Mar 31, 2011 at 10:43 AM, damien d damien.dur...@gmail.com
 wrote:
  Hi,
 
  I have trouble with the Auth component.
 
  I try something really simple :
   - I create a user db (with name,password field)
   - I use a appcontroler with this code :
 
  var $components = array(Session,Auth);
 function beforeFilter() {
 $this-Auth-fields = array('username' = 'name',
  'password' = 'password');
 $this-Auth-loginAction = array('controller' =
  'users', 'action' = 'login');
 $this-Auth-loginRedirect = array('controller' =
 'discs', 'action'
  = 'hello');
 $this-Auth-logoutRedirect = '/';
 $this-Auth-loginError = 'Invalid name / password
  combination.  Please try again';
 }
 
   - I got a classic login.ctp
   - and in my discs_controller :
 
  function beforeFilter() {
 $this-Auth-allow(*);
 parent::beforeFilter();
 }
 
 
  The issue is, when i log through the login page, i am correctly
  redirected, but on the redirect page the Auth variable aren't set.
  Here is the content of $session-read() on hello.ctp, after login.
  ($session-read('Auth.User') is empty);
 
  Array ( [Config] = Array ( [userAgent] = [time] = 1301618408
  [timeout] = 10 ) )
 
 
  I see there is some trouble with some fix on the net so i :
   - Configure::write('Session.checkAgent', false);
   - Configure::write('Security.level', 'low');
  in core.php but without any success.

 Try putting Auth before Session in the $components array.

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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




-- 
Damien Durant

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-21 Thread Tapan Kumar Thapa
Yes

QA:

idusernamepasswordemailfirst_name
last_namecreatedmodified
1adminfb1d00be1616be244194b049468f6c571c56d927
ad...@hindustantimes.comAdministratorAdmin\N\N

Development:

idusernamepasswordemailfirst_name
last_namecreatedmodified
1khbkfb1d00be1616be244194b049468f6c571c56d927
k...@khbk.comMahuaaTelevision\N\N

Please suggest.

Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on
QA  and also using cakephp 2.0 (cakephp-'Not know') development version on
development machine.

Regards
Tapan Thapa
India

On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 And the tables contain the same data?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote:

 Yes DB structure,code and model files are identical.

 From Development: (Fetched from mysql yog)

 CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(255) NOT NULL,
`first_name` varchar(40) NOT NULL,
`last_name` varchar(40) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

 From QA: (fetched from cli)

 mysql show create table users;

 +---+---+
 | Table | Create
 Table
 |

 +---+---+
 | users | CREATE TABLE `users` (
   `id` int(10) NOT NULL auto_increment,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime default NULL,
   `modified` datetime default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |

 +---+---+
 1 row in set (0.00 sec)

 mysql

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 Then your value is not being set in the session and you won't be able to
 retrieve it. Are you database structures the same? Have you changed anything
 to do with your User model? Are the code sets identical?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:

 Please find the debug info from development machine and QA machine.

 Development:

 Array
 (
 [id] = 1
 [username] = khbk
 [email] = k...@khbk.com

 [first_name] = Mahuaa
 [last_name] = Television
 [created] =
 [modified] =
 )

 QA:

 Array
 (
 [username] = admin
 [password] = suresh

 )

 Please suggest

 Regards
 Tapan Thapa



 On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 What happens when you debug out the value of the auth session variables?
 Is the value there?

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:

 Unfortunately i am not getting any error but my view shows blank in case
 no value retrieved from session for first_name. But if i change the code to
 read username from session it start displaying in my view.

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 

Re: Auth component question

2011-02-21 Thread Tapan Kumar Thapa
Hello Community,

Can you please suggest something?

Regards
Tapan Thapa
India

On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa 
tapan.th...@hindustantimes.com wrote:

 Yes

 QA:

 idusernamepasswordemailfirst_name
 last_namecreatedmodified
 1adminfb1d00be1616be244194b049468f6c571c56d927
 ad...@hindustantimes.comAdministratorAdmin\N\N

 Development:

 idusernamepasswordemailfirst_name
 last_namecreatedmodified
 1khbkfb1d00be1616be244194b049468f6c571c56d927
 k...@khbk.comMahuaaTelevision\N\N

 Please suggest.

 Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version
 on QA  and also using cakephp 2.0 (cakephp-'Not know') development version
 on development machine.

 Regards
 Tapan Thapa
 India

 On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 And the tables contain the same data?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote:

 Yes DB structure,code and model files are identical.

 From Development: (Fetched from mysql yog)

 CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(255) NOT NULL,
`first_name` varchar(40) NOT NULL,
`last_name` varchar(40) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

 From QA: (fetched from cli)

 mysql show create table users;

 +---+---+
 | Table | Create
 Table
 |

 +---+---+
 | users | CREATE TABLE `users` (
   `id` int(10) NOT NULL auto_increment,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime default NULL,
   `modified` datetime default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |

 +---+---+
 1 row in set (0.00 sec)

 mysql

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 Then your value is not being set in the session and you won't be able to
 retrieve it. Are you database structures the same? Have you changed anything
 to do with your User model? Are the code sets identical?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:

 Please find the debug info from development machine and QA machine.

 Development:

 Array
 (
 [id] = 1
 [username] = khbk
 [email] = k...@khbk.com

 [first_name] = Mahuaa
 [last_name] = Television
 [created] =
 [modified] =
 )

 QA:

 Array
 (
 [username] = admin
 [password] = suresh

 )

 Please suggest

 Regards
 Tapan Thapa



 On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 What happens when you debug out the value of the auth session variables?
 Is the value there?

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:

 Unfortunately i am not getting any error but my view shows blank in case
 no value retrieved from session for first_name. 

Re: Auth component question

2011-02-21 Thread Jeremy Burns | Class Outfit
If your code and data is identical (the data isn't actually identical, but I 
guess the differences are not important) then can you show your code? What is 
your log in method? Are you writing anything to the Auth session key anywhere 
else?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 21 Feb 2011, at 09:56, Tapan Kumar Thapa wrote:

 Hello Community,
 
 Can you please suggest something?
 
 Regards
 Tapan Thapa
 India
 
 On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa 
 tapan.th...@hindustantimes.com wrote:
 Yes
 
 QA:
 
 idusernamepasswordemailfirst_namelast_name
 createdmodified
 1adminfb1d00be1616be244194b049468f6c571c56d927
 ad...@hindustantimes.comAdministratorAdmin\N\N
 
 Development:
 
 idusernamepasswordemailfirst_namelast_name
 createdmodified
 1khbkfb1d00be1616be244194b049468f6c571c56d927
 k...@khbk.comMahuaaTelevision\N\N
 
 Please suggest.
 
 Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on 
 QA  and also using cakephp 2.0 (cakephp-'Not know') development version on 
 development machine.
 
 Regards
 Tapan Thapa
 India
 
 On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:
 And the tables contain the same data?
 
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
 
 On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote:
 
 Yes DB structure,code and model files are identical.
 
 From Development: (Fetched from mysql yog)
 
 CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(255) NOT NULL,
`first_name` varchar(40) NOT NULL,
`last_name` varchar(40) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
 
 From QA: (fetched from cli)
 
 mysql show create table users;
 +---+---+
 | Table | Create Table   
  
  
  
  
|
 +---+---+
 | users | CREATE TABLE `users` (
   `id` int(10) NOT NULL auto_increment,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime default NULL,
   `modified` datetime default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
 +---+---+
 1 row in set (0.00 sec)
 
 mysql
 
 Please suggest.
 
 Regards
 Tapan Thapa
 
 On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:
 Then your value is not being set in the session and you won't be able to 
 retrieve it. Are you database structures the same? Have you changed anything 
 to do with your User model? Are the code sets identical?
 
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
 
 On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:
 
 Please find the debug info from development machine and QA 

Re: Auth component question

2011-02-21 Thread Tapan Kumar Thapa
i am writing startdate and enddate to the session but i don't know if i am
writing in Auth session or not.

Please find my view vode for reading first_name from session.

View:

p align=centerb?php echo 'Welcome ' .
$this-Session-read('Auth.User.first_name'); ?/b/p

My controller code which writes startdate and enddate in session:
$this-Session-write('startdate', $startdate);
$this-Session-write('enddate', $enddate);

Fyi: All is working fine in my development machine but i don't know why in
QA.

Please suggest.

Regards
Tapan Thapa
India
On Mon, Feb 21, 2011 at 3:31 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 If your code and data is identical (the data isn't actually identical, but
 I guess the differences are not important) then can you show your code? What
 is your log in method? Are you writing anything to the Auth session key
 anywhere else?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 09:56, Tapan Kumar Thapa wrote:

 Hello Community,

 Can you please suggest something?

 Regards
 Tapan Thapa
 India

 On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa 
 tapan.th...@hindustantimes.com wrote:

 Yes

 QA:

 idusernamepasswordemailfirst_name
 last_namecreatedmodified
 1adminfb1d00be1616be244194b049468f6c571c56d927
 ad...@hindustantimes.comAdministratorAdmin\N\N

 Development:

 idusernamepasswordemailfirst_name
 last_namecreatedmodified
 1khbkfb1d00be1616be244194b049468f6c571c56d927
 k...@khbk.comMahuaaTelevision\N\N

 Please suggest.

 Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version
 on QA  and also using cakephp 2.0 (cakephp-'Not know') development version
 on development machine.

 Regards
 Tapan Thapa
 India

 On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 And the tables contain the same data?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote:

 Yes DB structure,code and model files are identical.

 From Development: (Fetched from mysql yog)

 CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(255) NOT NULL,
`first_name` varchar(40) NOT NULL,
`last_name` varchar(40) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

 From QA: (fetched from cli)

 mysql show create table users;

 +---+---+
 | Table | Create
 Table
 |

 +---+---+
 | users | CREATE TABLE `users` (
   `id` int(10) NOT NULL auto_increment,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime default NULL,
   `modified` datetime default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |

 +---+---+
 1 row in set (0.00 sec)

 mysql

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 Then your value is not being set in the session and you won't be able to
 retrieve it. Are you database structures the same? Have you changed 
 anything
 to do with your User 

Re: Auth component question

2011-02-21 Thread Tapan Kumar Thapa
Please find my complete code of controller fyi:

?php

class UsersController extends AppController {

var $name = 'Users';
var $uses = array('Incoming', 'User');
var $helpers = array('Html', 'Paginator', 'Form', 'Csv');
var $components = array('Auth');
var $paginate = array(
'limit' = 20,
'fields' = array('date', 'time', 'msisdn', 'shortcode', 'operator',
'circle', 'keyword', 'answer', 'age', 'gender', 'status'),
'order' = array('Incoming.id' = 'desc')
);

function beforeFilter() {
$this-Auth-autoRedirect = false;
parent::beforeFilter();
//$this-Auth-allow('register');
}

function index() {
$this-redirect(array('action' = 'login'));
}

function login() {
$this-User-set($this-data);
if ($this-User-validates()) {
if (isset($this-data['User'])) {
if ($this-Auth-login($this-data['User'])) {
$this-Session-setFlash('You\'ve successfully logged
in.');
//$this-redirect('view');
$this-redirect('report');
}
$this-Session-setFlash(Username/Password is incorrect);
}
}
}

function logout() {
$this-Auth-logout();
$this-Session-setFlash('You are now logged out.');
$this-redirect('login');
}

function view() {
if ($this-data) {
$startday = $this-data['Incoming']['StartDate']['day'];
$startmonth = $this-data['Incoming']['StartDate']['month'];
$startyear = $this-data['Incoming']['StartDate']['year'];
$starthour = $this-data['Incoming']['StartDate']['hour'];
$startmin = $this-data['Incoming']['StartDate']['min'];
$startdate = $startyear-$startmonth-$startday
$starthour:$startmin:00;
$endday = $this-data['Incoming']['EndDate']['day'];
$endmonth = $this-data['Incoming']['EndDate']['month'];
$endyear = $this-data['Incoming']['EndDate']['year'];
$endhour = $this-data['Incoming']['EndDate']['hour'];
$endmin = $this-data['Incoming']['EndDate']['min'];
$enddate = $endyear-$endmonth-$endday $endhour:$endmin:00;
$this-Session-write('startdate', $startdate);
$this-Session-write('enddate', $enddate);
$this-set('records', $this-paginate('Incoming',
array(Incoming.created = '$startdate' AND Incoming.created = '$enddate'
)));
} else {
$startdate = $this-Session-read('startdate');
$enddate = $this-Session-read('enddate');
$this-set('records', $this-paginate('Incoming',
array(Incoming.created = '$startdate' AND Incoming.created = '$enddate'
)));
}
}

function report() {

}

function export() {
$this-layout = '';
$startdate = $this-Session-read('startdate');
$enddate = $this-Session-read('enddate');
$this-set('Export', $this-Incoming-find('all', array(
'fields' = array('date', 'time', 'msisdn', 'shortcode',
'operator', 'circle', 'keyword', 'answer', 'age', 'gender'),
'order' = Incoming.id desc,
'conditions' = array(Incoming.created = '$startdate'
AND Incoming.created = '$enddate' ),
'contain' = false)));
}

}

?

Regards
Tapan Thapa
India

On Mon, Feb 21, 2011 at 4:06 PM, Tapan Kumar Thapa 
tapan.th...@hindustantimes.com wrote:

 i am writing startdate and enddate to the session but i don't know if i am
 writing in Auth session or not.

 Please find my view vode for reading first_name from session.

 View:

 p align=centerb?php echo 'Welcome ' .
 $this-Session-read('Auth.User.first_name'); ?/b/p

 My controller code which writes startdate and enddate in session:
 $this-Session-write('startdate', $startdate);
 $this-Session-write('enddate', $enddate);

 Fyi: All is working fine in my development machine but i don't know why in
 QA.


 Please suggest.

 Regards
 Tapan Thapa
 India
 On Mon, Feb 21, 2011 at 3:31 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 If your code and data is identical (the data isn't actually identical, but
 I guess the differences are not important) then can you show your code? What
 is your log in method? Are you writing anything to the Auth session key
 anywhere else?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 09:56, Tapan Kumar Thapa wrote:

 Hello Community,

 Can you please suggest something?

 Regards
 Tapan Thapa
 India

 On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa 
 tapan.th...@hindustantimes.com wrote:

 Yes

 QA:

 idusernamepasswordemailfirst_name
 last_namecreatedmodified
 1adminfb1d00be1616be244194b049468f6c571c56d927
 ad...@hindustantimes.comAdministratorAdmin\N\N

 

Re: Auth component question

2011-02-21 Thread Ryan Schmidt

On Feb 21, 2011, at 02:07, Tapan Kumar Thapa wrote:

 Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on 
 QA  and also using cakephp 2.0 (cakephp-'Not know') development version on 
 development machine.


I see 8cbd9fc is recent (from 2011-02-19) but if you don't know what version is 
on your development machine, try updating it to the same CakePHP version. 
Perhaps there is a CakePHP bug.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread andy_the ultimate baker
will u please tell what error is coming out?

On Feb 21, 12:12 pm, Tapan Kumar Thapa
tapan.th...@hindustantimes.com wrote:
 Hello Community,

 I am using auth component in my code and while retrieving first_name from
 session ($this-Session-read('Auth.User.first_name')) on my development
 machine(windows with wamp), it is working fine.

 However if deploying the same code on QA machine (linux with apache and php
 separately), i am not able to get the first_name from session although i
 have noticed if i am trying to retrieve username or password from session,
 it is working.

 Working on QA - $this-Session-read('Auth.User.username')
 Working on QA - $this-Session-read('Auth.User.password')
 *Not working on QA - $this-Session-read('Auth.User.first_name) or
 $this-Session-read('Auth.User.email')*

 Please suggest.

 Regards
 Tapan Thapa
 India

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread Tapan Kumar Thapa
Unfortunately i am not getting any error but my view shows blank in case no
value retrieved from session for first_name. But if i change the code to
read username from session it start displaying in my view.

Please suggest.

Regards
Tapan Thapa

On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
anandghaywankar...@gmail.com wrote:

 will u please tell what error is coming out?

 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name from
  session ($this-Session-read('Auth.User.first_name')) on my development
  machine(windows with wamp), it is working fine.
 
  However if deploying the same code on QA machine (linux with apache and
 php
  separately), i am not able to get the first_name from session although i
  have noticed if i am trying to retrieve username or password from
 session,
  it is working.
 
  Working on QA - $this-Session-read('Auth.User.username')
  Working on QA - $this-Session-read('Auth.User.password')
  *Not working on QA - $this-Session-read('Auth.User.first_name) or
  $this-Session-read('Auth.User.email')*
 
  Please suggest.
 
  Regards
  Tapan Thapa
  India

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread Jeremy Burns | Class Outfit
What happens when you debug out the value of the auth session variables? Is the 
value there?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:

 Unfortunately i am not getting any error but my view shows blank in case no 
 value retrieved from session for first_name. But if i change the code to read 
 username from session it start displaying in my view.
 
 Please suggest.
 
 Regards
 Tapan Thapa
 
 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 anandghaywankar...@gmail.com wrote:
 will u please tell what error is coming out?
 
 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name from
  session ($this-Session-read('Auth.User.first_name')) on my development
  machine(windows with wamp), it is working fine.
 
  However if deploying the same code on QA machine (linux with apache and php
  separately), i am not able to get the first_name from session although i
  have noticed if i am trying to retrieve username or password from session,
  it is working.
 
  Working on QA - $this-Session-read('Auth.User.username')
  Working on QA - $this-Session-read('Auth.User.password')
  *Not working on QA - $this-Session-read('Auth.User.first_name) or
  $this-Session-read('Auth.User.email')*
 
  Please suggest.
 
  Regards
  Tapan Thapa
  India
 
 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
 
 
 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
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread Tapan Kumar Thapa
Please find the debug info from development machine and QA machine.

Development:

Array
(
[id] = 1
[username] = khbk
[email] = k...@khbk.com
[first_name] = Mahuaa
[last_name] = Television
[created] =
[modified] =
)

QA:

Array
(
[username] = admin
[password] = suresh
)

Please suggest

Regards
Tapan Thapa



On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 What happens when you debug out the value of the auth session variables? Is
 the value there?

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:

 Unfortunately i am not getting any error but my view shows blank in case no
 value retrieved from session for first_name. But if i change the code to
 read username from session it start displaying in my view.

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 anandghaywankar...@gmail.com wrote:

 will u please tell what error is coming out?

 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name
 from
  session ($this-Session-read('Auth.User.first_name')) on my development
  machine(windows with wamp), it is working fine.
 
  However if deploying the same code on QA machine (linux with apache and
 php
  separately), i am not able to get the first_name from session although i
  have noticed if i am trying to retrieve username or password from
 session,
  it is working.
 
  Working on QA - $this-Session-read('Auth.User.username')
  Working on QA - $this-Session-read('Auth.User.password')
  *Not working on QA - $this-Session-read('Auth.User.first_name) or
  $this-Session-read('Auth.User.email')*
 
  Please suggest.
 
  Regards
  Tapan Thapa
  India

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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



 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread Jeremy Burns | Class Outfit
Then your value is not being set in the session and you won't be able to 
retrieve it. Are you database structures the same? Have you changed anything to 
do with your User model? Are the code sets identical?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:

 Please find the debug info from development machine and QA machine.
 
 Development:
 Array
 (
 [id] = 1
 [username] = khbk
 [email] = k...@khbk.com
 
 [first_name] = Mahuaa
 [last_name] = Television
 [created] = 
 [modified] = 
 )
 QA:
 Array
 (
 [username] = admin
 [password] = suresh
 
 )
 
 Please suggest
 
 Regards
 Tapan Thapa
 
 
 
 On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:
 What happens when you debug out the value of the auth session variables? Is 
 the value there?
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
 
 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:
 
 Unfortunately i am not getting any error but my view shows blank in case no 
 value retrieved from session for first_name. But if i change the code to 
 read username from session it start displaying in my view.
 
 Please suggest.
 
 Regards
 Tapan Thapa
 
 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 anandghaywankar...@gmail.com wrote:
 will u please tell what error is coming out?
 
 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name from
  session ($this-Session-read('Auth.User.first_name')) on my development
  machine(windows with wamp), it is working fine.
 
  However if deploying the same code on QA machine (linux with apache and php
  separately), i am not able to get the first_name from session although i
  have noticed if i am trying to retrieve username or password from session,
  it is working.
 
  Working on QA - $this-Session-read('Auth.User.username')
  Working on QA - $this-Session-read('Auth.User.password')
  *Not working on QA - $this-Session-read('Auth.User.first_name) or
  $this-Session-read('Auth.User.email')*
 
  Please suggest.
 
  Regards
  Tapan Thapa
  India
 
 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
 
 
 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
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component question

2011-02-20 Thread Tapan Kumar Thapa
Yes DB structure,code and model files are identical.

From Development: (Fetched from mysql yog)

CREATE TABLE `users` (
   `id` int(10) NOT NULL AUTO_INCREMENT,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime DEFAULT NULL,
   `modified` datetime DEFAULT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

From QA: (fetched from cli)

mysql show create table users;
+---+---+
| Table | Create
Table
|
+---+---+
| users | CREATE TABLE `users` (
  `id` int(10) NOT NULL auto_increment,
  `username` varchar(40) NOT NULL,
  `password` varchar(40) NOT NULL,
  `email` varchar(255) NOT NULL,
  `first_name` varchar(40) NOT NULL,
  `last_name` varchar(40) NOT NULL,
  `created` datetime default NULL,
  `modified` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `username` (`username`,`email`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
+---+---+
1 row in set (0.00 sec)

mysql

Please suggest.

Regards
Tapan Thapa

On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 Then your value is not being set in the session and you won't be able to
 retrieve it. Are you database structures the same? Have you changed anything
 to do with your User model? Are the code sets identical?


 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:

 Please find the debug info from development machine and QA machine.

 Development:

 Array
 (
 [id] = 1
 [username] = khbk
 [email] = k...@khbk.com

 [first_name] = Mahuaa
 [last_name] = Television
 [created] =
 [modified] =
 )

 QA:

 Array
 (
 [username] = admin
 [password] = suresh

 )

 Please suggest

 Regards
 Tapan Thapa



 On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:

 What happens when you debug out the value of the auth session variables?
 Is the value there?

 Jeremy Burns
 *Class Outfit*
 *
 *
 jeremybu...@classoutfit.com jeremybu...@mac.com
 http://www.classoutfit.com

 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:

 Unfortunately i am not getting any error but my view shows blank in case
 no value retrieved from session for first_name. But if i change the code to
 read username from session it start displaying in my view.

 Please suggest.

 Regards
 Tapan Thapa

 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 anandghaywankar...@gmail.com wrote:

 will u please tell what error is coming out?

 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name
 from
  session ($this-Session-read('Auth.User.first_name')) on my
 development
  machine(windows with wamp), it is working fine.
 
  However if deploying the same code on QA machine (linux with apache and
 php
  separately), i am not able to get the first_name from session although
 i
  have noticed if i am trying to retrieve username or password from
 session,
  it is working.
 
  Working on QA - $this-Session-read('Auth.User.username')
  Working on QA - $this-Session-read('Auth.User.password')
  *Not working on QA - $this-Session-read('Auth.User.first_name) or
  $this-Session-read('Auth.User.email')*
 
  Please suggest.
 
  Regards
  Tapan Thapa
  India

 --
 Our newest site for the community: CakePHP Video Tutorials
 

Re: Auth component question

2011-02-20 Thread Jeremy Burns | Class Outfit
And the tables contain the same data?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote:

 Yes DB structure,code and model files are identical.
 
 From Development: (Fetched from mysql yog)
 
 CREATE TABLE `users` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`email` varchar(255) NOT NULL,
`first_name` varchar(40) NOT NULL,
`last_name` varchar(40) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`,`email`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
 
 From QA: (fetched from cli)
 
 mysql show create table users;
 +---+---+
 | Table | Create Table
   
   
   
   
   |
 +---+---+
 | users | CREATE TABLE `users` (
   `id` int(10) NOT NULL auto_increment,
   `username` varchar(40) NOT NULL,
   `password` varchar(40) NOT NULL,
   `email` varchar(255) NOT NULL,
   `first_name` varchar(40) NOT NULL,
   `last_name` varchar(40) NOT NULL,
   `created` datetime default NULL,
   `modified` datetime default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `username` (`username`,`email`)
 ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
 +---+---+
 1 row in set (0.00 sec)
 
 mysql
 
 Please suggest.
 
 Regards
 Tapan Thapa
 
 On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:
 Then your value is not being set in the session and you won't be able to 
 retrieve it. Are you database structures the same? Have you changed anything 
 to do with your User model? Are the code sets identical?
 
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
 
 On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote:
 
 Please find the debug info from development machine and QA machine.
 
 Development:
 Array
 (
 [id] = 1
 [username] = khbk
 [email] = k...@khbk.com
 
 [first_name] = Mahuaa
 [last_name] = Television
 [created] = 
 [modified] = 
 )
 QA:
 Array
 (
 [username] = admin
 [password] = suresh
 
 )
 
 Please suggest
 
 Regards
 Tapan Thapa
 
 
 
 On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit 
 jeremybu...@classoutfit.com wrote:
 What happens when you debug out the value of the auth session variables? Is 
 the value there?
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
 
 On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote:
 
 Unfortunately i am not getting any error but my view shows blank in case no 
 value retrieved from session for first_name. But if i change the code to 
 read username from session it start displaying in my view.
 
 Please suggest.
 
 Regards
 Tapan Thapa
 
 On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker 
 anandghaywankar...@gmail.com wrote:
 will u please tell what error is coming out?
 
 On Feb 21, 12:12 pm, Tapan Kumar Thapa
 tapan.th...@hindustantimes.com wrote:
  Hello Community,
 
  I am using auth component in my code and while retrieving first_name from
  session ($this-Session-read('Auth.User.first_name')) on my development
  machine(windows with wamp), it is 

Re: auth component issue

2011-01-18 Thread Amit Badkas
Hi,

You need to use

$this-redirect($this-Auth-logout());

instead of

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

in users controller's logout action.

Hope this helps.

Amit Badkas

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



On Wed, Jan 19, 2011 at 11:57 AM, andy_the ultimate baker 
anandghaywankar...@gmail.com wrote:

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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Auth component

2011-01-02 Thread AD7six


On Jan 2, 8:13 am, gilsilas gilsi...@gmail.com wrote:
 Hey,
 I have two questions
 1. when I ran $this-Auth-login($data) I noticed that the resulted
 query select user and group but by $this-Auth-user() I can see only
 the user, why is that ?
 here is the query:
 SELECT `User`.`id`, `User`.`email`, `User`.`password`,
 `User`.`group_id`, `User`.`created`, `User`.`last_login`,
 `User`.`name`, `User`.`birthday`, `User`.`gender`, `User`.`code`,
 `User`.`active`, `User`.`verify`, `Group`.`id`, `Group`.`name` FROM
 `users` AS `User` LEFT JOIN `groups` AS `Group` ON (`User`.`group_id`
 = `Group`.`id`) WHERE `User`.`email` = 'gilsi...@gmail.com' AND
 `User`.`password` = '062c8d2974c2c92b8576f816a5c3ff476b175401' AND
 `User`.`active` = 1 LIMIT 1
 2. after my user login I update his last_login field by doing
 $this-User-id = $this-Auth-user('id');
 $this-User-saveField('last_login',date('c'));
 I noticed that this resulted two queries that are actually the same
 SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE `User`.`id` =
 1
 SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE `User`.`id` =
 1
 I don't figure out why this query should run twice by one function
 (saveField)

what makes you think both queries come from calling saveField?

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: Auth component

2011-01-02 Thread gilsilas
because when I remove saveField both queries don't run.

On Jan 2, 12:13 pm, AD7six andydawso...@gmail.com wrote:
 On Jan 2, 8:13 am, gilsilas gilsi...@gmail.com wrote:









  Hey,
  I have two questions
  1. when I ran $this-Auth-login($data) I noticed that the resulted
  query select user and group but by $this-Auth-user() I can see only
  the user, why is that ?
  here is the query:
  SELECT `User`.`id`, `User`.`email`, `User`.`password`,
  `User`.`group_id`, `User`.`created`, `User`.`last_login`,
  `User`.`name`, `User`.`birthday`, `User`.`gender`, `User`.`code`,
  `User`.`active`, `User`.`verify`, `Group`.`id`, `Group`.`name` FROM
  `users` AS `User` LEFT JOIN `groups` AS `Group` ON (`User`.`group_id`
  = `Group`.`id`) WHERE `User`.`email` = 'gilsi...@gmail.com' AND
  `User`.`password` = '062c8d2974c2c92b8576f816a5c3ff476b175401' AND
  `User`.`active` = 1 LIMIT 1
  2. after my user login I update his last_login field by doing
  $this-User-id = $this-Auth-user('id');
  $this-User-saveField('last_login',date('c'));
  I noticed that this resulted two queries that are actually the same
  SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE `User`.`id` =
  1
  SELECT COUNT(*) AS `count` FROM `users` AS `User` WHERE `User`.`id` =
  1
  I don't figure out why this query should run twice by one function
  (saveField)

 what makes you think both queries come from calling saveField?

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: Auth component

2011-01-02 Thread AD7six


On Jan 2, 4:14 pm, gilsilas gilsi...@gmail.com wrote:
 because when I remove saveField both queries don't run.

ic. so why don't you look at the code and or debug and find out :)

AD

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: Auth component

2011-01-02 Thread gilsilas
I posted my problem after I didn't succeed to solve it alone :)

anyway, you may have any solution for my first question ?

tnx

On Jan 2, 6:43 pm, AD7six andydawso...@gmail.com wrote:
 On Jan 2, 4:14 pm, gilsilas gilsi...@gmail.com wrote:

  because when I remove saveField both queries don't run.

 ic. so why don't you look at the code and or debug and find out :)

 AD

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: Auth Component - string to lowercase

2010-12-16 Thread Stephen
Unfortunately our customers are not always computer literate, I receive a
lot of calls about incorrect login details, in reality the customer is doing
something like this when the password is all lowercase.

Password
 PASSWORD
 PassWord


Whether the hash is uppercase or lowercase doesn't bother me, I don't
consider it a big enough security flaw to leave this amendment out.

Also 'Andy
Considered changing your settings in gmail?





On 15 December 2010 21:38, euromark dereurom...@googlemail.com wrote:

 by the way
 you should NEVER upper oder lowercase the password
 leave it as it is or you lower the security of the the site in general
 and compromise the security of the user passwords.
 thats not how it is done

 the hash will be lowercase anyway after sha1()

 On 15 Dez., 21:11, AD7six andydawso...@gmail.com wrote:
  btw, slightly OT but I find it really irritating to register somewhere
 and
  have my username become ad7six :)
 
  AD

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-16 Thread euromark
that has nothing do to with computer literate persons or not.
a password is by definition (and not without good reason) case
sensitive.
if those people dont know that by now they should learn it.
because its this way everywhere in this world

it starts with the windows logon and ends with some google email
account on the www.

you are creating a flaw in procedure and end up teaching them the
wrong stuff.
just my 5 cents


On 16 Dez., 10:57, Stephen step...@ninjacodermonkey.co.uk wrote:
 Unfortunately our customers are not always computer literate, I receive a
 lot of calls about incorrect login details, in reality the customer is doing
 something like this when the password is all lowercase.

 Password

  PASSWORD
  PassWord

 Whether the hash is uppercase or lowercase doesn't bother me, I don't
 consider it a big enough security flaw to leave this amendment out.

 Also 'Andy
 Considered changing your settings in gmail?

 On 15 December 2010 21:38, euromark dereurom...@googlemail.com wrote:









  by the way
  you should NEVER upper oder lowercase the password
  leave it as it is or you lower the security of the the site in general
  and compromise the security of the user passwords.
  thats not how it is done

  the hash will be lowercase anyway after sha1()

  On 15 Dez., 21:11, AD7six andydawso...@gmail.com wrote:
   btw, slightly OT but I find it really irritating to register somewhere
  and
   have my username become ad7six :)

   AD

  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.comcake-php%2bunsubscr...@googlegroups.c 
  omFor more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 --
 Kind Regards
  Stephen @ NinjaCoderMonkey

  www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-16 Thread euromark
oh, and before I forget

those are more appropriate counter measures:
a) inform the user that the PW is cs (maybe even in red for the DAUs)
b) use JS to display red warning symbols if capslock is (accidently)
active:
http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx
c) communicate and educate it (especially for those DAUs^^)

otherwise its like leaving the door open because someone is unable to
use a key... i wonder how they start and login to their windows
workstation in the first place?

On 16 Dez., 13:50, euromark dereurom...@googlemail.com wrote:
 that has nothing do to with computer literate persons or not.
 a password is by definition (and not without good reason) case
 sensitive.
 if those people dont know that by now they should learn it.
 because its this way everywhere in this world

 it starts with the windows logon and ends with some google email
 account on the www.

 you are creating a flaw in procedure and end up teaching them the
 wrong stuff.
 just my 5 cents

 On 16 Dez., 10:57, Stephen step...@ninjacodermonkey.co.uk wrote:







  Unfortunately our customers are not always computer literate, I receive a
  lot of calls about incorrect login details, in reality the customer is doing
  something like this when the password is all lowercase.

  Password

   PASSWORD
   PassWord

  Whether the hash is uppercase or lowercase doesn't bother me, I don't
  consider it a big enough security flaw to leave this amendment out.

  Also 'Andy
  Considered changing your settings in gmail?

  On 15 December 2010 21:38, euromark dereurom...@googlemail.com wrote:

   by the way
   you should NEVER upper oder lowercase the password
   leave it as it is or you lower the security of the the site in general
   and compromise the security of the user passwords.
   thats not how it is done

   the hash will be lowercase anyway after sha1()

   On 15 Dez., 21:11, AD7six andydawso...@gmail.com wrote:
btw, slightly OT but I find it really irritating to register somewhere
   and
have my username become ad7six :)

AD

   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.comcake-php%2bunsubscr...@googlegroups.c
omFor more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

  --
  Kind Regards
   Stephen @ NinjaCoderMonkey

   www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-16 Thread Ryan Schmidt

On Dec 16, 2010, at 07:04, euromark wrote:

 those are more appropriate counter measures:
 a) inform the user that the PW is cs (maybe even in red for the DAUs)

I had to look up this DAU acronym. It's the German equivalent of the English 
Luser which does seem apt.

http://de.wikipedia.org/wiki/Dümmster_anzunehmender_User


 b) use JS to display red warning symbols if capslock is (accidently)
 active:
 http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx

I was going to suggest this as well, assuming it must be possible to detect 
that in JavaScript; thanks for posting a link to an article about it.


 c) communicate and educate it (especially for those DAUs^^)

I agree, the only way to get rid of lusers is to educate them. Or maybe take 
away their computers


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: Auth Component - string to lowercase

2010-12-16 Thread Stephen
I'm not denying it's good practice to have a case sensitive password (I
would normally do this), but for this particular website, it's not the best
option in my eyes.

It is more expensive to the company in technical support, it also encourages
our (older fashioned) customers to use alternative methods such as fax and
email which is even more time consuming as it requires human input (30-40
minutes) and leaves room for human error. Factoring this in for cost we have
(time) wages, and in the event of a mistake, delivery charges, and the
charge of making a replacement and ordering in more stock.

I have also found that a lot our customers do not read what is on the
screen, they don't even notice the validation error messages which come in
big red bold boxes.

I must also point out that the website is not for public use, it is
exclusive to our traders.


Kind Regards
 Stephen


On 16 December 2010 13:11, Ryan Schmidt google-2...@ryandesign.com wrote:


 On Dec 16, 2010, at 07:04, euromark wrote:

  those are more appropriate counter measures:
  a) inform the user that the PW is cs (maybe even in red for the DAUs)

 I had to look up this DAU acronym. It's the German equivalent of the
 English Luser which does seem apt.

 http://de.wikipedia.org/wiki/Dümmster_anzunehmender_Userhttp://de.wikipedia.org/wiki/D%C3%BCmmster_anzunehmender_User


  b) use JS to display red warning symbols if capslock is (accidently)
  active:
  http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx

 I was going to suggest this as well, assuming it must be possible to detect
 that in JavaScript; thanks for posting a link to an article about it.


  c) communicate and educate it (especially for those DAUs^^)

 I agree, the only way to get rid of lusers is to educate them. Or maybe
 take away their computers


 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-16 Thread Stephen
Just another note, this is one of various steps I am implementing to make
the website as easy to use and understand as possible for our customers, we
would like to cut down paper and email orders to a bare minimum, as well as
mistakes on our side.

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: Auth Component - string to lowercase

2010-12-16 Thread euromark
afaik:
DAU = dumbest assumable user =  dümmster anzunehmender User
^^

and your trading partners must be a hell of a group :)
good luck then


On 16 Dez., 14:27, Stephen step...@ninjacodermonkey.co.uk wrote:
 Just another note, this is one of various steps I am implementing to make
 the website as easy to use and understand as possible for our customers, we
 would like to cut down paper and email orders to a bare minimum, as well as
 mistakes on our side.

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: Auth Component - string to lowercase

2010-12-16 Thread euromark
you will not believe how many still try to start their email with www.

please type in your email:
= www.myem...@googlemail.com
etc

thats just soo sad
and then they wonder why no confirmation mail reaches them..


On 16 Dez., 17:38, euromark dereurom...@googlemail.com wrote:
 afaik:
 DAU = dumbest assumable user =  dümmster anzunehmender User
 ^^

 and your trading partners must be a hell of a group :)
 good luck then

 On 16 Dez., 14:27, Stephen step...@ninjacodermonkey.co.uk wrote:







  Just another note, this is one of various steps I am implementing to make
  the website as easy to use and understand as possible for our customers, we
  would like to cut down paper and email orders to a bare minimum, as well as
  mistakes on our side.

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: Auth Component - string to lowercase

2010-12-16 Thread Stephen
A good handful of them certainly are .. DAU'S :P

On 16 December 2010 16:38, euromark dereurom...@googlemail.com wrote:

 afaik:
 DAU = dumbest assumable user =  dümmster anzunehmender User
 ^^

 and your trading partners must be a hell of a group :)
 good luck then


 On 16 Dez., 14:27, Stephen step...@ninjacodermonkey.co.uk wrote:
  Just another note, this is one of various steps I am implementing to make
  the website as easy to use and understand as possible for our customers,
 we
  would like to cut down paper and email orders to a bare minimum, as well
 as
  mistakes on our side.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-15 Thread AD7six
how is that going to magically make the hash of password the same as 
PASSWORD?

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: Auth Component - string to lowercase

2010-12-15 Thread euromark
if you use utf8_unicode_ci you dont have to
ci stands for case insensitive^^


On 15 Dez., 16:59, Stephen step...@ninjacodermonkey.co.uk wrote:
 Hey

 I like to convert my username and password strings to lowercase on any
 submit (to prevent case-sensitive data). The problem I have is that the Auth
 Component automatically hashes the password field before I get the
 opportunity to manipulate the string. I'm wondering if the only way to
 achieve this result is to use fields such as password_original and then
 convert that to a hashed password field afterwards?

 It would be nicer to do some model magic and reduce the code required in the
 controller.

 Look forward to your feedback.

 --
 Kind Regards
  Stephen @ NinjaCoderMonkey

  www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-15 Thread AD7six
you can access the unmodified $this-data in your beforeFilter

hth,

AD

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: Auth Component - string to lowercase

2010-12-15 Thread Stephen
Ah, makes sense, I didn't think of that.

Thanks AD7six

On 15 December 2010 17:43, AD7six andydawso...@gmail.com wrote:

 you can access the unmodified $this-data in your beforeFilter

 hth,

 AD

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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: Auth Component - string to lowercase

2010-12-15 Thread AD7six
btw, slightly OT but I find it really irritating to register somewhere and 
have my username become ad7six :)

AD

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: Auth Component - string to lowercase

2010-12-15 Thread euromark
by the way
you should NEVER upper oder lowercase the password
leave it as it is or you lower the security of the the site in general
and compromise the security of the user passwords.
thats not how it is done

the hash will be lowercase anyway after sha1()

On 15 Dez., 21:11, AD7six andydawso...@gmail.com wrote:
 btw, slightly OT but I find it really irritating to register somewhere and
 have my username become ad7six :)

 AD

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: Auth component variables

2010-10-07 Thread Marco
did you try 'allowedActions' = '*', 'allow' is the method.

Marco

On Oct 6, 2:31 am, Jeremy Burns jeremybu...@classoutfit.com wrote:
 Looking at this page in the 
 guide:http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables,
 you'd think you could do this:

 var $components = array(
   'Auth' = array(
         /.../
         'allow' = '*',
         /.../
  )
 );

 ...but it seems this is ignored. You have to specify $this-Auth-

 allow('*'); in beforeFilter().

 Is this correct, or is it a bug?

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: Auth component and login() layout

2010-10-01 Thread tekomp
There is no error message - it actually works ok.  But the docs for
the Auth component say that code in the login() function won't execute
until after an authorization attempt, so it seems like it shouldn't be
working.

I'm just trying to figure out why it's working if the docs say it
shouldn't.

Thanks.

On Sep 29, 11:29 pm, arro mangdeeisc...@gmail.com wrote:
 no problem if we use different layout for that function..
 what is the error message?

 On Sep 30, 4:41 am, tekomp btisch...@gmail.com wrote:

  I wanted to use a different layout for my login page, so in
  users_controller.php, I have this:

  function login() {
          $this-layout = 'login';

  }

  What's strange though is that according to the Auth component docs,
  code in the login() function will only execute after authentication is
  attempted.  So shouldn't it disregard my code within login() and use
  the default layout if I haven't tried logging in yet?  I'm glad it
  seems to work ok, but afraid that I might be missing something that
  will cause the default layout to be displayed when not logged in.

  Any ideas?  Thanks

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: Auth component and login() layout

2010-09-30 Thread arro
no problem if we use different layout for that function..
what is the error message?


On Sep 30, 4:41 am, tekomp btisch...@gmail.com wrote:
 I wanted to use a different layout for my login page, so in
 users_controller.php, I have this:

 function login() {
         $this-layout = 'login';

 }

 What's strange though is that according to the Auth component docs,
 code in the login() function will only execute after authentication is
 attempted.  So shouldn't it disregard my code within login() and use
 the default layout if I haven't tried logging in yet?  I'm glad it
 seems to work ok, but afraid that I might be missing something that
 will cause the default layout to be displayed when not logged in.

 Any ideas?  Thanks

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: Auth Component Login Hook?

2010-09-05 Thread Jeremy Burns | Class Outfit
See previous rely to your other post. autoRedirect.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Sep 2010, at 15:47, MrDarren wrote:

 Hi all, I want to do an action to my database everytime someone logs
 in via the Auth component. Is this possible and what method would I go
 about doing this? I have thought about extending the component but
 then what method in the component would I use?
 
 Thanks,
 Darren
 
 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: auth component issue

2010-08-12 Thread Max Dörfler

Hi,

that is beacuse when you create the user, the plaintext password gets 
encrypted. When you now edit the user, the encrypted password gets 
loaded and when you save your user, the encrypted password gets 
encrypted again. (so the already encrypted password is handled as if 
it's a plaintext password).
So, to keep the encrypted password, don't save it again. (unset the 
password field or don't load it or exclude it from your fields array or ...)


Greetings
Max

Am 12.08.2010 14:32, schrieb james:

Hi,

I'm using the auth component and ive noticed that if i edit a users
details from within the app it automatically changes the encrypted
password. Any ideas as to why it would do this?

thanks,

James.

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: auth component issue

2010-08-12 Thread james livsey
yes that must be it. Its encrypting the encrypted password!
cheers!

On Thu, Aug 12, 2010 at 2:41 PM, Max Dörfler max.doerf...@googlemail.comwrote:

 Hi,

 that is beacuse when you create the user, the plaintext password gets
 encrypted. When you now edit the user, the encrypted password gets loaded
 and when you save your user, the encrypted password gets encrypted again.
 (so the already encrypted password is handled as if it's a plaintext
 password).
 So, to keep the encrypted password, don't save it again. (unset the
 password field or don't load it or exclude it from your fields array or ...)

 Greetings
 Max

 Am 12.08.2010 14:32, schrieb james:

  Hi,

 I'm using the auth component and ive noticed that if i edit a users
 details from within the app it automatically changes the encrypted
 password. Any ideas as to why it would do this?

 thanks,

 James.

 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.comcake-php%2bunsubscr...@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.comcake-php%2bunsubscr...@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: Auth component not showing login errors

2010-07-10 Thread Hugo M
What's the difference between:

 ?php echo $session-flash(); ?
?php echo $session-flash('auth'); ?

and

?php echo $this-Session-flash(); ?

2010/7/9 Hugo M ham1...@gmail.com

 Hi all! I'm having a problem with the Auth component, is not showing login
 errors :S. Here's my code:

 *App controller:*

var $components = array('Auth', 'Session');

 function beforeFilter() {
 $this-Auth-logoutRedirect = array('controller' = 'deliveries',
 'action' = 'index');
 $this-Auth-loginError = Wrong user and password combination;
 $this-set('loggedin', !!$this-Auth-User());
 }

 *Users controller:*

 var $components = array('Session');
 var $helpers = array('Javascript');

 function beforeFilter() {
 parent::beforeFilter();
 $this-Auth-allow('register', 'login', 'logout', 'create',
 'modal_login', 'modal_register');
 }

 function login() {

 }

 A debug in session when I do a good login and a bad password is the same:

 Array
 (
 [Config] = Array
 (
 [userAgent] = USERAGENT
 [time] = 1278738789
 [timeout] = 100
 )

 [Message] = Array
 (
 )

 [Auth] = Array
 (
 )

 )



 *default.ctp Layout:*

 ?php echo $this-Session-flash(); ?

  ?php
 echo $session-flash();
 echo $session-flash('auth');
 ?

   ?php echo $content_for_layout; ?

 (I don't understand why I have to put both $session-flash() and 
 $this-Session-flash())

 I'm using cakePHP 1.3




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: Auth component not showing login errors

2010-07-10 Thread red
?php echo $session-flash(); ?
And
?php echo $this-Session-flash(); ?

Are exactly the same - from 1.3 you should use second notation.


?php echo $session-flash('auth'); ?

This display flash message with key 'auth'.



On 10 Lip, 17:40, Hugo M ham1...@gmail.com wrote:
 What's the difference between:

  ?php echo $session-flash(); ?
 ?php echo $session-flash('auth'); ?

 and

 ?php echo $this-Session-flash(); ?

 2010/7/9 Hugo M ham1...@gmail.com



  Hi all! I'm having a problem with the Auth component, is not showing login
  errors :S. Here's my code:

  *App controller:*

     var $components = array('Auth', 'Session');

      function beforeFilter() {
          $this-Auth-logoutRedirect = array('controller' = 'deliveries',
  'action' = 'index');
          $this-Auth-loginError = Wrong user and password combination;
          $this-set('loggedin', !!$this-Auth-User());
      }

  *Users controller:*

      var $components = array('Session');
      var $helpers = array('Javascript');

      function beforeFilter() {
          parent::beforeFilter();
          $this-Auth-allow('register', 'login', 'logout', 'create',
  'modal_login', 'modal_register');
      }

      function login() {

      }

  A debug in session when I do a good login and a bad password is the same:

  Array
  (
      [Config] = Array
          (
              [userAgent] = USERAGENT
              [time] = 1278738789
              [timeout] = 100
          )

      [Message] = Array
          (
          )

      [Auth] = Array
          (
          )

  )

  *default.ctp Layout:*

  ?php echo $this-Session-flash(); ?

                       ?php
                              echo $session-flash();
                              echo $session-flash('auth');
                          ?

                     ?php echo $content_for_layout; ?

  (I don't understand why I have to put both $session-flash() and 
  $this-Session-flash())

  I'm using cakePHP 1.3

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: Auth component not showing login errors

2010-07-10 Thread Hugo M
Thanks! And... mmm.. I should use $this-Session-flash('auth') too instead
$session-flash('auth') right?

2010/7/10 red mbu...@gmail.com

 ?php echo $session-flash(); ?
 And
 ?php echo $this-Session-flash(); ?

 Are exactly the same - from 1.3 you should use second notation.


 ?php echo $session-flash('auth'); ?

 This display flash message with key 'auth'.



 On 10 Lip, 17:40, Hugo M ham1...@gmail.com wrote:
  What's the difference between:
 
   ?php echo $session-flash(); ?
  ?php echo $session-flash('auth'); ?
 
  and
 
  ?php echo $this-Session-flash(); ?
 
  2010/7/9 Hugo M ham1...@gmail.com
 
 
 
   Hi all! I'm having a problem with the Auth component, is not showing
 login
   errors :S. Here's my code:
 
   *App controller:*
 
  var $components = array('Auth', 'Session');
 
   function beforeFilter() {
   $this-Auth-logoutRedirect = array('controller' =
 'deliveries',
   'action' = 'index');
   $this-Auth-loginError = Wrong user and password
 combination;
   $this-set('loggedin', !!$this-Auth-User());
   }
 
   *Users controller:*
 
   var $components = array('Session');
   var $helpers = array('Javascript');
 
   function beforeFilter() {
   parent::beforeFilter();
   $this-Auth-allow('register', 'login', 'logout', 'create',
   'modal_login', 'modal_register');
   }
 
   function login() {
 
   }
 
   A debug in session when I do a good login and a bad password is the
 same:
 
   Array
   (
   [Config] = Array
   (
   [userAgent] = USERAGENT
   [time] = 1278738789
   [timeout] = 100
   )
 
   [Message] = Array
   (
   )
 
   [Auth] = Array
   (
   )
 
   )
 
   *default.ctp Layout:*
 
   ?php echo $this-Session-flash(); ?
 
?php
   echo $session-flash();
   echo $session-flash('auth');
   ?
 
  ?php echo $content_for_layout; ?
 
   (I don't understand why I have to put both $session-flash() and
 $this-Session-flash())
 
   I'm using cakePHP 1.3

 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.comcake-php%2bunsubscr...@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: Auth component not showing login errors

2010-07-10 Thread red
Yes, take a look here:
http://book.cakephp.org/view/1572/New-features-in-CakePHP-1-3#View-Helpers-1574

If you use helpers with new way, you'll never have name collision with
variable and helper name.



On 10 Lip, 19:11, Hugo M ham1...@gmail.com wrote:
 Thanks! And... mmm.. I should use $this-Session-flash('auth') too instead
 $session-flash('auth') right?

 2010/7/10 red mbu...@gmail.com



  ?php echo $session-flash(); ?
  And
  ?php echo $this-Session-flash(); ?

  Are exactly the same - from 1.3 you should use second notation.

  ?php echo $session-flash('auth'); ?

  This display flash message with key 'auth'.

  On 10 Lip, 17:40, Hugo M ham1...@gmail.com wrote:
   What's the difference between:

    ?php echo $session-flash(); ?
   ?php echo $session-flash('auth'); ?

   and

   ?php echo $this-Session-flash(); ?

   2010/7/9 Hugo M ham1...@gmail.com

Hi all! I'm having a problem with the Auth component, is not showing
  login
errors :S. Here's my code:

*App controller:*

   var $components = array('Auth', 'Session');

    function beforeFilter() {
        $this-Auth-logoutRedirect = array('controller' =
  'deliveries',
'action' = 'index');
        $this-Auth-loginError = Wrong user and password
  combination;
        $this-set('loggedin', !!$this-Auth-User());
    }

*Users controller:*

    var $components = array('Session');
    var $helpers = array('Javascript');

    function beforeFilter() {
        parent::beforeFilter();
        $this-Auth-allow('register', 'login', 'logout', 'create',
'modal_login', 'modal_register');
    }

    function login() {

    }

A debug in session when I do a good login and a bad password is the
  same:

Array
(
    [Config] = Array
        (
            [userAgent] = USERAGENT
            [time] = 1278738789
            [timeout] = 100
        )

    [Message] = Array
        (
        )

    [Auth] = Array
        (
        )

)

*default.ctp Layout:*

?php echo $this-Session-flash(); ?

                     ?php
                            echo $session-flash();
                            echo $session-flash('auth');
                        ?

                   ?php echo $content_for_layout; ?

(I don't understand why I have to put both $session-flash() and
  $this-Session-flash())

I'm using cakePHP 1.3

  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.comcake-php%2bunsubscr...@googlegroups.c 
  omFor 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: Auth Component and user information.

2010-06-07 Thread cricket
On Jun 7, 11:39 am, saidbakr said@gmail.com wrote:
 Hi,

 I use User model to handle user's basic data such as Name, username,
 password and so on.

 The User model is associated with Rule model by belongsTo association,
 while Rule model is associated to User model by hasMany association.

 The later model Rule is meant by something like users groups so it
 handles name, description, value and of-course id, for example, two
 records from rules table:

 id - 1
 name - Administrators
 description - The super users group!
 value - ABC

 id - 2
 name - Editors
 decription - reviewers and articles writers.
 value - BC

 In AuthComponent documentation 
 :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387

 when they talked about user method of the component, they regards
 that it is possible to retrieve the current user data from the session
 in the view like:

 # $session-read('Auth.User.first_name') //returns particular field
 value

 This example shows that the access of User model property first_name.

 My Question Is,

 How could I able to access the associated model property Rule such
 as Rule.name ?

 Best Regards!

You should implement a login() method in your UsersController. In
there, do something like:

$this-Session-write('Auth.User.foo', 'bar');

When you need to read the info:

echo $this-Auth-user('foo');

Basically, Auth::user() simply reads whatever data has been written to
the Session's 'Auth.User' key (note the uppercase U). You can also
write entire arrays:

$this-Session-write('Auth.User.extra', array('foo' = 'bar'));

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: Auth Component and user information.

2010-06-07 Thread saidbakr
Well, but what about the data in the associated Model Rules? How could
I get it?

On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote:
 On Jun 7, 11:39 am, saidbakr said@gmail.com wrote:



  Hi,

  I use User model to handle user's basic data such as Name, username,
  password and so on.

  The User model is associated with Rule model by belongsTo association,
  while Rule model is associated to User model by hasMany association.

  The later model Rule is meant by something like users groups so it
  handles name, description, value and of-course id, for example, two
  records from rules table:

  id - 1
  name - Administrators
  description - The super users group!
  value - ABC

  id - 2
  name - Editors
  decription - reviewers and articles writers.
  value - BC

  In AuthComponent documentation 
  :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387

  when they talked about user method of the component, they regards
  that it is possible to retrieve the current user data from the session
  in the view like:

  # $session-read('Auth.User.first_name') //returns particular field
  value

  This example shows that the access of User model property first_name.

  My Question Is,

  How could I able to access the associated model property Rule such
  as Rule.name ?

  Best Regards!

 You should implement a login() method in your UsersController. In
 there, do something like:

 $this-Session-write('Auth.User.foo', 'bar');

 When you need to read the info:

 echo $this-Auth-user('foo');

 Basically, Auth::user() simply reads whatever data has been written to
 the Session's 'Auth.User' key (note the uppercase U). You can also
 write entire arrays:

 $this-Session-write('Auth.User.extra', array('foo' = 'bar'));

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: Auth Component and user information.

2010-06-07 Thread saidbakr
I also noticed another thing:

The output of $this-Auth-user() ,without key parameter, is an array
which is listing User model only without regarding the associated
model.


Array ( [User] = Array ( [id] = 1 [username] = admin [name] = Said
Bakr [join_date] = 2010-06-14 19:35:00 [email] = said@gmail.com
[rule_id] = 1 ) )

On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote:
 On Jun 7, 11:39 am, saidbakr said@gmail.com wrote:



  Hi,

  I use User model to handle user's basic data such as Name, username,
  password and so on.

  The User model is associated with Rule model by belongsTo association,
  while Rule model is associated to User model by hasMany association.

  The later model Rule is meant by something like users groups so it
  handles name, description, value and of-course id, for example, two
  records from rules table:

  id - 1
  name - Administrators
  description - The super users group!
  value - ABC

  id - 2
  name - Editors
  decription - reviewers and articles writers.
  value - BC

  In AuthComponent documentation 
  :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387

  when they talked about user method of the component, they regards
  that it is possible to retrieve the current user data from the session
  in the view like:

  # $session-read('Auth.User.first_name') //returns particular field
  value

  This example shows that the access of User model property first_name.

  My Question Is,

  How could I able to access the associated model property Rule such
  as Rule.name ?

  Best Regards!

 You should implement a login() method in your UsersController. In
 there, do something like:

 $this-Session-write('Auth.User.foo', 'bar');

 When you need to read the info:

 echo $this-Auth-user('foo');

 Basically, Auth::user() simply reads whatever data has been written to
 the Session's 'Auth.User' key (note the uppercase U). You can also
 write entire arrays:

 $this-Session-write('Auth.User.extra', array('foo' = 'bar'));

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: Auth Component and user information.

2010-06-07 Thread Jeremy Burns
I think the point is that as part of your log in process you scrape information 
from your associated model and add it to the User array. You could also do an 
update if the associated model data was changed, I guess.

Jeremy Burns
jeremybu...@me.com


On 7 Jun 2010, at 19:33, saidbakr wrote:

 I also noticed another thing:
 
 The output of $this-Auth-user() ,without key parameter, is an array
 which is listing User model only without regarding the associated
 model.
 
 
 Array ( [User] = Array ( [id] = 1 [username] = admin [name] = Said
 Bakr [join_date] = 2010-06-14 19:35:00 [email] = said@gmail.com
 [rule_id] = 1 ) )
 
 On Jun 7, 8:27 pm, cricket zijn.digi...@gmail.com wrote:
 On Jun 7, 11:39 am, saidbakr said@gmail.com wrote:
 
 
 
 Hi,
 
 I use User model to handle user's basic data such as Name, username,
 password and so on.
 
 The User model is associated with Rule model by belongsTo association,
 while Rule model is associated to User model by hasMany association.
 
 The later model Rule is meant by something like users groups so it
 handles name, description, value and of-course id, for example, two
 records from rules table:
 
 id - 1
 name - Administrators
 description - The super users group!
 value - ABC
 
 id - 2
 name - Editors
 decription - reviewers and articles writers.
 value - BC
 
 In AuthComponent documentation 
 :http://book.cakephp.org/view/247/AuthComponent-Methods#user-387
 
 when they talked about user method of the component, they regards
 that it is possible to retrieve the current user data from the session
 in the view like:
 
 # $session-read('Auth.User.first_name') //returns particular field
 value
 
 This example shows that the access of User model property first_name.
 
 My Question Is,
 
 How could I able to access the associated model property Rule such
 as Rule.name ?
 
 Best Regards!
 
 You should implement a login() method in your UsersController. In
 there, do something like:
 
 $this-Session-write('Auth.User.foo', 'bar');
 
 When you need to read the info:
 
 echo $this-Auth-user('foo');
 
 Basically, Auth::user() simply reads whatever data has been written to
 the Session's 'Auth.User' key (note the uppercase U). You can also
 write entire arrays:
 
 $this-Session-write('Auth.User.extra', array('foo' = 'bar'));
 
 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: Auth Component and user information.

2010-06-07 Thread cricket
On Jun 7, 2:19 pm, saidbakr said@gmail.com wrote:
 Well, but what about the data in the associated Model Rules? How could
 I get it?

The AuthComponent does not require anything in the User::login()
method. However, if you wish to run some code upon login, you
implement it there.

public function login()
{
if ($user = $this-Auth-user())
{
/* fetch and store your associated data
 */
$this-Session-write(
'Auth.User.whatever',
$this-User-find(...)
);

$this-redirect($this-Auth-loginRedirect);
}
}

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: Auth Component and user information.

2010-06-07 Thread cricket
On Jun 7, 2:33 pm, saidbakr said@gmail.com wrote:
 I also noticed another thing:

 The output of $this-Auth-user() ,without key parameter, is an array
 which is listing User model only without regarding the associated
 model.

Look at the API:

http://api.cakephp.org/class/auth-component#method-AuthComponentuser

Parameters:
$keystring  field to retrive. Leave null to get entire User
record  optionalNULL

if ($key == null) {
  $model = $this-getModel();
  return array($model-alias = $this-Session-read($this-
sessionKey));
} else {

And, of course, $this-sessionKey cannot be some arbitrary string that
the component doesn't know about. It can't read your mind so it
defaults to what it knows. Namely, 'Auth.User'.

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: Auth Component: Allow action in a controller but disallow it in another

2010-04-19 Thread WebbedIT
Can we assume you have set $this-Auth-allow('referrals'), at an
application level (/app/app_controller.php)

If so add $this-Auth-deny('referrals') in your User and Staff
controllers.

HTH

Paul.

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: Auth Component: Allow action in a controller but disallow it in another

2010-04-16 Thread John Andersen
Take a look at the message:
http://groups.google.com/group/cake-php/browse_thread/thread/e53fafc5c33dbe6a/543251f6349d373b?#543251f6349d373b
which is not about the same topic, but Crickets example and
explanation is certainly related to your issue.
Enjoy,
   John

On Apr 16, 10:28 am, Prof. No Time libertylivingst...@gmail.com
wrote:
 Hello,

 Please I have an action named referrals, I wish to allow this action
 in the guestscontroller without authentication but I have a similar
 action in the userscontroller and the staffscontroller. I DO NOT wish
 to change the action (vis-a-vis url format) name for LEGACY reasons.
 The Auth component keeps allowing my users and staffs referral pages
 access without authentication. This is understandable though. The
 question now is how do I achieve this feat?

 Thank You.

 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.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: Auth component and roles

2010-04-08 Thread Jeremy Burns
I engaged my brain and solved this:

$this-Session-write('Auth.User.role', $role);

Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 8 Apr 2010, at 12:30, Jeremy Burns wrote:

 Everything I have read about the Auth component uses a 'role' column
 in the users table. I want to store a role_id and have a related
 'roles' table instead. Is it possible to store the value in the 'name'
 column of the roles table in the Auth-User variable so that I can
 retrieve it via $this-Auth-user('role')?
 
 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
 
 To unsubscribe, reply using remove me as the subject.

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: Auth component not working as expected

2010-02-14 Thread Guillermo Mansilla

Tell me how did you set the authorized var

Enviado desde mi iPhone

El 14/02/2010, a las 02:39, leon neomanand...@gmail.com escribió:


Hi,

I'm trying to use Auth component for
parent::beforeFilter();
$this-Auth-allow('*');
But its redirecting to the login page.

Even I tried to do
$this-Auth-allow('home');
its not working at all.

Did I miss anything?
Any help will be highly appreciated.

Thanks,

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: auth component on 2 models?

2009-11-20 Thread Dave
I think typically the better implementation would be to use the same model
and use ACL to determine permissions.  This is pretty complicated though.

Too accomplish what you are talking about you can use the userModel variable
from the Auth component:
http://book.cakephp.org/view/248/AuthComponent-Variables

You would set it in the beforeFilter of the controller which you want to use
that model. ie.

users_controller.php
beforeFilter() {
   $this-Auth-userModel = 'User';
}

clients_controller.php
beforeFilter() {
   $this-Auth-userModel = 'Client';
}

On Fri, Nov 20, 2009 at 9:38 AM, K3 kiril.zvezdako...@gmail.com wrote:

 Hi,
 i have users model (for content management administrators) and clients
 model (for registered clients).

 Can i use the same Auth compoennt for both models (to allow them to
 login/register)? or i need different approach?
 Any examples/help?

 thanks.

 --

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




--

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-...@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=.




Re: Auth Component does not logout via URL

2009-11-05 Thread robustsolution

m really sorry for the delay but I really misunderstood the question

I don't know if you mean this

http://book.cakephp.org/view/431/disableCache


On Nov 4, 3:40 pm, Prof. No Time libertylivingst...@gmail.com
wrote:
 Thanks very very much RobustSolution, I have applied your logic. Its
 ok though I didn't use the famous remember me here checkbox. I have
 studied the issue and finally discovered that it is a fault of the
 BUGGY INTERNET EXPLORER that keeps CACHING the page instead of
 visiting the SERVER for proper details (Stupid Explorer!!!). Please
 can you help me out on how to prevent caching of the LOGOUT page by
 such browsers?

 Cheers in ADV.

 On Nov 2, 3:29 pm, robustsolution i...@robustsolution.net wrote:

  Prof.NoTime

  try to take a coffee cup and get relaxed, this is my current solution/
  tips/tricks for the moment

  1)put this in your AppController class
  final protected function _logout() {
          if (!empty($this-Cookie)) {
                  //this ensures if you were using the Cookie component along 
  with the
  Auth component (the famous remember me checkbox)
                  //and you have saved the credentials inside cookie
                  //you should delete the credentials from the cookie when 
  you log out
                  //noneed to verify if you have already saved the 
  credentials inside
  cookie,noerror is thrown
                  $this-Cookie-del($this-Auth-sessionKey);
          }
          return $this-Auth-logout();

  }

  2)your UsersController class logout() method should be now like this
  public function logout() {
          $this-redirect($this-_logout());

  }

  3)your UsersController class beforeFilter() method/callback should be
  now like this
  public function beforeFilter() {
          ...
          parent::beforeFilter();
          //please specify the always allowed actions... logout should be the
  first one of course
          $this-Auth-allow
  ('logout','forgotpassword','resetpassword','activate','register'/* put
  here any other always-allowed action*/);
          if ($this-Auth-user()) {
                  if (in_array($this-params['action'],array
  ('forgotpassword','resetpassword','register','activate'))) {
                          //if you are forgetting your password,
                          //if you resetting your password,
                          //if you are registering as a new user,
                          //or if you are activating you new accout via url
                          //you should not be logged in ... yea this is logic
                          $this-_logout();
                  } elseif($this-params['action']=='login') {
                          //you are already logged in,noneed to login again
                          $this-redirect($this-Auth-redirect());
                  }
          } elseif ($this-params['action']=='logout') {
                  //you are already logged out,noneed to log out again
                  $this-redirect($this-Auth-redirect());
          }
          ...

  }

  now have a nice baking day
--~--~-~--~~~---~--~~
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: Auth Component does not logout via URL

2009-11-04 Thread Prof. No Time

Thanks very very much RobustSolution, I have applied your logic. Its
ok though I didn't use the famous remember me here checkbox. I have
studied the issue and finally discovered that it is a fault of the
BUGGY INTERNET EXPLORER that keeps CACHING the page instead of
visiting the SERVER for proper details (Stupid Explorer!!!). Please
can you help me out on how to prevent caching of the LOGOUT page by
such browsers?

Cheers in ADV.

On Nov 2, 3:29 pm, robustsolution i...@robustsolution.net wrote:
 Prof.NoTime

 try to take a coffee cup and get relaxed, this is my current solution/
 tips/tricks for the moment

 1)put this in your AppController class
 final protected function _logout() {
         if (!empty($this-Cookie)) {
                 //this ensures if you were using the Cookie component along 
 with the
 Auth component (the famous remember me checkbox)
                 //and you have saved the credentials inside cookie
                 //you should delete the credentials from the cookie when you 
 log out
                 //noneed to verify if you have already saved the credentials 
 inside
 cookie,noerror is thrown
                 $this-Cookie-del($this-Auth-sessionKey);
         }
         return $this-Auth-logout();

 }

 2)your UsersController class logout() method should be now like this
 public function logout() {
         $this-redirect($this-_logout());

 }

 3)your UsersController class beforeFilter() method/callback should be
 now like this
 public function beforeFilter() {
         ...
         parent::beforeFilter();
         //please specify the always allowed actions... logout should be the
 first one of course
         $this-Auth-allow
 ('logout','forgotpassword','resetpassword','activate','register'/* put
 here any other always-allowed action*/);
         if ($this-Auth-user()) {
                 if (in_array($this-params['action'],array
 ('forgotpassword','resetpassword','register','activate'))) {
                         //if you are forgetting your password,
                         //if you resetting your password,
                         //if you are registering as a new user,
                         //or if you are activating you new accout via url
                         //you should not be logged in ... yea this is logic
                         $this-_logout();
                 } elseif($this-params['action']=='login') {
                         //you are already logged in,noneed to login again
                         $this-redirect($this-Auth-redirect());
                 }
         } elseif ($this-params['action']=='logout') {
                 //you are already logged out,noneed to log out again
                 $this-redirect($this-Auth-redirect());
         }
         ...

 }

 now have a nice baking day
--~--~-~--~~~---~--~~
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: Auth Component does not logout via URL

2009-11-02 Thread robustsolution

Prof.No Time

try to take a coffee cup and get relaxed, this is my current solution/
tips/tricks for the moment

1)put this in your AppController class
final protected function _logout() {
if (!empty($this-Cookie)) {
//this ensures if you were using the Cookie component along 
with the
Auth component (the famous remember me checkbox)
//and you have saved the credentials inside cookie
//you should delete the credentials from the cookie when you 
log out
//no need to verify if you have already saved the credentials 
inside
cookie, no error is thrown
$this-Cookie-del($this-Auth-sessionKey);
}
return $this-Auth-logout();
}

2)your UsersController class logout() method should be now like this
public function logout() {
$this-redirect($this-_logout());
}

3)your UsersController class beforeFilter() method/callback should be
now like this
public function beforeFilter() {
...
parent::beforeFilter();
//please specify the always allowed actions... logout should be the
first one of course
$this-Auth-allow
('logout','forgotpassword','resetpassword','activate','register'/* put
here any other always-allowed action*/);
if ($this-Auth-user()) {
if (in_array($this-params['action'],array
('forgotpassword','resetpassword','register','activate'))) {
//if you are forgetting your password,
//if you resetting your password,
//if you are registering as a new user,
//or if you are activating you new accout via url
//you should not be logged in ... yea this is logic
$this-_logout();
} elseif($this-params['action']=='login') {
//you are already logged in, no need to login again
$this-redirect($this-Auth-redirect());
}
} elseif ($this-params['action']=='logout') {
//you are already logged out, no need to log out again
$this-redirect($this-Auth-redirect());
}
...
}

now have a nice baking day
--~--~-~--~~~---~--~~
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: Auth component and which fields must be saved in session

2009-10-17 Thread robustsolution

you have two choices
either you hack your customized/personalized \app\controllers
\components\auth.php file (not recommened if you are not expert and if
you do not need it as in this case)

ORR

you have to put it in a controller callback so a check done one time

if (!array_key_exists('requested', $this-params)) {
/*
do here a test on one of the non required (auth user session key)
field if it is still available
if so
delete all the non required 
*/
}


On Oct 17, 3:26 pm, marco.rizze...@gmail.com
marco.rizze...@gmail.com wrote:
 Hi
 I use the Auth component to login in my application.
 I have noted that when the login is correct all fields of User model
 are saved in the session.
 How can I do so only some fields are saved in session and the other
 not?
 Thanks
 Marco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth-Component: Check more than 1 Users-Table (more than 1 User-Model)

2009-10-10 Thread braaan

yeah that was my idea today too... (propably much easier and cleaner
than adding support for another user-model ;))
thank you!
greets

On 9 Okt., 18:26, Dr. Loboto drlob...@gmail.com wrote:
 Users and companies have at least 3 common columns - id, login and
 password. Keep them in one table and put specific fields in 2 others.
 Point Auth to 'united' model. That's all.

 On Oct 9, 9:26 pm,braaanmartin.platt...@gmail.com wrote:

  Hello,

  my currect application has normal User (Employees) and Company models
  among others.
     = Users and companies should be able to login.
  Users can manage their account and Companies should be able to manage
  their employees (User).
  I didn't find a way to check companies- *and* users-table on a new
  login.

  i thought about extending AuthComponent but i'm not that familiar with
  cakephp.

  the thing why i need 2 users-models is, that User and Company have
  really different columns.

  do you have an idea how to solve that?
  thank you very much!
  greets
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   3   >