require_once "admin.php"; require_once "core.php"; $PRIVKEY = $_REQUEST['privkey']; $admin = new Admin(base64_decode($PRIVKEY)); $core = new CoreSock(); $forum_id = pack('H*', $config[SHARE][$SNAME][ID]); // got privkey, auth'em! while (list($key, $userhash) = each($_REQUEST['toauth'])) { if (strlen($userhash) != 32) { $std->Error("Selected user hash (id {$key}) has wrong lenght!"); } $member = pack("H*", $userhash); $admin->AuthMem($member); } // TODO: return Warning("Deve essere in formato esadecimale l'HASH membro.") if $memhash=~ /[^a-fA-F0-9]/i; $messaggio['BODY'] = $core->Var2BinDump($admin->ReturnVar()); $messaggio['TITLE'] = 'Valido utenti'; $messaggio['TYPE'] = 1; $messaggio['_PRIVATE'] = base64_decode($PRIVKEY); $risp = $core->AddMsg($messaggio); switch ($risp['ERRORE']) { case '104': $std->Error("Private key not valid!"); break; case -1: $std->Error("The Core didn't accept the message, aborting."); break; case -2: $std->Error("Forum unknown, cannot auth user(s)."); break; case NULL:
// = identificatore dell'utente nella tabella localmember. easadecimale $KEY_DECRYPT = pack('H*', md5($_SESSION[$SNAME]['sess_nick'] . $_SESSION[$SNAME]['sess_password'])); // = password per decriptare la chiave privata in localmember (16byte) $mreq['REP_OF'] = pack("H32", '39022b1483601c914c507e377f56df00'); $mreq['AUTORE'] = $user_hash; # Creo un vettore qualsiasi $extvar = array(); # Con questo vettore nel vettore dico che voglio fare l'update del mio avatar e firma $extvar[UpdateMyAvatar] = array(); $extvar[UpdateMyAvatar][avatar] = get_avatar($user_id); $extvar[UpdateMyAvatar][firma] = $_REQUEST['body']; $mreq['TYPE'] = '4'; $mreq['BODY'] = 'Madifico la mia firma :wacko:'; $mreq['_PRIVATE'] = base64_decode($userdata->PASSWORD); $mreq['_PWD'] = $KEY_DECRYPT; $mreq['EXTVAR'] = $core->Var2BinDump($extvar); $risp = $core->AddMsg($mreq); if (empty($risp['ERRORE'])) { Success_Page("Successo!", "Modifiche apportate con successo", "options_sign.php?MEM_ID={$user_id}", 1); } $is_post_back = 1; } } $current_sign = stripslashes(get_sign($mem_id)); //Processing data $current_sign_nobb = convert(secure_v($current_sign)); //OUTPUT if (!$is_post_back) { ?> <tr><td> <table cellspacing="0" width="100%">