Author Topic: PHPBB3 Auto-registration  (Read 3845 times)

JohnHarper

  • Active Member
  • ***
  • Posts: 79
  • Karma: +6/-0
    • SocialGratis.com
PHPBB3 Auto-registration
« on: January 20, 2015, 03:35:45 PM »
I decided to write a an auto-registration mod for PHPBB3. It is very simple and easy to update. I am sure others can help make it better and more secure.

Add this at the end of /events/processors/join.php

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'YOUR ROOT PATH HERE';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);

// Start session management
      $user->session_begin();
      $auth->acl($user->data);
      $user->setup();   

$user_row = array(
        'username'                      => $_POST['user'],
        'user_password'                 => $_POST['pass'],
        'user_email'                    => $_POST['email2'],
        'group_id'                      => 2,
        'user_timezone'                 => 1,
        'user_lang'                     => "en",
        'user_type'                     => 0,
        'user_actkey'                   => "",
        'user_ip'                       => "",
        'user_regdate'                  => time(),
        'user_inactive_reason'          => 0,
        'user_inactive_time'            => 0,
);
user_add($user_row, $cp_data);


Make sure errors are turned off in PHPBB3, or else it will halt the script for using POST.




flyer5

  • Prime Member
  • ****
  • Posts: 107
  • Karma: +4/-0
    • North East Nudists
Re: PHPBB3 Auto-registration
« Reply #1 on: February 02, 2015, 04:13:56 AM »
Quote
Make sure errors are turned off in PHPBB3, or else it will halt the script for using POST.

Where do I find that? All I can find is
Quote
Validate Referrer:
If enabled, the referrer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.

Is that it?
Cheers
F5

JohnHarper

  • Active Member
  • ***
  • Posts: 79
  • Karma: +6/-0
    • SocialGratis.com
Re: PHPBB3 Auto-registration
« Reply #2 on: February 05, 2015, 02:32:38 PM »
The latest versions of PHPBB3 disables the use of superglobals. You can change it in the config.php file of phpbb3, use error_reporting is "0", or even better, I think there are alternatives to the use of Superglobals such as POST provided in documentation.

Using superglobals throws an error and halts the script unless you make the changes above.