Advertisement
dcomicboy

OneIPOneAccount

Dec 28th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
  3. <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
  4. <name>One Account One Ip</name>
  5. <id>ips_doug:OneAccountOneIp</id>
  6. <version>1.0</version>
  7. <file name="$sourcedir/Register.php">
  8. <operation>
  9. <search position="replace"><![CDATA[// Begin the registration process.
  10. function Register($reg_errors = array())
  11. {
  12. global $txt, $boarddir, $context, $settings, $modSettings, $user_info;
  13. global $language, $scripturl, $smcFunc, $sourcedir, $smcFunc, $cur_profile;]]></search>
  14. <add><![CDATA[// Begin the registration process.
  15. function Register($reg_errors = array())
  16. {
  17. global $txt, $boarddir, $context, $settings, $modSettings, $user_info;
  18. global $language, $scripturl, $smcFunc, $sourcedir, $smcFunc, $cur_profile;
  19.  
  20. //Prevent users from registering more than account from the same ip
  21. $request = $smcFunc['db_query']('', '
  22. SELECT COUNT(*)
  23. FROM {db_prefix}members
  24. WHERE member_ip = {string:member_ip}
  25. AND member_ip2 = {string:member_ip2}',
  26. array(
  27. 'member_ip' => $_SERVER['REMOTE_ADDR'],
  28. 'member_ip2' => $_SERVER['REMOTE_ADDR'],
  29. )
  30. );
  31.  
  32. list ($exists) = $smcFunc['db_fetch_row']($request);
  33. $smcFunc['db_free_result']($request);
  34.  
  35. if (!empty($exists))
  36. fatal_lang_error('ip_already_registered_once', false, array($_SERVER['REMOTE_ADDR']));]]></add>
  37. </operation>
  38. </file>
  39. <file name="$languagedir/Modifications.english.php">
  40. <operation>
  41. <search position="end" />
  42. <add><![CDATA[$txt['ip_already_registered_once'] = 'According to our database records there is already an account registered from this ip: %s.';]]></add>
  43. </operation>
  44. </file>
  45. <file name="$languagedir/Modifications.english-utf8.php" error="skip">
  46. <operation>
  47. <search position="end" />
  48. <add><![CDATA[$txt['ip_already_registered_once'] = 'According to our database records there is already an account registered from this ip: %s.';]]></add>
  49. </operation>
  50. </file>
  51. </modification>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement