function Register($pXml) { $aParams = php_xmlrpc_decode($pXml); $aParams = $aParams[0]; $bpUserID = $aParams['bpUserID']; db("select * from user_accounts where bp_user_id={$bpUserID} and login_name != ''"); $data = dbr(); if (!dbc()) { insert_history($login_id, "Inscription via API BP {$bpUserID}"); db("select * from user_accounts where bp_user_id={$bpUserID}"); if (!dbc()) { dbn("insert into user_accounts (bp_user_id, affiliate_id, signed_up) values (" . $aParams['bpUserID'] . ", " . $aParams['affiliateID'] . ", " . time() . ")"); $login_id = mysql_insert_id(); insert_history($login_id, "Ajout du compte BP {$bpUserID}"); } else { $data2 = dbr(); $login_id = $data2['login_id']; insert_history($login_id, "Compte BP {$bpUserID} déjà existant mais sans pseudo"); } $url = URL_PREFIX . "/inscription.php?lidbp={$login_id}"; } else { require_once 'includes/session_funcs.inc.php'; $session = login_to_server($data['login_name'], '', $data['bp_user_id'], true); $url = URL_PREFIX . "/game_listing.php?sid={$session}"; $login_id = $data['login_id']; insert_history($login_id, "Compte BP {$bpUserID} existant"); } $aOutput = array('result' => new xmlrpcval('OK', 'string'), 'userID' => new xmlrpcval($login_id, 'int'), 'redirectURL' => new xmlrpcval($url, 'string')); return new xmlrpcresp(php_xmlrpc_encode($aOutput)); }
echo "<blockquote><b>" . $st[1819] . "<br />" . $st[1820] . "\n\t\t<p /><a href=\"javascript:history.back()\">" . $st[1818] . "</a></b><p />" . $st[789] . " ? <a href=change_pass.php?stage_one=1>" . $cw['click_here'] . "</a></blockquote><p />"; insert_history($p_user['login_id'], $cw['bad_login']); print_footer(); } else { //everthing correct ...undate fb_user_id and do login dbn("update user_accounts set fb_user_id='" . (int) $fbuser->id . "' where login_id = '{$data['login_id']}'"); //post on facebook wall fb_wallpost_wosdk_api('Astra Vires', "{*actor*} utilise maintenant Facebook pour se connecter à l'univers d'Astra Vires"); login_to_server($data['login_name'], '', 0, FALSE, $fbuser->id); } } elseif ($_GET['sid']) { db("select login_name, bp_user_id from user_accounts where session_id='" . mysql_real_escape_string(stripslashes($_GET['sid'])) . "'"); $data = dbr(); login_to_server($data['login_name'], '', $data['bp_user_id']); } elseif (empty($_COOKIE['session_id']) || empty($_COOKIE['login_id']) || isset($_POST['submit'])) { login_to_server(); //user already logged in. but check session details. } else { check_auth(); if ($login_id == 1) { //admin trying to continue old session. echo $st[793]; exit; } } if ($fbuser && empty($p_user['fb_token'])) { // verify if the user has fb_token and set it $tmp_fb_token = get_facebook_cookie(); dbn("update user_accounts set fb_token='" . $tmp_fb_token['access_token'] . "' WHERE login_id = '{$p_user['login_id']}'"); } $rs = "<br /><br />" . $st[794];
$fb_id = (int) $_POST['fb_id']; $pseudo = trim($_POST['pseudo']); db("select login_name from user_accounts where login_name like '{$pseudo}'"); $pseudo_pris = dbc(); if ($id && !$fb_id) { if (!$_POST['pseudo']) { print_s_page('Erreur', "Vous n'avez pas choisi de pseudo {$rs}"); } elseif ($pseudo_pris) { print_s_page('Erreur', "Ce pseudo est déjà pris, veuillez en choisir un autre {$rs}"); } else { db("select * from user_accounts where login_id={$id}"); $data = dbr(); if (dbc()) { dbn("update user_accounts set login_name='{$pseudo}' where login_id={$id}"); require_once 'includes/session_funcs.inc.php'; login_to_server($pseudo, '', $data['bp_user_id']); header("location: game_listing.php"); } else { print_s_page('Erreur', "Ce compte n'existe pas {$rs}"); } } } elseif (!$id && $fb_id) { //facebook // make login name safe. $login_name = trim(mysql_escape_string(strip_tags((string) $_POST['pseudo']))); $error_str = ""; /******************* * Check non-optional *******************/ //ensure login name and that it is valid. if (empty($login_name)) {