Re: problem in auth component

2011-05-09 Thread Jens Dittrich
I have seen your video but I can't really read your code with the
resolution provided, so I have to guess. Could it be that you do not
hash the value of the password confirm field? Cake will do a salted
hash on the password field automatically, but not on the field for
password confirmation that you have provieded.

On 9 Mai, 07:22, taq taqman...@gmail.com wrote:
 I got probem in register page
 when i use auth component
 can you see and help to fix it

 http://www.youtube.com/watch?v=zW3wRUw5NRo

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


problem in auth component

2011-05-08 Thread taq
I got probem in register page
when i use auth component
can you see and help to fix it

http://www.youtube.com/watch?v=zW3wRUw5NRo

-- 
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: problem in auth component when i was creating a login controller.

2010-06-09 Thread Narendra Padala
Thanks sir,
its working fine.!

On Tue, Jun 8, 2010 at 8:40 PM, calvin cal...@rottenrecords.com wrote:

 Don't post the same question twice, please. You already had people
 helping you with this in the other thread.

 On Jun 8, 4:16 am, Narendra Padala crazycake...@gmail.com wrote:
  Hi i am new to cake php, when i am  creating a login authentication using
  app controller the following error was showed so please help me out. here
  data base i am using postgress sql, here i dont have permission to
 chanage
  the databse.
 
  this is app_controller.php
  --
 
  ?php
 
  class AppController extends Controller {
 
  var $components = array('Auth', 'RequestHandler');
 
  var $uses = array ('Tbluser') ;
 
  var $helpers = array('Javascript','Html','Form','Ajax');
 
  function beforeFilter(){
 
  $this-Auth-loginAction = array('admin' = false, 'controller'
 =
  'tblusers', 'action' = 'login');
 
  $this-Auth-authError = Sorry, you are lacking access.;
 
  $this-Auth-loginError = No, you fool! That's not the right
  password!;
 
  $this-Auth-userModel = 'Tbluser';
 
  $this-Auth-authorize = 'tblusers';
 
  $this-Auth-fields = array('username' = 'struid', 'password' =
  'strpid');
 
  $this-Auth-allow('login');
 
  $username = $this-Auth-user('struid');
 
  $id = $this-Auth-user('lnguser');
 
  $this-set('userId', $this-Auth-user('lnguser'));
 
  $this-Auth-loginRedirect = array('controller' = 'tblusers',
  'action' = 'index');
 
  }
 
  function isAuthorized() {
  return true;
  }
 
  }
 
  ?
 
  Error Message :
  
 
  *Warning* (512) javascript:void(0);: Auth::isAuthorized() -
  $authorize is set to an incorrect value.  Allowed settings are:
  actions, crud, model or null.
  [*CORE/cake/libs/controller/components/auth.php*, line *525*]
  *Warning* (2) javascript:void(0);: Cannot modify header information
  - headers already sent by (output started at
  /var/www/wizard_auth/cake/basics.php:108)
  [*CORE/cake/libs/controller/controller.php*, line *646*]
 
  Please any one can help me out...thanks in advance..!

 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


problem in auth component when i was creating a login controller.

2010-06-08 Thread Narendra Padala
Hi i am new to cake php, when i am  creating a login authentication using
app controller the following error was showed so please help me out. here
data base i am using postgress sql, here i dont have permission to chanage
the databse.


this is app_controller.php
--

?php

class AppController extends Controller {

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

var $uses = array ('Tbluser') ;

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

function beforeFilter(){

$this-Auth-loginAction = array('admin' = false, 'controller' =
'tblusers', 'action' = 'login');

$this-Auth-authError = Sorry, you are lacking access.;

$this-Auth-loginError = No, you fool! That's not the right
password!;

$this-Auth-userModel = 'Tbluser';

$this-Auth-authorize = 'tblusers';

$this-Auth-fields = array('username' = 'struid', 'password' =
'strpid');

$this-Auth-allow('login');

$username = $this-Auth-user('struid');

$id = $this-Auth-user('lnguser');

$this-set('userId', $this-Auth-user('lnguser'));

$this-Auth-loginRedirect = array('controller' = 'tblusers',
'action' = 'index');

}

function isAuthorized() {
return true;
}

}
?


