8
i am trying to change te fbconnect to allow create a user as it is logged in fbconnect, i am getting error while traying to create,
Hope that someone could help me to see where is the error so i can continue with it.
What i want is to create like,
/modules/profile/admin/user.php
but that it would be created automatically, with for example random pass and mail.
I am getting the error message _AM_CNRNU
in modules/fbconnect/index.php
if ($user->fbc_is_facebook_user()) {
echo "
uid " . $user->fbc_uid;
echo "
User " . $user->fbc_name ;
echo "
Name " . $user->fbc_first_name ;
echo "
Surname " . $user->fbc_last_name ;
$uid = $user->fbc_uid;
$username = $user->fbc_name;
$name = $user->fbc_name;
$password = "aitor";
$pass2 = "aitor";
$email = "usuario@mail.com";
if (!$username || !$email || !$password) {
$adduser_errormsg = _AM_YMCACF;
} else {
$member_handler =& xoops_gethandler('member');
// make sure the username doesnt exist yet
if ($member_handler->getUserCount(new Criteria('uname', $uid)) > 0) {
$adduser_errormsg = 'User name '.$uid.' already exists';
} else {
$newuser =& $member_handler->createUser();
if (isset($user_viewemail)) {
$newuser->setVar("user_viewemail",$user_viewemail);
}
if (isset($attachsig)) {
$newuser->setVar("attachsig",$attachsig);
}
$newuser->setVar("name", $username);
$newuser->setVar("uname", $uid);
$newuser->setVar("email", $email);
$newuser->setVar("url", formatURL($url));
$newuser->setVar("user_avatar",'blank.gif');
$newuser->setVar('user_regdate', time());
$newuser->setVar("user_icq", $user_icq);
$newuser->setVar("user_from", $user_from);
$newuser->setVar("user_sig", $user_sig);
$newuser->setVar("user_aim", $user_aim);
$newuser->setVar("user_yim", $user_yim);
$newuser->setVar("user_msnm", $user_msnm);
if ($pass2 != "") {
if ( $password != $pass2 ) {
xoops_cp_header();
echo "" . _AM_STNPDNM . "";
xoops_cp_footer();
exit();
}
$newuser->setVar("pass", md5($password));
}
$newuser->setVar("timezone_offset", $timezone_offset);
$newuser->setVar("uorder", $uorder);
$newuser->setVar("umode", $umode);
// RMV-NOTIFY
$newuser->setVar("notify_method", $notify_method);
$newuser->setVar("notify_mode", $notify_mode);
$newuser->setVar("bio", $bio);
$newuser->setVar("rank", $rank);
$newuser->setVar("level", 1);
$newuser->setVar("user_occ", $user_occ);
$newuser->setVar("user_intrest", $user_intrest);
$newuser->setVar('user_mailok', $user_mailok);
if (!$member_handler->insertUser($newuser)) {
$adduser_errormsg = _AM_CNRNU;
} else {
$groups_failed = array();
foreach ($groups as $group) {
if (!$member_handler->addUserToGroup($group, $newuser->getVar('uid'))) {
$groups_failed[] = $group;
}
}
if (!empty($groups_failed)) {
$group_names = $member_handler->getGroupList(new Criteria('groupid', "(".implode(", ", $groups_failed).")", 'IN'));
$adduser_errormsg = sprintf(_AM_CNRNU2, implode(", ", $group_names));
} else {
xoops_load('XoopsUserUtility');
XoopsUserUtility::sendWelcome($newuser);
redirect_header("admin.php?fct=users", 1, _AM_DBUPDATED);
exit();
}
}
}
}
echo "
" . $adduser_errormsg . "
";
the error message is
define("_AM_CNRNU","Could not register new user.");