Alofoxx
Member
Im trying to extend XenForo_DataWriter_User::_verifyUsername
So that when they signup on my site it checks the username against minecraft.net premium acct list.
its not working but here is what i did at the end of the function.
the goal is to add the username to the end of "http://www.minecraft.net/haspaid.jsp?user=" if its a paid acct it will return True otherwise it will be false. My name is alofoxx so it would send out http://www.minecraft.net/haspaid.jsp?user=alofoxx and returns true where as "fakename" "http://www.minecraft.net/haspaid.jsp?user=fakename" would return false and throw an error.
hope fully someone can tell me my errors in code
THANKS
So that when they signup on my site it checks the username against minecraft.net premium acct list.
its not working but here is what i did at the end of the function.
the goal is to add the username to the end of "http://www.minecraft.net/haspaid.jsp?user=" if its a paid acct it will return True otherwise it will be false. My name is alofoxx so it would send out http://www.minecraft.net/haspaid.jsp?user=alofoxx and returns true where as "fakename" "http://www.minecraft.net/haspaid.jsp?user=fakename" would return false and throw an error.
hope fully someone can tell me my errors in code
THANKS
PHP:
// compare against romanized name to help reduce confusable issues
$romanized = utf8_deaccent(utf8_romanize($username));
if ($romanized != $username)
{
$existingUser = $this->_getUserModel()->getUserByName($romanized);
if ($existingUser && $existingUser['user_id'] != $this->get('user_id'))
{
$this->error(new XenForo_Phrase('usernames_must_be_unique'), 'username');
return false;
}
}
//Alo minecraft verification
/*** 2012-01-07 BEGIN AmigoJack
Check username: has Minecraft nick paid? ***/
try
{
if( strpos( $sRes, 'true' )=== FALSE );
{
$this->error(new XenForo_Phrase('The_username_must_exist_on_Minecraft'), 'username');
return false;
}
}
catch (Exception $e) {}
//End alo code
return true;