tags:

views:

86

answers:

2

Hello everyone,

Is it possible in cakephp that a user be registered automatically with a predefined set of inputs (username, password and all that...) provided by the programmer.?

I want to register a user automatically whenever he tries to enter/access a member's restricted area.

Please help me achieve this functionality.

Using cakephp v1.2, xampp

Thanks...

+1  A: 

This sounds weird. Why not just prompt for a username and password, then check to see if the user exists. If the user exists, try to authenticate them. If not, create an account with the credentials provided. Would that not work?

inkedmn
actually it is also a facebook application, and I don't want that the visitors of my facebook application are prompted to register separately for this app, that is why I needed to register a new account whenever a new user access the member's restricted area..I hope I made myself clear,.. :-)
Gaurav Sharma
In that case, I'd use Facebook Connect.
inkedmn
yes, :-) actually the below trick worked too but not as that efficiently as facebook connect. Found a very nice tutorial (http://cutfromthenorth.com/integrating-facebook-connect-with-cakephps-auth-component/comment-page-1/#comment-157) on integrating facebook connect with the auth component of cakephp.
Gaurav Sharma
+2  A: 

:)

Found the answer, :)

I simply assigned

'$this->data'

some values by myself like this

$this->data['User']['password'] = "test";
$this->data['User']['email'] = "[email protected]";
$this->data['User']['password'] = "Registered";

and then the add action did it's work accordingly..

Gaurav Sharma