Exemplo n.º 1
0
                $save_failed = false;
            } else {
                $choose_another_login = true;
                $save_failed = true;
            }
        } else {
            $save_failed = true;
        }
    }
}
//Connection of a user
if (isset($_POST['connection']) && !USER_IS_CONNECTED) {
    $login = isset($_POST['l_caver_login']) ? $_POST['l_caver_login'] : '';
    $password = isset($_POST['l_caver_password']) ? $_POST['l_caver_password'] : '';
    $key = isset($_POST['l_key']) ? $_POST['l_key'] : '';
    $password = crypt_xor(stripslashes($password), $key);
    $string = isset($_POST['l_caver_check']) ? $_POST['l_caver_check'] : '';
    $connectionArray = connectUser($login, $password, $string);
    $activated = $connectionArray['Activated'];
    $banned = $connectionArray['Banned'];
    $registered = $connectionArray['Registered'];
    $connection_failed = !$connectionArray['Connected'];
    if ($connection_failed) {
        $_SESSION['login_retry'] += 1;
    } else {
        if ($result['status'] != LOGIN_SUCCESS && !defined('NO_PHPBB_INSTALLED')) {
            addphpBBuser($login, $password, $_SESSION['user_contact'], $_SESSION['user_language']);
        }
    }
} else {
    $_SESSION['login_retry'] = 1;
Exemplo n.º 2
0
$phpbb_root_path = '../phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
if (!is_dir($phpbb_root_path)) {
    define('NO_PHPBB_INSTALLED', true);
} else {
    include $phpbb_root_path . 'common.' . $phpEx;
    include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    if (isset($_POST['connection'])) {
        $loginn = isset($_POST['l_caver_login']) ? $_POST['l_caver_login'] : '';
        $passwordd = isset($_POST['l_caver_password']) ? $_POST['l_caver_password'] : '';
        $keyy = isset($_POST['l_key']) ? $_POST['l_key'] : '';
        $passwordd = crypt_xor($passwordd, $keyy);
        $result = $auth->login(stripslashes($loginn), $passwordd);
    }
}
function addphpBBuser($login, $pwd, $mail, $lang)
{
    $cryptpass = phpbb_hash($pwd);
    $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`forum_users` WHERE `username` = '" . $login . "'";
    $dataset_exists = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
    if ($dataset_exists['Count'] == 0) {
        $new_user_array = array('username' => stripslashes($login), 'user_password' => $cryptpass, 'user_email' => $mail, 'group_id' => 7, 'user_type' => 0, 'user_lang' => strtolower($lang));
        $phpBBid = user_add($new_user_array);
    }
}
function chgPwdphpBBuser($nick, $pwd)
{