Advertisement
Guest User

Untitled

a guest
May 26th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. Hello
  2. here's a quick tutorial that will make easier the management of user accounts between phpBB3 and arcemu
  3.  
  4. Operation of the script:
  5.  
  6. When a new user will create an account on your phpbb3 it'll automatically create your database but will be deactivated arcemu.
  7. To activate the new user must identify on your phpbb3 (this method was chosen for reasons of securitées).
  8. If your users change their password or email phpbb3 shalt update your database arcemu.
  9.  
  10. -------------------------------------------------- ---------------------------------------------
  11.  
  12. Prerequisite:
  13.  
  14. Utilsier php5 minimum charset php must be UTF-8.
  15. Your web server (tested on Apache) should also have the charset to UTF-8.
  16.  
  17. Your phpbb3 must:
  18. Use the account validation email.
  19. The administrator logs must be enabled.
  20. Your users should not change the nickname does not support script
  21.  
  22. -------------------------------------------------- ---------------------------------------------
  23.  
  24. Open:
  25. phpbb3/config.php
  26.  
  27. Then look for:
  28. $ Load_extensions ='';
  29.  
  30. After add
  31. $ Sql_server_host = "adresse_ip_de_votre_serveur_sql";
  32. $ Sql_server_user = "login_de_votre_serveur_sql";
  33. $ Sql_server_pass = "password_de_votre_serveur_sql";
  34.  
  35.  
  36. Close config.php
  37.  
  38. -------------------------------------------------- -----------------------
  39.  
  40. Open:
  41. phpbb3/includes/functions.php
  42.  
  43.  
  44.  
  45. Search:
  46. Reapply_sid $ redirect = ($ redirect);
  47.  
  48. After add
  49. if ($ user-> data ['user_lastvisit'] == 0)
  50. (
  51. Server_userlogin $ = $ user-> data ['username'];
  52. $ Sql = "UPDATE accounts SET banned = '0 'WHERE login =' $ server_userlogin";
  53. $ Result = mysql_query ($ sql, sql_server_connect (realm));
  54. )
  55.  
  56.  
  57. UPDATE: watched this line $ result = mysql_query ($ sql, sql_server_connect ('realm'));
  58. REALM by replacing the name of your sql database containing the accounts
  59.  
  60. Then look at the very end:
  61. ?>
  62.  
  63. Before add:
  64. sql_server_connect function ($ sql_server_db) (
  65.  
  66. global $ sql_server_host, $ sql_server_user, $ sql_server_pass;
  67.  
  68. $ Sql_cont = mysql_connect ($ sql_server_host, $ sql_server_user, $ sql_server_pass) or die (mysql_error ());
  69. mysql_select_db ($ sql_server_db, $ sql_cont) or die (mysql_error ());
  70.  
  71. return $ sql_cont;
  72. )
  73.  
  74.  
  75. Close functions.php
  76.  
  77. -------------------------------------------------- -----------------------
  78.  
  79. Open:
  80. phpbb3/includes/ucp/ucp_register.php
  81.  
  82. Then look for:
  83. $ User_id = user_add ($ user_row, $ cp_data);
  84.  
  85. After add
  86. Server_userlogin $ = $ data ['username'];
  87. Server_userpass $ = $ data ['new_password'];
  88. $ Server_userencodpass = sha1 (strtoupper ($ server_userlogin ).":". strtoupper ($ server_userpass));
  89. Server_usermail $ = $ data ['email'];
  90. $ = $ Server_userip user_row ['user_ip'];
  91.  
  92. $ Sql = "INSERT INTO accounts (login, password, encrypted_password, gm, banned, email, flags, lastip)
  93. VALUES ('$ server_userlogin', '$ server_userpass',' $ server_userencodpass', '0 ', '1', '$ server_usermail', '8 ',' $ server_userip ') ";
  94.  
  95. $ Result = mysql_connect ($ sql, sql_server_connect (realm));
  96.  
  97.  
  98. UPDATE: watched this line $ result = mysql_query ($ sql, sql_server_connect ('realm'));
  99. REALM by replacing the name of your sql database containing the accounts
  100.  
  101. Close ucp_register.php
  102.  
  103. -------------------------------------------------- -----------------------
  104.  
  105. Open:
  106. phpbb3/includes/ucp/ucp_profile.php
  107.  
  108. Then look for:
  109. add_log ('user', $ user-> data ['user_id'], 'LOG_USER_NEW_PASSWORD', $ data ['username']);
  110.  
  111. After add
  112. Server_userlogin $ = $ data ['username'];
  113. Server_userpass $ = $ data ['new_password'];
  114. $ Server_userencodpass = sha1 (strtoupper ($ server_userlogin ).":". strtoupper ($ server_userpass));
  115.  
  116. $ Sql = "UPDATE accounts SET password = '$ server_userpass' encrypted_password =' $ server_userencodpass' WHERE login = '$ server_userlogin";
  117. $ Result = mysql_query ($ sql, sql_server_connect ('realm'));
  118.  
  119.  
  120. UPDATE: watched this line $ result = mysql_query ($ sql, sql_server_connect ('realm'));
  121. REALM by replacing the name of your sql database containing the accounts
  122.  
  123. Then look for:
  124. add_log ('user', $ user-> data ['user_id'], 'LOG_USER_UPDATE_EMAIL', $ data ['username'], $ user-> data ['user_email'], $ data ['email']);
  125.  
  126. After add
  127. Server_userlogin $ = $ data ['username'];
  128. Server_usermail $ = $ data ['email'];
  129. $ Sql = "UPDATE accounts SET email = '$ server_usermail' WHERE login = '$ server_userlogin";
  130. $ Result = mysql_query ($ sql, sql_server_connect ('realm'));
  131.  
  132.  
  133. UPDATE: watched this line $ result = mysql_query ($ sql, sql_server_connect ('realm'));
  134. REALM by replacing the name of your sql database containing the accounts
  135.  
  136. Close ucp_profile.php
  137.  
  138. -------------------------------------------------- -----------------------
  139.  
  140. Voila you're done.
  141. In case of problems post or other errors.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement