Likes: 0
Results 1 to 1 of 1
Thread: [FREE] IPB 4 Fusion CMS Bridge
-
10-02-16, 03:00 PM #1
[FREE] IPB 4 Fusion CMS Bridge
Register to remove this adPHP Code:<?php
class Ipb4 extends Plugin
{
private $username;
private $password;
private $email;
private $db;
public function register($username, $password, $email)
{
$this->username = $username;
$this->password = $password;
$this->email = $email;
$this->db = $this->CI->load->database($this->CI->config->item('bridge'), TRUE);
$this->process();
}
private function process()
{
$salt = $this->generatePasswordSalt(5);
$salt = str_replace( '\\', "\\\\", $salt );
$password = $this->encryptPassword($salt);
$key = $this->generateAutoLoginKey();
$expire = time() + 86400;
$this->db->query("INSERT INTO ".$this->CI->config->item('forum_table_prefix').
"core_members(`name`, `member_group_id`, `email`, `joined`, `member_login_key`, `members_pass_hash`, `members_pass_salt`, `member_login_key_expire`, `members_seo_name`)
VALUES(?, '3', ?, ?, ?, ?, ?, ?, ?)",
array($this->username, $this->email, time(), $key, $password, $salt, $expire, $this->username));
}
private function encryptPassword($salt)
{
return md5( md5($salt) . md5( $this->password ) );
}
private function generateAutoLoginKey( $len=60 )
{
$pass = $this->generatePasswordSalt( $len );
return md5($pass);
}
private function generatePasswordSalt($len=5)
{
$salt = '';
for ( $i = 0; $i < $len; $i++ )
{
$num = mt_rand(33, 126);
if ( $num == '92' )
{
$num = 93;
}
$salt .= chr( $num );
}
return $salt;
}
}
After done this go to this file : /var/www/html/application/modules/register/config/bridge.php (Or you path to the plugins folder) and enter your forum config details ...
PHP Code:<?php
$config['use_forum_bridge'] = false;
/**
* Default support:
* phpbb, ipb, smf, mybb
*/
$config['forum_bridge'] = "phpbb, ipb, ipb4, smf or mybb";
$config['forum_table_prefix'] = "phpbb_";
$config['bridge']['hostname'] = "127.0.0.1";
$config['bridge']['username'] = "root";
$config['bridge']['password'] = "";
$config['bridge']['database'] = "phpbb";
$config['bridge']['dbdriver'] = "mysqli";
$config['bridge']['dbprefix'] = "";
$config['bridge']['pconnect'] = TRUE;
$config['bridge']['db_debug'] = TRUE;
$config['bridge']['cache_on'] = FALSE;
$config['bridge']['cachedir'] = "";
$config['bridge']['char_set'] = "utf8";
$config['bridge']['dbcollat'] = "utf8_general_ci";
$config['bridge']['swap_pre'] = "";
$config['bridge']['autoinit'] = TRUE;
$config['bridge']['stricton'] = FALSE;Originally Posted by CoC
Originally posted by CoC
› See More: [FREE] IPB 4 Fusion CMS Bridge