keys/b3194_5e44d_2901225ca4b80f866a016c8e950a8432.key000064000000003216147203271150014030 0ustar00-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAsxlHssmQPQl4TECGRbnH+7kwk8djb8mdGa61Obdf9jg1WEXG aSY25KOWa0Dr8HC3SxwueHenhLn4iSu0GsoAY08zk5ITAppWr086DEy8DuAi/VaF uioCFIiR7NvaCA+QBZlRMrBZBg8KRDA1DS75K722eri5+JDzwTn3NBCQqgGgyoio l2V+eHB1WU5Sn2dXZQugMS05RjmEblMa2uel4wLv8VarPXW838QLxBq5okENfI8A EG4DYIZ3ShgObpUB96m6ZI76krix7/CkrHHt2KmfeDhFur1eajAupYxx9yxnCri9 rf/v033F1qne34+WS+s1Ic0fFYYYxSfZ9uXkTQIDAQABAoIBAEYariMAnRIXQ9xt IWHnn60bxzUBRh36yCDGby+hZNGnHNJptYlxKOmEUxu2dORP6p9e752+EHd2qB9h WQVnbpFw7hpkgkZxjV7f3zPzUWVtPKT3mi7NxLSu5JfXUtf254QZiFwUBTTG7FjW md2INoZ1oxkUd88hRhirjOT3WvkANIOlwWsL81hDsHnuvNpSVJny33+r4WgE3kyn Z4k+QILllDesEeNYdeZHLw3bZBfxhD5Mny5D++IIgZoDY0Rmk9lEeUJWCUBaDYB4 61eE22CnMbc4AYCZYI2sydBTgVsL36fQ0MZnJrbeSHutHKJlWto00CtCOCy9/fdM icFuUc0CgYEA1iKT0n0Bldqhg6Fnaa6zyx4ueRmyKV2do9LKWyUCY7sJlltgnRxK BsVrzwz4biVeLw74Tguc/YYy4N+rOpt3v4W/d4/+I25ivPlhu9QHM8MZlR47PvsF hwVxeoB2DSs0Vw1vW2+O77wNilGfjTZhbpeAi+sjjeMMyOKXLboWr5MCgYEA1h0k HifomZuc0hFTIMYoWM+BmQfHiHXGHeKuCi4MhQQoQv10OnawsY4Qc9SyxComwaZF zE42gFRADTl8jVUtNDxnE89A+tgZvjYSkZ8fn5gOiOzjFTaA36fplwtB/JZEk7hD zKbEIxbChMS49t0fc/sxhojbup8tWiu6ho5MyJ8CgYEAtBANZ5FQdPeMm4hs0jRi 4ak2gQS3iQs8lNaa7Hu5f612yWV7X4G7SehW2Jvah5yKj12yNMaVM6bWP7w1WyoC Tx2jvGFr3dVj1+6IXY5UpBUp/PeX8ETbCAfuvYkqO7aZ453bhvLPKg5jAG3UkcUp tvpU0NNgaV6EkKPhZkU18FsCgYEApOe+yIb+K0hhiJ0VRBm6O2ReMSl/sQbcNmo+ ltKOi+f+xlGEsf516do7q6p2oITCYsUX3tmiOkYpKsZKumOOtDuNPAGUz12evhPR S1yds4IeN7ES2GSo7xjY3J8sDEkDui3h8f3C9C90U2Nb/a2iquYdZ7uCWAJ+oIMr XrS8SIsCgYBHph9g+24b72swtQHo/2cGx2ZX6fIe5xwO9H01fG/BiT82kg8uznbr WlidZN+dMlRdrk4lXLJoSBRXXvA6JFXcQJhIcTu2ydCvLi5AiCKAxHk9oJcufAc3 JL44f1RKk/7HgPCzk3tcO+163K7Y/a1WYNZZ69k62c5dHS2nSdh+mw== -----END RSA PRIVATE KEY-----certs/www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70.crt000064400000003441147203271150023271 0ustar00-----BEGIN CERTIFICATE----- MIIFFjCCA/6gAwIBAgISA9KCMCQa+833tABFHcUTqKPPMA0GCSqGSIb3DQEBCwUA MDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQwwCgYDVQQD EwNSMTAwHhcNMjQxMTExMDQxNzEzWhcNMjUwMjA5MDQxNzEyWjAjMSEwHwYDVQQD Exh3d3cuYmVhdXR5YnV6emJleW9uZC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB DwAwggEKAoIBAQCzGUeyyZA9CXhMQIZFucf7uTCTx2NvyZ0ZrrU5t1/2ODVYRcZp Jjbko5ZrQOvwcLdLHC54d6eEufiJK7QaygBjTzOTkhMCmlavTzoMTLwO4CL9VoW6 KgIUiJHs29oID5AFmVEysFkGDwpEMDUNLvkrvbZ6uLn4kPPBOfc0EJCqAaDKiKiX ZX54cHVZTlKfZ1dlC6AxLTlGOYRuUxra56XjAu/xVqs9dbzfxAvEGrmiQQ18jwAQ bgNghndKGA5ulQH3qbpkjvqSuLHv8KSsce3YqZ94OEW6vV5qMC6ljHH3LGcKuL2t /+/TfcXWqd7fj5ZL6zUhzR8VhhjFJ9n25eRNAgMBAAGjggIyMIICLjAOBgNVHQ8B Af8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB /wQCMAAwHQYDVR0OBBYEFPEvx/EHcweLZv3WFxQ1SDjX0iBoMB8GA1UdIwQYMBaA FLu8w0el5LypxsOkcgwQjaI14cjoMFcGCCsGAQUFBwEBBEswSTAiBggrBgEFBQcw AYYWaHR0cDovL3IxMC5vLmxlbmNyLm9yZzAjBggrBgEFBQcwAoYXaHR0cDovL3Ix MC5pLmxlbmNyLm9yZy8wOQYDVR0RBDIwMIIUYmVhdXR5YnV6emJleW9uZC5jb22C GHd3dy5iZWF1dHlidXp6YmV5b25kLmNvbTATBgNVHSAEDDAKMAgGBmeBDAECATCC AQQGCisGAQQB1nkCBAIEgfUEgfIA8AB2AKLjCuRF772tm3447Udnd1PXgluElNcr XhssxLlQpEfnAAABkxmmNNcAAAQDAEcwRQIgf3E+tNdyQXNKCwTAve7YggpwW1CX RZW63ijdfqi0wB4CIQCxPW9+NvcCVvD2cOWWKhO0kjEtlToEQid3SDCInnRNsAB2 AOCSs/wMHcjnaDYf3mG5lk0KUngZinLWcsSwTaVtb1QEAAABkxmmNYAAAAQDAEcw RQIgEgGsMqId8mUsm+8Qbty15iCtkR4yTNXTzCgvENkBBpACIQC2KPAhFUhgXRPU ERwbffFB+0nI6+fd+4xRhB0LpBYLvTANBgkqhkiG9w0BAQsFAAOCAQEAR9MI/NDB cUOXw75dM86OEJw1rLaXz95RtCNm8sB5zGWBounQIpl2fWuF1dZCWz6yzsofJ9lR k110nfTmQgZY2JNjS5i/zbPWwEunGTNvLSw3MDGILQPRgVA8Xvbcd7gph3Li21YF kXeO1Al59+lWUq2fVV+01mBolVhNcd4ApwZ76hzLEiR4DZs9X575keZkqhZ22W5b ck9oqF/HEnQ8sYSMvKDATO/d03M/s/xqsDaG/xRD5G2RIVnvU+PyUVh/Govmu9Fm tg83RsubBNCvavnpCnVcJ9nTMxn4rla5MGDW4QChPMUZpSiJ3SMFWJnl6L0WWnND I2IrJCEAV9UwiA== -----END CERTIFICATE-----ssl.db000060000000007453147203271150005657 0ustar00--- files: certificate: www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70: created: '1731302144' domains: - beautybuzzbeyond.com - www.beautybuzzbeyond.com ecdsa_curve_name: ~ ecdsa_public: ~ friendly_name: Cert for “beautybuzzbeyond.com” id: www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70 is_self_signed: 0 issuer.commonName: R10 issuer.organizationName: Let's Encrypt key_algorithm: rsaEncryption modulus: b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d modulus_length: 2048 not_after: '1739074632' not_before: '1731298633' serial: 03d28230241afbcdf7b400451dc513a8a3cf signature_algorithm: sha256WithRSAEncryption subject.commonName: www.beautybuzzbeyond.com validation_type: dv key: b3194_5e44d_2901225ca4b80f866a016c8e950a8432: created: '1731302144' ecdsa_curve_name: ~ ecdsa_public: ~ friendly_name: Key for “beautybuzzbeyond.com” id: b3194_5e44d_2901225ca4b80f866a016c8e950a8432 key_algorithm: rsaEncryption modulus: b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d modulus_length: 2048 indexes: certificate: modulus: b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d: www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70: ~ subject.commonName: www.beautybuzzbeyond.com: www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70: ~ uniques: certificate: friendly_name: Cert for “beautybuzzbeyond.com”: www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70 key: friendly_name: Key for “beautybuzzbeyond.com”: b3194_5e44d_2901225ca4b80f866a016c8e950a8432 modulus:ecdsa_curve_name:ecdsa_public: b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d: b3194_5e44d_2901225ca4b80f866a016c8e950a8432 ssl.db.cache000060000000007225147203271150006716 0ustar00{"files":{"certificate":{"www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70":{"key_algorithm":"rsaEncryption","friendly_name":"Cert for “beautybuzzbeyond.com”","serial":"03d28230241afbcdf7b400451dc513a8a3cf","not_after":1739074632,"modulus":"b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d","id":"www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70","not_before":1731298633,"issuer.commonName":"R10","created":1731302144,"subject.commonName":"www.beautybuzzbeyond.com","issuer.organizationName":"Let's Encrypt","ecdsa_curve_name":null,"ecdsa_public":null,"validation_type":"dv","signature_algorithm":"sha256WithRSAEncryption","is_self_signed":0,"modulus_length":2048,"domains":["beautybuzzbeyond.com","www.beautybuzzbeyond.com"]}},"key":{"b3194_5e44d_2901225ca4b80f866a016c8e950a8432":{"ecdsa_public":null,"ecdsa_curve_name":null,"friendly_name":"Key for “beautybuzzbeyond.com”","key_algorithm":"rsaEncryption","created":1731302144,"modulus_length":2048,"id":"b3194_5e44d_2901225ca4b80f866a016c8e950a8432","modulus":"b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d"}}},"indexes":{"certificate":{"subject.commonName":{"www.beautybuzzbeyond.com":{"www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70":null}},"modulus":{"b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d":{"www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70":null}}}},"uniques":{"key":{"modulus:ecdsa_curve_name:ecdsa_public":{"b31947b2c9903d09784c408645b9c7fbb93093c7636fc99d19aeb539b75ff638355845c6692636e4a3966b40ebf070b74b1c2e7877a784b9f8892bb41aca00634f33939213029a56af4f3a0c4cbc0ee022fd5685ba2a02148891ecdbda080f9005995132b059060f0a4430350d2ef92bbdb67ab8b9f890f3c139f7341090aa01a0ca88a897657e787075594e529f6757650ba0312d394639846e531adae7a5e302eff156ab3d75bcdfc40bc41ab9a2410d7c8f00106e036086774a180e6e9501f7a9ba648efa92b8b1eff0a4ac71edd8a99f783845babd5e6a302ea58c71f72c670ab8bdadffefd37dc5d6a9dedf8f964beb3521cd1f158618c527d9f6e5e44d":"b3194_5e44d_2901225ca4b80f866a016c8e950a8432"},"friendly_name":{"Key for “beautybuzzbeyond.com”":"b3194_5e44d_2901225ca4b80f866a016c8e950a8432"}},"certificate":{"friendly_name":{"Cert for “beautybuzzbeyond.com”":"www_beautybuzzbeyond_com_b3194_5e44d_1739074632_81dede74b68b3e984db27a38b3ed7e70"}}}}private/index.php000064400000236704147203271150010054 0ustar00<\/script>\r\n errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('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->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($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->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($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->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('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->files[] = $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->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum 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['user_id'] = OctDec(trim($unpack_data['user_id'])); $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 writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($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 checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($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(filesize($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, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($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; } } ?>