Hello,
i´am completly new to XenForo, moved from an not activated IPB license.
I want to use thw XenForo in an Intranet-Web with its own user-database. From other AddOn´s i copy & pasted the following code (and adapted for me). But it raises an error!
Do you have any ideas?
Thank you,
Eric
Error raised:
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'XenForo_DataWriter_Helper_Language::verifyLanguageId' was given in /www/docs/kd.auto-partner.net/forum/library/XenForo/DataWriter.php on line 970
i´am completly new to XenForo, moved from an not activated IPB license.
I want to use thw XenForo in an Intranet-Web with its own user-database. From other AddOn´s i copy & pasted the following code (and adapted for me). But it raises an error!
Do you have any ideas?
Thank you,
Eric
PHP:
XenForo_Autoloader::getInstance()->setupAutoloader(XF_ROOT . '/library');
XenForo_Application::initialize(XF_ROOT . '/library', XF_ROOT);
XenForo_Application::set('page_start_time', TIMENOW);
XenForo_Application::disablePhpErrorHandler();
XenForo_Application::setDebugMode(true);
XenForo_Session::startPublicSession();
$GpID = '19760';
$visitor = XenForo_Visitor::getInstance();
$userModel = XenForo_Model::create('XenForo_Model_User');
$userExternalModel = XenForo_Model::create('XenForo_Model_UserExternal');
$UserInfo = $userExternalModel->getExternalAuthAssociation('pnet', $GpID);
if (!$UserInfo)
{
$data = array(
'username' => 'Demo User',
'email' => 'Demo User@domain.tdl',
'location' => 'Home',
'dob_day' => '22',
'dob_month' => '08',
'dob_year' => '1987',
'timezone' => 'Europe/Amsterdam'
);
$auth = XenForo_Authentication_Abstract::create('XenForo_Authentication_NoPassword');
$writer = XenForo_DataWriter::create('XenForo_DataWriter_User');
$options = XenForo_Application::get('options');
$writer->bulkSet($options->registrationDefaults, array('ignoreInvalidFields' => true));
$writer->bulkSet($data);
$writer->set('scheme_class', $auth->getClassName());
$writer->set('data', $auth->generate(''), 'xf_user_authenticate');
$writer->set('user_group_id', XenForo_Model_User::$defaultRegisteredGroupId);
$writer->set('language_id', XenForo_Visitor::getInstance()->get('language_id'));
$writer->advanceRegistrationUserState(false);
$writer->save();
$user = $writer->getMergedData();
$UserID = $user['user_id'];
$userExternalModel->updateExternalAuthAssociation('pnet', $GpID, $UserID);
XenForo_Model_Ip::log($UserID, 'user', $UserID, 'register');
} else {
$UserID = $UserInfo['user_id'];
}
restore_error_handler();
restore_exception_handler();
$userModel->setUserRememberCookie($UserID);
$session = XenForo_Application::get('session');
$session->changeUserId($UserID);
XenForo_Visitor::setup($UserID);
header("Location: index.php");
Error raised:
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'XenForo_DataWriter_Helper_Language::verifyLanguageId' was given in /www/docs/kd.auto-partner.net/forum/library/XenForo/DataWriter.php on line 970