8Dle

DLE 9.3 + IP.Board 3.2.1

KoCTuK 13-11-2011, 00:18 Dle 0
   DLE 9.3 + IP.Board 3.2.1

:

DLE 9.x + IP.Board 3.1.x-3.2.1 ()

:
/engine/modules/register.php


:
require_once ENGINE_DIR . '/classes/parse.class.php';


:
$ipb_dle_lan[0] = "     .";
$db_ipb_user = "";
$db_ipb_password = "";
$db_ipb_namedb = "_";
$db_ipb_local = "localhost";
$db_ipb_error = 1; // 1 -       , 0 - 
$db_prefix_ipb = "_____";
$ipb = new db;
$ipb->connect($db_ipb_user, $db_ipb_password, $db_ipb_namedb, $db_ipb_local, $db_ipb_error);


:
global $lang, $db, $banned_info, $relates_word;


:
global $lang, $db, $banned_info, $relates_word, $ipb, $ipb_dle_lan, $db_prefix_ipb;


:
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . USERPREFIX . "_users WHERE email = '$email' OR LOWER(name) REGEXP '[[:<:]]{$search_name}[[:>:]]' OR name = '$name'" );


:
$ipb_test_name = $ipb->super_query ("SELECT COUNT(*) as count FROM {$db_prefix_ipb}members where name = '".strtolower($name)."'");
if ($ipb_test_name ['count'] > 0) $stop .= $ipb_dle_lan[0];


:
$db->query( "INSERT INTO " . USERPREFIX . "_users (name, password, email, reg_date, lastdate, user_group, info, signature, favorites, xfields, logged_ip) VALUES ('$name', '$regpassword', '$email', '$add_time', '$add_time', '" . $config['reg_group'] . "', '', '', '', '', '" . $_IP . "')" );


:
 $ipb_dle = new ipb_dle;
$salt = $ipb_dle->generate_password_salt(5);
$salt = addslashes($salt);
$ph = $ipb_dle->generate_compiled_passhash($salt, md5($_POST['password1']) );
$insert_ipb = $ipb->insert_id(); // 
$member_key = $ipb_dle->generate_auto_log_in_key();
$key_expire = $member_key * 60 * 60 * 24;
$ipb->query("INSERT INTO `{$db_prefix_ipb}members` (
member_id,
name,
members_l_username,
members_display_name,
members_l_display_name,
members_seo_name,
member_login_key,
member_login_key_expire,
email,
member_group_id,
joined,
ip_address,
time_offset,
allow_admin_mails,
language,
msg_show_notification,
members_auto_dst,
members_pass_hash,
members_pass_salt
)
VALUES (
0,
'$name',
'".strtolower($name)."',
'$name',
'".strtolower($name)."',
'".strtolower($name)."',
'".$ipb_dle->generate_auto_log_in_key()."',
'$key_expire',
'$email',
'3',
'".time()."',
'$_IP',
'3',
'1',
'1',
'1',
'0',
'$ph',
'$salt'
)");
$ipb_st = $ipb->super_query("select * from {$db_prefix_ipb}cache_store where cs_key = 'stats'");
$st_arr= unserialize($ipb_st['cs_value']);
$st_arr['mem_count']++;
$st_arr['last_mem_name'] = $name;
$st_arr['last_mem_id'] = $insert_ipb;
$st_arr2 = serialize($st_arr);
$ipb->query("UPDATE {$db_prefix_ipb}cache_store set cs_value = '$st_arr2' where cs_key = 'stats'");


:
?>


:
class ipb_dle
{
function generate_password_salt($len=5)
{
$salt = '';

for ( $i = 0; $i < $len; $i++ )
{
$num = rand(33, 126);

if ( $num == '92' )
{
$num = 93;
}

$salt .= chr( $num );
}

return $salt;
}

function generate_compiled_passhash($salt, $md5_once_password)
{
return md5( md5( $salt ) . $md5_once_password );
}

function generate_auto_log_in_key($len=60)
{
$pass = $this->generate_password_salt( $len );

return md5($pass);
}

}


:
/engine/ajax/registration.php


:
$db->query ("SELECT name FROM " . USERPREFIX . "_users WHERE LOWER(name) REGEXP '[[:<:]]{$search_name}[[:>:]]' OR name = '$name'");

if ($db->num_rows() > 0)
{
$stop .= $lang['reg_err_20'];
}


:
$ipb_dle_lan[0] = "     .";
$db_ipb_user = "";
$db_ipb_password = "";
$db_ipb_namedb = "_";
$db_ipb_local = "localhost";
$db_ipb_error = 1; // 1 -       , 0 - 
$db_prefix_ipb = "_____";
$ipb = new db;
$ipb->connect($db_ipb_user, $db_ipb_password, $db_ipb_namedb, $db_ipb_local, $db_ipb_error);
$ipb_test_name = $ipb->super_query ("SELECT COUNT(*) as count FROM {$db_prefix_ipb}members where name = '".strtolower($name)."'");
if ($ipb_test_name ['count'] > 0) $stop .= $ipb_dle_lan[0];


   ,       :    DLE      IP.Board

, !



, , .


Dle , . ( ) CMS dle .