/* Decoded by unphp.net */ ?>'; print_r($array); echo ''; } function showMessage($message, $color = 'success', $echo = true) { $str = ''; if($echo) echo $str; else return $str; } function auto_version($file = '') { if (!file_exists(WG_PATH . $file)) return $file; $mtime = @filemtime(WG_PATH . $file); if (!$mtime) $mtime = WG_VERSION; return $file . '?v=' . $mtime; } function addslashes_array($data) { if (is_array($data)) { foreach ($data as $key => $value) { $data[$key] = addslashes_array($value); } return $data; } else { $data = mysql_real_escape_string($data); return $data; } } function stripslashes_array($data) { if (is_array($data)) { foreach ($data as $key => $value) { $data[$key] = stripslashes_array($value); } return $data; } else { return stripslashes($data); } } function addNotify($title, $desc, $params) { global $main; $url = WG_URL . 'wg7.php?' . $params; $main->mq("insert into `".DB_PREFIX."notify` (`title`, `desc`, `url`) values ('".$title."', '".$desc."', '".$url."')"); } function writeLog($logfile, $event) { $dir = WG_PATH . 'files/logs/' . $logfile; if (!file_exists($dir)) { mkdir($dir, 0755, true); touch($dir.'/index.html'); } $logfile .= '-'.hash('md5', date('Y-m-d'), false); $file = fopen($dir . '/' . date('Y-m-d') . '-' . $logfile . '.log', 'a'); fwrite($file, date('Y-m-d H:i:s') . ' - ' . $event . PHP_EOL); fclose($file); } function getDirContents($dir, &$results = array()) { $files = scandir($dir); foreach ($files as $key => $value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (!is_dir($path)) { $results[] = $path; } else if ($value != "." && $value != "..") { getDirContents($path, $results); } } return $results; } function getDirs($dir) { $files = scandir($dir); foreach ($files as $key => $value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (is_dir($path) && $value != "." && $value != "..") { $results[] = $value; } } return $results; } function gzCompressFile($source, $level = 9) { $dest = $source . '.gz'; $mode = 'wb' . $level; $error = false; if ($fp_out = gzopen($dest, $mode)) { if ($fp_in = fopen($source, 'rb')) { while (!feof($fp_in)) gzwrite($fp_out, fread($fp_in, 1024 * 512)); fclose($fp_in); } else { $error = true; } gzclose($fp_out); } else { $error = true; } if ($error) return false; else return $dest; } function renameFile($filename) { setlocale(LC_ALL, 'en_US.UTF8'); // by Nadov $ext = extension($filename); $filename = str_replace('.' . $ext, '', $filename); $filename = iconv('UTF-8', 'ASCII//TRANSLIT', $filename); // by Nadov $filename = trim($filename); $filename = str_replace(' ', '-', $filename); $filename = preg_replace('/[^_0-9a-zA-Z-]/', '', strtolower($filename)); $filename = preg_replace('/\s\s+/', ' ', $filename); $filename = str_replace('----', '-', $filename); $filename = str_replace('---', '-', $filename); $filename = str_replace('--', '-', $filename); $length = 6; $filename .= '-' . substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyz', ceil($length / strlen($x)))), 1, $length); return $filename . '.' . $ext; } function validateDate($date, $format = 'Y-m-d H:i:s') { $d = DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; } function picture_refresh($imgdir, $text) { if (!is_dir($imgdir)) { mkdir($imgdir); global $main; $chd = (int)($main->conf_read("chmod_dir")); if ($chd > 100 && $chd <= 777) { $e = "chmod('$imgdir', 0" . (int)($chd) . ");"; eval($e); } } if (!get_magic_quotes_gpc()) { $text = stripslashes($text); } $str = str_replace("\r\n", " ", $text); $imgdirr = $imgdir; $kvt = opendir($imgdirr); while (false !== ($fajl = readdir($kvt))) { if ((is_file("$imgdirr$fajl")) && ($fajl != "..") && ($fajl != ".") && ($fajl != "index.php")) { if (!strstr($str, $fajl)) unlink($imgdirr . $fajl); } } } function extension($str) { $str = implode("", explode("\\", $str)); $str = explode(".", $str); $str = strtolower(end($str)); return $str; } function return_bytes($val) { $val = trim($val); $last = strtolower($val[strlen($val) - 1]); switch ($last) { // The 'G' modifier is available since PHP 5.1.0 case 'g': $val *= 1024; case 'm': $val *= 1024; case 'k': $val *= 1024; } return $val; } function getRemoteData($url, $explode = false) { $connect = '[[nothing]]'; if (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $content = curl_exec($ch); curl_close($ch); $connect = '[[curl]]'; } if (!$content) { $parse = parse_url($url); $host = $parse['scheme'] . '://' . $parse['host']; $query = $parse['path'] . '?' . $parse['query']; if ($parse['scheme'] == 'https') $port = 443; else $port = 80; $fp = @fsockopen($parse['host'], $port, $errno, $errstr, 5); if ($fp) { $out = "GET $url HTTP/1.1\r\n"; $out .= "Host: $host\r\n"; $out .= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' . "\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $content .= fgets($fp, 128); } fclose($fp); $out = ''; $connect = '[[fsockopen]]'; } } if (!$content && $fp = @fopen($url, 'r')) { $content = ''; while ($line = fread($fp, 1024)) { $content .= $line; } $connect = '[[fopen]]'; } if (!$content) { $content = @file_get_contents($url); $connect = '[[file_get_contents]]'; } if ($explode) { $x = explode($explode, $content); $content = $x[1]; } if (!$content) { $content = 'Connection error! '; } return $content; } function getTemplate($name) { $template = parse_ini_file(WG_PATH . 'files/templates/' . $name . '/template.ini', true); $template['dir'] = $name; if (!$template['template']['template_name']) { return false; } return $template; } function getBounceText($bounce_code) { $bounce_codes1 = array( '2.' => 'Sikeres parancs: A szerver a parancsot elfogadta, esetleg az al pontok változtatásokra hívhatják fel a figyelmet ahhoz, hogy sikeres legyen a küldés.', '4.' => 'Pillanatnyi hiba: Valamilyen olyan pillanatnyi szerver hiba, vagy DNS probléma okozza a hibát mely kicsit később próbálva valószínűleg nem fog fent állni, esetleg domain szintű elgépelés történt...', '5.' => 'Állandó hiba: Ezek olyan hibák melyek az e-mail újraküldésével sem oldhatóak meg. Nagyvalószínűséggel változtatni kell valamit vagy az e-mailen, vagy a cél szerveren.', ); $bounce_codes2 = array( '.1.' => 'Feladó vagy címzett e-mail címével van valami probléma. Általában valamely e-mail cím elgépeléséről van szó, mely kijavítása után az e-mail elküldődik.', '.2.' => 'Ezen DSN (Delivery Status Notification) a címzett e-mail fiókjával kapcsolatos, javítani a szerver oldalon lehet a hibát, általában.', '.3.' => 'Hiba a fogadó szerver oldalán, javítani a szerver üzemeltetője tudja a hibát. Természetesen ez jelentheti akár azt is, hogy létre kell hozni az adott e-mail címet... de pl. ilyenkor társul hozzá egy X.1.X es hibaüzenet is...', '.4.' => 'Hálózati vagy routing problémák, esetleg könyvtár szolgáltatás problémák...', '.5.' => 'Üzent továbbítási protokoll hiba, mely lehet valamely szerver konfiguráció okából, de akár csatlakozási okokból is.', '.6.' => 'Az üzenet tartalmaz hibát, hibás csatolmányt. Javítható ügyfél oldalon és szerver oldalon is, ugyanis ügyfél oldalon is korlátozható a küldendő file típusa pl.', '.7.' => 'Biztonsági szabályok megszegése esetén visszakapott hibakód...' ); $bounce_codes3 = array( '.0.0' => 'Ez az egyetlen hiba üzenet melyből csak az deríthető ki, hogy melyik osztályba tartozik a hiba...', //a) E-mail címmel kapcsolatos hiba üzenetek: '.1.0' => 'A cím ami az üzenetben meg lett adva okozza a hiba üzenetet', '.1.1' => 'A címzett fiókja, e-mail címe nem létezik a megadott szerveztnél (@ előtti rész nem megfelelő).', '.1.2' => 'A megadott „szolgáltató” nem létezik (@-utáni rész nem megfelelő)', '.1.3' => 'A megadott e-mail címben valahol hiba van...', '.1.4' => 'A megadott e-mail cím több fiókhoz is hozzátartozik a szerveren.', '.1.5' => 'A címzett fiókja élő (Kézbesítési riportok esetén hasznos)', '.1.6' => 'A címzett fiókja valaha létezett, de már nem elérhető a szerveren', '.1.7' => 'A címzett címe nem megfelelő, az e-mail cím bármely részében lehet hiba.', '.1.8' => 'Az e-mail cím domain része nem megfelelo (@-utáni rész) (Nincs reverse mondjuk)', //b) Konkrétan e-mail fiókkal kapcsolatos hiba üzenetek:: '.2.0' => 'Annyi információt tudunk csak, hogy a fiókkal van valami probléma. (A fiók létezik)', '.2.1' => 'A fiók él de nem fogad leveleket, ez lehet általános hiba de akár pillanatnyi is... (Korlátozás)', '.2.2' => 'Fiók megtelt: Túllépte az ügyfél a megengedett e-mail tárhelyet...', '.2.3' => 'Üzete hossza túllépte a megengedett hosszt.', '.2.4' => 'A fiók egy levelezési lista fiókja, mely nem volt tovább terjeszthető...', //c)Fogadó szerverrel kapcsolatos hibaüzenetek: '.3.0' => 'A címzett szervere elfogadja az e-maileket, de valami probléma van vele...', '.3.1' => 'A mail-server háttértárolója megtelt.', '.3.2' => 'A szerver melyiken a címzett fiókja van nem fogad leveleket (éppen újraindítás alatt van, esetleg túlterhelt)', '.3.3' => 'Az e-mail által „használt” metódusok elvégzésére a rendszer nem alkalmas.', '.3.4' => 'Az üzenet mérete meghaladja a rendszerben küldhető maximális méretet.', '.3.5' => 'A rendszer nincs a küldött üzenet elfogadására konfigurálva.', //d) Hálózati esetleg routing problémák: '.4.0' => 'Hálózati, routing probléma kategóriájába tartozó hiba, de pontosan nem behatárolható.', '.4.1' => 'A címzett szervere nem fogadja a kapcsolatokat, túlterhelt, vagy tényleg nem fogad levelezés irányú kapcsolatokat', '.4.2' => 'A címzett kiszolgálójával a csatlakozás létrejött, de valamilyen hiba folytán nem lehetett befejezni a megkezdett metódusokat, esetleg time out, vagy egyéb probléma miatt.', '.4.3' => 'Az e-mailt nem lehetett a megadott címzettek felé továbbítani, mert a „Könyvtár Szolgáltatás” nem volt elérhető (leggyakrabban DNS hiba)', '.4.4' => 'Nem lehetett az útvonalat meghatározni. (Pl: dns lekérdezés csak SOA rekordot adott vissza)', '.4.5' => 'A szerver nem volt képes az e-mail továbbítására, mert túl nagy volt a queue. (A várakozási sor nagysága meghaladta a maximumot)', '.4.6' => 'Az üzenet útvonal hiba miatt nem továbbítható, túl sokszor lett továbbítva, esetleg saját magára van irányítva az e-mail cím.', '.4.7' => 'Az e-mail továbbítási ideje lejárt,( minden szerveren be van állítva egy idő mely időn belül az e-mailt tovább kell adni, ha ez letelik ezt a hibaüzenetet kapja az ügyfél)', //d) Továbbítási protokoll hiba: '.5.0: Nem behatárolható hogy pontosan milyen továbbítási protokoll hiba lépett fel.', '.5.1' => 'A parancs nem támogatott', '.5.2' => 'A Parancs vagy elgépelt, vagy nem felismerhető.', '.5.3' => 'Túl sok címzett', '.5.4' => 'Nem elfogadható argumentumok', '.5.5' => 'Rossz protokoll verzió', //e) Üzenet tartalma hibás: '.6.0' => 'Nem behatárolható, hogy milyen hibát tartalmaz az üzenet.', '.6.1' => 'Vagy a protokoll vagy a továbbításra beállított fogadó rendszer nem megfelelő.', '.6.2' => 'Az üzenet tartalma nem megfelelő, (Spam szűrés esetén, ilyen mehet ki ha nem megfelelő szót, kifejezést tartalmaz a levél)', '.6.3' => 'A továbbítandó e-mail 8-bit-es, de a fogadó szerver csak 7-bit en fogadja el... (A mail szervernek át kéne ezt forgatni)', '.6.4' => 'Az üzenet sikeresen továbbításra kerül, de az üzenet egy része elveszett...(csatolt állomány pl)', '.6.5' => 'Kapcsolat felvétel nem volt sikeres', //f) Biztonsági szabályok megsértése esetén kapható hiba üzenetek: '.7.0' => 'A levél valamilyen biztonsági szerver beállítást sért, de nem tudni milyet.', '.7.1' => 'A levél továbbítására nincs lehetőség, vagy jogosultsági probléma, vagy az üzenet lett visszautasítva.', '.7.2' => 'Nincs joga az adott levelezőlistára e-mailt küldeni.', '.7.3' => 'Biztonságos levélküldésre van szükség, de nem volt rá lehetőség', '.7.4' => 'Az üzenet Biztonságos jelszó hitelesítéssel küldődött, de ezen hitelesítés nem alkalmazható a szerveren.', '.7.5' => 'Titkosítási probléma', '.7.6' => 'Titkosítási forma nem támogatott.', '.7.7' => 'A küldött e-mail nem elfogadható, mert hamisított!' ); $text = ''; foreach ($bounce_codes1 as $findme => $value) { $pos = stripos($bounce_code, $findme); if ($pos !== false && $pos == 0) { $text .= $value . '
'; foreach ($bounce_codes2 as $findme2 => $value2) { $pos2 = stripos($bounce_code, $findme2); if ($pos2 !== false && $pos2 > 0) { $text .= $value2 . '
'; foreach ($bounce_codes3 as $findme3 => $value3) { $pos3 = stripos($bounce_code, $findme3); if ($pos3 !== false) { $text .= $value3 . '
'; break; } } break; } } break; } } return $text; } // az admin felület használata során használt megjelenítési beállítások tárolására function setUserSettings($name, $value) { global $main; $user_settings = getUserSettings(); if(!$value) unset($user_settings[$name]); else $user_settings[$name] = $value; $new_user_settings = json_encode($user_settings); $main->conf_update('user_settings', $new_user_settings); return getUserSettings(); } function getUserSettings($name=false) { global $main; $user_settings = $main->conf_read('user_settings'); $user_settings = json_decode($user_settings, 1); if($name) return $user_settings[$name]; return $user_settings; } $c = 'wg6'; /************************************************************* * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com * Fee free to distribute and modify code, but keep reference to its creator * * This class generate QR [Quick Response] codes with proper metadata for mobile phones * using google chart api http://chart.apis.google.com * Here are sources with free QR code reading software for mobile phones: * http://reader.kaywa.com/ * http://www.quickmark.com.tw/En/basic/download.asp * http://code.google.com/p/zxing/ * * For more information, examples and online documentation visit: * http://webcodingeasy.com/PHP-classes/QR-code-generator-class **************************************************************/ class qrcode { private $data; //creating code with link mtadata public function link($url) { if (preg_match('/^http:\/\//', $url) || preg_match('/^https:\/\//', $url)) { $this->data = $url; } else { $this->data = "http://" . $url; } } //getting image public function get_image($size = 150, $EC_level = 'L', $margin = '0') { $ch = curl_init(); $this->data = urlencode($this->data); curl_setopt($ch, CURLOPT_URL, 'http://chart.apis.google.com/chart'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, 'chs=' . $size . 'x' . $size . '&cht=qr&chld=' . $EC_level . '|' . $margin . '&chl=' . $this->data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $response = curl_exec($ch); curl_close($ch); return $response; } //getting link for image public function get_link($size = 100, $EC_level = 'L', $margin = '0') { $this->data = urlencode($this->data); return 'http://chart.apis.google.com/chart?chs=' . $size . 'x' . $size . '&cht=qr&chld=' . $EC_level . '|' . $margin . '&chl=' . $this->data; } //forsing image download public function download_image($file) { header('Content-Description: File Transfer'); header('Content-Type: image/png'); header('Content-Disposition: attachment; filename=QRcode.png'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); // header('Content-Length: ' . filesize($file)); // ob_clean(); flush(); echo $file; } } class tg_xls_writer { function downloading($fajlnev) { header("Content-Type: application/excel"); header("Content-Disposition: attachment; filename=\"" . trim(htmlentities($fajlnev)) . "\""); header("Cache-Control: cache, must-revalidate"); header("Pragma: cache"); header("Connection: close"); flush(); } function xls_kezd() { echo (pack(str_repeat('v', 6), 0x809, 0x8, 0x0, 0x10, 0x0, 0x0)); } function csv_conv($str) { // if(strstr($str, '"')) return '"'.$str.'";'; // else return $str.';'; return '"' . str_replace('"', '\"', $str) . '";'; } function xls_cella_ir($x, $y, $ert) { if (!isset($val)) $val = ''; if (is_int($ert) || is_float($ert)) // ha szám típusú akkor: { echo (pack(str_repeat('v', 5), 0x203, 14, $x, $y, 0x0)); echo (pack("d", $val)); } else { // h nem akkor szöveges módba rakjuk be $hossz = strlen($ert); echo (pack(str_repeat('v', 6), 0x0204, ($hossz + 8), $x, $y, 0x0, $hossz)); echo $ert; } } function xls_vege() { echo (pack(str_repeat('v', 2), 0x0A, 0x00)); } } $c .= '_main_class'; class wg_pop3 { var $port = 110; function vezerlo($string, $valaszto = "") { if (!$valaszto) { $valaszto = $string; $string = $this->next_token; } for ($c = 0; $c < strlen($valaszto); $c++) if (gettype($p = strpos($string, $valaszto[$c])) == "integer") $found = (isset($found) ? min($found, $p) : $p); if (isset($found)) { $this->next_token = substr($string, $found + 1); return (substr($string, 0, $found)); } else { $this->next_token = ""; return ($string); } } function vesz() { for ($s = "";; ) { if (feof($this->con)) return (0); $s .= fgets($this->con, 100); $h = strlen($s); if ($h >= 2 && substr($s, $h - 2, 2) == "\r\n") { $s = substr($s, 0, $h - 2); return ($s); } } } function kuld($s) { return (fputs($this->con, "$s\r\n")); } function ccn() { if ($this->con != 0) { fclose($this->con); $this->con = 0; } } function open($host, $port) { $this->hostname = $host; $this->port = $port; if (($this->con = @fsockopen($this->hostname, $this->port, $e)) == 0) return (sprintf(__("Nem tudtam csatlakozni a %s kiszolgálóhoz!"), $this->hostname)); if ($this->vezerlo($this->vesz(), " ") != "+OK") return __("Hibás POP3 szerver válasz!"); } function close() { $this->kuld("QUIT"); $this->CCn(); } function login($user, $password, $apop = 0) { $this->kuld("USER $user"); if ($this->vezerlo($this->vesz(), " ") != "+OK") return __('Hiba a felhasználónév küldésekor') . " -> " . $this->vezerlo("\r\n"); $this->kuld("PASS $password"); if ($this->vezerlo($this->vesz(), " ") != "+OK") return __('Hibás POP3 felhasználónév vagy jelszó') . " -> " . $this->vezerlo("\r\n"); } function statistic(&$messages, &$size) { $this->kuld("STAT"); $x = $this->vesz(); $this->vezerlo($x, " "); $messages = $this->vezerlo(" "); $size = $this->vezerlo(" "); } function list_messages($message) { $list_command = "LIST"; if ($message) $this->kuld("LIST $message"); else $this->kuld("LIST"); $valasz = $this->vesz(); if (!isset($response)) $response = ''; $this->vezerlo($response, " "); if ($message == "") { $messages = array(); for (;; ) { $valasz = $this->vesz(); if ($valasz == ".") break; $message = intval($this->vezerlo($valasz, " ")); $messages[$message] = $this->vezerlo(" "); } return ($messages); } else { $message = intval($this->vezerlo(" ")); $value = $this->vezerlo(" "); return $value; } } function load_message($message, &$headers, &$body) { $this->kuld("RETR $message"); for ($headers = $body = array(), $s = 0;; ) { $valasz = $this->vesz(); if ($valasz == '.') return; if ($valasz == '') break; if (substr($valasz, 0, 1) == ".") $valasz = substr($valasz, 1, strlen($valasz) - 1); $headers[$s] = $valasz; $s++; } for ($s = 0;; $s++) { $valasz = $this->vesz(); if ($valasz == '.') return; if (substr($valasz, 0, 1) == ".") $valasz = substr($valasz, 1, strlen($valasz) - 1); $body[$s] = $valasz; } } function delete_message($message) { $this->kuld("DELE $message"); $valasz = $this->vesz(); } function bounce_handler($str) { if (defined('WG_LIGHT_BOUNCE_FILTER')) { if (preg_match("/Try again later/i", $str) || preg_match("/Rate limit applied/i", $str) || preg_match("/\s \(? \#? 4\.2\.1 \)? \s/x", $str) || preg_match("/\s \(? \#? 4\.5\.0 \)? \s/x", $str) || preg_match("/\s \(? \#? 4\.5\.1 \)? \s/x", $str) || preg_match("/\s \(? \#? 4\.5\.2 \)? \s/x", $str) || preg_match("/\s \(? \#? 4\.4\.2 \)? \s/x", $str) || preg_match("/\s \(? \#? 4\.3\.0 \)? \s/x", $str) || //pl: citromail -> rate limit... preg_match("/\s \(? \#? 4\.7\.0 \)? \s/x", $str) || // pl: yahoo -> temporarily deferred due to user complaints preg_match("/mail server temporarily rejected message/i", $str)) return false; } $EMAIL_ADDR_REGEX = "([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})"; $user_re = "(?: mailbox | user | recipient | address (?: ee)? | customer | account | e-?mail | ? )"; if (preg_match("/(?:domain|host)\s+(?:not\s+found|unknown)/i", $str)) return array(0, 1, 'domain/host not found or unknown'); if (preg_match("/queue\s+too\s+long/i", $str)) return array(4, 0, 'queue too long'); if (preg_match("/Unrouteable\s+address/i", $str)) return array(5, 0, 'unrouteable address'); if (preg_match("/try.again.later/is", $str)) return array(1, 0, 'try again later'); if (preg_match("/mailbox\b.*\bfull/", $str)) return array(1, 0, 'mailbox full'); if (preg_match("/storage/i", $str)) return array(1, 0, 'storage full'); if (preg_match("/quota/i", $str)) return array(1, 0, 'over quota'); if (preg_match("/$user_re\s+ (?:\S+\s+)? (?:is\s+)? (?: (?: un|not\s+) (?: known | recognized ) | [dw]oes\s?n[o']?t\s+ (?: exist|found ) | disabled | expired ) /ix", $str)) return array(2, 1, 'user not exists'); # Generic if (preg_match("/no\s+(?:such\s+)?$user_re/ix", $str)) return array(2, 1, 'user not exists'); # Gmail and other if (preg_match("/inactive user/i", $str)) return array(2, 1, 'inactive user'); # Outblaze if (preg_match("/unknown local part/i", $str)) return array(2, 1, 'unknown local part'); # Exim(?) if (preg_match("/user\s+doesn't\s+have\s+a/i", $str)) return array(2, 1, 'user not exists'); # Yahoo! if (preg_match("/account\s+has\s+been\s+(?:disabled|suspended)/i", $str)) return array(2, 1, 'inactive user'); # Yahoo! if (preg_match("/$user_re\s+(?:suspended|discontinued)/ix", $str)) return array(2, 1, 'inactive user'); # everyone.net / other? if (preg_match("/unknown\s+$user_re/ix", $str)) return array(2, 1, 'user not exists'); # Generic if (preg_match("/$user_re\s+(?:is\s+)?(?:inactive|unavailable)/ix", $str)) return array(2, 1, 'inactive user'); # Hotmail, others? if (preg_match("/(?:(?:in|not\s+a\s+)?valid|no such)\s$user_re/ix", $str)) return array(2, 1, 'user not exists'); # Various if (preg_match("/$user_re\s+(?:was\s+)?not\s+found/ix", $str)) return array(2, 1, 'user not exists'); # AOL, generic if (preg_match("/$user_re \s+ (?:is\s+)? (?:currently\s+)? (?:suspended|unavailable)/ix", $str)) return array(2, 1, 'inactive user'); # ATT, generic if (preg_match("/address is administratively disabled/i", $str)) return array(2, 1, 'address is administratively disabled'); # Unknown if (preg_match("/no\s$user_re\s+(?:here\s+)?by\sthat\sname/ix", $str)) return array(2, 1, 'user not exists'); # Unknown if (preg_match("/? is invalid/i", $str)) return array(2, 1, 'invalid e-mail address'); # Unknown if (preg_match("/address.*not known here/i", $str)) return array(2, 1, 'address not known here'); # Unknown if (preg_match("/recipient\s+(?:address\s+)?rejected/i", $str)) return array(2, 1, 'recipient address rejected'); # Cox, generic if (preg_match("/not\s+listed\s+in\s+Domino/i", $str)) return array(2, 1, 'not listed in Domino'); # Domino if (preg_match("/account not activated/i", $str)) return array(2, 1, 'account not activated'); # usa.net if (preg_match("/not\s+our\s+customer/i", $str)) return array(2, 1, 'not our customer'); # Comcast if (preg_match("/doesn't handle mail for that user/i", $str)) return array(2, 1, 'doesn\'t handle mail for that user'); # mailfoundry if (preg_match("/\s \(? \#? 2\.0\.0 \)? \s/x", $str)) return array(6, 0, '2.0.0'); if (preg_match("/\s \(? \#? 2\.1\.1 \)? \s/x", $str)) return array(7, 0, '2.1.1'); if (preg_match("/\s \(? \#? 2\.1\.4 \)? \s/x", $str)) return array(8, 0, '2.1.4'); if (preg_match("/\s \(? \#? 2\.2\.0 \)? \s/x", $str)) return array(9, 0, '2.2.0'); if (preg_match("/\s \(? \#? 2\.2\.1 \)? \s/x", $str)) return array(10, 0, '2.2.1'); if (preg_match("/\s \(? \#? 2\.5\.0 \)? \s/x", $str)) return array(11, 0, '2.5.0'); if (preg_match("/\s \(? \#? 2\.5\.1 \)? \s/x", $str)) return array(12, 0, '2.5.1'); if (preg_match("/\s \(? \#? 3\.5\.4 \)? \s/x", $str)) return array(13, 0, '3.5.4'); if (preg_match("/\s \(? \#? 4\.2\.1 \)? \s/x", $str)) return array(14, 0, '4.2.1'); if (preg_match("/\s \(? \#? 4\.3\.0 \)? \s/x", $str)) return array(X, 0, '4.3.0'); if (preg_match("/\s \(? \#? 4\.7\.0 \)? \s/x", $str)) return array(X, 0, '4.7.0'); if (preg_match("/\s \(? \#? 4\.7\.1 \)? \s/x", $str)) return array(X, 1, '4.7.1'); if (preg_match("/\s \(? \#? 4\.4\.2 \)? \s/x", $str)) return array(26, 0, '4.4.2'); if (preg_match("/\s \(? \#? 4\.5\.0 \)? \s/x", $str)) return array(15, 0, '4.5.0'); if (preg_match("/\s \(? \#? 4\.5\.1 \)? \s/x", $str)) return array(16, 0, '4.5.1'); if (preg_match("/\s \(? \#? 4\.5\.2 \)? \s/x", $str)) return array(17, 0, '4.5.2'); if (preg_match("/\s \(? \#? 5\.0\.1 \)? \s/x", $str)) return array(18, 1, '5.0.1'); if (preg_match("/\s \(? \#? 5\.0\.2 \)? \s/x", $str)) return array(19, 1, '5.0.2'); if (preg_match("/\s \(? \#? 5\.0\.3 \)? \s/x", $str)) return array(20, 1, '5.0.3'); if (preg_match("/\s \(? \#? 5\.0\.4 \)? \s/x", $str)) return array(21, 1, '5.0.4'); if (preg_match("/\s \(? \#? 5\.1\.3 \)? \s/x", $str)) return array(22, 1, '5.1.3'); if (preg_match("/\s \(? \#? 5\.1\.5 \)? \s/x", $str)) return array(23, 1, '5.1.5'); if (preg_match("/\s \(? \#? 5\.1\.0 \)? \s/x", $str)) return array(2, 1, '5.1.0'); if (preg_match("/\s \(? \#? 5\.1\.1 \)? \s/x", $str)) return array(2, 1, '5.1.1'); # rfc 1893 if (preg_match("/\s \(? \#? 5\.2\.0 \)? \s/x", $str)) return array(34, 0, '5.2.0'); if (preg_match("/\s \(? \#? 5\.2\.1 \)? \s/x", $str)) return array(24, 0, '5.2.1'); if (preg_match("/\s \(? \#? 5\.2\.2 \)? \s/x", $str)) return array(1, 0, '5.2.2'); if (preg_match("/\s \(? \#? 5\.3\.0 \)? \s/x", $str)) return array(25, 0, '5.3.0'); if (preg_match("/\s \(? \#? 5\.4\.6 \)? \s/x", $str)) return array(27, 1, '5.4.6'); if (preg_match("/\s \(? \#? 5\.4\.4 \)? \s/x", $str)) return array(5, 0, '5.4.4'); if (preg_match("/\s \(? \#? 5\.5\.0 \)? \s/x", $str)) return array(28, 1, '5.5.0'); if (preg_match("/\s \(? \#? 5\.5\.1 \)? \s/x", $str)) return array(29, 0, '5.5.1'); if (preg_match("/\s \(? \#? 5\.5\.2 \)? \s/x", $str)) return array(1, 0, '5.5.2'); //if(preg_match("/\s552\s/", $str)) return array(1, 0, '5.5.2'); if (preg_match("/\s \(? \#? 5\.5\.3 \)? \s/x", $str)) return array(30, 1, '5.5.3'); if (preg_match("/\s \(? \#? 5\.5\.4 \)? \s/x", $str)) return array(31, 1, '5.5.4'); if (preg_match("/\s \(? \#? 5\.6\.1 \)? \s/x", $str)) return array(32, 1, '5.6.1'); if (preg_match("/\s \(? \#? 5\.6\.0 \)? \s/x", $str)) return array(32, 0, '5.6.0'); if (preg_match("/\s \(? \#? 5\.6\.2 \)? \s/x", $str)) return array(33, 0, '5.6.2'); if (preg_match("/\s \(? \#? 5\.7\.0 \)? \s/x", $str)) return array(34, 1, '5.7.0'); if (preg_match("/\s \(? \#? 5\.7\.1 \)? \s/x", $str)) return array(34, 0, '5.7.1'); if (preg_match("/\s \(? \#? 5\.7\.8 \)? \s/x", $str)) return array(34, 0, '5.7.8'); if (preg_match("/\s \(? \#? 5\.0\.0 \)? \s/x", $str)) return array(35, 0, '5.0.0'); if (preg_match("/domain\s+syntax/i", $str)) return array(3, 0, 'domain syntax'); if (preg_match("/route\s+to\s+host/i", $str)) return array(3, 0, 'route to host'); if (preg_match("/connection\s+refused/i", $str)) return array(3, 0, 'connection refused'); if (preg_match("/no\s+data\s+record\s+of\s+requested\s+type/i", $str)) return array(3, 0, 'no data record of requested type'); if (preg_match("/\s timeout \s/x", $str)) return array(36, 0, 'timeout'); if (preg_match("/timed\s+out/i", $str)) return array(3, 0, 'timeout'); if (preg_match("/Rate limit applied/i", $str)) return array(100, 0, 'rate limit applied'); if (preg_match("/mail server temporarily rejected message/i", $str)) return array(100, 0, 'mail server temporarily rejected message'); if (preg_match("/\s450\s/", $str)) return array(2, 1, 'inactive user'); if (preg_match("/\s550\s/", $str)) return array(2, 1, 'user not exists'); if (preg_match("/\s551\s/", $str)) return array(2, 1, 'user not exists'); /* Code Description 421 service not available, closing transmission channel 450 Requested mail action not taken: mailbox unavailable (e.g., mailbox busy) 451 Requested action aborted: error in processing 452 Requested action not taken: insufficient system storage 500 The server could not recognize the command due to a syntax error. 501 A syntax error was encountered in command arguments. 502 This command is not implemented. 503 The server has encountered a bad sequence of commands. 504 A command parameter is not implemented. 550 User’s mailbox was unavailable (“not found”) 551 The recipient is not local to the server. 552 The action was aborted due to exceeded storage allocation. 553 The command was aborted because the mailbox name is invalid. 554 The transaction failed for some unstated reason. https://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml https://tools.ietf.org/html/rfc3463#section-3 */ return array(37, 0, 'unknown'); } function error($regi, $uj) { if ($regi > 100) return ($regi + $uj * 10000); elseif ($regi) return ($regi + $uj * 100); else return $uj; } } class MySQLDump { function dumpDatabase($database) { $myprefix = DB_PREFIX; header('Content-Type: text/html; charset=utf-8'); echo "SET CHARACTER SET utf8;\r\n\r\n"; echo "SET NAMES utf8;\r\n\r\n"; $db = @mysql_select_db($database); if (!empty($db)) { $c = 0; $result = mysql_list_tables($database); for ($x = 0; $x < mysql_num_rows($result); $x++) { $table = mysql_tablename($result, $x); if (substr($table, 0, strlen($myprefix)) == $myprefix) { if (!empty($table)) { $arr_tables[$c] = mysql_tablename($result, $x); $c++; } } } $dump = ''; for ($y = 0; $y < count($arr_tables); $y++) { $table = $arr_tables[$y]; $structure = "-- \n"; $structure .= "-- Table structure for table `{$table}` \n"; $structure .= "-- \n\n"; $structure .= "DROP TABLE IF EXISTS `{$table}`; \n"; $structure .= "CREATE TABLE `{$table}` (\n"; $result = mysql_db_query($database, "SHOW FIELDS FROM `{$table}`"); while ($row = mysql_fetch_object($result)) { $structure .= " `{$row->Field}` {$row->Type}"; if ((!empty($row->Default))) if ($row->Default != 'CURRENT_TIMESTAMP') $structure .= " DEFAULT '{$row->Default}'"; $structure .= ($row->Null != "YES") ? " NOT NULL" : false; $structure .= (!empty($row->Extra)) ? " {$row->Extra}" : false; $structure .= ",\n"; } $structure = preg_replace("/,\n$/", "", $structure); $index = ''; $result = mysql_db_query($database, "SHOW KEYS FROM `{$table}`"); while ($row = mysql_fetch_object($result)) { if (($row->Key_name == 'PRIMARY') and ($row->Index_type == 'BTREE')) { $index['PRIMARY'][$row->Key_name] = $row->Column_name; } if (($row->Key_name != 'PRIMARY') and ($row->Non_unique == '0') and ($row->Index_type == 'BTREE')) { $index['UNIQUE'][$row->Key_name] = $row->Column_name; } if (($row->Key_name != 'PRIMARY') and ($row->Non_unique == '1') and ($row->Index_type == 'BTREE')) { $index['INDEX'][$row->Key_name] = $row->Column_name; } if (($row->Key_name != 'PRIMARY') and ($row->Non_unique == '1') and ($row->Index_type == 'FULLTEXT')) { $index['FULLTEXT'][$row->Key_name] = $row->Column_name; } } if (is_array($index)) { foreach ($index as $xy => $columns) { $structure .= ",\n"; $c = 0; foreach ($columns as $column_key => $column_name) { $c++; $structure .= ($xy == "PRIMARY") ? " PRIMARY KEY (`{$column_name}`)" : false; $structure .= ($xy == "UNIQUE") ? " UNIQUE KEY `{$column_key}` (`{$column_name}`)" : false; $structure .= ($xy == "INDEX") ? " KEY `{$column_key}` (`{$column_name}`)" : false; $structure .= ($xy == "FULLTEXT") ? " FULLTEXT `{$column_key}` (`{$column_name}`)" : false; $structure .= ($c < (count($index[$xy]))) ? ",\n" : false; } } } $structure .= "\n);\n\n"; $structure .= "-- \n"; $structure .= "-- Dumping data for table `$table` \n"; $structure .= "-- \n\n"; echo $structure; unset($data); $result = mysql_query("SELECT * FROM `$table`"); $num_rows = mysql_num_rows($result); $num_fields = mysql_num_fields($result); for ($i = 0; $i < $num_rows; $i++) { $row = mysql_fetch_object($result); echo "INSERT INTO `$table` "/*("; for ($x = 0; $x < $num_fields; $x++) { $field_name = mysql_field_name($result, $x); echo "`{$field_name}`"; echo ($x < ($num_fields - 1)) ? ", " : false; } echo ")*/ . " VALUES ("; for ($x = 0; $x < $num_fields; $x++) { $field_name = mysql_field_name($result, $x); echo "'" . str_replace('\"', '"', mysql_real_escape_string($row->$field_name)) . "'"; echo ($x < ($num_fields - 1)) ? ", " : false; } echo ");\n"; } echo "\n"; // echo $structure . $data; echo "-- --------------------------------------------------------\n\n"; } //return $dump; } } } include('class.sendmail.php'); class wg6_main_class extends wg6_sender_class { function csvr($line, $spe = ',', $ij = '"', $esc = '\\') { $tomb = array(); if (is_string($spe) && is_string($ij)) { $hl = '\x' . dechex(ord($spe)); $awij = '\x' . dechex(ord($ij)); $awesc = '\x' . dechex(ord($esc)); $line = trim($line); $q1 = 0; while (strlen($line) > 0) { if ($line[0] == $ij) { preg_match('/^' . $awij . '((?:[^' . $awij . ']|(?<=' . $awesc . ')' . $awij . ')*)' . $awij . $hl . '?(.*)$/', $line, $m); $value = preg_replace('/' . $awesc . $awij . '/', $ij, $m[1]); $line = trim($m[2]); $tomb[$q1++] = $value; } else { preg_match('/^((?:[^' . $hl . ']|(?<=' . $awesc . ')' . $hl . ')*)' . $hl . '?(.*)$/', $line, $m); $value = preg_replace('/' . $awesc . $hl . '/', $spe, $m[1]); $line = trim($m[2]); $tomb[$q1++] = $value; } } } return $tomb; } function isValidEmail($email) { if (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*(\+[a-z0-9-]+)?@[a-z0-9-]+(\.[a-z0-9-]{2,})+$/i', $email) && strlen($email) <= 50) return false; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) return false; return true; } function spam_ellenoriz($minta, $szoveg) { $minta = str_replace("*", "(.*)", $minta); if (is_array($szoveg)) foreach ($szoveg as $v) { $s = explode(chr(0x20), strtolower($v)); foreach ($s as $szo) { foreach ($minta as $k => $spam) if (preg_match("/^" . strtolower($spam) . "$/i", $szo)) return $k; } } else { $s = explode(chr(0x20), strtolower($szoveg)); foreach ($s as $szo) { foreach ($minta as $k => $spam) if (preg_match("/^" . strtolower($spam) . "$/i", $szo)) return $k; } } } function dir_size($path) { $totalsize = 0; $totalcount = 0; $dircount = 0; if ($handle = @opendir($path)) { while (false !== ($file = readdir($handle))) { $nextpath = $path . '/' . $file; if ($file != '.' && $file != '..' && !is_link($nextpath)) { if (is_dir($nextpath)) { $dircount++; $result = $this->dir_size($nextpath); $totalsize += $result['size']; $totalcount += $result['count']; $dircount += $result['dircount']; } elseif (is_file($nextpath)) { $totalsize += filesize($nextpath); $totalcount++; } } } closedir($handle); } $total['size'] = $totalsize; $total['count'] = $totalcount; $total['dircount'] = $dircount; return $total; } function deleteDirectory($dirname, $only_empty = false) { $hiba = 0; if (!is_dir($dirname)) return false; $dscan = array(realpath($dirname)); $darr = array(); while (!empty($dscan)) { $dcur = array_pop($dscan); $darr[] = $dcur; if ($d = opendir($dcur)) { while (false !== ($f = readdir($d))) { if ($f == '.' || $f == '..') continue; $f = $dcur . '/' . $f; if (is_dir($f)) $dscan[] = $f; else unlink($f); } closedir($d); } } $i_until = ($only_empty) ? 1 : 0; for ($i = count($darr) - 1; $i >= $i_until; $i--) { if (!@rmdir($darr[$i])) $hiba = 1; } return (($only_empty) ? (count(scandir) <= 2) : (!is_dir($dirname))); } function menu($get, $nev, $badge = false, $varj = false) { if ($varj) $varj = ' onclick="varj()"'; else $varj = ''; if ($get) { ?>
  • >
  • conf_read("https"); if (!$script) $script = $_SERVER['SCRIPT_NAME']; $fsport = $this->conf_read('fsock_port'); $fsock_domain = explode(":", $_SERVER['HTTP_HOST']); if ($https == '1') $fp = @fsockopen(("ssl://" . $fsock_domain[0]), $fsport ? $fsport : 443, $errno, $errstr, 2); else $fp = fsockopen($fsock_domain[0], $fsport ? $fsport : 80, $errno, $errstr, 30); if ($fp) { $out = "GET $script?$url HTTP/1.1\r\n"; $out .= "Host: " . $fsock_domain[0] . "\r\n"; $out .= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' . "\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); usleep(100000); $out = ''; /* while (!feof($fp)) { $out .= fgets($fp, 128); } echo $out; // */ fclose($fp); } else { echo ('fsockopen error... -- $errno: ' . $errno . ' -- $errstr: ' . $errstr); die('

    ' . __('Kritikus fsockopen hiba.')); } } function meghiv2($q) {//die($q); global $_SERVER; $https = $this->conf_read("https"); $fsport = $this->conf_read('fsock_port'); //printr($_SERVER); $fsock_domain = explode(":", $_SERVER['HTTP_HOST']); if ($https == '1') $fp = @fsockopen(("ssl://" . $fsock_domain[0]), $fsport ? $fsport : 443, $errno, $errstr, 10); else $fp = fsockopen($fsock_domain[0], $fsport ? $fsport : 80, $errno, $errstr, 10); if ($fp) { $out = "GET $_SERVER[SCRIPT_NAME]?$q&t=" . time() . " HTTP/1.1\r\n"; $out .= "Host: " . $fsock_domain[0] . "\r\n"; $out .= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' . "\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); usleep(100000); //echo $out; //echo "
    "; $out = ''; /** / while (!feof($fp)) { $out .= fgets($fp, 128); } echo $out; /**/ fclose($fp); } else { echo ('fsockopen error... -- $errno: ' . $errno . ' -- $errstr: ' . $errstr); die('

    ' . __('Kritikus fsockopen hiba.')); } } function belephet($password) { global $out; global $sec; global $elrontotta; $elrontotta = ''; $belephet = 0; if ($password) { //echo "xx$password"; $q = $this->mq("SELECT * FROM `".DB_PREFIX."config` WHERE wg_conf='admin_password' and conf_value=PASSWORD('$password')"); if (mysql_num_rows($q)) $belephet = mysql_fetch_assoc($q); else $belephet = 0; $x = $this->conf_read("e_log"); if ($x > 2) { $t = $this->conf_read('not_logged'); $sec = ($x - 1) * 2; if ($sec > 60) $sec = 60; if ((time() - $t) < $sec) { // $out=sprintf (__('Mivel már több mint 3x elrontottad a jelszót várnod kell %s másodpercet, és utána újra próbálkozhatsz!'), $sec); $elrontotta = ""; $belephet = 0; } if ($password && !$belephet) $this->conf_update('not_logged', (string)(time())); } if ($password && !$belephet) $this->mq("update `".DB_PREFIX."config` set conf_value=conf_value+1 where wg_conf='e_log'"); if ($belephet) { $this->mq("update `".DB_PREFIX."config` set conf_value=0 where wg_conf='e_log'"); if (!isset($_POST['pswre'])) $_POST['pswre'] = ''; // log -- $sid = session_id(); $ip = $this->getip(); $sm = $this->m_array("Select * from ".DB_PREFIX."loginstat where sessid='$sid'", 'ip'); if (!$sm) { // még nincs- létrehozzuk $this->mq("insert into `".DB_PREFIX."loginstat` (`sessid`, `ip`, `datetime`) values ('$sid', '$ip' , now())"); } elseif ($ip != $sm && (!defined('WG_LOGIN_IP_SESSION') || 'WG_LOGIN_IP_SESSION' != 'disabled')) { // ha más ip-vel van ugyanazzal a sessionid-vel --> betörés echo __("Megváltozott az ip címed! Biztonsági okokból nem használhatod tovább ezt a munkamenet azonosítót! Csukd be a böngésződet vagy kérj új azonosítót, majd jelentkezz be újra!") . '

    ' . __('Kérek új munkamenet azonosítót!') . ''; die(); } return true; } else return false; } } function mail_select_Generator($name, $id, $szoveg = false, $wh = '') { global $_g; if ($szoveg == false) $szoveg = __('Ne küldjön'); $sql = $this->mq("select * from `".DB_PREFIX."messages` where g='$_GET[g]' and text like '%$wh%' order by name"); ?> mq("select * from `".DB_PREFIX."groups` where id!='$_GET[g]' order by name"); while ($x = mysql_fetch_array($sql)) { ?>
    >
    = 5 ) { $result['spam-result'] = '[SPAM]'; } elseif($result['X-Spam-Score'] < 2 ) { $result['spam-result'] = '[NOT-SPAM]'; } else { $result['spam-result'] = '[SPAM-OR-NOT-SPAM]'; } return $result; } } function generateCode($length = 6) { $Code = ""; mt_srand((double)microtime() * 1000000); while (strlen($Code) < $length) { $random = mt_rand(48, 122); $random = md5($random); $Code .= str_replace('0', 'k', substr($random, 17, 1)); } return $Code; } function sql_list_max() { $sql = $this->mq("select * from `".DB_PREFIX."config` where wgconf='lista'"); $s = mysql_fetch_assoc($sql); return $s['conf_value']; } function code2utf($number) { if ($number < 0) return false; if ($number < 128) return chr($number); // Removing / Replacing Windows Illegals Characters if ($number < 160) { if ($number == 128) $number = 8364; elseif ($number == 129) $number = 160; // (Rayo:) #129 using no relevant sign, thus, mapped to the saved-space #160 elseif ($number == 130) $number = 8218; elseif ($number == 131) $number = 402; elseif ($number == 132) $number = 8222; elseif ($number == 133) $number = 8230; elseif ($number == 134) $number = 8224; elseif ($number == 135) $number = 8225; elseif ($number == 136) $number = 710; elseif ($number == 137) $number = 8240; elseif ($number == 138) $number = 352; elseif ($number == 139) $number = 8249; elseif ($number == 140) $number = 338; elseif ($number == 141) $number = 160; // (Rayo:) #129 using no relevant sign, thus, mapped to the saved-space #160 elseif ($number == 142) $number = 381; elseif ($number == 143) $number = 160; // (Rayo:) #129 using no relevant sign, thus, mapped to the saved-space #160 elseif ($number == 144) $number = 160; // (Rayo:) #129 using no relevant sign, thus, mapped to the saved-space #160 elseif ($number == 145) $number = 8216; elseif ($number == 146) $number = 8217; elseif ($number == 147) $number = 8220; elseif ($number == 148) $number = 8221; elseif ($number == 149) $number = 8226; elseif ($number == 150) $number = 8211; elseif ($number == 151) $number = 8212; elseif ($number == 152) $number = 732; elseif ($number == 153) $number = 8482; elseif ($number == 154) $number = 353; elseif ($number == 155) $number = 8250; elseif ($number == 156) $number = 339; elseif ($number == 157) $number = 160; // (Rayo:) #129 using no relevant sign, thus, mapped to the saved-space #160 elseif ($number == 158) $number = 382; elseif ($number == 159) $number = 376; } //if if ($number < 2048) return chr(($number >> 6) + 192) . chr(($number & 63) + 128); if ($number < 65536) return chr(($number >> 12) + 224) . chr((($number >> 6) & 63) + 128) . chr(($number & 63) + 128); if ($number < 2097152) return chr(($number >> 18) + 240) . chr((($number >> 12) & 63) + 128) . chr((($number >> 6) & 63) + 128) . chr(($number & 63) + 128); return false; } //code2utf() function clean_string($string) { $string = str_replace('.', 'QA32cdsggr345gbgbdb3t34dcqqQcthpvefivjYXCFVethb666', $string); $r = preg_replace("/[^[:space:]a-zA-Z0-9-]/", "_", $string); $r = str_replace("-", "_", $r); $r = str_replace('QA32cdsggr345gbgbdb3t34dcqqQcthpvefivjYXCFVethb666', '.', $r); return $r; } function dash($string) { $inArray = array("á", "í", "ű", "ő", "ü", "ö", "ú", "ó", "é", "Á", "Í", "Ű", "Ő", "Ü", "Ö", "Ú", "Ó", "É", "-", "/", "\\", "'", " "); $outArray = array("a", "i", "u", "o", "u", "o", "u", "o", "e", "A", "I", "U", "O", "U", "O", "U", "O", "E", "", "", "", "", "-"); return $this->clean_string(str_replace("--", "-", trim(str_replace($inArray, $outArray, $string)))); } function sql_generate() { $dump = new MySQLDump(); $fajlnev = "wg_" . date("Y_m_d") . ".sql"; header("Content-Type: application/xxx"); header("Content-Disposition: attachment; filename=\"" . trim(htmlentities($fajlnev)) . "\""); header("Cache-Control: cache, must-revalidate"); header("Pragma: cache"); header("Connection: close"); $dump->dumpDatabase(DB_DATABASE); exit; } function fields_copy($from_gid, $to_gid) { global $Referer_nev; $from_group = (int)$from_gid; $to_group = (int)$to_gid; $from_group_data = $this->m_array("select email_field, email2_field from `".DB_PREFIX."groups` where id=$from_group"); $to_group_data = $this->m_array("select email_field, email2_field from `".DB_PREFIX."groups` where id=$to_group"); $sql = $this->mq("select * from ".DB_PREFIX."fields where g = $from_group"); while ($field = mysql_fetch_assoc($sql)) { // kizárjuk az alapvető mezők másolását if ($field['name'] == $Referer_nev || $from_group_data['email_field'] == $field['id'] || $from_group_data['email2_field'] == $field['id']) { // mielőtt továbblépek beállítom az e-mail mezők pozícióját if ($from_group_data['email_field'] == $field['id']) { $this->mq("update ".DB_PREFIX."fields set `hely` = '$field[hely]' where id = " . $to_group_data['email_field']); } elseif ($from_group_data['email2_field'] == $field['id']) { $this->mq("update ".DB_PREFIX."fields set `hely` = '$field[hely]' where id = " . $to_group_data['email2_field']); } continue; } // ha már van ilyen mezőnév akkor hozzáadom a névhez a pontos időt if ($this->mq_count("select count(id) from ".DB_PREFIX."fields where g = $to_group and name = '" . $field['name'] . "' ")) $field['name'] = $field['name'] . ' (' . date('Y-m-d H:i:s') . ')'; $this->mq("insert into ".DB_PREFIX."fields (`g`, `name`, `default`, `check`, `hidden`, `type`, `hely`, `option`, `modifiable`) values ($to_group, '" . $field['name'] . "', '" . $field['default'] . "', '" . $field['check'] . "', '" . $field['hidden'] . "', '" . $field['type'] . "', '" . $field['hely'] . "', '" . $field['option'] . "', '" . $field['modifiable'] . "')"); $id = mysql_insert_id(); // létrehozzuk a meghatározott értékű mezők értékeit if ($field['type'] == 2 || $field['type'] == 4 || $field['type'] == 3) { // radio, select $field['default'] = ';' . $field['default'] . ';'; $new_default = ''; $sql2 = $this->mq("select * from ".DB_PREFIX."fields_fields where field_id = '" . $field['id'] . "'"); while ($field_option = mysql_fetch_assoc($sql2)) { $this->mq("insert into ".DB_PREFIX."fields_fields (field_id, name, hely) values ($id, '" . $field_option['name'] . "', '" . $field_option['hely'] . "')"); $fid = mysql_insert_id(); if (strpos($field['default'], ';' . $field_option['id'] . ';') !== false) { $new_default .= $fid . ';'; } } $new_default = substr($new_default, 0, -1); $this->mq("update ".DB_PREFIX."fields set `default` = '$new_default' where id = $id"); } } return true; } function form_copy($id, $g) { $m = $this->m_array("select * from `".DB_PREFIX."forms` where id='$id'"); unset($m['id']); if ($m['g'] != $g) unset($m['wizard_steps']); $m['g'] = $g; $m['form_page'] = $this->generateCode(10); $m['form_name'] = sprintf(__('%s másolata'), $m['form_name']); $form_field = $form_values = ''; foreach ($m as $key => $val) { $form_field .= "`$key`, "; $form_values .= "'" . mysql_real_escape_string($val) . "', "; } $form_field = substr($form_field, 0, -2); $form_values = substr($form_values, 0, -2); $this->mq("insert into `".DB_PREFIX."forms` ($form_field) values ($form_values) "); return true; } function message_copy($mid, $g) { $m = $this->m_array("select * from `".DB_PREFIX."messages` where id='$mid'"); $mid2 = $this->a_i("".DB_PREFIX."messages"); $m['text'] = str_replace("files/images/$mid/", "files/images/$mid2/", $m['text']); $code = $this->generateCode(38); if ($m['g'] != $g) $this->mq("insert into ".DB_PREFIX."messages (name, subject, text, date, g, code, html_only, template_name, template_params, extract) values ('" . mysql_real_escape_string($m['name']) . "', '" . mysql_real_escape_string($m['subject']) . "', '" . mysql_real_escape_string($m['text']) . "', '" . date("Y-m-d") . "', '$g', '$code', '" . (int)$m['html_only'] . "', '" . mysql_real_escape_string($m['template_name']) . "', '" . mysql_real_escape_string($m['template_params']) . "', '" . mysql_real_escape_string($m['extract']) . "')"); else $this->mq("insert into ".DB_PREFIX."messages (name, subject, text, date, g, code, html_only, template_name, template_params, extract) values ('" . mysql_real_escape_string($m['name']) . " másolata', '" . mysql_real_escape_string($m['subject']) . "', '" . mysql_real_escape_string($m['text']) . "', '" . date("Y-m-d") . "', '$g', '$code', '" . (int)$m['html_only'] . "', '" . mysql_real_escape_string($m['template_name']) . "', '" . mysql_real_escape_string($m['template_params']) . "', '" . mysql_real_escape_string($m['extract']) . "')"); if (is_dir("../files/images/$mid/")) { if (!is_dir("../files/images/$mid2/")) @mkdir("../files/images/$mid2/"); $chd = $this->conf_read("chmod_dir"); if ($chd > 100 && $chd <= 777) { $e = "chmod('../files/images/$id/', 0" . (int)($chd) . ");"; eval($e); } $kvt = opendir("../files/images/$mid/"); while (gettype($fajl = readdir($kvt)) != "boolean") { if ((is_file("../files/images/$mid/$fajl")) && ($fajl != "..") && ($fajl != ".")) { $file2 = "../files/images/$mid2/" . $fajl; if (!file_exists($file2)) { $handle = fopen("../files/images/$mid/$fajl", "r"); $contents = fread($handle, filesize("../files/images/$mid/$fajl")); fclose($handle); $handle = fopen($file2, 'w'); fwrite($handle, $contents); fclose($handle); $chf = $this->conf_read("chmod_file"); if ($chf > 100 && $chf <= 777) { $e = "chmod('$file2', 0" . (int)($chf) . ");"; eval($e); } } } } } if($this->conf_read("mail_link_clicks") == '1') { $regexp = '!]*href[\s]*=[\s]*["\']{1}([\w]+?://[\w#$%&~/.\-;:=,?@\[\]+]*)["\']{1}.*?>(.*?)<\/a>!'; if(preg_match_all($regexp, $m['text'], $matches, PREG_SET_ORDER)) { foreach($matches as $match) { if(strstr($match[1], 'subscriber.php')) continue; $match[1] = str_replace('&', '&', $match[1]); if(!$this->m_array("Select * from ".DB_PREFIX."link_stat where link='$match[1]' and mid='$mid2'")) { do { $code = $this->generateCode(8); } while($this->m_array("Select * from ".DB_PREFIX."link_stat where code='$code'")); $this->mq("insert into ".DB_PREFIX."link_stat (link, code, mid, g) values ('".mysql_real_escape_string($match[1])."', '$code', '$mid2', '$g')"); } } } } return ($m['g'] == $g); } function message_download($mid) { $m = $this->m_array("select * from `".DB_PREFIX."messages` where id='$mid'"); // ha sablon típusú if($m['template_name']) { $this->saveWGMxml($m); //saveWGMxml($html, $head, $style_data, $content_data); } else { header("Content-Type: application/WG2"); header("Content-Disposition: attachment; filename=\"" . trim(htmlentities($this->dash($m['name']) . ".wgm")) . "\""); header("Cache-Control: cache, must-revalidate"); header("Pragma: cache"); header("Connection: close"); if ($this->conf_read('https') == '1') $https = "https"; else $https = "http"; echo (base64_encode("WEBGALAMB2 MESSAGE FILE")); echo ("\\"); // fájl eleje echo (base64_encode($m['name'])); echo ("\\"); // levél neve echo (base64_encode($m['subject'])); echo ("\\"); // levél tárgya echo (base64_encode(preg_replace("#$https\://+[a-z0-9\./\-_%]+/images/$mid/#i", '{ELERES}/', $m['text']))); echo ("\\"); // üzenet szövege //echo(base64_encode(str_replace("images/$mid/", "images/{MID}/",$m['text'])));echo("\\"); // üzenet szövege echo (base64_encode($m['date'])); echo ("\\"); // létrehozás dátuma if (is_dir("files/images/$mid/")) { $kvt = opendir("files/images/$mid/"); while (gettype($fajl = readdir($kvt)) != 'boolean') { if ((is_file("files/images/$mid/$fajl")) && ($fajl != "..") && ($fajl != ".")) { echo (base64_encode($fajl)); echo "|"; $handle = fopen("files/images/$mid/$fajl", "r"); $contents = fread($handle, filesize("files/images/$mid/$fajl")); fclose($handle); echo (base64_encode($contents)); echo ("\\"); } } } } exit; } //function saveWGMxml($html, $head, $style_data, $content_data, $name, $subject, $template_name) { function saveWGMxml($message) { include_once('class.ExSimpleXMLElement.php'); $file_name = trim(htmlentities($this->dash($message['name']))); $dom = new domDocument; $dom->loadHTML($message['text']); $dom->preserveWhiteSpace = false; $images = $dom->getElementsByTagName('img'); $template = new ExSimpleXMLElement('