thank you again but i think that some things were missing again.
maybe the files inclusions are missing somewhere but i could find the good order
here is my working code :
[code:1]
function registerCbUser($post) {
global $_CB_framework, $_CB_database, $ueConfig;
if ( ! file_exists( JPATH_BASE. '/administrator/components/com_comprofiler/plugin.foundation.php')
|| ! file_exists( JPATH_BASE. '/administrator/components/com_comprofiler/plugin.class.php')
|| ! file_exists( JPATH_BASE. '/administrator/components/com_comprofiler/library/cb/cb.database.php')
|| ! file_exists( JPATH_BASE. '/administrator/components/com_comprofiler/comprofiler.class.php')) {
return 'could not find some files';
}
include_once( JPATH_BASE . '/administrator/components/com_comprofiler/plugin.foundation.php' );
include_once( JPATH_BASE . '/administrator/components/com_comprofiler/plugin.class.php' );
include_once( JPATH_BASE . '/administrator/components/com_comprofiler/library/cb/cb.database.php' );
include_once( JPATH_BASE . '/administrator/components/com_comprofiler/comprofiler.class.php' );
$row = new moscomprofilerUser( $_CB_database );
$row->usertype = $_CB_framework->getCfg( 'new_usertype' );
$row->gid = $_CB_framework->acl->get_group_id( $row->usertype, 'ARO' );
$row->confirmed = 1;
$row->approved = 1;
$row->block = 0;
$row->sendEmail = 0;
$row->registerDate = date( 'Y-m-d H:i:«»s', $_CB_framework->now() );
$row->name = $post;
$row->firstname = $post;
$row->lastname = $post;
$row->username = $post;
$row->email = $post;
$row->password = cbHashPassword($post);
if ($row->store()) {
return 'saved';
}
else {
return 'error';
}
}
[/code:1]
Post edited by: wene, at: 2009/06/12 07:15