Error Message :


*Warning* (512) javascript:void(0);: Auth::isAuthorized() -
$authorize is set to an incorrect value.  Allowed settings are:
actions, crud, model or null.
[*CORE/cake/libs/controller/components/auth.php*, line *525*]
*Warning* (2) javascript:void(0);: Cannot modify header information
- headers already sent by (output started at
/var/www/wizard_auth/cake/basics.php:108)
[*CORE/cake/libs/controller/controller.php*, line *646*]


Please any one can help me out...thanks in advance..!

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: problem in auth component when i was creating a login controller.

2010-06-08 Thread Jeremy Burns
Read the error message and obey:

You have:  $this-Auth-authorize = 'tblusers';

The error says:

 Warning (512): Auth::isAuthorized() - $authorize is set to an incorrect 
 value.  Allowed settings are: actions, crud, model or null. 
 [CORE/cake/libs/controller/components/auth.php, line 525]


Jeremy Burns
jeremybu...@me.com


On 8 Jun 2010, at 12:16, Narendra Padala wrote:

 Hi i am new to cake php, when i am  creating a login authentication using app 
 controller the following error was showed so please help me out. here data 
 base i am using postgress sql, here i dont have permission to chanage the 
 databse.
 
 
 this is app_controller.php
 --
 
 ?php
 
 class AppController extends Controller {
 
 var $components = array('Auth', 'RequestHandler');
 
 var $uses = array ('Tbluser') ; 
 
 var $helpers = array('Javascript','Html','Form','Ajax');
 
 function beforeFilter(){
 
 $this-Auth-loginAction = array('admin' = false, 'controller' = 
 'tblusers', 'action' = 'login');
 
 $this-Auth-authError = Sorry, you are lacking access.;
 
 $this-Auth-loginError = No, you fool! That's not the right 
 password!;
 
 $this-Auth-userModel = 'Tbluser';
 
 $this-Auth-authorize = 'tblusers';
 
 $this-Auth-fields = array('username' = 'struid', 'password' = 
 'strpid');
 
 $this-Auth-allow('login');
 
 $username = $this-Auth-user('struid');
 
 $id = $this-Auth-user('lnguser');
 
 $this-set('userId', $this-Auth-user('lnguser'));
 
 $this-Auth-loginRedirect = array('controller' = 'tblusers', 
 'action' = 'index');
 
 }
 
 function isAuthorized() {
 return true;
 }
 
 }
 ?
 
 
 Error Message :
 
 
 Warning (512): Auth::isAuthorized() - $authorize is set to an incorrect 
 value.  Allowed settings are: actions, crud, model or null. 
 [CORE/cake/libs/controller/components/auth.php, line 525]
 
 Warning (2): Cannot modify header information - headers already sent by 
 (output started at /var/www/wizard_auth/cake/basics.php:108) 
 [CORE/cake/libs/controller/controller.php, line 646]
 
 
 
 Please any one can help me out...thanks in advance..!
 
 
 
 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: Problem with Auth Component hashes

2010-04-20 Thread Stefano Martins
Duh, I forgot about the salt value and added the user in the users
table without it.

Thanks, people!

