CreateUser probelm

Arturo Hernández

Joined: 2009-08-16
Posts: 3
Posted: Sun, 2009-08-16 13:28

Hi, Im new with this and i have several problems with the createuser function, i hope anyone can help me.
i use phpcake in a page, and i want to create the user since there.
firts i have this in my controler folder

Class GalleryComponent extends Object{

function startup(&$controller)
{
require_once('/var/www/galeria/embed.php');
//require_once('../../../galeria/embed.php');

$ret = GalleryEmbed::init(array('fullInit' => true));
if ($ret) {
$data = $ret->getAsHtml();
return false;
}
return true;
}

function SetUser($extUserId, $parametros){
$ret = GalleryEmbed::createUser($extUserId, $parametros);
if ($ret) {
print "An error occurred during the on-the-fly user creation <br>";
print $ret->getAsHtml();
exit;
}
}
}

this function call the gallery component

function _SetUser($id){
$this->Inquilino->id = $id;
$User = $this->Inquilino->read();

$Options =array('username' => $User['Inquilino']['Email'],
'email' => $User['Inquilino']['Email'],
'fullname' => $User['Inquilino']['Nombre'],
'language' => 'es',
'password' => $User['Inquilino']['Password']);
//$this->Gallery->SetUser($id,$Options);
$this->Gallery->setUserNew($id,$Options);
}

and this call the _SetUser function

function Activar($id){
$this->_SetUser($id);
$this->_EnviaMail($id, 'aceptado');
$this->Session->setFlash('El inquilino con el id '.$id.' ha sido aceptado. ');
$this->redirect(array('action'=>'view'));
//}

}

Idont have errors and all seams work well but the class dont create any users.

Tks for the time.

 
Arturo Hernández

Joined: 2009-08-16
Posts: 3
Posted: Sun, 2009-08-16 14:24

I didt!!!

this is my new GalleryComponent
function startup(&$controller)
{
require_once('/var/www/galeria/embed.php');
$ret = GalleryEmbed::init( array ('g2Uri'=>'http://localhost/galeria/main.php', 'embedUri'=>$URLembebed, 'fullInit'=>'false'));
if ($ret) {
print 'G2 init error: '.$ret->getAsHtml();
}

function SetUser($extUserId, $parametros){
$g2data = GalleryEmbed::handleRequest();
if ($g2data['isDone']) {
exit;
}
$ret = GalleryEmbed::createUser($extUserId, $parametros);
if ($ret) {
print "An error occurred during the on-the-fly user creation <br>";
print $ret->getAsHtml();
exit;
}
GalleryEmbed::done();
}

 
Arturo Hernández

Joined: 2009-08-16
Posts: 3
Posted: Sun, 2009-08-16 14:38

i found the answer here http://www.flashyourweb.com/