@Moderator kann geschlossen werden!
Beiträge von shenzhen
-
-
Dir geht es also nur darum das CMS zu behalten? Räume und Userdatenbank wären in dem Falle egal?
Räume und Userdatenbank wäre ja noch egal, ich meine halt die Datenbank zu dem Emu benutzen können das R63B auf die Reihe kriegt, aber trotzdem beim selben CMS bleibt
Du müsstest halt ein paar Sachen wohl umschreiben. Ausserdem die Datenbank anpassen etc.
Kleiner Tipp: Hör auf die 31er nicht, wie Businessman. Machen nur scheiße & verlangen danach PSC.
Sein CMS hab ich schon in real gesehen... einfach nur schrecklich.....
Solltest du nur das Content beibehalten wollen -> CMS muss an die neue R63B Datenbank angepasst werden (teils umgeschrieben werden)
Solltest du die Daten (Accs, Fortschritte und Räume etc) mitnehmen wollen -> Datenbank Struktur muss komplett angepasst werden.
ooouuh... z. B.?
-
Ja, so meine ichs auch. Ich wollte halt mal wissen ob & wie man es macht von einem R63A zum R63B und dabei das CMS behält..
-
Halloo,
ich habe mir immer die Frage gestellt wie man aus einem R63A zu einem R63B Hotel macht, also die neuste Client Version die es im offiziellen Habbo-Hotel auch gibt.
Hat da jemand Ahnung davon?
-
Hey,
ich will nicht in alte Wunden greifen, aber ich habe mir das HabboMN CMS gedownloaded, aber schaffe es nicht mit dem Client zu connecten.
Der Client bleibt schwarz und da tut sich garnix.Ich war schon auf dem Thread
Habbo.mn CMS Hilfe gibs hier :) von arbian
Aber der Link zu den client_assets ist down..
Ich bitte um Hilfe :pinch: -
Könnte mir bitte jemand helfen? Ich bekomme immernoch nicht diesen einen Fehler raus und ich hab keine Ahnung
wie man ihn fixxt :I -
Wie sollen wir dir da helfen? Jede Zeile dir umschreiben? Google doch mal..
Denkhilfe:
Deins:
<rule name="Importierte Regel 90">
<match url="^credits/pixels(|/)$" ignoreCase="false" />
<action type="Rewrite" url="pixels.php" />
</rule>Umgeschrieben:
RewriteRule ^credits/pixels(|/)$ pixel.phpIch würde nicht für genaue 141 Regeln sie umschreiben. Gibt es nicht lieber einen online Konverter oder so? Ich find' in Google keins.
-
Hey, Leute!
Leider hab ich ein Problem mit dem alten https://retrotown.ws/www.Huggo.ST CMS.Ich bräuchte eine umgeschriebene .htaccess-Datei für Xampp/ Apache und ja, vielleicht könnt ihr mich weiterhelfen!
Wäre sehr dankbar!
#Bearbeitet
-
-
Ja, ich hab alles eingestellt... aber das mit dem "{" hat es etwas auf sich und ich hab keine Ahnung was..
-
Hallo Retrotowner!
Ich hab ein kleines Problem mit dem CMS was mir grad wirklich nervt und ich kann es leider nicht beheben.Vielleicht könnte jemand von euch mir helfen, wie ich es hinkriege, dass es wirklich komplett funktioniert.
Das ist mein Problem: Screen
Wäre schön, wenn mir jemand helfen würde! -
Weiß jemand, wie man den Register fixxen kann? Ich hab quasi kein Zugriff drauf bzw. wenn ich mit .php am Ende setze komme ich dran aber mich verlinkt es dann nicht mit der me.php wenn ich mich fertig registriert hat.
-
Danke für eure Hilfe! Könnte es jemand auf Mega.nz hochladen, sonst downloadet es schneller als gedacht und lässt ein großes Stück weg.
-
Hallo Retrotowner,
Ich weiß grad nicht ob das jemand hat, aber hat irgendjemand das CMS vom http://www.hobba.bzDas CMS ist das gleiche wie das Panfu.in-CMS.
Es gab von dem CMS auch ein Release, aber ich finde es nicht mehr.Hat es jemand noch auf Lager und könnte es hochladen?
-
Hab mal für dich es hier draufgeklascht.. weil dieses phpformatter den gleichen Scheiß Fehler angibt wie hier. Sorry, dass es so lang ist.. und das überall Smileys verstecken..
PHP
Alles anzeigen<?php ob_start(); define("FNETWORK", TRUE); define("Sitename","HabboMN"); define("SiteFolder",""); define("SitePath","http://0.0.0.0".SiteFolder.""); define("SiteAvatarPath","http://0.0.0.0/habbo-imager/avatarimage.php?name="); define("LangPath","/Web_Files/open_data/response_data/Web_2.0/language/"); error_reporting(E_ALL); //Generate secure SESSIONID! define("SESSION_NAME","_ini_cpu_ID"); //SYSTEM ADDRESSEN define("MailAddWelcome","welcome@habbo.mn"); define("MailAddNoreply","noreply@habbo.mn"); define("MailAddBot","bot@habbo.mn"); define("MailAddSpam","spam@habbo.mn"); define("MailAddForum","forum@habbo.mn"); define("MailPassSystem","Qwer1234p"); //EVENT ADDRESSEN define("MailHost","mail.habbo.mn"); define("MailPort",25); $httponly = true; ini_set('session.use_only_cookies', 1); session_name(SESSION_NAME); session_start(); $previous_encoding = mb_internal_encoding(); mb_internal_encoding('UTF-8'); mb_internal_encoding($previous_encoding); //require_once "private_conf/conf_decomprimer.utml.php.es.php"; $requiredFolder = str_replace("/","\\",$_SERVER["DOCUMENT_ROOT"]); //echo $requiredFolder; require_once $_SERVER["DOCUMENT_ROOT"].SiteFolder."/PHPMailer-master/class.smtp.php"; require_once $_SERVER["DOCUMENT_ROOT"].SiteFolder."/PHPMailer-master/class.phpmailer.php"; interface userInterface { public function set_logged_in($user,$pass); public function isLoggedIn(); } $mysqli_db = new mysqli("127.0.0.1", "root", "*******", "mn_core", "3306"); $mysqli_db->set_charset("utf8"); $MUS_cmd = new MUS("0.0.0.0"); $path = ""; $ClientPath = "http://0.0.0.0".SiteFolder."/client.php"; class Language{ public $lang; function __construct($lang){ try { } $this->getStandard(); } } private function getStandard(){ } } class HabboHPServer { private $address = '0.0.0.0'; private $port = 30089; private $maxClients = 0; private $MyHabbo; private $clients; private $socket; private $allow_connect = false; private $connection = false; public function __construct($b) { set_time_limit(0); error_reporting(E_ALL ^ E_NOTICE); $this->MyHabbo = $b; if($this->MyHabbo->logged_in) $this->allow_connect = true; } public function SocketCreate(){ if($this->allow_connect){ $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1); socket_bind($this->socket, $this->address, $this->port); socket_listen($this->socket, $this->maxClients); $this->clients = array('0' => array('socket' => $this->socket)); } } private function SocketClose(){ if(!$connection){ $MyHabbo->setConnection = false; } } public function SocketLoop() { while (true) { //HandlingEtc. Kommt gleich } } private function log($msg) { echo "[".date('Y-m-d H:i:s', time())."] " . $msg . "\r\n"; } } class MUS{ private $host = 'localhost'; private $port = 30001; public function __construct($host=false, $port=false) { if($host) $this->host = $host; if($port) $this->port = $port; } public function send($command, $data = array()) { /* $MUSdata = $command . chr(1) . implode(chr(5), $data); $socket = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp')); socket_connect($socket, $this->host, $this->port); socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE); socket_close($socket); */ } } class FunctionList { public $db; public $remote_ip; /*function __construct(){ global $habbo_sql; try { if(!$habbo_sql->ping()){ throw new Exception("connection"); } else { $this->DB = $habbo_sql; } } catch(Exception $e) { header("location: ".$path."/error/".$e); } }*/ public function __construct(){ global $mysqli_db; $this->db = $mysqli_db; try { $this->setRealIPAddress(); } catch(Exception $e) { header("location: ".$path."/error/".$e); } } private function setRealIPAddress(){ if(!empty($_SERVER['HTTP_CLIENT_IP'])){ //check ip from share internet $this->remote_ip = $_SERVER['HTTP_CLIENT_IP']; } else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ //to check ip is pass from proxy $this->remote_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else{ $this->remote_ip = $_SERVER['REMOTE_ADDR']; } if(!empty($this->remote_ip)) return true; else return false; } public static function getBrowser(){ $u_agent = $_SERVER['HTTP_USER_AGENT']; $bname = 'Unknown'; $platform = 'Unknown'; $version= ""; //First get the platform? if (preg_match('/linux/i', $u_agent)) { $platform = 'linux'; } elseif (preg_match('/macintosh|mac os x/i', $u_agent)) { $platform = 'mac'; } elseif (preg_match('/windows|win32/i', $u_agent)) { $platform = 'windows'; } // Next get the name of the useragent yes seperately and for good reason if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) { $bname = 'Internet Explorer'; $ub = "MSIE"; } elseif(preg_match('/Firefox/i',$u_agent)) { $bname = 'Mozilla Firefox'; $ub = "Firefox"; } elseif(preg_match('/Chrome/i',$u_agent)) { $bname = 'Google Chrome'; $ub = "Chrome"; } elseif(preg_match('/Safari/i',$u_agent)) { $bname = 'Apple Safari'; $ub = "Safari"; } elseif(preg_match('/Opera/i',$u_agent)) { $bname = 'Opera'; $ub = "Opera"; } elseif(preg_match('/Netscape/i',$u_agent)) { $bname = 'Netscape'; $ub = "Netscape"; } // finally get the correct version number $known = array('Version', $ub, 'other'); $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#'; if (!preg_match_all($pattern, $u_agent, $matches)) { // we have no matching number just continue } // see how many we have $i = count($matches['browser']); if ($i != 1) { //we will have two since we are not using 'other' argument yet //see if version is before or after the name if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){ $version= $matches['version'][0]; } else { $version= $matches['version'][1]; } } else { $version= $matches['version'][0]; } // check if we have a number if ($version==null || $version=="") {$version="?";} return array( 'userAgent' => $u_agent, 'name' => $bname, 'version' => $version, 'platform' => $platform, 'pattern' => $pattern ); } public static function getOS() { $u_agent = $_SERVER['HTTP_USER_AGENT']; $os_platform = "Unknown OS Platform"; $os_array = array( '/windows nt 10/i' => 'Windows 10', '/windows nt 6.3/i' => 'Windows 8.1', '/windows nt 6.2/i' => 'Windows 8', '/windows nt 6.1/i' => 'Windows 7', '/windows nt 6.0/i' => 'Windows Vista', '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', '/windows nt 5.1/i' => 'Windows XP', '/windows xp/i' => 'Windows XP', '/windows nt 5.0/i' => 'Windows 2000', '/windows me/i' => 'Windows ME', '/win98/i' => 'Windows 98', '/win95/i' => 'Windows 95', '/win16/i' => 'Windows 3.11', '/macintosh|mac os x/i' => 'Mac OS X', '/mac_powerpc/i' => 'Mac OS 9', '/linux/i' => 'Linux', '/ubuntu/i' => 'Ubuntu', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'Mobile' ); foreach($os_array as $regex => $value) if(preg_match($regex, $u_agent)) $os_platform = $value; return $os_platform; } public static function FilterText($str,$advanced=false) { global $mysqli_db; if($advanced === true){ return $mysqli_db->real_escape_string($str); } $str = $mysqli_db->real_escape_string(htmlspecialchars($str)); return $str; } private static function rand_char() { $chars = "0123456789@*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUFWXYZ"; $n = rand(0,(strlen($chars)-1)); return $chars{$n}; } public static function rand_string($length=10,$feature=false) { $str = ''; if($feature == false){ for($n=0;$n<$length;$n++) { $str .= self::rand_char(); } } else { for($n=0;$n<$length;$n++) { $str .= self::rand_char(); } $str.= "_".$feature."_"; for($n=0;$n<$length;$n++) { $str .= self::rand_char(); } } return $str; } //////FOR OLD COMPATIBIlITYS TO THE OLD DATA IN DB//////////////////////////////////// /**/public static function HoloHash($password){////////////////////////////////////// /*////*/$string = sha1($password);////////////////////////////////////////////////// /*////*/return $string;//////////////////////////////////////////////////////////// /**/}///////////////////////////////////////////////////////////////////////////// /**/public static function HoloHashMD5($password){/////////////////////////////// /*////*/$hash_secret = "xCg532%@%gdvf^5DGaa6&*rFTfg^FD4\$OIFThrR_gh(ugf*/";///// /*////*/$string = md5($password.($hash_secret));/////////////////////////////// /*////*/return $string;/////////////////////////////////////////////////////// /**/}//////////////////////////////////////////////////////////////////////// /**/public static function HoloText($str,$adv=false){/////////////////////// /*////*/if($adv == true){ return stripslashes($str);}////////////////////// /*////*/$str = nl2br(htmlspecialchars($str));///////////////////////////// /*////*/return $str;///////////////////////////////////////////////////// /**/}/////////////////////////////////////////////////////////////////// /**/public static function IsEven($intNumber){///////////////////////// /*////*/if($intNumber % 2 == 0){return true;////////////////////////// /*////*/} else {///////////////////////////////////////////////////// /*////*/return false;/////////////////////////////////////////////// /*////*/}////////////////////////////////////////////////////////// /**/}///////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// public static function NowHashMDSHA($inline){ $sec_hash = "Yog6*faK$2!@%g*Sdvf^5DG_A87fg^FD4\$POEFThrR_gh(API*/P[SSI])"; $string = sha1(md5($inline.($sec_hash))); return $string; } public static function Mysql_count($q,$w){ global $mysqli_db; $query = $mysqli_db->query("SELECT COUNT(id) FROM ".$q." ".$w."") or die($mysqli_db->error); $count = $query->fetch_row; return $count[0]; } public static function MySQL_select($s,$q,$w,$wt=false){ global $mysqli_db; $wts = ($wt===true)? " ".$w : " WHERE ".$w; $query = $mysqli_db->query("SELECT ".$s." FROM ".$q.$wts."") or die($mysqli_db->error); return $query; } public static function MySQL_update($q,$s,$w){ global $mysqli_db; $update = $mysqli_db->query("UPDATE ".$q." SET ".$s." WHERE ".$w."") or die($mysqli_db->error); return $update; } public function MySQL_delete($q,$w){ //global $mysqli_db; $delete = $this->db->query("DELETE FROM ".$q." WHERE ".$w.""); return $delete; } public static function MySQL_insert($q,$t,$v){ global $mysqli_db; $insert = $mysqli_db->query("INSERT INTO ".$q." (".$t.") VALUES (".$v.")") or die($mysqli_db->error); return $insert; } public static function Query_select_rows($q,$w,$wi,$if=false,$bl=false){ global $mysqli_db; if($if===false){ $query_row = $mysqli_db->query("SELECT id FROM ".$q." WHERE ".$w."='".$wi."'"); } elseif($bl===false) { $query_row = $mysqli_db->query("SELECT id FROM ".$q." WHERE ".$w.""); } else { $query_row = $mysqli_db->query("SELECT ".$wi." FROM ".$q." WHERE ".$w.""); } $end = $query_row->num_rows; return $end; } public static function Query_select_rows_B($q,$w,$wi,$a,$ai,$se=false){ global $mysqli_db; $query_row = $mysqli_db->query("SELECT id FROM ".$q." WHERE ".$w."='".$wi."' AND ".$a."='".$ai."' ".$se.""); $end = $query_row->num_rows; return $end; } public static function Query_fetch_assoc($s,$q,$w){ global $mysqli_db; $query_row = self::MySQL_select($s,$q,$w); $end = $query_row->fetch_assoc(); return $end; } public static function Query_fetch_array($s,$q,$w){ global $mysqli_db; $query_row = self::MySQL_select($s,$q,$w); $end = $query_row->fetch_array(); return $end; } public static function Query_fetch_object($s,$q,$w,$wt=false){ global $mysqli_db; $wts = ($wt===true)? true : false; $query_row = self::MySQL_select($s,$q,$w,$wts); $end = $query_row->fetch_object(); return $end; } public static function date_str($time){ if($time <= time()-31536000){ $current = date("Y",$time)-date("Y",time()); $cu= "vor etwa " .preg_replace("#-#", "", $current)." Jahr/en"; return $cu; } elseif($time <= time()-2592000){ $current = date("m",$time)-date("m",time()); $cu= "vor etwa " .preg_replace("#-#", "", $current)." Monat/en"; return $cu; } elseif($time <= time()-86400){ if(date("d",$time) >= date("d",time())){ if(date("d",time())-date("d",$time)-30 === date("d",$time)){ $current = date("d",$time)-30-date("d",time()); } else { $current = date("d",$time)-31-date("d",time()); } } else { $current = date("d",$time)-date("d",time()); } $cu= "vor " .preg_replace("#-#", "", $current)." Tag/en"; return $cu; } elseif($time > time()-3600 && $time <= time()) { if(date("i",$time) >= date("i",time())){ $current = date("i",$time)-60-date("i",time()); if($current === -60){ $current=0; } } else { $current = date("i",$time)-date("i",time()); } $cu= "vor etwa " . floor(preg_replace("#-#", "",$current))." Minute/en"; return $cu; } elseif($time > time()-86400) { if(date("H",$time) >= date("H",time())){ $current = date("H",$time)-24-date("H",time()); } else { $current = date("H",$time)-date("H",time()); } $cu= "vor etwa " .preg_replace("#-#", "", $current)." Stunde/en"; return $cu; } } public static function getStrTime($time_string,$b=true){ if($b == true){ if(!empty($time_string)){ $getUnixDate = (strpos($time_string, '.') !== false)? strtotime($time_string) : $time_string; $output = self::date_str($getUnixDate); } else { $output = self::date_str(time()); } } else { $getUnixDate = (strpos($time_string, '.') !== false)? strtotime($time_string) : $time_string; $output = $getUnixDate; } return $output; } public static function trans_html($obj){ $str = preg_replace('#\[url=(.*)=(.*)\]#Uis', '<a href="\1" target="_blank">\2</a>', $obj); $str = preg_replace('#\[img=(.*)\]#Uis', '<a href="\1" target="_blank"><img width="75" height="75" src="\1"></a></img>', $str); $str = preg_replace('#\[img=(.*) title=(.*)\]#Uis', '<a href="\1" target="_blank"><img width="75" height="75" src="\1" title="\2"></a></img>', $str); $str = preg_replace('#\[b\](.*)\[/b\]#Uis', '<b>\1</b>', $str); $str = preg_replace('#\[u\](.*)\[/u\]#Uis', '<u>\1</u>', $str); $str = preg_replace('#\[kurv\](.*)\[/kurv\]#Uis', '<i>\1</i>', $str); $str = preg_replace('#\<br\>(.*)\<\/br\>#Uis', '<br>\1</br>', $str); return $str; } } class HabboInit extends FunctionList{ //Link IMMER ohne "/" am Ende! public static $path = Array("site"=>SitePath,"img"=>"UNDEFINED"); public static function SiteData($s,$typ=false){ if($s === "CONF"){ $row = parent::Query_select_rows("strl_config","id","1"); if($row !== 0){ if($typ === "desc"){ $sel = parent::Query_fetch_object("site_description","strl_config","id='1'"); $turn = $sel->site_description; } if($typ === "lang"){ $sel = parent::Query_fetch_object("site_lang","strl_config","id='1'"); $turn = $sel->site_lang; } if($typ === "loc"){ $sel = parent::Query_fetch_object("site_locale","strl_config","id='1'"); $turn = $sel->site_locale; } if($typ === "tags"){ $sel = parent::Query_fetch_object("site_tags","strl_config","id='1'"); $turn = $sel->site_tags; } if($typ === "path"){ $sel = parent::Query_fetch_object("site_path","strl_config","id='1'"); $turn = $sel->site_path; } if($typ === "SName"){ $sel = parent::Query_fetch_object("site_name","strl_config","id='1'"); $turn = $sel->site_name; } if($typ === "title"){ $sel = parent::Query_fetch_object("site_title","strl_config","id='1'"); $turn = $sel->site_title; } if($typ === "vers"){ $sel = parent::Query_fetch_object("site_version","strl_config","id='1'"); $turn = $sel->site_version; } if($typ === "build"){ $sel = parent::Query_fetch_object("site_build","strl_config","id='1'"); $turn = $sel->site_build; } if($typ === "credits"){ $sel = parent::Query_fetch_object("site_credits","strl_config","id='1'"); $turn = $sel->site_credits; } } else { $turn = false; } } /*case "HEADER"; break; case "CONTENT"; break; case "FOOTER"; break;*/ return $turn; } public static function CatchID($s,$q){ global $mysqli_db; if($mysqli_db){ $db = $mysqli_db; $sel = $db::query("SELECT id FROM ".$q." WHERE id > 0"); if($sel->select_rows > 0){ $myID = $db::fetch_object($sel); return $myID->id; } else { return 0; } } } public static function getNextRegDate($ip,$t){ $time = time()-$t; $sel = parent::Query_select_rows("register_check_ip","user_ip='".$ip."' && date > ".$time."",false,true); if($sel > 0){ $sel = parent::Query_fetch_object("date","register_check_ip","user_ip='".$ip."'"); return $sel->date; } else { return time(); } } public static function getBadgeText($badgeID){ $row = 1; /*if(($handle = fopen("http://Link/swf/external_flash_texts3.txt","r")) !== false){ }*/ } } class MyHabbo implements userInterface{ public $user_id, $username, $mail, $rank, $credits, $birth, $avatar, $vip_points, $pixels, $ActivityPoints, $activ_p_lastupdate, $look, $gender, $motto, $activate_state, $account_activ, $account_created, $last_online, $online, $ip_last, $ip_reg, $respect, $is_muted, $isFriend = 0, $isRFriend = 0, $stats_setted, $block_frequest, $block_trading, $block_follow, $logged_in = false, $user_session = "logged_activ_user", $settings_prfl, $settings_prfl_for, $settings_gbpl, $settings_gbfr, $settings_nwsltr, $session_security = "CPL_sess_crypt_e"; private $db, $MUS_cmd, $CData, $session_object = false; protected $_ControlSession = false; public function __construct($db){ global $MUS_cmd; $this->db = $db; $this->MUS_cmd = $MUS_cmd; $this->CData = new HabboInit(); $this->_ControlSession = new UserSessionControl($this->db,$this->user_session); $this->_ControlSession->uid = isset($_SESSION[$this->user_session]['conn_name'])? $this->getUserId($_SESSION[$this->user_session]['conn_name']) : false; $this->session_object = true; if($this->logged_in()){ session_regenerate_id(); $userRowQuery = $this->db->query("SELECT users.id, username, mail, rank, birth, credits, vip_points, activity_points, users_stats.achievement_score, activity_points_lastupdate, look, gender, motto, account_created, last_online, online, ip_last, ip_reg, users_stats.respect, is_muted, block_newfriends, hide_inroom FROM users, users_stats WHERE username = '".$_SESSION[$this->user_session]["conn_name"]."' && users.id=users_stats.id || mail = '".$_SESSION[$this->user_session]["conn_name"]."' && users.id=users_stats.id") or die($this->db->error); if($userRowQuery->num_rows > 0){ $userRow = $userRowQuery->fetch_object(); $userRowQuery->close(); goto SELECT_SETTINGS; SELECT_SETTINGS: { $userDataQuery = $this->db->query("SELECT id, uid, open_profile, allow_guestbook, allow_hashtaging, newsletter_abo, is_enabled FROM users_settings WHERE uid = '".$userRow->id."'"); $affected = $this->db->affected_rows; if(!$affected){ $userDataQuery->close(); $save = $this->db->query("INSERT INTO users_settings (uid) VALUES ('".$userRow->id."')"); $saveAffected = $this->db->affected_rows; goto SELECT_SETTINGS; } else { $userData = $userDataQuery->fetch_object(); $userDataQuery->close(); } } $this->settings_nwsltr = ((int)$userData->newsletter_abo == 1)? 0 : 1; switch($userData->open_profile){ case 0: $this->settings_prfl = 1; $this->settings_prfl_for = 0; break; case 1: $this->settings_prfl = 0; $this->settings_prfl_for = 0; break; case 2: $this->settings_prfl = 0; $this->settings_prfl_for = 1; break; } switch($userData->allow_guestbook){ case 0: $this->settings_gbpl = 1; $this->settings_gbfr = 0; break; case 1: $this->settings_gbpl = 0; $this->settings_gbfr = 0; break; case 2: $this->settings_gbpl = 0; $this->settings_gbfr = 1; break; } $this->user_id = $userRow->id; $this->username = $userRow->username; $this->avatar = $userRow->username; $this->mail = $userRow->mail; $this->rank = $userRow->rank; $this->birth = $userRow->birth; $this->credits = $userRow->credits; $this->vip_points = $userRow->vip_points; $this->activate_state = $userData->is_enabled; $this->account_activ = ((int)$userData->is_enabled == 1)? "Account aktiviert" : "Account nicht aktiviert"; $this->pixels = $userRow->activity_points; $this->ActivityPoints = $userRow->achievement_score; $this->activ_p_lastupdate = $userRow->activity_points_lastupdate; $this->look = $userRow->look; $this->gender = $userRow->gender; $this->motto = $userRow->motto; $this->account_created = $userRow->account_created; $this->last_online = $userRow->last_online; $this->online = $userRow->online; $this->ip_last = $userRow->ip_last; $this->ip_reg = $userRow->ip_reg; $this->respect = $userRow->respect; $this->is_muted = $userRow->is_muted; $this->block_frequest = $userRow->block_newfriends; // $this->block_trading = $userRow->accept_trading; $this->block_follow = $userRow->hide_inroom; $this->setDailyPoints(); $this->logged_in = true; } else { $this->logged_in = false; } } else { $this->logged_in = false; } } private function setDailyPoints(){ if($this->activ_p_lastupdate <= (time()-(24*60*60))){ $UpdateVal = 3; switch($this->rank){ case 1: $UpdateVal = 5; break; case 2: $UpdateVal = 5; break; case 3: $UpdateVal = 10; break; case 4: $UpdateVal = 20; break; case 5: $UpdateVal = 50; break; case 6: $UpdateVal = 100; break; case 7: $UpdateVal = 150; break; case 8: $UpdateVal = 200; break; case 9: $UpdateVal = 5000; break; } $this->db->query("UPDATE users, users_stats SET users.activity_points_lastupdate = ".time().", users_stats.daily_respect_points = {$UpdateVal}, users_stats.daily_pet_respect_points = {$UpdateVal}, users_stats.daily_competition_votes = {$UpdateVal} WHERE users.id = {$this->user_id} && users_stats.id = users.id"); //if($this->db->affected_rows) //return true; //else return false; } else { return false; } } public function logged_in($do=false){ $reason = "false"; $control = ($this->session_object)? $this->_ControlSession->checkLoginState() : false; $log = (isset($_SESSION[$this->user_session]) && isset($_SESSION[$this->user_session]["logged"]) && $_SESSION[$this->user_session]["logged"] == true) ? true : false; if($do === "data:admin" && $log){ $log = (isset($_SESSION[$this->user_session]) && isset($_SESSION[$this->user_session]["logged_admin"]) && $_SESSION[$this->user_session]["logged_admin"] == true) ? true : false; } if($control) if($this->IsBanned()){ $control = false; $reason = "BannContactSupport"; goto SESSION_CLOSED; } if(empty($do) || $do===false){ if($log){ if(!$control) goto SESSION_CLOSED; else return $control; } else return $log; } if($do === "data:unset"){ $this->db->query("UPDATE users_sessions SET activity = '0' WHERE uid = {$this->_ControlSession->uid} && session_src = '{$_SESSION[$this->user_session]['ssid_src']}'") or die($this->db->error); goto SESSION_CLOSED; } SESSION_CLOSED: { $_SESSION = array(); unset($_SESSION[$this->user_session]); setcookie(session_name(),"0", time()-3600, "/"); session_unset(); session_destroy(); session_regenerate_id(true); header("location: ".HabboInit::$path['site']."/?logged_out=MEOUT&closedSession&typ={$reason}"); //header("location: ".HabboInit::$path['site']."/goodbye/hash/".$hash."/status/closed"); exit(); } } private function IsBanned(){ $GetUsername = $this->CData->Query_fetch_object("username","users","mail='{$_SESSION[$this->user_session]["conn_name"]}'"); $num_ban = $this->CData->Query_select_rows("users_bans","value='{$GetUsername->username}' AND bantype='user' OR value='{$this->CData->remote_ip}' AND bantype='ip'",false,true); if($num_ban > 0){ $bandata = $this->CData->Query_fetch_object("reason,expire","users_bans","value='{$GetUsername->username}' AND bantype='user' OR value='{$this->CData->remote_ip}' AND bantype ='ip'"); $timestamp = time(); if($bandata->expire > $timestamp){ return true; } else { $this->CData->MySQL_delete("users_bans","value='{$GetUsername->username}' AND bantype='user' AND expire > ".time()." OR value='{$this->CData->remote_ip}' AND bantype='ip' AND expire > ".time()." LIMIT 1"); return false; } } else { return false; } } private function getUserId($user){ $userRowQuery = $this->db->query("SELECT users.id FROM users WHERE users.username = '{$user}' || users.mail = '{$user}'") or die($this->db->error); if($this->db->affected_rows){ $id = $userRowQuery->fetch_object()->id; $userRowQuery->close(); return $id; } else return false; } public function set_logged_in($user,$pass,$location=true){ if(!empty($user) && !empty($pass)){ $this->_ControlSession->uid = $this->getUserId($user); $this->_ControlSession->DoSomethingCool(); if($this->_ControlSession->checkLoginState()){ $_SESSION[$this->user_session]['conn_name'] = $user; $_SESSION[$this->user_session]['conn_passo'] = FunctionList::NowHashMDSHA($pass, $user); if($location) header('location: '.HabboInit::$path['site'].'/index?logged_in'); else return "3"; } } } public function isLoggedIn(){ return $this->logged_in; } } class UserSessionControl{ public $uid; private $db, $length = 22, $browser, $sess_name; protected $session_src, $generator; public function __construct($db,$sess_name){ $secure = "Yog6*faK$2!@%g*Sdvf^5DG_A87fg^FD4\$POEFThrR_gh(API*/P[SSI])"; $this->generator = new SecureStringGenerator($secure); $this->db = $db; $this->sess_name = $sess_name; $this->browser = FunctionList::getBrowser(); } public function DoSomethingCool(){ !$this->checkLoginState() and $this->setNewActiveSession(); } public function checkLoginState(){ if(isset($_SESSION[$this->sess_name]['ssid_src'])){ if($this->uid){ $sql = $this->db->query("SELECT activity FROM users_sessions WHERE uid = {$this->uid} && session_src = '{$_SESSION[$this->sess_name]['ssid_src']}' LIMIT 1"); $affectedRows = $this->db->affected_rows; if($affectedRows){ $activity = (int) $sql->fetch_object()->activity; $sql->close(); if($activity) return true; else return false; } else return false; } else return false; } else return false; } private function setNewActiveSession(){ $this->session_src = FunctionList::FilterText($this->generator->generate($this->length),true); SECURE_TRY_CASE: { try { $sql = $this->db->query("SELECT id FROM users_sessions WHERE uid = {$this->uid} && session_src = '{$this->session_src}'"); $affectedRows = $this->db->affected_rows; if($affectedRows){ $sql->close(); throw new Exception("Secure Source gefunden"); } else { $sql->close(); $stmt = $this->db->prepare("INSERT INTO users_sessions (uid,session_src,activity,active_since,browser,browser_name,browser_version,platform,platform_unit) VALUES (?,?,?,?,?,?,?,?,?)"); $stmt->bind_param("issississ",$user_id,$secure,$activ,$timestamp,$brws,$brwsname,$brwsve,$platform,$platformUnit); $user_id = $this->uid; $secure = $this->session_src; $activ = '1'; $timestamp = time(); $brws = $this->browser['userAgent']; $brwsname = $this->browser['name']; $brwsve = $this->browser['version']; $platform = $this->browser['platform']; $platformUnit = FunctionList::getOS(); $stmt->execute(); $affectedRows = $this->db->affected_rows; $stmt->close(); if($affectedRows){ $_SESSION[$this->sess_name]['ssid_src'] = $this->session_src; $_SESSION[$this->sess_name]["logged"] = true; return true; } else throw new Exception("Konnte irg. wie nicht eingetragen werden"); } } catch(Exception $e){ if($e){ $this->session_src = $this->generator->generate($this->length); goto SECURE_TRY_CASE; } } } } } class HabboLogs{ private $db, $CData; public function __construct($db,$flist){ $this->db = $db; $this->CData = $flist; } public function DoLog($log,$uid,$error=false){ if(isset($log,$uid)){ $e = ($error == true)? 1 : 0; $s = (isset($_SESSION['logged_activ_user']['ssid_src']))? $_SESSION['logged_activ_user']['ssid_src'] : false; $stmt = $this->db->prepare("INSERT INTO users_logs (uid,activity,activity_date,error,ip_activity_did,session_src) VALUES(?,?,?,?,?,?)"); $stmt->bind_param("isisss",$rid,$act,$dat,$err,$ipa,$ses); $rid = (int) $this->CData->FilterText($uid); $act = $this->CData->FilterText($log); $dat = (int) time(); $err = $e; $ipa = $this->CData->remote_ip."8.8.6.8"; $ses = $s; $stmt->execute(); $affected = $stmt->affected_rows; $stmt->close(); return $affected? true : false; } } } class OtherHabbo{ public $user_id, $username, $mail, $rank, $credits, $birth, $vip_points, $pixels, $avatar, $ActivityPoints, $activ_p_lastupdate, $look, $gender, $motto, $account_created, $last_online, $online, $ip_last, $ip_reg, $respect, $is_muted, $isFriend, $isRFriend, $block_frequest, $block_trading, $block_follow, $allow_guestbook, $allow_hashtaging, $open_profile; private $db, $MyHabbo; public function __construct($db,$myhabbo){ $this->db = $db; $this->MyHabbo = $myhabbo; } public function searchHabbo($name){ $username = $name; $userRowQuery = $this->db->query("SELECT users.id, username, mail, rank, birth, credits, vip_points, activity_points, users_stats.achievement_score, activity_points_lastupdate, look, gender, motto, account_created, last_online, online, ip_last, ip_reg, users_stats.respect, is_muted, block_newfriends, hide_inroom, users_settings.uid, users_settings.open_profile, users_settings.allow_guestbook, users_settings.allow_hashtaging FROM users, users_stats, users_settings WHERE users.username = '{$username}' && users.id=users_stats.id && users.id=users_settings.uid") or die($this->db->error); if($userRowQuery->num_rows > 0){ $userRow = $userRowQuery->fetch_object(); $userRowQuery->close(); $this->user_id = $userRow->id; $this->username = $userRow->username; $this->avatar = $userRow->username; $this->mail = $userRow->mail; $this->rank = $userRow->rank; $this->birth = $userRow->birth; $this->credits = $userRow->credits; $this->vip_points = $userRow->vip_points; $this->pixels = $userRow->activity_points; $this->ActivityPoints = $userRow->achievement_score; $this->activ_p_lastupdate = $userRow->activity_points_lastupdate; $this->look = $userRow->look; $this->gender = $userRow->gender; $this->motto = $userRow->motto; $this->account_created = $userRow->account_created; $this->last_online = $userRow->last_online; $this->online = $userRow->online; $this->ip_last = $userRow->ip_last; $this->ip_reg = $userRow->ip_reg; $this->respect = $userRow->respect; $this->is_muted = $userRow->is_muted; $this->block_frequest = $userRow->block_newfriends; //$this->block_trading = $userRow->accept_trading; $this->block_follow = $userRow->hide_inroom; $this->open_profile = $userRow->open_profile; $this->allow_hashtaging = $userRow->allow_hashtaging; $this->allow_guestbook = $userRow->allow_guestbook; switch($userRow->open_profile){ case 0: $this->open_profile = false; break; case 1: if($this->checkFriendship()) $this->open_profile = true; break; case 2: $this->open_profile = true; break; } if($this->checkFriendship()) $this->isFriend = 2; elseif($this->user_id !== $this->MyHabbo->user_id) $this->isFriend = 1; else $this->isFriend = 0; if($this->checkFriendshipRequest()) $this->isRFriend = 1; else $this->isRFriend = 0; $userRow = false; } else { $userRowQuery->close(); $this->open_profile = false; } } public function checkFriendship(){ if($this->user_id){ $friendship = $this->db->query("SELECT user_two_id FROM messenger_friendships WHERE user_one_id = '{$this->MyHabbo->user_id}' && user_two_id = '{$this->user_id}' || user_two_id = '{$this->MyHabbo->user_id}' && user_one_id = '{$this->user_id}'") or die($this->db->error); $saveNum = $friendship->num_rows; $friendship->close(); if($saveNum > 0) return true; else return false; } else { return false; } } public function checkFriendshipRequest(){ if($this->user_id){ $friendship = $this->db->query("SELECT id FROM messenger_requests WHERE from_id = '{$this->MyHabbo->user_id}' && to_id = '{$this->user_id}'") or die($this->db->error); $saveNum = $friendship->num_rows; $friendship->close(); if($saveNum > 0) return true; else return false; } else { return false; } } public function close(){ // SET STANDARD $this->user_id = false; $this->username = false; $this->avatar = false; $this->mail = false; $this->rank = false; $this->birth = false; $this->credits = false; $this->vip_points = false; $this->pixels = false; $this->ActivityPoints = false; $this->activ_p_lastupdate = false; $this->look = false; $this->gender = false; $this->motto = false; $this->account_created = false; $this->last_online = false; $this->online = false; $this->ip_last = false; $this->ip_reg = false; $this->respect = false; $this->is_muted = false; $this->block_frequest = false; $this->block_trading = false; $this->block_follow = false; $this->block_follow = false; $this->allow_guestbook = false; $this->allow_hashtaging = false; $this->open_profile = false; } } class HabboNews{ public $news_id, $title, $category, $story, $published, $author, $images, $comment_count, $lista = "", $searchedNews = false; private $db, $MyHabbo; public function __construct($db){ $this->db = $db; } public function searchNews($id,$last=false){ $nId = ($last) ? "id > ".$id." ORDER BY ID DESC" : "id = ".$id; $newsRowQuery = $this->db->query("SELECT id, title, category, image, shortstory, published, author, images FROM cms_news WHERE {$nId} LIMIT 1"); if($newsRowQuery->num_rows > 0){ $newsRow = $newsRowQuery->fetch_object(); $newsRowQuery->close(); $newsRowQueryList = $this->db->query("SELECT id,title FROM cms_news WHERE 1 ORDER BY ID DESC"); $int = 0; $count = $this->db->affected_rows; if($count > 1){ while($objSrcR=$newsRowQueryList->fetch_object()){ $int++; $komma = ($int-1 !== $count)? "}," : ""; $last = ($int !== $count)? "}," : ""; $this->lista .= $objSrcR->id.$komma.$objSrcR->title.$last; } } else { $objSrcR = $newsRowQueryList->fetch_object(); $this->lista .= $objSrcR->id."},".$objSrcR->title; } $newsRowQueryList->close(); $this->news_id = $newsRow->id; $this->title = $newsRow->title; $this->category = $newsRow->category; $this->image = $newsRow->image; $this->story = $newsRow->shortstory; $this->published = $newsRow->published; $this->author = $newsRow->author; $this->images = $newsRow->images; $news_cmnt_RowQuery = $this->db->query("SELECT COUNT(id) FROM cms_news_comments WHERE article_id = {$this->news_id} LIMIT 1"); $fetcha = $news_cmnt_RowQuery->fetch_row(); $news_cmnt_RowQuery->close(); $this->comment_count = $fetcha[0]; $newsRow = false; $this->searchedNews = true; } else { $this->searchedNews = false; $newsRowQuery->close(); } } public function close(){ // SET STANDARD $this->news_id = false; $this->title = false; $this->category = false; $this->image = false; $this->shortstory = false; $this->longstory = false; $this->published = false; $this->author = false; $this->images = false; $this->lista = false; $this->searchedNews = false; } } class MakeSources{ private $db, $MUS_cmd, $CData, $postData, $MyHabbo, $OtherHabbo, $NewsData = false, $gettedSrc, $getableSrcTypeString, $getableSrcDataString, $ProtectedParse = false, $otherSources = false, $LastCount = false, $Sources = false; public function __construct($src,$db){ global $MUS_cmd; $this->db = $db; $this->MUS_cmd = $MUS_cmd; $this->CData = new FunctionList(); $this->MyHabbo = new MyHabbo($db); $this->OtherHabbo = new OtherHabbo($db,$this->MyHabbo); $this->startProgress($src); } private function startProgress($src){ if(isset($src['CPl_INIGETosSrc']) && !empty($src['CPl_INIGETosSrc'])){ $this->gettedSrc = explode(",",$src['CPl_INIGETosSrc']); if($this->paraeSrc()){ $this->displaySource(); } } if(isset($src['CPl_INIStaffsOsSrc']) && !empty($src['CPl_INIStaffsOsSrc'])){ $this->gettedSrc = explode(",",$src['CPl_INIStaffsOsSrc']); if(!empty($this->gettedSrc)){ $this->ProtectedParse = true; if($this->paraeSrc()){ if($this->otherSources !== false){ $this->displaySource($this->otherSources); } } } } if(isset($src['CPl_INIGETncmSrc']) && !empty($src['CPl_INIGETncmSrc'])){ $this->gettedSrc = explode(",",$src['CPl_INIGETncmSrc']); if(!empty($this->gettedSrc)){ $this->ProtectedParse = true; if($this->paraeSrc()){ if($this->otherSources !== false){ $this->displaySource($this->otherSources); } } } } if(isset($src['CPl_ININewsOsSrc']) && !empty($src['CPl_ININewsOsSrc'])){ $this->gettedSrc = explode(",",$src['CPl_ININewsOsSrc']); if($this->initNews($this->gettedSrc[1])) echo $this->Sources; } if(isset($src['CPl_INISenDosSrc']) && !empty($src['CPl_INISenDosSrc'])){ $this->gettedSrc = explode('-ESp=☺♫-',$src['CPl_INISenDosSrc']); if(count($this->gettedSrc) == 3){ if($this->insertData()) echo 1; else echo 0; } else { echo "Corrupt Error appeared Count:".count($this->gettedSrc).";\n Source:".$src['CPl_INISenDosSrc']."\n Next:".var_dump($this->gettedSrc); } } } private function initNews($last=false,$check=false){ if($check && $last !== 0){ $lastI = (int) $this->CData->FilterText($last,true); $newsRow = $this->CData->MySQL_select("COUNT(id)","cms_news"," id = {$lastI}"); $lala = $newsRow->fetch_row(); $this->LastCount = $lala[0]; $newsRow->close(); return true; } elseif($this->gettedSrc[0] == "S1" && $last !== "0"){ $lastI = (int) $this->CData->FilterText($last,true); $newsRow = $this->CData->MySQL_select("COUNT(id)","cms_news"," id > {$lastI}"); $lala = $newsRow->fetch_row(); $this->Sources = $lala[0]; $newsRow->close(); return true; } else { $newsRow = $this->CData->MySQL_select("id,title,category,image,shortstory,longstory,published,author,important,images","cms_news"," id > 0 ORDER BY ID DESC LIMIT 10"); $i=0; $varNews = "_this.newNewsVars = \""; while($news=$newsRow->fetch_object()){ $i++; $varNews .= "_this.NewsNumb_{$i} = {$news->id},"; $varNews .= "_this.NewsTitle_{$i} = '".preg_replace("#\</br>#Uis","",preg_replace("#\<br>#Uis","",$news->title))."',"; $varNews .= "_this.NewsLongstory_{$i} = '".preg_replace("#\</br>#Uis","",preg_replace("#\<br>#Uis","",$news->longstory))."',"; $varNews .= "_this.NewsPushlished_{$i} = '".date("d.m.Y H:i:s",$news->published)."',"; $varNews .= "_this.NewsPublishedDateString_{$i} = '".$this->CData->date_str($news->published)."',"; $varNews .= "_this.NewsBackgroundImage_{$i} = '{$news->image}',"; } $newsRow->close(); $varNews .= "_this.NewsInternal = {$i}\";"; $this->Sources = $varNews; return true; } } private function insertData(){ $affectedRows = 0; $insert_data = $this->CData->FilterText($this->gettedSrc[1],false); $insert_data_for = (int) $this->CData->FilterText($this->gettedSrc[2],true); if(!empty($this->gettedSrc[0]) && !empty($this->gettedSrc[1]) && !empty($this->gettedSrc[2]) && $this->MyHabbo->logged_in){ switch($this->gettedSrc[0]){ case "guestbook_query": if(strlen(utf8_decode ($this->gettedSrc[1])) >= 1 && $insert_data_for !== 0 && strlen(utf8_decode ($this->gettedSrc[1])) <= 360){ $ug_query = $this->db->query("SELECT users.id FROM users WHERE users.id = {$insert_data_for}"); $affected = $this->db->affected_rows; if($affected){ $allowed_to_post = false; $guestbook_data = $ug_query->fetch_object(); $ug_query->close(); $guestbook_query = $this->db->query("SELECT users_guestbook.id, users_guestbook.published FROM users_guestbook WHERE users_guestbook.uid = {$this->MyHabbo->user_id} && users_guestbook.to_id = {$guestbook_data->id} ORDER BY id DESC LIMIT 1"); $affected = $this->db->affected_rows; if($affected){ $guestbook_data2 = $guestbook_query->fetch_object(); $guestbook_query->close(); $guestbook_query = $this->db->query("SELECT users_guestbook.id FROM users_guestbook WHERE users_guestbook.to_id = {$guestbook_data->id} && users_guestbook.id > {$guestbook_data2->id} && users_guestbook.uid != {$this->MyHabbo->user_id}"); $check_not_my_last_CMNTBitch = $this->db->affected_rows; if($check_not_my_last_CMNTBitch){ if($guestbook_query->num_rows > 0) $allowed_to_post = true; } else { $allowed_to_post = ((time() - (int)$guestbook_data2->published) > 1800)? true : false; } if($this->MyHabbo->rank >= 7) $allowed_to_post = true; } else { $allowed_to_post = true; } if($allowed_to_post){ $stmt = $this->db->prepare("INSERT INTO users_guestbook (uid,to_id,comment,published) VALUES (?,?,?,?)"); $stmt->bind_param("iisi",$gbuId,$user_id,$gb_cmnt,$date); $gbuId = $this->MyHabbo->user_id; $user_id = $guestbook_data->id; $gb_cmnt = $insert_data; $date = time(); $stmt->execute(); $affectedRows = $this->db->affected_rows; $stmt->close(); } } else { $ug_query->close(); } } else { return false; } break; case "article_cmnt": if(strlen(utf8_decode($this->gettedSrc[1])) >= 1 && $insert_data_for !== 0 && strlen(utf8_decode($this->gettedSrc[1])) <= 360){ $getEnabled = $this->db->query("SELECT id FROM users_settings WHERE users_settings.uid = {$this->MyHabbo->user_id} && users_settings.is_enabled = '1'"); $affected = $this->db->affected_rows; $getEnabled->close(); if($affected){ $news_query = $this->db->query("SELECT cms_news.id FROM cms_news WHERE cms_news.id = {$insert_data_for}"); $affected = $this->db->affected_rows; if($affected){ $news_data = $news_query->fetch_object(); $news_query->close(); $stmt = $this->db->prepare("INSERT INTO cms_news_comments (article_id,user_id,comment,timestamp) VALUES (?,?,?,?)"); $stmt->bind_param("iisi",$newsId,$user_id,$news_cmnt,$date); $user_id = $this->MyHabbo->user_id; $newsId = $news_data->id; $news_cmnt = $insert_data; $date = time(); $stmt->execute(); $affectedRows = $this->db->affected_rows; $stmt->close(); } else { $news_query->close(); } } } else { return false; } break; case "friendship_query": if($insert_data_for){ $friendship_query = $this->db->query("SELECT messenger_friendships.user_two_id FROM messenger_friendships WHERE messenger_friendships.user_one_id = {$this->MyHabbo->user_id} && messenger_friendships.user_two_id = {$insert_data_for}"); $affected = $this->db->affected_rows; if(!$affected){ $friendship_query->close(); $user_query = $this->db->query("SELECT users.id FROM users WHERE users.id = {$insert_data_for} && users.id != {$this->MyHabbo->user_id}"); $affected = $this->db->affected_rows; if($affected){ $user_data = $user_query->fetch_object(); $user_query->close(); $request_query = $this->db->query("SELECT messenger_requests.from_id FROM messenger_requests WHERE messenger_requests.from_id = {$this->MyHabbo->user_id} && messenger_requests.to_id = {$user_data->id}"); $affected = $this->db->affected_rows; if(!$affected){ $request_query->close(); $stmt = $this->db->prepare("INSERT INTO messenger_requests (from_id,to_id) VALUES (?,?)"); $stmt->bind_param("ii",$user_id,$to_id); $user_id = $this->MyHabbo->user_id; $to_id = $user_data->id; $date = time(); $stmt->execute(); $affectedRows = $this->db->affected_rows; $stmt->close(); $this->MUS_cmd->send('onnewrequest', array($user_id, $to_id)); } else { $request_query->close(); } } else { $user_query->close(); } } else { $friendship_query->close(); } } else { $affectedRows = 0; } break; } if($affectedRows > 0) return true; } else { return false; } } private function displaySource($otherSource=false){ if($this->Sources && !$otherSource){ echo '_this.CreateSource = ['.$this->getableSrcTypeString.'];_this.CreateSourceText = ['.$this->getableSrcDataString.'];'; } if($otherSource && !empty($otherSource)){ echo $otherSource; } } private function paraeSrc(){ $this->getableSrcTypeString = "\"0\","; $this->getableSrcDataString = "\"0\","; $valideSrc = array("user_id"=>true,"onlinecount"=>true,"account_activ"=>true,"activate_state"=>true,"settings_prfl"=>true,"settings_prfl_for"=>true,"settings_frnshp"=>true,"settings_gbpl"=>true,"settings_gbfr"=>true,"settings_nwsltr"=>true,"block_frequest"=>true, "username"=>true, "mail"=>true, "avatar"=>true, "auth_ticket"=>true, "rank"=>true, "credits"=>true,"pixels"=>true,"vip_points"=>true, "ActivityPoints"=>true, "activity_points_lastupdate"=>true, "look"=>true, "gender"=>true, "motto"=>true, "account_created"=>true, "last_online"=>true, "ip_reg"=>true, "respect"=>true, "newbie_status"=>true, "is_muted"=>true, "isFriend"=>true, "isRFriend"=>true); //$valideNSrc = array("news_id"=>true, "title"=>true, "category"=>true, "story"=>true,"published"=>true,"author"=>true, "images"=>true); $countSrc = count($this->gettedSrc); $i = 1; //Wichtig $i darf nicht überschrieben werden! $isUserSite = false; $UserSitename = false; $userQuery = false; $error = false; foreach((array) $this->gettedSrc as $src){ $gSrc = str_replace(array("{","}"),"",$src); $cut = ($i < $countSrc) ? "," : ""; if($error){ break; } if(!strstr($gSrc,':') && !empty($gSrc)){ if(!strstr($gSrc,'-')){ if(isset($valideSrc[$gSrc])){ if($isUserSite) eval("\$data = \$this->OtherHabbo->\$gSrc;"); elseif($this->MyHabbo->logged_in) eval("\$data = \$this->MyHabbo->\$gSrc;"); $this->getableSrcDataString .= (isset($data)) ? "\"". $this->CData->FilterText($data)."\"".$cut : ""; $this->getableSrcTypeString .= (isset($data)) ? "\"".$this->CData->FilterText($src)."\"".$cut : ""; } } else { $parseGsrc = explode("-",$gSrc); $todoIs = $parseGsrc[0]; $doQuery = $parseGsrc[1]; switch($todoIs){ case "count": switch($doQuery){ case "friends": if($this->MyHabbo->logged_in){ $SearchID = ($isUserSite)? $this->OtherHabbo->user_id : $this->MyHabbo->user_id; if($SearchID){ $friendsCount = $this->db->query("SELECT COUNT(user_two_id) FROM messenger_friendships WHERE user_one_id = '{$SearchID}' && user_two_id!=user_one_id || user_two_id = '{$SearchID}' && user_two_id!=user_one_id") or die($this->db->error); $saveCount = $friendsCount->fetch_row(); $friendsCount->close(); } else { $saveCount[0] = 0; } $this->getableSrcDataString .= "\"". $this->CData->FilterText($saveCount[0],true)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } break; case "guestbook_query": if($this->MyHabbo->logged_in){ $SearchID = ($isUserSite)? $this->OtherHabbo->user_id : $this->MyHabbo->user_id; if($SearchID){ $friendsCount = $this->db->query("SELECT COUNT(id) FROM users_guestbook WHERE to_id = {$SearchID}") or die($this->db->error); $saveCount = $friendsCount->fetch_row(); $friendsCount->close(); } else { $saveCount[0] = 0; } $this->getableSrcDataString .= "\"". $this->CData->FilterText($saveCount[0],true)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } break; case "guestbook_users": if($this->MyHabbo->logged_in){ $SearchID = ($isUserSite)? $this->OtherHabbo->user_id : $this->MyHabbo->user_id; if($SearchID){ $friendsCount = $this->db->query("SELECT COUNT(DISTINCT uid) FROM users_guestbook WHERE to_id = {$SearchID}") or die($this->db->error); $saveCount = $friendsCount->fetch_row(); $friendsCount->close(); } else { $saveCount[0] = 0; } $this->getableSrcDataString .= "\"". $this->CData->FilterText($saveCount[0],true)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } break; case "online": $onlinecount = $this->db->query("SELECT users_online FROM server_status WHERE id = '1'") or die($this->db->error); $saveCount = $onlinecount->fetch_object(); $onlinecount->close(); $saveCount = $saveCount->users_online; $this->getableSrcDataString .= "\"". $this->CData->FilterText($saveCount,true)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; break; } break; case "dateStr": switch($doQuery){ case "account_created": if($this->MyHabbo->logged_in){ $dateStr = ($isUserSite)? $this->CData->getStrTime($this->OtherHabbo->account_created) : $this->CData->getStrTime($this->MyHabbo->account_created); $this->getableSrcDataString .= "\"". $this->CData->FilterText($dateStr)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } break; case "last_online": if($this->MyHabbo->logged_in){ $dateStr = ($isUserSite)? $this->CData->getStrTime($this->OtherHabbo->last_online) : $this->CData->getStrTime($this->MyHabbo->last_online); $this->getableSrcDataString .= "\"". $this->CData->FilterText($dateStr)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } break; } break; case "logs": if($this->MyHabbo->logged_in){ $case = (int) $this->CData->FilterText($parseGsrc[2],true); switch($doQuery){ case "date": $dateStr = ""; $date = date("d-m-Y",(time()-(3600*24*($case-1)))); $loa = $this->db->query("SELECT activity_date FROM users_logs WHERE DATE_FORMAT(FROM_UNIXTIME(activity_date),'%d-%m-%Y') = '{$date}' && uid = {$this->MyHabbo->user_id} ORDER BY activity_date DESC LIMIT 1"); if($this->db->affected_rows){ $lb = $loa->fetch_object(); $dateStr = date('d.m.Y',$lb->activity_date); } $this->getableSrcDataString .= "\"". $this->CData->FilterText($dateStr)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; $loa->close(); break; case "error": $errorNum = 0; $srcError = ""; $date = date("d-m-Y",(time()-(3600*24*($case-1)))); $loa = $this->db->query("SELECT COUNT(id) FROM users_logs WHERE DATE_FORMAT(FROM_UNIXTIME(activity_date),'%d-%m-%Y') = '{$date}' && uid = {$this->MyHabbo->user_id} && error = '1' ORDER BY activity_date DESC LIMIT 1"); if($this->db->affected_rows){ $lb = $loa->fetch_row(); $errorNum = (int) $lb[0]; } $loa->close(); if(!empty($dateStr)){ $srcError = $errorNum." Fehlversuch".(($errorNum>1 || $errorNum == 0)? "e":""); } $this->getableSrcDataString .= "\"". $this->CData->FilterText($srcError)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; } } break; case "site": switch($doQuery){ case "friends": $CurrentHabbo = ($isUserSite)? $this->OtherHabbo->user_id : $this->MyHabbo->user_id ; $friendId = false; $friends = "Meine Freunde sind "; $ArrayFriendsQuery = $this->db->query("SELECT user_one_id, user_two_id FROM messenger_friendships WHERE user_one_id = {$CurrentHabbo} || user_two_id = {$CurrentHabbo}"); $b = 0; while($data = $ArrayFriendsQuery->fetch_object()){ $b++; $friendId[$b] = ($data->user_one_id !== $CurrentHabbo)? $data->user_one_id : $data->user_two_id; } $ArrayFriendsQuery->close(); foreach($friendId as $fr){ $FriendsDQuery = $this->db->query("SELECT username FROM users WHERE id = {$fr} LIMIT 1"); $fra = $FriendsDQuery->fetch_object(); $friends .= $fra->username." "; $FriendsDQuery-close(); } $this->getableSrcDataString .= "\"". $this->CData->FilterText($friends)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; break; case "staffs": //Verhindern dass die Resourcen anderseitig aufgerufen werden können if($this->ProtectedParse){ //Bereitet Staffseiten Array vor $ArrayStaff = "_this.ArrayStaffs = ["; //Gruppen wählen und einsortieren $GisOk = false; $Groups = "'Groups',["; $GroupsRank = "'GroupsRank',["; $GroupsRight = "'GroupsRight',["; $ArrayGroupQuery = $this->db->query("SELECT group_name, expected_rank, right_group FROM ranks_group WHERE visible_group = '1' ORDER BY expected_rank DESC"); if($this->db->affected_rows > 0){ $GisOk = true; $int = 0; while($a = $ArrayGroupQuery->fetch_object()){ $int++; $ccut = ($int >= 2)? ',' : ''; $Groups .= $ccut."'{$a->group_name}'"; $GroupsRank .= $ccut."'{$a->expected_rank}'"; $GroupsRight .= $ccut."'{$a->right_group}'"; } $ArrayGroupQuery->close(); $Groups .= "]"; $GroupsRank.= "]"; $GroupsRight.= "]"; } //Staffmitglieder wählen und einsortieren $SisOk = false; $StaffsMember = "'Staffs',["; $StaffsMemberRank = "'StaffsRank',["; $StaffsMemberTag = "'StaffsTag',["; $StaffsMemberGroup = "'StaffsGroup',["; $StaffsMemberTask = "'StaffsTask',["; $StaffsMemberLOn = "'StaffLOn',["; $ArrayStaffsQuery = $this->db->query("SELECT users.rank, users.username, users.last_online, ranks.rank_tag, ranks_staffusers.rank as task, ranks_staffusers.rank_group FROM users, ranks, ranks_staffusers WHERE users.rank > 1 && users.id = ranks_staffusers.uid && ranks_staffusers.rank = ranks.name && ranks.rank_id <= users.rank ORDER BY users.last_online DESC"); if($this->db->affected_rows > 0){ $SisOk = true; $int = 0; while($a = $ArrayStaffsQuery->fetch_object()){ $int++; $ccut = ($int >= 2)? ',' : ''; $StaffsMember .= $ccut."'{$a->username}'"; $StaffsMemberRank .= $ccut."'{$a->rank}'"; $StaffsMemberTag .= $ccut."'{$a->rank_tag}'"; $StaffsMemberGroup .= $ccut."'{$a->rank_group}'"; $StaffsMemberTask .= $ccut."'{$a->task}'"; $StaffsMemberLOn .= $ccut."'{$this->CData->date_str($a->last_online)}'"; } $ArrayStaffsQuery->close(); $StaffsMember .= "]"; $StaffsMemberRank .= "]"; $StaffsMemberTag .= "]"; $StaffsMemberGroup .= "]"; $StaffsMemberTask .= "]"; $StaffsMemberLOn .= "]"; } //Wenn Gruppen gefunden && Mitglieder vorhanden if($SisOk && $GisOk){ $ArrayStaff .= $Groups.','.$GroupsRank.','.$GroupsRight.','.$StaffsMember.','.$StaffsMemberRank.','.$StaffsMemberTag.','.$StaffsMemberGroup.','.$StaffsMemberTask.','.$StaffsMemberLOn; $ArrayStaff .= "]"; $this->otherSources = $ArrayStaff; } } break; case "news": $newsId = (int) $this->CData->FilterText($parseGsrc[2],true); //Verhindern dass die Resourcen anderseitig aufgerufen werden können if($this->ProtectedParse && !empty($newsId)){ //Bereitet News Kommentar Array vor $ArrayComments = "_this.ArrayComments = ["; $HisOk = false; $HabboMember = "'User',["; //$HabboMemberRank = "'Rank',["; $HabboMemberComment = "'Comment',["; $HabboMemberDate = "'Date',["; //$HabboMemberIsUser = "'isUser',["; $ArrayNCQuery = $this->db->query("SELECT cms_news_comments.comment, cms_news_comments.timestamp, users.username FROM cms_news_comments, users WHERE cms_news_comments.article_id = {$newsId} && cms_news_comments.user_id = users.id ORDER BY cms_news_comments.id DESC LIMIT 15"); if($this->db->affected_rows > 0){ $HisOk = true; $int = 0; while($a = $ArrayNCQuery->fetch_object()){ $int++; $ccut = ($int >= 2)? ',' : ''; $dateStr = $this->CData->getStrTime($a->timestamp); $br = htmlspecialchars("<br>"); $cmnt = preg_replace("'".$br."'", '</br>', $a->comment); $dateStr = date("d.m.Y",$a->timestamp); $HabboMember .= $ccut."'{$a->username}'"; //$HabboMemberRank .= $ccut."'{$a->rank}'"; $HabboMemberComment .= $ccut."'{$cmnt}'"; $HabboMemberDate .= $ccut."'{$dateStr}'"; //$HabboMemberIsUser .= $ccut."'{$a->task}'"; } $ArrayNCQuery->close(); $HabboMember .= "]"; //$HabboMemberRank .= "]"; $HabboMemberComment .= "]"; $HabboMemberDate .= "]"; //$HabboMemberIsUser .= "]"; } if($HisOk){ $ArrayComments .= $HabboMember.','.$HabboMemberComment.','.$HabboMemberDate; $ArrayComments .= "]"; $this->otherSources = $ArrayComments; } else { $ArrayComments .= "]"; $this->otherSources = $ArrayComments; } } break; case "guestbook": $userId = (int) $this->CData->FilterText($parseGsrc[2],true); //Verhindern dass die Resourcen anderseitig aufgerufen werden können if($this->ProtectedParse && !empty($userId)){ //Bereitet News Kommentar Array vor $ArrayGuestbook = "_this.ArrayGuestbook = ["; $GisOk = false; $GuestMember = "'User',["; $GuestMemberComment = "'Comment',["; $GuestMemberDate = "'Date',["; //$GuestMemberIsUser = "'isVisible',["; $ArrayGCQuery = $this->db->query("SELECT users_guestbook.comment, users_guestbook.published, users.username FROM users_guestbook, users WHERE users_guestbook.to_id = {$userId} && users_guestbook.uid = users.id && users_guestbook.visible = '1' ORDER BY users_guestbook.id DESC LIMIT 20"); if($this->db->affected_rows > 0){ $GisOk = true; $int = 0; while($a = $ArrayGCQuery->fetch_object()){ $int++; $ccut = ($int >= 2)? ',' : ''; $dateStr = $this->CData->getStrTime($a->published); $dateStr = date("d.m.Y H:i:s",$a->published)." Uhr"; $GuestMember .= $ccut."'{$a->username}'"; //$HabboMemberRank .= $ccut."'{$a->rank}'"; $GuestMemberComment .= $ccut."'{$a->comment}'"; $GuestMemberDate .= $ccut."'{$dateStr}'"; //$HabboMemberIsUser .= $ccut."'{$a->task}'"; } $ArrayGCQuery->close(); $GuestMember .= "]"; //$HabboMemberRank .= "]"; $GuestMemberComment .= "]"; $GuestMemberDate .= "]"; //$HabboMemberIsUser .= "]"; } if($GisOk){ $ArrayGuestbook .= $GuestMember.','.$GuestMemberComment.','.$GuestMemberDate; $ArrayGuestbook .= "]"; $this->otherSources = $ArrayGuestbook; } } break; } break; case "news": if($this->NewsData){ if($this->NewsData->searchedNews){ $data = false; switch($doQuery){ case "published": $data = $this->CData->getStrTime($this->NewsData->published); break; case "news_id": $data = $this->NewsData->news_id; break; case "category": $data = $this->NewsData->category; break; case "story": $data = $this->NewsData->story; break; case "author": $data = $this->NewsData->author; break; case "images": $data = $this->NewsData->images; break; case "title": $data = $this->NewsData->title; break; case "ccmnt": $data = $this->NewsData->comment_count; break; case "list": $data = $this->NewsData->lista; break; } $this->getableSrcDataString .= ($data !== false) ? "\"". $this->CData->FilterText($data)."\"".$cut : ""; $this->getableSrcTypeString .= ($data !== false) ? "\"".$this->CData->FilterText($src)."\"".$cut : ""; } } break; } } } elseif(!empty($gSrc)) { $parseGsrc = explode(":",$gSrc); switch($parseGsrc[0]){ case "usersite": $name = $this->CData->FilterText($parseGsrc[1],true); if($this->MyHabbo->logged_in){ if($name !== $this->MyHabbo->username && !empty($name)){ $this->OtherHabbo->searchHabbo($name); if($this->OtherHabbo->open_profile){ $isUserSite = true; $UserSitename = $this->OtherHabbo->username; } else { $isUserSite = true; $UserSitename = $this->OtherHabbo->close(); $this->OtherHabbo->username = "Privat"; $this->OtherHabbo->motto = "Dieser Nutzer möchte nicht besucht werden"; //$error = true; } } } else { $isUserSite = true; if(empty($name)){ $UserSitename = $this->OtherHabbo->close(); $this->OtherHabbo->isFriend = 0; $this->OtherHabbo->username = "Du bist nicht angemeldet"; $this->OtherHabbo->motto = "Du wurdest ausgeloggt, bitte melde dich wieder an"; } else { $this->OtherHabbo->searchHabbo($name); if($this->OtherHabbo->open_profile){ $UserSitename = $this->OtherHabbo->username; } else { $UserSitename = $this->OtherHabbo->close(); $this->OtherHabbo->username = "Privat"; $this->OtherHabbo->motto = "Dieser Nutzer möchte nicht besucht werden"; //$error = true; } } } $this->getableSrcDataString .= "\"".$this->CData->FilterText($gSrc)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; break; case "current_newsId": $nId = (int) $this->CData->FilterText($parseGsrc[1],true); $this->NewsData = new HabboNews($this->db); if(!empty($nId) && $nId !== "getNewest"){ if($this->initNews($nId,true)){ if($this->LastCount){ $this->NewsData->searchNews($nId); } else { $this->NewsData->searchNews(0, true); } } } else { $this->NewsData->searchNews(0, true); } $this->getableSrcDataString .= "\"".$this->CData->FilterText($gSrc)."\"".$cut; $this->getableSrcTypeString .= "\"".$this->CData->FilterText($src)."\"".$cut; break; } } if($i !== $countSrc){ $i++; } else { $this->Sources = true; return true; } } $this->OtherHabbo->close(); } } class ValidateAccount{ private $db, $CData, $user_mail = false, $created = false, $birth = false, $newsletter = false; public $user_id = false, $username = false, $hash_url = false, $screen_msg = false; protected $hash; public function __construct($db,$FList){ $this->db = $db; $this->CData = $FList; $secure = "YogPOEFThrR_ghs-(API*/P[SSTI])"; $this->hash = new SecureStringGenerator($secure); $this->log = new HabboLogs($this->db,$this->CData); } public function StartProgress(){ if(!$this->hash_url){ if($this->CheckAccount()) $this->SendMail(); else $this->screen_msg = 12; } else { if($this->AcivateAccount()) $this->screen_msg = 22; elseif($this->screen_msg !== 15) $this->screen_msg = 11; } } private function AcivateAccount(){ if(isset($this->db,$this->hash_url,$this->username)){ $cx_time = time(); $data = $this->db->query("SELECT users.id FROM users_registermail, users WHERE users.username = '{$this->username}' && users.id = users_registermail.uid && users_registermail.hash = '{$this->hash_url}' && users_registermail.endstation_date >= {$cx_time}"); $affected = $this->db->affected_rows; if($affected > 0){ $dat = $data->fetch_object(); $data->close(); $uid = $this->CData->FilterText($dat->id); $this->db->query("UPDATE users_settings SET is_enabled = '1' WHERE uid = {$uid}"); if($this->db->affected_rows){ $this->db->query("DELETE FROM users_registermail WHERE uid = {$uid}"); return true; } } elseif($affected !== -1){ $data->close(); return false;} } else return false; } private function CheckAccount(){ if(isset($this->user_id,$this->db)){ $uid = $this->CData->FilterText($this->user_id); $data = $this->db->query("SELECT users.id, users.username, users.mail, users.account_created as created, users.birth, users_settings.newsletter_abo as n_letter, users_settings.is_enabled FROM users_settings, users WHERE users.id = {$uid} && users.id = users_settings.uid"); $affected = $this->db->affected_rows; if($affected > 0){ $dat = $data->fetch_object(); if((int) $dat->is_enabled !== 1){ $this->user_id = $dat->id; $this->username = $dat->username; $this->user_mail = $dat->mail; $this->created = $dat->created; $this->birth = $dat->birth; $this->newsletter = (int) $dat->n_letter; return true; } else return false; } else var_dump($this->db); } } private function SendMail(){ if(isset($this->username,$this->user_mail)){ if(!isset($_SESSION["ACCOUNT"]["ACTIVATEMAIL"]) || isset($_SESSION["ACCOUNT"]["ACTIVATEMAIL"]) && $_SESSION["ACCOUNT"]["ACTIVATEMAIL_"]["TIME"] <= time()){ goto SendRGMAIL; SendRGMAIL: { $hash = $this->hash->generate(22); $code = $this->CData->rand_string(); $timeEnd = time()+(3600*24); $time = time(); $this->db->query("UPDATE users_registermail SET code='{$code}', hash='{$hash}', creation_date={$time}, endstation_date={$timeEnd} WHERE uid = {$this->user_id}"); $affected = $this->db->affected_rows; if($affected > 0){ $blub = new SendMail(MailHost, MailPort); $blub->MailTo = $this->user_mail; $blub->Habbo = $this->username; $blub->registerDate = date("d.m.Y",$this->created)." um ".date("h:i",$this->created)." Uhr"; $blub->registerBirth = $this->birth; $blub->register_vCode = $code; $blub->register_vHash = $hash; $blub->register_newsletter = ($this->newsletter == 1)? "abonniert und bekommst regelmäßig von uns Nachrichten." : "nicht abonniert.";//KommtNoch $Mob = $blub->RegisterMail(); $_SESSION["ACCOUNT"]["ACTIVATEMAIL"] = true; $_SESSION["ACCOUNT"]["ACTIVATEMAIL_"]["TIME"] = time()+3600*2; $this->log->DoLog("account_validate_mail",$this->user_id); return true; } else { goto SendRGMAIL; } } } else return false; } } } class PasswortForgot{ private $db, $CData, $error = false, $user_id, $newPassword, $r_mail, $r_pass, $r_passRe, $r_bday, $r_bmonth, $r_byear, $r_birth, $r_vCode, $postData, $postDataRAW, $MyHabbo; public $screen_msg, $username, $hash_url = false; protected $hash, $MailClient, $log; public function __construct($post,$db,$FList,$UserClass){ $this->db = $db; $this->CData = $FList; $this->MyHabbo = $UserClass; $this->postDataRAW = $post; $this->log = new HabboLogs($this->db,$this->CData); $this->MailClient = new SendMail(MailHost, MailPort); $secure = "YogPOEFThrR_ghs-(API*/P[SSTI])"; $this->hash = new SecureStringGenerator($secure); if(isset($this->postDataRAW['CPl_INIFmPOhShpt'])){ $this->FilterVariables("CPl_INIFmPOhShpt"); if(empty($_SESSION['scrty_token']) || !isset($_SESSION['scrty_token']) || $_SESSION['scrty_token'] === ""){ $_SESSION['scrty_token'] = $this->CData->rand_string(); } if(isset($this->postData["secure_auth_tkn"]) && $this->postData["secure_auth_tkn"] == $_SESSION['scrty_token']){ if(!isset($this->postData["_vld_cdi_step"])){ if(isset($this->postData["forgot_secure_mail"],$this->postData["forgot_secure_bday"],$this->postData["forgot_secure_bmonth"],$this->postData["forgot_secure_byear"])){ $this->r_mail = $this->CData->FilterText($this->postData["forgot_secure_mail"]); $this->r_bday = $this->CData->FilterText($this->postData["forgot_secure_bday"],true); $this->r_bmonth = $this->CData->FilterText($this->postData["forgot_secure_bmonth"],true); $this->r_byear = $this->CData->FilterText($this->postData["forgot_secure_byear"],true); $this->StartProgress(); } else { $this->error = true; $this->screen_msg = 1; } } else { if(isset($this->postData["forgot_secure_mail"],$this->postData["forgot_secure_vCode"],$this->postData["forgot_secure_new_password"],$this->postData["forgot_secure_new_passwordre"])){ if(isset($_SESSION["ACCOUNT"]['RESETPASSWORD'])){ $this->r_mail = $this->CData->FilterText($this->postData["forgot_secure_mail"]); $this->r_bday = $this->CData->FilterText($this->postData["forgot_secure_bday"],true); $this->r_bmonth = $this->CData->FilterText($this->postData["forgot_secure_bmonth"],true); $this->r_byear = $this->CData->FilterText($this->postData["forgot_secure_byear"],true); $this->r_vCode = $this->CData->FilterText($this->postData["forgot_secure_vCode"]); $this->r_pass = $this->CData->FilterText($this->postData["forgot_secure_new_password"]); $this->r_passRe = $this->CData->FilterText($this->postData["forgot_secure_new_passwordre"]); if($this->r_mail == $_SESSION["ACCOUNT"]['RESETPASSWORD_']['EMAIL']){ $this->StartProgress(); } else { $this->screen_msg = 7; //Ein unbekannter Fehler ist aufgetreten, bitte überprüfe deine Daten } } else { $this->screen_msg = 8;//Entweder ist deine Sitzung abgelaufen oder etwas lief gewaltig schief, starte den Vorgang bitte neu } } } } else $this->screen_msg = 0; } } private function StartProgress(){ $this->validate_birth(); if(!$this->error){ if($this->ValidateData()){ if(!isset($this->postData["_vld_cdi_step"])) $this->SendPWMail(); else $this->ValidateCodeData(); } elseif($this->screen_msg == 2){ $this->SendActivateMail(); } } else $this->screen_msg = 1; } public function validate_hash(){ if(isset($_SESSION["ACCOUNT"]['RESETPASSWORD_']['userid'],$this->hash_url,$this->username)){ $this->user_id = $_SESSION["ACCOUNT"]['RESETPASSWORD_']['userid']; $cx_time = time(); $data = $this->db->query("SELECT users.id, users_fpass.code FROM users_fpass, users WHERE users_fpass.uid = {$this->user_id} && users_fpass.hash = '{$this->hash_url}' && users_fpass.expire_date >= {$cx_time} && users_fpass.uid = users.id && users.username = '{$this->username}'"); if($this->db->affected_rows){ $codeSrc = $data->fetch_object(); $data->close(); $_SESSION["ACCOUNT"]['RESETPASSWORD_']['VALID_HASH'] = true; $_SESSION["ACCOUNT"]['RESETPASSWORD_']['vCode'] = $codeSrc->code; } else { unset($_SESSION["ACCOUNT"]); $data->close(); $this->db->query("DELETE FROM users_fpass WHERE uid = {$this->user_id} && expire_date < {$cx_time}"); header('location: '.HabboInit::$path['site'].'/index?expired_data&term=1'); } } else header('location: '.HabboInit::$path['site'].'/index?expired_data&term=0'); } public function ChangePassword($post){ if(isset($_SESSION["ACCOUNT"]['RESETPASSWORD_']['VALID_HASH'])){ if(isset($post["secure_auth_tkn"]) && $post["secure_auth_tkn"] == $_SESSION['scrty_token']){ if(isset($post["forgot_secure_new_password"],$post["forgot_secure_new_passwordre"])){ if($post["forgot_secure_new_password"] == $post["forgot_secure_new_passwordre"]){ if(strlen($post["forgot_secure_new_password"]) >= 6){ $this->newPassword = $this->CData->FilterText($this->CData->NowHashMDSHA(md5($post["forgot_secure_new_password"]))); $this->user_id = (int) $this->CData->FilterText($_SESSION["ACCOUNT"]['RESETPASSWORD_']['userid']); if(isset($post["forgot_secure_mail"]) && $post["forgot_secure_mail"] == $_SESSION["ACCOUNT"]['RESETPASSWORD_']['EMAIL']){ $this->r_mail = $this->CData->FilterText($post["forgot_secure_mail"]); if(isset($post["forgot_secure_vCode"]) && $post["forgot_secure_vCode"] == $_SESSION["ACCOUNT"]['RESETPASSWORD_']['vCode']){ $this->r_vCode = $this->CData->FilterText($post["forgot_secure_vCode"]); $cx_time = time(); $data = $this->db->query("SELECT id FROM users_fpass WHERE uid = {$this->user_id} && code = '{$this->r_vCode}' && expire_date >= {$cx_time}"); $affected = $this->db->affected_rows; $data->close(); if($affected){ $this->db->query("DELETE FROM users_fpass WHERE uid = {$this->user_id}"); $affected = $this->db->affected_rows; if($affected){ $this->db->query("UPDATE users SET password = '{$this->newPassword}' WHERE id = {$this->user_id}"); $affected = $this->db->affected_rows; if($affected){ $this->log->DoLog("changed_password",$this->user_id); unset($_SESSION["ACCOUNT"]); $this->MyHabbo->set_logged_in($this->r_mail,$this->CData->FilterText($this->CData->NowHashMDSHA($this->newPassword,$this->r_mail))); } else { $this->log->DoLog("changed_password",$this->user_id,true); $this->screen_msg = "Dein Passwort konnte nicht geändert werden kontaktiere bitte den Support.";} } else $this->screen_msg = "Ein unbekannter Fehler trat auf."; } else $this->screen_msg = "Dein Link scheint abgelaufen zu sein."; } else $this->screen_msg = "Dein Link scheint abgelaufen zu sein."; } else $this->screen_msg = "Beim validieren deines Accounts ging etwas schief starte den gesamten Vorgang neu!"; } else $this->screen_msg = "Passwort benötigt mindesten 6 Zeichen!"; } else $this->screen_msg = "Passwort nicht identisch mit dem anderen"; } else $this->screen_msg = "Passwort nicht gesetzt"; } else $this->screen_msg = "Deine Sitzung ist abgelaufen starte den gesamten Vorgang bitte neu!"; } else $this->screen_msg = "Deine Sitzung ist abgelaufen starte den gesamten Vorgang bitte neu!"; } private function ValidateCodeData(){ if(isset($_SESSION["ACCOUNT"]['RESETPASSWORD_']['EMAIL'])){ if(isset($this->postData["forgot_secure_vCode"]) && !empty($this->r_vCode)){ $cx_time = time(); $data = $this->db->query("SELECT id FROM users_fpass WHERE uid = {$this->user_id} && code = '{$this->r_vCode}' && expire_date >= {$cx_time}"); $affected = $this->db->affected_rows; $data->close(); if($affected){ $this->newPassword = $this->CData->FilterText($this->CData->NowHashMDSHA($this->r_pass)); $this->db->query("DELETE FROM users_fpass WHERE uid = {$this->user_id}"); $affected = $this->db->affected_rows; if($affected){ $this->db->query("UPDATE users SET password = '{$this->newPassword}', last_online = {$cx_time} WHERE id = {$this->user_id}"); $affected = $this->db->affected_rows; if($affected){ $this->screen_msg = 21; $this->log->DoLog("changed_password",$this->user_id); $this->MyHabbo->set_logged_in($this->r_mail,$this->CData->FilterText($this->CData->NowHashMDSHA($this->newPassword,$this->r_mail)),false); //unset($_SESSION["ACCOUNT"]); } else $this->log->DoLog("changed_password",$this->user_id,true); } else $this->screen_msg = 7; } else $this->screen_msg = 5; } else { $this->screen_msg = 4; } } } private function SendActivateMail(){ $valida = new ValidateAccount($this->db,$this->CData); $valida->user_id = $this->user_id; $valida->StartProgress(); if($valida->screen_msg == 12) $this->screen_msg = 8; else $this->screen_msg = 2; } private function SendPWMail(){ goto SendPWMAIL; SendPWMAIL: { $data = $this->db->query("SELECT id FROM users_fpass WHERE uid = {$this->user_id}"); $affected = $this->db->affected_rows; $data->close(); if($affected < 1){ $hash = $this->hash->generate(22); $code = $this->hash->generate(10); $timeEnd = time()+(60*15); $this->db->query("INSERT INTO users_fpass (uid,code,hash,creation_date,expire_date) VALUES (".$this->user_id.",'".$code."','".$hash."',".time().",".$timeEnd.")"); $affectedPasswordForgotData = $this->db->affected_rows; if($affectedPasswordForgotData){ $_SESSION["ACCOUNT"]['RESETPASSWORD'] = true; $_SESSION["ACCOUNT"]['RESETPASSWORD_']['EMAIL'] = $this->r_mail; $_SESSION["ACCOUNT"]['RESETPASSWORD_']['userid'] = $this->user_id; $this->MailClient->MailTo = $this->r_mail; $this->MailClient->Habbo = $this->username; $this->MailClient->creationDate = date("d.m.Y",time())." um ".date("H:i:s",time())." Uhr"; $this->MailClient->expireDate = date("d.m.Y",$timeEnd)." um ".date("H:i:s",$timeEnd)." Uhr"; $this->MailClient->resetpass_vCode = $code; $this->MailClient->resetpass_vHash = $hash; $this->MailClient->ResetPasswordMail(); $this->log->DoLog("reset_password_mail",$this->user_id); $this->screen_msg = 3;//Schau mal in deinem E-Mail Postfach nach, wenn Du keine Mail bekommen hast, kannst Du diesen Vorgang in 5 Minuten wiederholen } else { goto SendPWMAIL; } } else { unset($_SESSION["ACCOUNT"]); $this->db->query("DELETE FROM users_fpass WHERE uid = {$this->user_id}"); goto SendPWMAIL; } } } private function ValidateData(){ if(isset($this->r_mail,$this->r_birth)){ $data = $this->db->query("SELECT users.id as ipd, users.username, users_settings.is_enabled FROM users, users_settings WHERE users.mail='{$this->r_mail}' && users.birth='{$this->r_birth}' && users_settings.uid = users.id LIMIT 1"); $affected = $this->db->affected_rows; if($affected){ $dat = $data->fetch_object(); $data->close(); if((int)$dat->is_enabled == 1){ $this->user_id = $dat->ipd; $this->username = $dat->username; } else { $this->error = true; $this->user_id =(int)$dat->ipd; $this->screen_msg = 2;//"Aktiviere zuerst deine Mail, Du erhältst soeben eine weitere Bestätigungsmail von uns."; $this->log->DoLog("activate_mail_reset_password",$this->user_id,true); } } else { if($affected !== -1) $data->close(); $this->error = true; $this->screen_msg = 1;//Keinen Habbo unter diesen Daten gefunden $data = $this->db->query("SELECT id FROM users WHERE mail='{$this->r_mail}' LIMIT 1"); $affected = $this->db->affected_rows; if($affected){ $dat = $data->fetch_object(); $data->close(); $this->log->DoLog("reset_password_wrong_birth",$dat->id,true); } elseif($affected !== -1) $data->close(); } } else { $this->error = true; $this->screen_msg = 1;//Keinen Habbo unter diesen Daten gefunden } if(isset($this->postData["_vld_cdi_step"])){ if(isset($this->r_pass,$this->r_passRe) && !empty($this->r_pass) && !empty($this->r_passRe)){ if($this->r_pass !== $this->r_passRe){ $this->error = true; $this->screen_msg = 6;//Irgend etwas stimmt mit deinem Passwort nicht. } } else { $this->error = true; $this->screen_msg = 6;//Irgend etwas stimmt mit deinem Passwort nicht. } } if($this->error) return false; else return true; } private function validate_birth(){ $error = false; if(ctype_digit($this->r_bday) && $this->r_bday < 10){ $this->r_bday = "0".$this->r_bday; } if(ctype_digit($this->r_bmonth) && $this->r_bmonth < 10){ $this->r_bmonth = "0".$this->r_bmonth; } $this->r_birth = $this->r_bday.".".$this->r_bmonth.".".$this->r_byear; if(!ctype_digit($this->r_bday) || !ctype_digit($this->r_bmonth) || !ctype_digit($this->r_byear)){ $error = true; } if((date("Y",time())-8) < (int) $this->r_byear){ $error = true; } if($error) $this->error = true; } private function FilterVariables($a){ $theSrc = false; $ini = explode(",",$this->postDataRAW[$a]); $count = 0; foreach((array) $ini as $src){ $count++; $GSrc = str_replace(array("{","}",",","$"),"",$src); if(isset($ini[$count])){ $iniS = str_replace(array("{","}",","),"",$ini[$count]); if(!$theSrc){ $this->postData[$GSrc] = $iniS; $theSrc = $GSrc; } else { $theSrc = false; } } } } } class HabboLogin{ private $db, $log, $CData, $postData, $postDataRAW, $MyHabbo, $username, $password; public $login_error; public function __construct($post,$db,$FList,$UserClass){ $this->db = $db; $this->CData = $FList; $this->MyHabbo = $UserClass; $this->postDataRAW = $post; $this->log = new HabboLogs($this->db,$this->CData); if($this->CheckBruteForce()){ $this->login_error = "Hast Du dein Passwort vergessen, bitte setze dein Passwort zurück"; } else { if(!$this->MyHabbo->logged_in){ if(isset($this->postDataRAW['CPl_INIPpncm'])){ $this->FilterVariables(); if(isset($this->postData['_habbo_secure_mail'], $this->postData['_habbo_secure_pass'])){ if(empty($_SESSION['scrty_token']) || !isset($_SESSION['scrty_token']) || $_SESSION['scrty_token'] === ""){ $_SESSION['scrty_token'] = $this->CData->rand_string(); } if(isset($this->postData['_habbo_secure_hpc_stkn']) && $this->postData['_habbo_secure_hpc_stkn'] === $_SESSION['scrty_token'] ){ $this->username = $this->CData->FilterText($this->postData['_habbo_secure_mail']); $this->password = $this->CData->FilterText($this->CData->NowHashMDSHA($this->postData['_habbo_secure_pass'],$this->username)); $this->StartProgress(); } else { $this->login_error = "0"; //header("location: http://".$_SERVER['SERVER_NAME'].""); } } else { //$this->login_error = "Du musst alle Felder ausfüllen, um dich einzuloggen!"; $this->login_error = "1"; } } } } } private function FilterVariables(){ $theSrc = false; $ini = explode(",",$this->postDataRAW['CPl_INIPpncm']); $count = 0; foreach((array) $ini as $src){ $count++; $GSrc = str_replace(array("{","}",","),"",$src); if(isset($ini[$count])){ $iniS = str_replace(array("{","}",","),"",$ini[$count]); if(!$theSrc){ $this->postData[$GSrc] = $iniS; $theSrc = $GSrc; } else { $theSrc = false; } } } } private function StartProgress(){ if($this->validate_user()){ if(!$this->IsBanned()) $this->DoLogin(); } } private function validate_user(){ if(empty($this->username) || empty($this->password)){ //$this->login_error = "Bitte überprüfe deine Eingaben und versuche es erneut."; $this->login_error = "1"; return false; } else { $num = $this->CData->Query_select_rows("users","mail='{$this->username}' && password='{$this->password}' LIMIT 1",false,true); if($num < 1){ //$this->login_error = "Deine Daten waren fehlerhaft. Bitte versuche es erneut."; $this->login_error = "2"; $numU = $this->CData->Query_select_rows("users","mail='{$this->username}' LIMIT 1",false,true); if($numU > 0){ $row = $this->CData->Query_fetch_object("id","users","mail='{$this->username}'"); $this->log->DoLog("login",$row->id,true); } $_SESSION["antibf"][0]++; if($_SESSION["antibf"][0]==4) { $_SESSION["antibf"][0]++; $_SESSION["antibf"][1]=time(); } return false; } elseif($num > 0){ return true; } } } private function IsBanned(){ $GetUsername = $this->CData->Query_fetch_object("username","users","mail='{$this->username}'"); $num_ban = $this->CData->Query_select_rows("users_bans","value='{$GetUsername->username}' AND bantype='user' OR value='{$this->CData->remote_ip}' AND bantype='ip'",false,true); if($num_ban > 0){ $bandata = $this->CData->Query_fetch_object("reason,expire","users_bans","value='{$GetUsername->username}' AND bantype='user' OR value='{$this->CData->remote_ip}' AND bantype ='ip'"); $timestamp = time(); if($bandata->expire > $timestamp){ $this->login_error = "Du wurdest gebannt, der Grund dafür lautet: ".$bandata->reason." und endet am " . date('d.m.Y - H:i:s', $bandata->expire) . "."; return true; } else { $this->CData->MySQL_delete("users_bans","value='{$GetUsername->username}' AND bantype='user' AND expire > ".time()." OR value='{$this->CData->remote_ip}' AND bantype='ip' AND expire > ".time()." LIMIT 1"); return false; } } else { return false; } } private function CheckBruteForce(){ if(!isset($_SESSION["antibf"])) $_SESSION["antibf"] = array(0,0); if($_SESSION["antibf"][0] > 20) { $time = time()+(10*60); if($_SESSION["antibf"][1] > $time) { $_SESSION["antibf"]=array(0,0); return false; } else { return true; } } } private function DoLogin(){ $this->CData->MySQL_update("users","ip_last='{$this->CData->remote_ip}',last_online='".time()."'","mail='{$this->username}'"); if(isset($this->postData['_login_remember_me']) && $this->postData['_login_remember_me'] == "true"){ $this->MyHabbo->set_logged_in($this->username,$this->password,false); $this->login_error = 3; $row = $this->CData->Query_fetch_object("id","users","username='{$this->username}' || mail='{$this->username}'"); $this->log->DoLog("login",$row->id); } else { $this->MyHabbo->set_logged_in($this->username,$this->password,false); $this->login_error = 3; $row = $this->CData->Query_fetch_object("id","users","username='{$this->username}' || mail='{$this->username}'"); $this->log->DoLog("login",$row->id); } //exit(); } } class HabboRegister{ private $db, $chck_stkn, $CData, $r_username, $user_flag, $mod_check, $r_pass, $pwd_flag, $pwdpass, $r_bday, $r_bmonth, $r_byear, $r_birth, $r_mail, $r_tos, $r_cookieply, $r_newsletter, $email_check, $gend, $gender, $look, $error = false, $fehler, $MAC_Adress, $postData, $postDataRAW, $log; public $ip_check_reg, $screen_error, $reg_Allowed = false; public function __construct($post,$db,$FList,$UserClass){ $this->db = $db; $this->CData = $FList; $this->MyHabbo = $UserClass; $this->log = new HabboLogs($this->db,$this->CData); $this->ip_check_reg = $this->CheckIP($this->CData->remote_ip,7200); $this->postDataRAW = $post; if(isset($post['CPl_INICheckRegosSrc'])){ if(!$this->MyHabbo->logged_in){ $this->FilterVariables('CPl_INICheckRegosSrc'); $this->validate_step($this->postData['checkname'],$this->postData['checkmail']); } else $this->screen_error = 10; } if($this->AllowedRegister()){ $this->reg_Allowed = true; } if(isset($post["CPl_INIRpnrcm"])){ if(!$this->MyHabbo->logged_in){ $this->FilterVariables('CPl_INIRpnrcm'); if($this->reg_Allowed){ if($this->ip_check_reg){ if(isset($this->postData['_habbo_secure_hpc_stkn']) && $this->CData->FilterText($this->postData['_habbo_secure_hpc_stkn']) === $_SESSION['scrty_token']){ if(isset($this->postData["_habbo_secure_habboname"]) && isset($this->postData["_habbo_secure_password"]) && isset($this->postData["_habbo_secure_TOS"]) && isset($this->postData["_habbo_secure_cookie_plcy"]) && isset($this->postData["_habbo_secure_newsletter"]) && isset($this->postData["_habbo_secure_password_re"]) && isset($this->postData["_habbo_secure_mail"]) && isset($this->postData["_habbo_secure_b_day"]) && isset($this->postData["_habbo_secure_b_month"]) && isset($this->postData["_habbo_secure_b_year"])){ $this->r_username = $this->CData->FilterText($this->postData["_habbo_secure_habboname"]); $this->r_pass = $this->CData->FilterText($this->postData["_habbo_secure_password"]); $this->r_pass2 = $this->CData->FilterText($this->postData["_habbo_secure_password_re"]); $this->r_bday = $this->CData->FilterText($this->postData['_habbo_secure_b_day'],true); $this->r_bmonth = $this->CData->FilterText($this->postData['_habbo_secure_b_month'],true); $this->r_byear = $this->CData->FilterText($this->postData['_habbo_secure_b_year'],true); $this->r_tos = $this->CData->FilterText($this->postData['_habbo_secure_TOS'],true); $this->r_cookieply = $this->CData->FilterText($this->postData['_habbo_secure_cookie_plcy'],true); $this->r_newsletter = $this->CData->FilterText($this->postData['_habbo_secure_newsletter'],true); $this->r_mail = $this->CData->FilterText($this->postData["_habbo_secure_mail"]); $this->gender = "boy"; $this->fehler = ""; $this->chck_stkn = $post["CPl_INIRpnrcm"]; $this->StartProgress(); } else { $this->screen_error = 1; } } else { $this->screen_error = 0; } } else { $this->screen_error = 3; } } else { $this->screen_error = "Die Registration ist momentan nicht aktiv, bitte besuche uns später nocheinmal"; } } else { $this->screen_error = 10; } } } private function StartProgress(){ $this->look = 'hd-180-1.ch-210-66.lg-270-82.sh-290-91.hr-100-'; $this->validate_username(); $this->validate_password(); $this->validate_email(); $this->validate_birth(); $this->validate_gender(); $this->validate_tos_cookie_policy(); if(!$this->error){ $this->DoRegister(); } elseif(!empty($this->fehler)) { $this->screen_error = $this->fehler; } } private function DoRegister(){ if(empty($this->fehler)){ try { $stmt = $this->db->prepare("INSERT INTO users (username,real_name,password,birth,auth_ticket,motto,mail,rank,look,gender,account_created,last_online,online,ip_last,ip_reg,home_room) VALUES (?,?,?,?,?,?,?,1,?,?,".time().",".time().",1,?,?,?)"); $stmt->bind_param("sssssssssssi",$username,$realname,$password,$birthday,$ticket,$motto,$mail,$look,$gend,$remoteIp,$remoteIp,$home_room); $username = $this->r_username; $realname = Sitename; $password = $this->CData->FilterText($this->CData->NowHashMDSHA($this->r_pass,$this->r_mail)); $birthday = $this->r_birth; $ticket = "-/-"; $motto = "Willkommen im ".Sitename; $mail = $this->r_mail; $look = $this->look; $gend = $this->gend; $remoteIp = $this->CData->remote_ip; $home_room = 15; $stmt->execute(); $affected = $this->db->affected_rows; $stmt->close(); if($affected){ $userDataQuery = $this->db->query("SELECT id FROM users WHERE username = '".$this->r_username."'") or die($this->db->error); $userDataObj = $userDataQuery->fetch_object(); $UID = $userDataObj->id; $userDataQuery->close(); $usInf = $this->db->query("INSERT INTO users_info (user_id,reg_timestamp) VALUES (".$UID.",'".time()."')") or die($this->db->error); $affectedInf = $this->db->affected_rows; $usStat = $this->db->query("INSERT INTO users_stats (id) VALUES (".$UID.")") or die($this->db->error); $affectedStat = $this->db->affected_rows; $usIpCheck = $this->db->query("INSERT INTO register_check_ip (user_ip,date) VALUES ('".$this->CData->remote_ip."',".time().")") or die($this->db->error); $affectedIPC = $this->db->affected_rows; $code = $this->CData->rand_string(); $secure = "YogPOEFThrR_ghs-(API*/P[SSTI])"; $hash = new SecureStringGenerator($secure); $hash = $hash->generate(22); $timeEnd = time()+(3600*24); $usRegistermail = $this->db->query("INSERT INTO users_registermail (uid,code,hash,creation_date,endstation_date) VALUES ('".$UID."','".$code."','".$hash."',".time().",".$timeEnd.")"); $affectedRgstmail = $this->db->affected_rows; $newsletter_abo = ($this->r_newsletter == "true")? 1 : 0; $usSettings = $this->db->query("INSERT INTO users_settings (uid,tos_accepted,cookie_policy,newsletter_abo) VALUES ('".$UID."',1,1,".$newsletter_abo.")"); $affectedStngs = $this->db->affected_rows; if(!$affectedInf) $this->log->DoLog("user_info",$UID,true); if(!$affectedStat) $this->log->DoLog("users_stats",$UID,true); if(!$affectedIPC) $this->log->DoLog("register_check_ip",$UID,true); if(!$affectedStngs) $this->log->DoLog("users_settings",$UID,true); if(!$affectedRgstmail) $this->log->DoLog("users_registermail",$UID,true); if(!$affectedInf && !$affectedStat && !$affectedIPC) $this->log->DoLog("register_fail_data",$UID,true); else $this->log->DoLog("register",$UID); $blub = new SendMail(MailHost, MailPort); $blub->MailTo = $this->r_mail; $blub->Habbo = $this->r_username; $blub->registerDate = date("d.m.Y",time())." um ".date("h:i",time())." Uhr"; $blub->registerBirth = $this->r_birth; $blub->register_vCode = $code; $blub->register_vHash = $hash; $blub->register_newsletter = ($this->r_newsletter == "true")? "abonniert und bekommst regelmäßig von uns Nachrichten." : "nicht abonniert.";//KommtNoch $Mob = $blub->RegisterMail(); $this->log->DoLog("account_validate_mail",$UID); $this->MyHabbo->set_logged_in($this->r_mail,$this->CData->FilterText($this->CData->NowHashMDSHA($this->r_pass,$this->r_mail)),false); $this->screen_error = 10; //exit(); } else { throw new Exception('Ein Problem trat beim eintragen der Daten ein!'); } } catch(Exception $e){ $this->screen_error = '<script>var err_msg = confirm("'.$e.'"); if(err_msg) startRegister();</script>'; } } } private function AllowedRegister(){ $sel = $this->db->query("SELECT value FROM server_settings WHERE variable = 'cms.registration'") or die($this->db->error); if($this->db->affected_rows){ $obj = $sel->fetch_object(); if((int) $obj->value == 1) return true; else return false; } $sel->close(); } private function CheckIP($ip,$t){ $time = time()-$t; $sel = $this->db->query("SELECT id,date FROM register_check_ip WHERE user_ip = '".$ip."'") or die($this->db->error); if($this->db->affected_rows){ $obj = $sel->fetch_object(); if($obj->date < $time){ $sel->close(); $stmt = $this->db->prepare("DELETE FROM register_check_ip WHERE user_ip='".$ip."' AND date < ".$time.""); $stmt->execute(); $affected = $this->db->affected_rows; $stmt->close(); if($affected){ return true; } else { return false; } } else { return false; } } else { return true; } if($sel) $sel->close(); } private function validate_step($name,$mail){ $username = (!empty($name))? $this->CData->FilterText($name) : false; $email = (!empty($mail))? $this->CData->FilterText($mail) : false; $error = ""; $u_row = ($username)? $this->CData->Query_select_rows("users","username",$username) : 0; $e_row = ($email)? $this->CData->Query_select_rows("users","mail",$email) : 0; $this->email_check = filter_var($this->r_mail, FILTER_VALIDATE_EMAIL); if($this->email_check){ $error .= "v_mail,"; } if($u_row > 0 && $e_row > 0){ $error.= "name,mail"; } if($e_row > 0 && $u_row < 1){ $error.= ",mail"; } if($u_row > 0 && $e_row < 1){ $error = "name,"; } if($u_row < 1 && $e_row < 1){ $error = ","; } $this->screen_error = $error; } private function FilterVariables($a){ $theSrc = false; $ini = explode(",",$this->postDataRAW[$a]); $count = 0; foreach((array) $ini as $src){ $count++; $GSrc = str_replace(array("{","}",","),"",$src); if(isset($ini[$count])){ $iniS = str_replace(array("{","}",","),"",$ini[$count]); if(!$theSrc){ $this->postData[$GSrc] = $iniS; $theSrc = $GSrc; } else { $theSrc = false; } } } } private function validate_tos_cookie_policy(){ if($this->r_tos !== "true" && $this->r_cookieply !== "true"){ $this->error = true; $this->fehler .= "Akzpetiere gefälligst unsere Cookie Richtlinien sowie die AGB's \\n"; } } private function validate_username(){ $error = false; $this->mod_check = substr($this->r_username, 0, 4); $this->user_flag = preg_match('/[^0-9\-._a-z]/i',$this->r_username); $menge = $this->db->query("SELECT id FROM users WHERE username = '".$this->r_username."'") or die($this->db->error); if($this->db->affected_rows){ $error = true; $this->fehler .= "Der Benutzername ist bereits vergeben! \\n"; } $menge->close(); if ((isset($this->r_username)) && (empty($this->r_username))){ $error = true; $this->fehler .= "Du musst einen Namen eingeben!\\n"; } if (!empty($this->r_username) && $this->user_flag && strlen($this->r_username) < 3 && strlen($this->r_username) > 20 && preg_match('/\s/',$this->r_username)) { $error = true; $this->fehler .= "Benutzername ist ungültig Mindestlänge 3 Zeichen maximal 20 Zeichen, achte darauf das es keine Sonderzeichen oder Leerzeichen enthält.\\n"; } elseif($this->mod_check == "MOD-") { $error = true; $this->fehler .= "Ungültiger Benutzername ('MOD-') erkannt, diesen Namenstitel dürfen nur Moderatoren tragen.\\n"; } if($error) $this->error = true; } private function validate_password(){ $error = false; $this->pwdpass = $this->r_pass == $this->r_pass2; //$this->pwd_flag = preg_match("/[^\s]{6,20}$/",$this->r_pass); if ((isset($this->r_pass)) && (empty($this->r_pass))){ $error = true; $this->fehler .= "Bitte gebe ein Passwort ein.\\n" ; } if ((isset($this->r_pass2)) && (empty($this->r_pass2))) { $error = true; $this->fehler .= "Bitte wiederhole dein Passwort.\\n" ; } if ((FALSE == $this->pwdpass)) { $error = true; $this->fehler .= "Das Passwort stimmt nicht überein.\\n" ; } if($error) $this->error = true; } private function validate_email(){ $error = false; $this->email_check = filter_var($this->r_mail, FILTER_VALIDATE_EMAIL); $menge = $this->db->query("SELECT id FROM users WHERE mail = '".$this->r_mail."'") or die($this->db->error); if($this->db->affected_rows){ $error = true; $this->fehler .= "Die Email Adresse ist bereits vergeben! \\n"; } $menge->close(); if ((isset($this->r_mail)) && (empty($this->r_mail))) { $error = true; $this->fehler .= "Bitte gib deine Emailadresse ein.\\n" ; } if ((isset($this->r_mailre)) && (empty($this->r_mailre))) { $error = true; $this->fehler .= "Bitte wiederhole deine Emailadresse.\\n" ; } if(!$this->email_check){ $error = true; $this->fehler .= "Ungültige Emailadresse.\\n" ; } if($error) $this->error = true; } private function validate_birth(){ $error = false; if(ctype_digit($this->r_bday) && $this->r_bday < 10){ $this->r_bday = "0".$this->r_bday; } if(ctype_digit($this->r_bmonth) && $this->r_bmonth < 10){ $this->r_bmonth = "0".$this->r_bmonth; } $this->r_birth = $this->r_bday.".".$this->r_bmonth.".".$this->r_byear; if(!ctype_digit($this->r_bday) || !ctype_digit($this->r_bmonth) || !ctype_digit($this->r_byear)){ $error = true; $this->fehler .= "Bitte wähle dein Geburtsdatum aus.\\n"; } if((date("Y",time())-8) < (int) $this->r_byear){ $error = true; $this->fehler .= "Du bist zu jung für HabboMN.\\n"; } if($error) $this->error = true; } private function validate_gender(){ $error = false; if($this->gender == "girl"){ $this->gend = "F"; } elseif($this->gender == "boy"){ $this->gend = "M"; } else { $error = true; $this->fehler .= "Kein Geschlecht erkannt.\\n"; } if($error) $this->error = true; } } class SendMail{ //GLOBAL VARIABLES// public $MailTo, $Sitename = Sitename, $Habbo, $empty = true; //Sender Mail Connections// private $MailMN; public $MailMNPass; private $Message, $Subject; protected $realPath,$fpath,$MailHandler,$MailHost,$MailPort; //RegisterVariables// public $registerDate = "", $registerBirth = "", $register_vCode = "", $register_vHash = "", $register_newsletter = ""; //PasswordResetVariables// public $creationDate = "", $expireDate = "", $resetpass_vCode = "", $resetpass_vHash = ""; public function __construct($MailHost,$MailPort,$folder=false){ $this->MailHost = $MailHost; $this->MailPort = $MailPort; $this->MailHandler = new PHPMailer(true); $folder = ($folder)? $folder : SiteFolder; $this->realPath = $_SERVER["DOCUMENT_ROOT"]."/".$folder."/Web_Files/private_data/";//str_replace("/","\\\\",$_SERVER["DOCUMENT_ROOT"])."\\\\".$folder."\\\\Web_Files\\\\private_data\\\\"; $this->fpath = new stdclass(); $this->fpath->namespace = "mail_content"; $this->fpath->fp = "ini_get_"; $this->fpath->lp = "_mtp.tmp.php"; } public function RegisterMail(){ $this->empty = (!empty($this->MailHost) && !empty($this->MailPort) && !empty($this->MailTo) && !empty($this->Habbo) && !empty($this->registerDate) && !empty($this->registerBirth) && !empty($this->register_vCode) && !empty($this->register_vHash) && !empty($this->register_newsletter))? false : true; if(!$this->empty){ $this->MailMN = MailAddWelcome; $this->MailMNPass = MailPassSystem; $this->Subject = $this->Sitename." - Deine Registrierungsbestätigung"; $FilePath = $this->realPath.$this->fpath->namespace."/registration/".$this->fpath->fp."registration".$this->fpath->lp; $SourceRar = array("{Sitename}","{datetime}","{habboname}","{birthday}","{validateCode}","{validateURL}","{newsletter_abo_inf}","{ItsNotMeURL}"); $pageSrc = array("{Sitename}"=>$this->Sitename, "{datetime}"=>$this->registerDate, "{habboname}"=>$this->Habbo, "{birthday}"=>$this->registerBirth, "{validateCode}"=>$this->register_vCode, "{validateURL}"=>SitePath."/account/activate_/user/".$this->Habbo."/v_hash/".$this->register_vHash, "{newsletter_abo_inf}"=>$this->register_newsletter, "{ItsNotMeURL}"=>SitePath."/account/activate_/user/".$this->Habbo."/f_hash/".md5($this->register_vHash.$this->register_vCode)."_".$this->register_vHash); $ThePageFile = (file_exists($FilePath))? fread(fopen($FilePath,"r"),filesize($FilePath)) : null; foreach((array) $SourceRar as $src){ $ThePageFile = (str_replace($src, $pageSrc[$src], $ThePageFile)); } $this->Message = $ThePageFile; $this->DoMail(); return $this->ThrowError(true,"valid"); } else { return $this->ThrowError(true,"empty"); } } public function ResetPasswordMail(){ $this->empty = (!empty($this->MailHost) && !empty($this->MailPort) && !empty($this->MailTo) && !empty($this->Habbo) && !empty($this->creationDate) && !empty($this->expireDate) && !empty($this->resetpass_vCode) && !empty($this->resetpass_vHash))? false : true; if(!$this->empty){ $this->MailMN = MailAddNoreply; $this->MailMNPass = MailPassSystem; $this->Subject = $this->Sitename." - Passwort-Zurücksetzung"; $FilePath = $this->realPath.$this->fpath->namespace."/account/".$this->fpath->fp."reset_password".$this->fpath->lp; $SourceRar = array("{Sitename}","{creationDate}","{habboname}","{expireDate}","{validateCode}","{validateURL}"); $pageSrc = array("{Sitename}"=>$this->Sitename, "{creationDate}"=>$this->creationDate, "{expireDate}"=>$this->expireDate, "{habboname}"=>$this->Habbo, "{validateCode}"=>$this->resetpass_vCode, "{validateURL}"=>SitePath."/account/reset_password/user/".$this->Habbo."/hash/".$this->resetpass_vHash); $ThePageFile = (file_exists($FilePath))? fread(fopen($FilePath,"r"),filesize($FilePath)) : null; foreach((array) $SourceRar as $src){ $ThePageFile = (str_replace($src, $pageSrc[$src], $ThePageFile)); } $this->Message = $ThePageFile; $this->DoMail(); return $this->ThrowError(true,"valid"); } else { return $this->ThrowError(true,"empty"); } } public function EventMail(){ } public function GratulationMail(){ } private function DoMail(){ try{ $this->MailHandler->IsHTML(true); $this->MailHandler->CharSet = 'utf-8'; $this->MailHandler->SetLanguage ("de"); $this->MailHandler->SMTPSecure = 'tls'; $this->MailHandler->Username = $this->MailMN; $this->MailHandler->Password = $this->MailMNPass; $this->MailHandler->AddAddress($this->MailTo); $this->MailHandler->FromName = $this->Sitename; $this->MailHandler->Subject = $this->Subject; $this->MailHandler->MsgHTML($this->Message); $this->MailHandler->Host = $this->MailHost; $this->MailHandler->Port = $this->MailPort; //$this->MailHandler->IsSMTP(true); $this->MailHandler->SMTPAuth = true; $this->MailHandler->From = $this->MailMN; $this->MailHandler->Send(); } catch (phpmailerException $e){ echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e){ echo $e->getMessage(); //Boring error messages from anything else! } } private function ThrowError($e,$c){ $array = new stdclass(); $array->error=$e; $array->code=$c; if(isset($e,$c)) return $array; } public function close(){ $this->MailMN = false; $this->MailMNPass = false; $this->MailTo = false; $this->Message = false; $this->Subject = false; $this->empty = true; } } class SecureStringGenerator{ protected $alphabet; protected $alphabetLength; public function __construct($alphabet = ''){ if ('' !== $alphabet) { $this->setAlphabet($alphabet); } else { $this->setAlphabet( implode(range('a', 'z')) . implode(range('A', 'Z')) . implode(range(0, 9)) ); } } public function setAlphabet($alphabet){ $this->alphabet = $alphabet; $this->alphabetLength = strlen($alphabet); } public function generate($length){ $token = ''; for ($i = 0; $i < $length; $i++) { $randomKey = $this->getRandomInteger(0, $this->alphabetLength); $token .= $this->alphabet[$randomKey]; } return $token; } protected function getRandomInteger($min, $max) { $range = ($max - $min); if ($range < 0) { return $min; } $log = log($range, 2); $bytes = (int) ($log / 8) + 1; $bits = (int) $log + 1; $filter = (int) (1 << $bits) - 1; do { $rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes))); $rnd = $rnd & $filter; } while ($rnd >= $range); return ($min + $rnd); } }
-
wie sollen wir dir bitte helfen, wenn wir deinen code nicht korrigieren können? poste einfach die methode (php formatter damit es übersichtlich ist und nicht alles am rand)
Schau mal, ich hab irgendeinen Error, den ich nicht verstehe. Und dann hab ich auf dem Editor nachgeforscht, was auf dieser Zeile 57 ist, aber ich kriege es nicht behoben...
-
ganzen code hier einfügen und dann alles was da steht hier posten: http://beta.phpformatter.com/ und bitte kein screenshot oder so, sondern den code
Das bringt mir sehr wenig...
-
Ok, die Config übersichtlicher hab ich schon gemacht. Also hat sich erledigt, habe ein anderes Problem:
Fehlermeldung:
ZitatParse error: syntax error, unexpected '}' in C:\xampp\htdocs\Web_Files\private_data\classes\cpu_data_class_main_pcfka.php.php on line 57
Bild: Klick hier!Ich bin da jetzt echt überfordert..
-
Ich komm mit der ganzen Scheiß Config nicht zurecht -.- Weil irgendwie mach ich immer was falsch dran. Kann mir jemand die Config übersichtlicher machen?
-
Nimm ein x-beliebiges CMS, lern HTML und CSS, code das Design nach und tausch es mit dem Front-End Design aus und benutz es. Jetzt ist es Zeit mal was selber zu machen, beweg dein Arsch!
Es ist quasi meine Sache was ich machen werde... Da hat mir niemand was zu sagen