Friday 24 November 2006 3:39:29 pm
I write a login page
On this page, I user a digital identity, that send me the informations : login, name,firstname I I have succeeds to add a user in ez, but I do not know how to add the user in the good group and with encoder his name and first name here's my script
include_once( 'lib/ezutils/classes/ezhttptool.php' );
include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );
include_once( 'kernel/common/template.php' );
include_once( 'lib/ezutils/classes/ezini.php' ); include_once( 'kernel/classes/datatypes/ezuser/ezuserloginhandler.php' );
$login = "jfsenechal";
$name = "nom"; $prenom = "toto";
$ini =& eZINI::instance();
$userClassID = $ini->variable( "UserSettings", "UserClassID" );
$userCreatorID = $ini->variable( "UserSettings", "UserCreatorID" );
$class = eZContentClass::fetch( $userClassID );
$defaultSectionID = 132;
$contentObject = $class->instantiate( $userCreatorID, $defaultSectionID );
$objectID = $contentObject->attribute( 'id' );
$userClassID = $ini->variable( "UserSettings", "UserClassID" );
$class = eZContentClass::fetch( $userClassID );
$objectID = $contentObject->attribute( 'id' );
$userId = $objectID;
$passwordLength = 8;
$user =& eZUser::create( $userId );
$password = $user->createPassword( $passwordLength );
$passwordConfirm = $password;
$user->setInformation( $userId, $login, "jf@marche.be", $password, $passwordConfirm );
$isEnabled = 1;
$userSetting =& eZUserSetting::create( $userId, $isEnabled );
$userSetting->store(); $user->store() Can You help me ? Thanks
L'informaticien est comme un petit canard:
il est calme en surface mais en dessous il brasse beaucoup d'eau pour
avancer ...!
|