On 19 abr, 04:50, WebbedIT p...@webbedit.co.uk wrote:
 If wanting to compare your hashed password with a salt inflected
 hashed string use

 if ($password == $this-Auth-password($password_confirm))

 or

 if ($password == Security::hash(Configure::read('Security.salt') .
 $password_confirm)

 HTH

 Paul

 On Apr 18, 5:24 pm, Zaky Katalan-Ezra procsh...@gmail.com wrote:



   I think the Auth uses a salt.

  On Sun, Apr 18, 2010 at 6:43 PM,StefanoMartins xstefa...@gmail.comwrote:

   Hello folks,

   As I was studying CakePHP and the Auth Component, I've found out that
   it's not using sha1 hashes - or at least it doesn't seems to - by
   default. I had to manually set it to use md5 hashes, following the
   instructions given by the Cookbook. For the string stefano, Cake's
   generating the 35b914b05db99937e255f0eaebd3ac89f804a1cc, while the
   sha1() function generates the
   80980fcaf2ab3f243874695f57b2ed065d8e67e4 hash for the stefano
   string.

   Am I doing something wrong?

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

  --
  Regards,
  Zaky Katalan-Ezra
  QA Administratorwww.IGeneriX.com
  Sites.IGeneriX.com
  054-7762312

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

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

 Check out the new CakePHP Questions 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: Problem with Auth Component hashes

2010-04-19 Thread WebbedIT
If wanting to compare your hashed password with a salt inflected
hashed string use

if ($password == $this-Auth-password($password_confirm))

or

if ($password == Security::hash(Configure::read('Security.salt') .
$password_confirm)

HTH

Paul

On Apr 18, 5:24 pm, Zaky Katalan-Ezra procsh...@gmail.com wrote:
  I think the Auth uses a salt.

 On Sun, Apr 18, 2010 at 6:43 PM, Stefano Martins xstefa...@gmail.comwrote:



  Hello folks,

  As I was studying CakePHP and the Auth Component, I've found out that
  it's not using sha1 hashes - or at least it doesn't seems to - by
  default. I had to manually set it to use md5 hashes, following the
  instructions given by the Cookbook. For the string stefano, Cake's
  generating the 35b914b05db99937e255f0eaebd3ac89f804a1cc, while the
  sha1() function generates the
  80980fcaf2ab3f243874695f57b2ed065d8e67e4 hash for the stefano
  string.

  Am I doing something wrong?

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

 --
 Regards,
 Zaky Katalan-Ezra
 QA Administratorwww.IGeneriX.com
 Sites.IGeneriX.com
 054-7762312

 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


Problem with Auth Component hashes

2010-04-18 Thread Stefano Martins
Hello folks,

As I was studying CakePHP and the Auth Component, I've found out that
it's not using sha1 hashes - or at least it doesn't seems to - by
default. I had to manually set it to use md5 hashes, following the
instructions given by the Cookbook. For the string stefano, Cake's
generating the 35b914b05db99937e255f0eaebd3ac89f804a1cc, while the
sha1() function generates the
80980fcaf2ab3f243874695f57b2ed065d8e67e4 hash for the stefano
string.

Am I doing something wrong?

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: Problem with Auth Component hashes

2010-04-18 Thread John Andersen
It is probably related to the salt value in the configuration that
CakePHP is using!
Which is also why I get yet another sha1 hash for stefano in my
application :)
Enjoy,
   John

On Apr 18, 6:43 pm, Stefano Martins xstefa...@gmail.com wrote:
 Hello folks,

 As I was studying CakePHP and the Auth Component, I've found out that
 it's not using sha1 hashes - or at least it doesn't seems to - by
 default. I had to manually set it to use md5 hashes, following the
 instructions given by the Cookbook. For the string stefano, Cake's
 generating the 35b914b05db99937e255f0eaebd3ac89f804a1cc, while the
 sha1() function generates the
 80980fcaf2ab3f243874695f57b2ed065d8e67e4 hash for the stefano
 string.

 Am I doing something wrong?

 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: Problem with Auth Component hashes

2010-04-18 Thread Zaky Katalan-Ezra
 I think the Auth uses a salt.

On Sun, Apr 18, 2010 at 6:43 PM, Stefano Martins xstefa...@gmail.comwrote:

 Hello folks,

 As I was studying CakePHP and the Auth Component, I've found out that
 it's not using sha1 hashes - or at least it doesn't seems to - by
 default. I had to manually set it to use md5 hashes, following the
 instructions given by the Cookbook. For the string stefano, Cake's
 generating the 35b914b05db99937e255f0eaebd3ac89f804a1cc, while the
 sha1() function generates the
 80980fcaf2ab3f243874695f57b2ed065d8e67e4 hash for the stefano
 string.

 Am I doing something wrong?

 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




-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

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: Problem with auth component

2008-12-31 Thread j0n4s.h4rtm...@googlemail.com

if I understood the thread opener he wants to have an automagical
redirect to the login page after x min of inactivity by the user where
x is the SessionTimeout.
If you want that, I do not think CakePHP does it. Typo3 for instance
does that (and it is very annoying being a developer to have that
feature enabled because it popups windows all over the place).

How you could do it manually:
- Set / Refresh a specific cookie everytime the user does an action
- Have a Javascript/Ajax method that starts counting down after a page
was loaded until SessionTimeout should be reached. Do an Ajax call to
see if the session is still available. The user could have navigated
on other tabs tough, there he might have written the cookie to a newer
date. Fetch that cookie to your js and start counting again.

Do not forget: this relys on javascript that can do ajax calls
(xmlhttprequest) and cookies being enabled on the useragent side.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with auth component

2008-12-30 Thread vikas

hi
I have used auth component in login page. so i havent used session
because Its automatic in the Auth component.

now the problem is after login by valid user, if user will remain idle
for few minutes it will automatically loggedout, thats ok.
but after automatic logged out he still stays on the same page he was
lastly visited..

I cant understand what is the problem..

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



Re: Problem with auth component

2008-12-30 Thread WebbedIT

Have you set Auth to be used across all controllers?  If so Auth by
default will not allow access to any controller/action unless there is
an authorised user.  If they are not authorised, Auth will redirect
them to '/app/User/login'.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with auth component

2008-12-30 Thread vikas

ya I have set Auth to be used across all controllers. It is ok that
only authorised user can access that controller..thats not problem for
me.
but the problem is that loggedin user automatically loggedout if he
remains idle for few minutes...(I have mentioned this problem before
also..), and he stays on the same page he lastly stand.. he is not
redirected to login page after automatically loggedout..
I need solution for this problem..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with auth component

2008-12-30 Thread vikas

and ya i have to clerify that i have written this line in
'app_controller' file:
*
var $components = array('Auth');


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



Re: Problem with auth component

2008-12-30 Thread gearvOsh

What does your AppController beforeFilter() look like?

http://www.milesj.me/blog/read/5/using-cakephps-auth-component/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Security problem on Auth component when using XMLHttpRequest via POST (AJAX)

2008-12-22 Thread Nic

Hello! first at all, thanks for your attention!

I have a very weird problem, this is it: I have a Javascript file
(AJAX) that is sending a XMLHttpRequest via POST to a cakephp-
controller with has the Auth component implemented and a beforeFilter
function too; but when the request is made via AJAX the Auth component
in the controller doesn't handle the redirect to the loging page, thus
I can conclude that the Auth component doesn't work properly. This is
the code:

JAVASCRIPT:
html
head
titleAn Ajax demo/title
script language = javascript
var getVars =  _method=POSTdata[Articulo][user_id]=1;
var XMLHttpRequestObject = new XMLHttpRequest();
function getData(){
if(XMLHttpRequestObject) {
XMLHttpRequestObject.open(POST, '/articulosXml/add/', true);
XMLHttpRequestObject.setRequestHeader(Content-Type, 
application/x-
www-form-urlencoded; charset=UTF-8);
XMLHttpRequestObject.setRequestHeader(X-Requested-With,
XMLHttpRequest);
XMLHttpRequestObject.send(getVars);
}
}
/script
/head
body
H1An Ajax demo/H1
form
  input type = button value = Fetch the message
onclick = getData('targetDiv')
/form
/body
/html

CAKEPHP CONTROLER:
?php
class ArticulosXmlController extends AppController {

var $name = 'ArticulosXml';
var $uses = array('Articulo');
var $autoRender = false;
var $components = array('Auth');

function beforeFilter() {
$this-Auth-loginAction = array
('controller'='users','action'='login');
$this-Auth-allow('index');
}

function index() {
Configure::write('debug', '0');
$this-Articulo-recursive = 0;
$this-set('articulos', $this-paginate());
$this-layout = 'ajax';
$this-render();
}

function add() {
$savedArtcl = false;
Configure::write('debug', '0');
if (!empty($this-data)) {
$this-layout = 'ajax';
$this-Articulo-create();
if ($this-Articulo-save($this-data)) {
$savedArtcl = true;
$this-set(compact('savedArtcl'));
$this-render();
} else {
$savedArtcl = false;
$this-set(compact('savedArtcl'));
$this-render();
}
}
}

}
?

WEIRD NOTES:
- if I access via http to http://localhost/articulosXml/add the Auth
component works fine, it makes the redirect to http://localhost/users/login
(OK)
- if I access via http to http://localhost/articulosXml/index the Auth
component woks fine, it makes the redirect to http://localhost/users/login
(OK)
- if I access via XMLHttpRequest to /articulosXml/add, the Auth
component doesn't work (WRONG)


My question again is: why the Auth component and the beforeFilter()
function doesn't work when I use a XMLHttpRequest request???. Note
that if you change POST to GET in the javascript the Auth component
works. Maybe is a BUG... who knows!!!

XMLHttpRequestObject.open(GET, '/articulosXml/add/', true); // -
WORKS FINE
XMLHttpRequestObject.open(POST, '/articulosXml/add/', true); // -
DO NOT WORK

Does anyone have a clue about what is happening?

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



Re: problem in auth component, please help

2008-09-25 Thread [EMAIL PROTECTED]

One thing I notice in your code is that you allow login. Skip that.
Auth will allow access to the login-action by itself and this will
create a conflict.




On Sep 23, 9:52 pm, Golam Kibria [EMAIL PROTECTED] wrote:
 hello i have tried authcomponent but i dont know why it is not working for me.

 i have two controller Doctors and Patients. Login methods are in
 Doctors controller.

 After hit the login form, the login form reappears with no flash/auth message.

 Doctors Controller code

  var $name = 'Doctors';
  var $components = array('Auth');

     function beforeFilter(){
         $this-Auth-userModel = 'Doctor';
         $this-Auth-fields = array('username'='email',
 'password'='password');
         $this-Auth-loginAction = array('controller' = 'Doctors',
 'action' = 'login');
         $this-Auth-loginRedirect = array('controller' = 'Patients',
 'action' = 'index');
         $this-Auth-allow('login');
         $this-Auth-authorize = 'controller';
         $this-Auth-userScope = array('Doctor.status'=1);
     }

     function isAuthorized() {
          return true;
     }
     function login(){

     }

     function logout(){
         $this-Session-setFlash('You Have been Logged Out.');
         $this-redirect($this-Auth-logout());

     }

 Patients Controller code

  var $name = 'Patients';
  var $components = array('Auth');

    function beforeFilter(){
         $this-Auth-userModel = 'Doctor';
         $this-Auth-fields = array('username'='email',
 'password'='password');
         $this-Auth-loginAction = array('controller' = 'Doctors',
 'action' = 'login');
         $this-Auth-loginRedirect = array('controller' = 'Patients',
 'action' = 'index');
         $this-Auth-allow('login');
         $this-Auth-authorize = 'controller';
         $this-Auth-userScope = array('Doctor.status'=1);
     }

     function isAuthorized() {
          return true;
     }

 anyone please help me

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



Re: problem in auth component, please help

2008-09-25 Thread [EMAIL PROTECTED]

thanks martin.

but when i changed controller name from Patients to patients and
Doctors to doctors, it works.

do i always need to name controller in lowercase?

thanks.

On Sep 25, 1:25 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 One thing I notice in your code is that you allow login. Skip that.
 Auth will allow access to the login-action by itself and this will
 create a conflict.

 On Sep 23, 9:52 pm, Golam Kibria [EMAIL PROTECTED] wrote:

  hello i have tried authcomponent but i dont know why it is not working for 
  me.

  i have two controller Doctors and Patients. Login methods are in
  Doctors controller.

  After hit the login form, the login form reappears with no flash/auth 
  message.

  Doctors Controller code

   var $name = 'Doctors';
   var $components = array('Auth');

      function beforeFilter(){
          $this-Auth-userModel = 'Doctor';
          $this-Auth-fields = array('username'='email',
  'password'='password');
          $this-Auth-loginAction = array('controller' = 'Doctors',
  'action' = 'login');
          $this-Auth-loginRedirect = array('controller' = 'Patients',
  'action' = 'index');
          $this-Auth-allow('login');
          $this-Auth-authorize = 'controller';
          $this-Auth-userScope = array('Doctor.status'=1);
      }

      function isAuthorized() {
           return true;
      }
      function login(){

      }

      function logout(){
          $this-Session-setFlash('You Have been Logged Out.');
          $this-redirect($this-Auth-logout());

      }

  Patients Controller code

   var $name = 'Patients';
   var $components = array('Auth');

     function beforeFilter(){
          $this-Auth-userModel = 'Doctor';
          $this-Auth-fields = array('username'='email',
  'password'='password');
          $this-Auth-loginAction = array('controller' = 'Doctors',
  'action' = 'login');
          $this-Auth-loginRedirect = array('controller' = 'Patients',
  'action' = 'index');
          $this-Auth-allow('login');
          $this-Auth-authorize = 'controller';
          $this-Auth-userScope = array('Doctor.status'=1);
      }

      function isAuthorized() {
           return true;
      }

  anyone please help me

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



Re: problem in auth component, please help

2008-09-25 Thread [EMAIL PROTECTED]

Yes, when referring to them as urls they should be lowercase as shown
here:
http://book.cakephp.org/view/391/loginAction

It may be confusing at first but it will soon become second nature.
/Martin

On Sep 25, 1:32 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 thanks martin.

 but when i changed controller name from Patients to patients and
 Doctors to doctors, it works.

 do i always need to name controller in lowercase?

 thanks.

 On Sep 25, 1:25 pm, [EMAIL PROTECTED]

 [EMAIL PROTECTED] wrote:
  One thing I notice in your code is that you allow login. Skip that.
  Auth will allow access to the login-action by itself and this will
  create a conflict.

  On Sep 23, 9:52 pm, Golam Kibria [EMAIL PROTECTED] wrote:

   hello i have tried authcomponent but i dont know why it is not working 
   for me.

   i have two controller Doctors and Patients. Login methods are in
   Doctors controller.

   After hit the login form, the login form reappears with no flash/auth 
   message.

   Doctors Controller code

    var $name = 'Doctors';
    var $components = array('Auth');

       function beforeFilter(){
           $this-Auth-userModel = 'Doctor';
           $this-Auth-fields = array('username'='email',
   'password'='password');
           $this-Auth-loginAction = array('controller' = 'Doctors',
   'action' = 'login');
           $this-Auth-loginRedirect = array('controller' = 'Patients',
   'action' = 'index');
           $this-Auth-allow('login');
           $this-Auth-authorize = 'controller';
           $this-Auth-userScope = array('Doctor.status'=1);
       }

       function isAuthorized() {
            return true;
       }
       function login(){

       }

       function logout(){
           $this-Session-setFlash('You Have been Logged Out.');
           $this-redirect($this-Auth-logout());

       }

   Patients Controller code

    var $name = 'Patients';
    var $components = array('Auth');

      function beforeFilter(){
           $this-Auth-userModel = 'Doctor';
           $this-Auth-fields = array('username'='email',
   'password'='password');
           $this-Auth-loginAction = array('controller' = 'Doctors',
   'action' = 'login');
           $this-Auth-loginRedirect = array('controller' = 'Patients',
   'action' = 'index');
           $this-Auth-allow('login');
           $this-Auth-authorize = 'controller';
           $this-Auth-userScope = array('Doctor.status'=1);
       }

       function isAuthorized() {
            return true;
       }

   anyone please help me

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



Re: problem in auth component, please help

2008-09-24 Thread nachopitt

I know that AppController::beforeFiler() is a better place to put the
Auth Component configuration to share the same configuration between
all controllers and have all protected by Auth.

On Sep 23, 2:52 pm, Golam Kibria [EMAIL PROTECTED] wrote:
 hello i have tried authcomponent but i dont know why it is not working for me.

 i have two controller Doctors and Patients. Login methods are in
 Doctors controller.

 After hit the login form, the login form reappears with no flash/auth message.

 Doctors Controller code

  var $name = 'Doctors';
  var $components = array('Auth');

     function beforeFilter(){
         $this-Auth-userModel = 'Doctor';
         $this-Auth-fields = array('username'='email',
 'password'='password');
         $this-Auth-loginAction = array('controller' = 'Doctors',
 'action' = 'login');
         $this-Auth-loginRedirect = array('controller' = 'Patients',
 'action' = 'index');
         $this-Auth-allow('login');
         $this-Auth-authorize = 'controller';
         $this-Auth-userScope = array('Doctor.status'=1);
     }

     function isAuthorized() {
          return true;
     }
     function login(){

     }

     function logout(){
         $this-Session-setFlash('You Have been Logged Out.');
         $this-redirect($this-Auth-logout());

     }

 Patients Controller code

  var $name = 'Patients';
  var $components = array('Auth');

    function beforeFilter(){
         $this-Auth-userModel = 'Doctor';
         $this-Auth-fields = array('username'='email',
 'password'='password');
         $this-Auth-loginAction = array('controller' = 'Doctors',
 'action' = 'login');
         $this-Auth-loginRedirect = array('controller' = 'Patients',
 'action' = 'index');
         $this-Auth-allow('login');
         $this-Auth-authorize = 'controller';
         $this-Auth-userScope = array('Doctor.status'=1);
     }

     function isAuthorized() {
          return true;
     }

 anyone please help me

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



problem in auth component, please help

2008-09-23 Thread Golam Kibria

hello i have tried authcomponent but i dont know why it is not working for me.

i have two controller Doctors and Patients. Login methods are in
Doctors controller.

After hit the login form, the login form reappears with no flash/auth message.

Doctors Controller code

 var $name = 'Doctors';
 var $components = array('Auth');

function beforeFilter(){
$this-Auth-userModel = 'Doctor';
$this-Auth-fields = array('username'='email',
'password'='password');
$this-Auth-loginAction = array('controller' = 'Doctors',
'action' = 'login');
$this-Auth-loginRedirect = array('controller' = 'Patients',
'action' = 'index');
$this-Auth-allow('login');
$this-Auth-authorize = 'controller';
$this-Auth-userScope = array('Doctor.status'=1);
}

function isAuthorized() {
 return true;
}
function login(){

}

function logout(){
$this-Session-setFlash('You Have been Logged Out.');
$this-redirect($this-Auth-logout());

}


Patients Controller code

 var $name = 'Patients';
 var $components = array('Auth');

   function beforeFilter(){
$this-Auth-userModel = 'Doctor';
$this-Auth-fields = array('username'='email',
'password'='password');
$this-Auth-loginAction = array('controller' = 'Doctors',
'action' = 'login');
$this-Auth-loginRedirect = array('controller' = 'Patients',
'action' = 'index');
$this-Auth-allow('login');
$this-Auth-authorize = 'controller';
$this-Auth-userScope = array('Doctor.status'=1);
}

function isAuthorized() {
 return true;
}



anyone please help me

thanks

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



Problem with auth component

2008-07-26 Thread Intellex

Hey i am having a problem ... every thing is going fine except the
redirect url ... Cake is saving the referer address in Session
Auth.redirect but its not accurate ... its not giving correct url of
controller ... instead its just giving an s in place of controller
name ... example ... when i try to access localhost/recipe/recipes/add
(recipes is controller) it moves to localhost/recipe/users/login after
successfull authentication it redirects me to localhost/recipe/s/
add ... I am clueless why cake isnt getting correct url ... plz help ?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---