Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*===================================================
- || # SpisCMS - Versione di Test - Alpha Build
- ||===================================================
- || # Made & Produced by Cosimo Celeste
- || # https://www.facebook.com/CosimoCelesteGoglia
- |+===================================================
- || # Licenza Creative Commons Attribuzione.
- || # Non commerciale 4.0 Internazionale.
- |+===================================================*/
- /*
- Lista delle Funzioni
- IpUtente();
- GestioneUtente();
- Loggato();
- ControlloUtente();
- Crypto();
- Login();
- UsernameValido();
- ControlloMailR();
- ControlloUtenteR();
- Register();
- Ticket();
- AggiornamentoLastOnline();
- Data();
- Ora();
- CambiaPassword();
- ControlloBan();
- */
- /// Impostazione della zona CMS
- if(!defined('SpisCMS'))
- {
- die('Non puoi accedere a questa zona di SpisCMS.');
- }
- /// Classe Utente
- class Utente
- {
- public static function IpUtente()
- {
- if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])){
- $ip_utente = $_SERVER['HTTP_CF_CONNECTING_IP'];
- } else {
- $ip_utente = $_SERVER['REMOTE_ADDR'];
- }
- return $ip_utente;
- }
- public static function GestioneUtente($key)
- {
- global $database;
- $stmt = $database->prepare("SELECT * FROM users WHERE id = :id");
- $stmt->bindParam(":id", $_SESSION['id']);
- $stmt->execute();
- $row = $stmt->fetch();
- return $row[$key];
- }
- public static function Loggato()
- {
- if(isset($_SESSION['id']))
- {
- return true;
- } else
- {
- return false;
- }
- }
- public static function ControlloUtente($password, $passwordDb, $username)
- {
- global $database;
- if (substr($passwordDb, 0, 1) == "$" && password_verify($password, $passwordDb))
- return true;
- $passwordBcrypt = Utente::Crypto($password);
- if (sha1($password) == $passwordDb)
- {
- $stmt = $database->prepare("UPDATE users SET password = :password WHERE username = :username");
- $stmt->bindParam(':username', $username);
- $stmt->bindParam(':password', $passwordBcrypt);
- $stmt->execute();
- return true;
- }
- return false;
- }
- public static function Crypto($password)
- {
- return password_hash($password, PASSWORD_BCRYPT);
- }
- public static function Login()
- {
- global $database, $Configurazione, $lingua;
- if(!isset($_POST['username'], $_POST['password']))
- return;
- $username = Html::Filtro($_POST['username']);
- $password = Html::Filtro($_POST['password']);
- if(empty($username))
- return Html::Errore($lingua["IErrore5"]);
- if(empty($password))
- return Html::Errore($lingua["IErrore4"]);
- $stmt = $database->prepare("SELECT id, password, username, rank FROM users WHERE username = :username");
- $stmt->bindParam(':username', $username);
- $stmt->execute();
- if($stmt->RowCount() == 0)
- return Html::Errore($lingua["IErrore3"]);
- $row = $stmt->fetch();
- if(!Utente::ControlloUtente($password, $row['password'], $row['username']))
- return Html::Errore($lingua["IErrore2"]);
- $IpUsersBan = Utente::IpUtente();
- $stmtBans = $database->prepare("SELECT * FROM bans WHERE value = :user OR value = :ip LIMIT 1");
- $stmtBans->bindParam(":user", $username);
- $stmtBans->bindParam(":ip", $IpUsersBan);
- $stmtBans->execute();
- $stmtBansFetch = $stmtBans->fetch(PDO::FETCH_ASSOC);
- if($stmtBans->rowCount() > "0")
- {
- return Html::Errore("Sei stato bannato per ".$stmtBansFetch['reason']." e il ban scade il ".date("d/m/Y H:i:s", $stmtBansFetch['expire'])."");
- }
- $_SESSION['id'] = $row['id'];
- if($Configurazione['manutenzione'])
- {
- if($row['rank'] >= $Configurazione['rankminimologinstaff'])
- {
- session_regenerate_id();
- header("location: ".$Configurazione['link']."home.php");
- exit;
- }
- return Html::Errore($lingua["IErrore1"]);
- }
- session_regenerate_id();
- header("location: ".$Configurazione['link']."home.php");
- exit;
- }
- public static function UsernameValido($username)
- {
- if(strlen($username) <= 12 && strlen($username) >= 3 && ctype_alnum($username))
- {
- return true;
- }
- return false;
- }
- public static function ControlloMailR($email)
- {
- global $database;
- $stmt = $database->prepare("SELECT mail FROM users WHERE mail = :email LIMIT 1");
- $stmt->bindParam(':email', $email);
- $stmt->execute();
- if($stmt->RowCount() > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public static function ControlloUtenteR($username)
- {
- global $database;
- $stmt = $database->prepare("SELECT username FROM users WHERE username = :username LIMIT 1");
- $stmt->bindParam(':username', $username);
- $stmt->execute();
- if($stmt->RowCount() > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public static function Register()
- {
- global $database, $Configurazione, $Client, $lingua;
- if(!isset($_POST['register']))
- return;
- $username = Html::Filtro($_POST['username']);
- $motto = Html::Filtro($_POST['motto']);
- $mail = Html::Filtro($_POST['mail']);
- $password = Utente::Crypto(Html::Filtro($_POST['password']));
- $ripetipassword = Utente::Crypto(Html::Filtro($_POST['ripetipassword']));
- $avatar = Html::Filtro($_POST['look']);
- $IpReg = Utente::IpUtente();
- $RankIniziale = Html::Filtro($Configurazione['rankiniziale']);
- $RankVipIniziale = Html::Filtro($Configurazione['rankvipiniziale']);
- $CreditiPartenza = Html::Filtro($Configurazione["creditipartenza"]);
- $DucketsPartenza = Html::Filtro($Configurazione["ducketspartenza"]);
- $DiamantiPartenza = Html::Filtro($Configurazione["diamantipartenza"]);
- $HomeRoom = Html::Filtro($Client["home_room"]);
- $time = strtotime('now');
- $stanza = Html::Filtro($_POST['stanza']);
- if(empty($username))
- return Html::Errore($lingua['RErrore10']);
- if(!Utente::UsernameValido($username))
- return Html::Errore($lingua['RErrore9']);
- if(empty($_POST['password']))
- return Html::Errore($lingua['RErrore8']);
- if(empty($_POST['ripetipassword']))
- return Html::Errore($lingua['RErrore7']);
- if(empty($mail))
- return Html::Errore($lingua['RErrore6']);
- if(!filter_var($mail, FILTER_VALIDATE_EMAIL))
- return Html::Errore($lingua['RErrore5']);
- if(Utente::ControlloUtenteR($username))
- return Html::Errore($lingua['RErrore4']);
- if(Utente::ControlloMailR($mail))
- return Html::Errore($lingua['RErrore3']);
- if(!strlen($_POST['password']) >= 6)
- return Html::Errore($lingua['RErrore2']);
- if(!$_POST['password'] == $_POST['ripetipassword'])
- return Html::Errore($lingua['RErrore1']);
- session_regenerate_id();
- $AggiungiNuovoUtente = $database->prepare("INSERT INTO users(username,password,mail,look,gender,motto,rank,rank_vip,ip_reg,credits,activity_points,vip_points,account_created) VALUES (:username, :password, :mail, :look, 'M', :motto, :rank, :rank_vip, :ip_reg, :crediti, :duckets, :diamanti, :creazioneaccount)");
- $AggiungiNuovoUtente->bindParam(":username", $username);
- $AggiungiNuovoUtente->bindParam(":password", $password);
- $AggiungiNuovoUtente->bindParam(":mail", $mail);
- $AggiungiNuovoUtente->bindParam(":look", $avatar);
- $AggiungiNuovoUtente->bindParam(":motto", $motto);
- $AggiungiNuovoUtente->bindParam(":rank", $RankIniziale);
- $AggiungiNuovoUtente->bindParam(":rank_vip", $RankVipIniziale);
- $AggiungiNuovoUtente->bindParam(":ip_reg", $IpReg);
- $AggiungiNuovoUtente->bindParam(":crediti", $CreditiPartenza);
- $AggiungiNuovoUtente->bindParam(":duckets", $DucketsPartenza);
- $AggiungiNuovoUtente->bindParam(":diamanti", $DiamantiPartenza);
- $AggiungiNuovoUtente->bindParam(":creazioneaccount", $time);
- $AggiungiNuovoUtente->execute();
- $UltimoId = $database->lastInsertId();
- $_SESSION['id'] = $UltimoId;
- switch ($_POST['stanza'])
- {
- case 'stanza1':
- $nuovaStanza = $database->prepare("INSERT INTO `rooms`(roomtype, caption, owner, description, category, state, users_now, users_max, model_name, score, tags, password, wallpaper, floor, landscape, allow_pets, allow_pets_eat, room_blocking_disabled, allow_hidewall, wallthick, floorthick, group_id, mute_settings, ban_settings, kick_settings, chat_mode, chat_size, chat_speed, chat_extra_flood, chat_hearing_distance, trade_settings, push_enabled, pull_enabled, enables_enabled, respect_notifications_enabled, pet_morphs_allowed, spull_enabled, spush_enabled, golpe_enabled, tutorial) VALUES ('private','La Stanza di ".$_POST['username']."','".$UltimoId."','',36,'locked',0,50,'model_bc_99999991',0,'','','215','110','5.1','0','0','0','0',0,1,0,'0','1','1',0,0,0,0,0,2,'1','1','1','1','1','1','1','1','false');");
- $nuovaStanza->execute();
- $TrovaIdSala = $database->prepare("SELECT * FROM rooms WHERE caption = 'La Stanza di ".$_POST['username']."' AND owner = ".$UltimoId." LIMIT 1");
- $TrovaIdSala->execute();
- $TrovaIdSalaFetch = $TrovaIdSala->fetch(PDO::FETCH_ASSOC);
- $addFurni = $database->prepare("INSERT INTO `items`(user_id, room_id, base_item, extra_data, x, y, z, rot, wall_pos, limited_number, limited_stack, VinkingThiago) VALUES (".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 10, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 8, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 6, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 4, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 10, 2, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 10, 4, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 8, 4, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 8, 2, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 6, 2, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 6, 4, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 4, 2, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20131, '4', 4, 4, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1737, '1', 0, 0, 0, 0, ':w=3,8 l=32,50 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1731, '1', 0, 0, 0, 0, ':w=5,0 l=29,51 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1736, '1', 0, 0, 0, 0, ':w=3,10 l=12,71 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1359, '', 11, 1, 0.7, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1359, '', 4, 1, 0.7, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 6, 3, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 5, 3, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 10, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 8, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 6, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 4, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1356, '0', 5, 2, 0.7, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1360, '', 7, 4, 0.7, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1361, '1', 4, 4, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1353, '1', 4, 3, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20403, '1', 8, 2, 0.7, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 9, 3, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1349, '', 8, 3, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20394, '1', 0, 0, 0, 0, ':w=3,12 l=13,33 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1712, '', 0, 0, 0, 0, ':w=8,0 l=31,51 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 8, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 6, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 6, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 4, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 4, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 4, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 10, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 8, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 10, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 6, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 8, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 10, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 10, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 8, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 6, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900340, '2', 4, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900354, '', 10, 8, 0, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900354, '', 8, 8, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900354, '', 9, 11, 0, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900354, '', 9, 13, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900343, '', 4, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900331, '', 9, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900331, '', 9, 12, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900329, '', 5, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 900355, '', 4, 7, 0, 0, '', 0, 0, 'true');");
- $addFurni->execute();
- $addroom = $database->prepare("UPDATE users SET home_room = ".$TrovaIdSalaFetch['id']." WHERE id = ".$UltimoId);
- $addroom->execute();
- exit;
- case 'stanza2':
- $nuovaStanza = $database->prepare("INSERT INTO `rooms`(roomtype, caption, owner, description, category, state, users_now, users_max, model_name, score, tags, password, wallpaper, floor, landscape, allow_pets, allow_pets_eat, room_blocking_disabled, allow_hidewall, wallthick, floorthick, group_id, mute_settings, ban_settings, kick_settings, chat_mode, chat_size, chat_speed, chat_extra_flood, chat_hearing_distance, trade_settings, push_enabled, pull_enabled, enables_enabled, respect_notifications_enabled, pet_morphs_allowed, spull_enabled, spush_enabled, golpe_enabled, tutorial) VALUES ('private','La Stanza di ".$_POST['username']."','".$UltimoId."','',36,'locked',0,50,'model_bc_99999992',0,'','','215','110','5.1','0','0','0','0',0,1,0,'0','1','1',0,0,0,0,0,2,'1','1','1','1','1','1','1','1','false');");
- $nuovaStanza->execute();
- $TrovaIdSala = $database->prepare("SELECT * FROM rooms WHERE caption = 'La Stanza di ".$_POST['username']."' AND owner = ".$UltimoId." LIMIT 1");
- $TrovaIdSala->execute();
- $TrovaIdSalaFetch = $TrovaIdSala->fetch(PDO::FETCH_ASSOC);
- $addFurni = $database->prepare("INSERT INTO `items`(user_id, room_id, base_item, extra_data, x, y, z, rot, wall_pos, limited_number, limited_stack, VinkingThiago) VALUES(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1704, '', 0, 0, 0, 0, ':w=2,4 l=25,72 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1704, '', 0, 0, 0, 0, ':w=10,0 l=23,68 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65274, '', 9, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65323, '', 0, 0, 0, 0, ':w=7,0 l=28,33 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65290, '', 7, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65275, '', 10, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65269, '', 1, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65311, '', 0, 0, 0, 0, ':w=0,9 l=23,34 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65305, '', 1, 8, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65305, '', 2, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65319, '', 0, 0, 0, 0, ':w=4,2 l=2,68 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65280, '', 6, 1, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 12240, '', 7, 5, 0, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 12240, '', 6, 6, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 12237, '', 7, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 12235, '', 11, 10, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 11, 8, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 9, 10, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 8, 10, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 7, 10, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 4, 6, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 3, 6, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 2, 6, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 1, 6, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 44391305, '', 3, 6, 1.5, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 44391305, '', 1, 6, 1.5, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 7, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 9, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 8, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 10, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 8, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 3, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 2, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 3, 6, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 4, 6, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 2, 6, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 1, 6, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 2, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 3, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 4, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 1, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 89985, '1', 2, 7, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 8, 10, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 7, 10, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 9, 10, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 8, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 7, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 11, 6, 1.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 11, 7, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 11, 6, 0.25, 0, '', 0, 0, 'true');");
- $addFurni->execute();
- $addroom = $database->prepare("UPDATE users SET home_room = ".$TrovaIdSalaFetch['id']." WHERE id = ".$UltimoId);
- $addroom->execute();
- exit;
- case 'stanza3':
- $nuovaStanza = $database->prepare("INSERT INTO `rooms`(roomtype, caption, owner, description, category, state, users_now, users_max, model_name, score, tags, password, wallpaper, floor, landscape, allow_pets, allow_pets_eat, room_blocking_disabled, allow_hidewall, wallthick, floorthick, group_id, mute_settings, ban_settings, kick_settings, chat_mode, chat_size, chat_speed, chat_extra_flood, chat_hearing_distance, trade_settings, push_enabled, pull_enabled, enables_enabled, respect_notifications_enabled, pet_morphs_allowed, spull_enabled, spush_enabled, golpe_enabled, tutorial) VALUES ('private','La Stanza di ".$_POST['username']."','".$UltimoId."','',36,'locked',0,50,'model_bc_99999993',0,'','','215','110','5.1','0','0','0','0',0,1,0,'0','1','1',0,0,0,0,0,2,'1','1','1','1','1','1','1','1','false');");
- $nuovaStanza->execute();
- $TrovaIdSala = $database->prepare("SELECT * FROM rooms WHERE caption = 'La Stanza di ".$_POST['username']."' AND owner = ".$UltimoId." LIMIT 1");
- $TrovaIdSala->execute();
- $TrovaIdSalaFetch = $TrovaIdSala->fetch(PDO::FETCH_ASSOC);
- $addFurni = $database->prepare("INSERT INTO `items`(user_id, room_id, base_item, extra_data, x, y, z, rot, wall_pos, limited_number, limited_stack, VinkingThiago) VALUES (".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65081, '', 1, 10, 0.25, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65019, '3', 1, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 12283, '', 8, 10, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 65836, '1', 1, 10, 1.25, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=5,1 l=1,103 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=6,0 l=31,103 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=8,0 l=23,99 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=10,0 l=17,96 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=12,0 l=10,93 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=14,0 l=1,89 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=5,3 l=23,93 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1794, '1', 0, 0, 0, 0, ':w=5,5 l=29,91 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 13, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '1', 13, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 13, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 11, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '2', 11, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 11, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 9, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '1', 9, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 9, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 7, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '2', 7, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 7, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '0', 5, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '1', 5, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 5, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 3, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '2', 3, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '3', 3, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '0', 1, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '1', 1, 9, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20125, '', 1, 11, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 12, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 7, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 14, 2, 1, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 14, 3, 1, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 11, 1, 1, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 6, 2, 1, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 6, 3, 1, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 9, 1, 1, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '', 7, 1, 1, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95382, '1', 12, 1, 1, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '', 9, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '', 11, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '1', 14, 1, 1, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '1', 14, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '1', 6, 1, 1, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95384, '1', 6, 5, 1, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95383, '', 10, 5, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 12, 3, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 12, 2, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 11, 3, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 11, 2, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 9, 3, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 9, 2, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 7, 3, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 25362, '', 7, 2, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 95389, '1', 7, 2, 1, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1620, '0', 10, 1, 1.5, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 540022, '', 0, 0, 0, 0, ':w=0,12 l=32,116 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 77707, '0', 12, 10, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 949, '', 1, 11, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 540022, '', 0, 0, 0, 0, ':w=2,6 l=3,116 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 540022, '', 0, 0, 0, 0, ':w=0,8 l=32,116 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 540022, '', 0, 0, 0, 0, ':w=0,9 l=4,130 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 20202, '2', 0, 0, 0, 0, ':w=0,8 l=28,105 l', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 77706, '1', 6, 6, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 171, '', 1, 9, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 921, '', 10, 11, 0, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 930, '', 8, 9, 0, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 921, '', 9, 9, 0, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 930, '', 10, 10, 0, 6, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 930, '', 7, 11, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 921, '', 7, 10, 0, 2, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 1528, '', 8, 10, 0.7, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 710001999, 'mlg-270-92.ch-250-78.sh-906-92Ropa', 3, 7, 0, 4, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 710002014, '', 0, 0, 0, 0, ':w=4,6 l=18,106 r', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 710002000, '', 4, 7, 0, 0, '', 0, 0, 'true'),(".$UltimoId.", ".$TrovaIdSalaFetch['id'].", 710002006, '1', 1, 7, 0, 2, '', 0, 0, 'true');");
- $addFurni->execute();
- $addroom = $database->prepare("UPDATE users SET home_room = ".$TrovaIdSalaFetch['id']." WHERE id = ".$UltimoId);
- $addroom->execute();
- exit;
- }
- header("location: ".$Configurazione['link']."home.php");
- exit;
- }
- public static function Ticket()
- {
- $data = "SpisCMS-";
- for ($i=1; $i<=9; $i++){
- $data = $data . rand(0,6);
- }
- $data = $data . "-";
- for ($i=1; $i<=9; $i++){
- $data = $data . rand(0,6);
- }
- $data = $data . "-";
- for ($i=1; $i<=9; $i++){
- $data = $data . rand(0,6);
- }
- $data = $data . "-key-client";
- return $data;
- }
- public static function AggiornamentoLastOnline()
- {
- global $database, $Configurazione, $lingua;
- if(Utente::Loggato() == true)
- {
- $time = strtotime('now');
- $username = Utente::GestioneUtente('username');
- $SystemSQL = $database->prepare("UPDATE users SET last_online = :lastonline WHERE username = :username");
- $SystemSQL->bindParam(":lastonline", $time);
- $SystemSQL->bindParam(":username", $username);
- $SystemSQL->execute();
- }
- }
- public static function Data()
- {
- $m = date('m');
- $d = date('d');
- $Y = date('Y');
- $DateSystem = date('d/m/Y',mktime($m,$d,$Y));
- return $DateSystem;
- }
- public static function Ora()
- {
- $H = date('H');
- $i = date('i');
- $s = date('s');
- $OraSystem = date('H:i:s',mktime($H,$i,$s));
- return $OraSystem;
- }
- public static function Adesso()
- {
- return strtotime("now");
- }
- public static function CambiaPassword()
- {
- global $database, $Configurazione, $lingua;
- if(!isset($_POST['cambiapassword']))
- return;
- $mailattuale = Html::Filtro($_POST['mailattuale']);
- $nuovapassword = Utente::Crypto(Html::Filtro($_POST['nuovapassword']));
- $username = Utente::GestioneUtente('username');
- $mailattuale2 = Utente::GestioneUtente('mail');
- if(empty($mailattuale))
- return Html::Errore("Il campo della mail attuale non può essere vuoto.");
- if(empty($nuovapassword))
- return Html::Errore("Il campo della nuova password non può essere vuoto.");
- if(!$mailattuale == $mailattuale2)
- return Html::Errore("La mail attuale non corrisponde a quella di registrazione.");
- $SystemSQL = $database->prepare("UPDATE users SET password = :nuovapassword WHERE username = :username AND mail = :mailattuale");
- $SystemSQL->bindParam(":nuovapassword", $nuovapassword);
- $SystemSQL->bindParam(":username", $username);
- $SystemSQL->bindParam(":mailattuale", $mailattuale);
- $SystemSQL->execute();
- }
- public static function ControlloBan()
- {
- global $database, $Configurazione, $lingua;
- $UsernameBan = Utente::GestioneUtente('username');
- $IpUsersBan = Utente::IpUtente();
- $stmtBans = $database->prepare("SELECT * FROM bans WHERE value = :user OR value = :ip LIMIT 1");
- $stmtBans->bindParam(":user", $UsernameBan);
- $stmtBans->bindParam(":ip", $IpUsersBan);
- $stmtBans->execute();
- $stmtBansFetching = $stmtBans->fetch(PDO::FETCH_ASSOC);
- if($stmtBans->rowCount() > "0")
- {
- session_destroy();
- header("location: ".$Configurazione['link']."index.php");
- exit;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement