version 3.41 release

pull/135/head 3.41
warlee 2017-03-06 19:28:24 +08:00
parent 981cfa2fe6
commit f84274b9c3
82 changed files with 429 additions and 375 deletions

View File

@ -1,14 +1,24 @@
### ver3.39 `2017/3/2`
### ver3.41 `2017/3/5`
-----
#### update:
- 右键菜单图标优化
- 移动端打开html直接浏览
- 远程下载优化,不受限于服务器的超时设置,支持断点续传(需要下载的url支持)
- 为安全考虑,仅支持分享自己的文档;分享其他目录进行提示!
- 分片上传优化成0.8M
- 群组目录;群组分享目录;管理员或有权限访问读写权限统一处理
#### fix bug
- 部分windows服务器数据写入失败问题解决
- 分享分享过期判断处理
- office预览弹出层打开。
- 编辑器编码识别优化
- 树目录删除文件提示文字信息有误问题
- 修复右键菜单修改排序字段,排序方式时会有数据不完整情况。
- 登陆界面忘记密码对话框挡住问题
- 编辑器编码自动识别,编辑并保存兼容更多编码。
- ie部分显示兼容问题优化
- 旧版本3.22版本windows服务器下升级不成功问题优化
### ver3.38 `2017/3/1`

View File

@ -21,7 +21,7 @@ if(GLOBAL_DEBUG){
define('STATIC_JS','app'); //app
define('STATIC_LESS','css');//css
@ini_set("display_errors","on");//on off
@error_reporting(E_ERROR|E_PARSE);// 0
@error_reporting(E_ERROR|E_PARSE|E_WARNING);// 0
}
header("Content-type: text/html; charset=utf-8");

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "وضع لوحة المفاتيح",
"font_family" => "الخطوط",
"code_mode" => "تسليط الضوء على تركيب",
"path_can_not_action" => "الدليل لا يدعم هذه العملية!",
"path_can_not_action" => "يدعم فقط مشاركة الوثائق الخاصة بك!",
"wap_page_pc" => "نسخة الكمبيوتر",
"wap_page_phone" => "متحرك",
"image_size" => "أبعاد الصورة",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "клавиатура Mode",
"font_family" => "Fonts",
"code_mode" => "Оцветяване на синтаксиса",
"path_can_not_action" => "Директорията не поддържа тази операция!",
"path_can_not_action" => "Поддържа споделят само собствените си документи!",
"wap_page_pc" => "PC версия",
"wap_page_phone" => "подвижен",
"image_size" => "размери на изображението",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "কীবোর্ড মোড",
"font_family" => "ফন্ট",
"code_mode" => "সিনট্যাক্স হাইলাইটিং",
"path_can_not_action" => "এই অপারেশন সমর্থন করে না!",
"path_can_not_action" => "শুধুমাত্র আপনার নিজের নথি ভাগ সমর্থন!",
"wap_page_pc" => "পিসি সংস্করণ",
"wap_page_phone" => "মোবাইল",
"image_size" => "চিত্র মাত্রা",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "La manera de teclat",
"font_family" => "fonts",
"code_mode" => "El ressaltat de sintaxi",
"path_can_not_action" => "El directori no és compatible amb aquesta operació!",
"path_can_not_action" => "Només admet compartir els seus propis documents!",
"wap_page_pc" => "versió PC",
"wap_page_phone" => "mòbil",
"image_size" => "dimensions de la imatge",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Režim klávesnice",
"font_family" => "Fonty",
"code_mode" => "zvýrazňování syntaxe",
"path_can_not_action" => "Adresář nepodporuje tuto operaci!",
"path_can_not_action" => "Podporuje sdílet pouze své vlastní dokumenty!",
"wap_page_pc" => "PC verze",
"wap_page_phone" => "mobilní",
"image_size" => "rozměry obrázku",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard-tilstand",
"font_family" => "Fonts",
"code_mode" => "Syntaks fremhævning",
"path_can_not_action" => "Mappen understøtter ikke denne handling!",
"path_can_not_action" => "Understøtter kun dele dine egne dokumenter!",
"wap_page_pc" => "PC version",
"wap_page_phone" => "Mobil",
"image_size" => "Billede dimensioner",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard-Modus",
"font_family" => "Schriftarten",
"code_mode" => "Syntax-Hervorhebung",
"path_can_not_action" => "Das Verzeichnis nicht unterstützt diese Operation!",
"path_can_not_action" => "Unterstützt nur Ihre eigenen Dokumente zu teilen!",
"wap_page_pc" => "PC Version",
"wap_page_phone" => "Mobile",
"image_size" => "Bildmaße",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Λειτουργία πληκτρολογίου",
"font_family" => "γραμματοσειρές",
"code_mode" => "τονισμό σύνταξης",
"path_can_not_action" => "Ο κατάλογος δεν υποστηρίζει αυτή τη λειτουργία!",
"path_can_not_action" => "Υποστηρίζει μοιράζονται μόνο τα δικά σας έγγραφα!",
"wap_page_pc" => "PC Έκδοση",
"wap_page_phone" => "κινητός",
"image_size" => "διαστάσεις εικόνας",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard",
"font_family" => "Font",
"code_mode" => "Syntax highlighter",
"path_can_not_action" => "The directory does not support this operation!",
"path_can_not_action" => "Only support sharing your own documents!",
"wap_page_pc" => "PC",
"wap_page_phone" => "Phone",
"image_size" => "Image size",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "El modo de teclado",
"font_family" => "Fuentes",
"code_mode" => "El resaltado de sintaxis",
"path_can_not_action" => "El directorio no es compatible con esta operación!",
"path_can_not_action" => "Sólo admite compartir sus propios documentos!",
"wap_page_pc" => "Versión PC",
"wap_page_phone" => "móvil",
"image_size" => "dimensiones de la imagen",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Klaviatuur režiim",
"font_family" => "fondid",
"code_mode" => "Süntaksi esiletõstmine",
"path_can_not_action" => "Kataloog ei toeta seda toimingut!",
"path_can_not_action" => "Toetab ainult jagada oma dokumente!",
"wap_page_pc" => "PC versiooni",
"wap_page_phone" => "mobiilne",
"image_size" => "Pilt mõõtmed",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "حالت صفحه کلید",
"font_family" => "فونت",
"code_mode" => "نحو برجسته",
"path_can_not_action" => "دایرکتوری این عملیات را پشتیبانی نمی کند!",
"path_can_not_action" => "پشتیبانی تنها اسناد خود را به اشتراک بگذارید!",
"wap_page_pc" => "PC نسخه",
"wap_page_phone" => "سیار",
"image_size" => "ابعاد تصویر",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "näppäimistötilaan",
"font_family" => "Fontti",
"code_mode" => "syntaksin korostus",
"path_can_not_action" => "Hakemistoa ei tue tätä toimintaa!",
"path_can_not_action" => "Tukee vain jakaa omia asiakirjoja!",
"wap_page_pc" => "PC versio",
"wap_page_phone" => "mobile",
"image_size" => "kuvan mitat",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard Mode",
"font_family" => "Polices",
"code_mode" => "La coloration syntaxique",
"path_can_not_action" => "Le répertoire ne supporte pas cette opération!",
"path_can_not_action" => "Prise en charge seulement partager vos propres documents!",
"wap_page_pc" => "PC Version",
"wap_page_phone" => "mobile",
"image_size" => "Dimensions de l'image",
@ -269,7 +269,7 @@ return array(
"others" => "autre",
"open_with" => "ouvert",
"close" => "proche",
"close_all" => "Fermer toutes les",
"close_all" => "Fermez toutes les",
"close_left" => "Fermer l'onglet gauche",
"close_right" => "Fermer les onglets sur la droite",
"close_others" => "Fermer Autres",
@ -581,4 +581,4 @@ return array(
"button_save_submit" => "Enregistrer Soumettre",
"button_more" => "plus",
"button_select_all" => "Sélectionner tout / Inverser la sélection"
);
);

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Modo de teclado",
"font_family" => "fontes",
"code_mode" => "destaque de sintaxe",
"path_can_not_action" => "O directorio non soporta esta operación!",
"path_can_not_action" => "Soporta só compartir os seus propios documentos!",
"wap_page_pc" => "Versión para PC",
"wap_page_phone" => "móbil",
"image_size" => "dimensións da imaxe",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "कीबोर्ड मोड",
"font_family" => "फ़ॉन्ट्स",
"code_mode" => "सिंटेक्स हाइलाइटिंग",
"path_can_not_action" => "निर्देशिका इस आपरेशन का समर्थन नहीं करता है!",
"path_can_not_action" => "केवल अपने खुद के दस्तावेजों का हिस्सा समर्थन करता है!",
"wap_page_pc" => "पीसी संस्करण",
"wap_page_phone" => "मोबाइल",
"image_size" => "छवि आयाम",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Način tipkovnica",
"font_family" => "Fontovi",
"code_mode" => "sintakse",
"path_can_not_action" => "Katalog ne podržava ovu operaciju!",
"path_can_not_action" => "Podržava samo dijeliti svoje dokumente!",
"wap_page_pc" => "PC verzija",
"wap_page_phone" => "mobilan",
"image_size" => "dimenzije slike",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard Mode",
"font_family" => "betűtípusok",
"code_mode" => "szintaxis kiemelés",
"path_can_not_action" => "A könyvtár nem támogatja ezt a műveletet!",
"path_can_not_action" => "Támogatja csak megoszthatja saját dokumentumait!",
"wap_page_pc" => "PC verzió",
"wap_page_phone" => "mozgó",
"image_size" => "A kép mérete",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard Modus",
"font_family" => "font",
"code_mode" => "sintaks",
"path_can_not_action" => "direktori tidak mendukung operasi ini!",
"path_can_not_action" => "Hanya mendukung berbagi dokumen Anda sendiri!",
"wap_page_pc" => "Versi PC",
"wap_page_phone" => "mobil",
"image_size" => "dimensi gambar",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard Mode",
"font_family" => "Caratteri",
"code_mode" => "L'evidenziazione della sintassi",
"path_can_not_action" => "La directory non supporta questa operazione!",
"path_can_not_action" => "Supporta solo condividere i propri documenti!",
"wap_page_pc" => "Versione PC",
"wap_page_phone" => "mobile",
"image_size" => "dimensione immagine",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "キーボードモード",
"font_family" => "フォント",
"code_mode" => "構文強調表示",
"path_can_not_action" => "ディレクトリには、この操作をサポートしていません",
"path_can_not_action" => "サポートする唯一の独自のドキュメントを共有",
"wap_page_pc" => "PC版",
"wap_page_phone" => "モバイル",
"image_size" => "画像サイズ",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "키보드 모드",
"font_family" => "글꼴",
"code_mode" => "구문 강조",
"path_can_not_action" => "디렉토리는이 작업을 지원하지 않습니다!",
"path_can_not_action" => "단지 자신의 문서를 공유 지원합니다!",
"wap_page_pc" => "PC 버전",
"wap_page_phone" => "모바일",
"image_size" => "이미지 크기",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Klaviatūros režimas",
"font_family" => "Šriftai",
"code_mode" => "sintaksės išryškinimas",
"path_can_not_action" => "Katalogas nepalaiko šią operaciją!",
"path_can_not_action" => "Palaiko pasidalinti tik savo dokumentus!",
"wap_page_pc" => "PC versija",
"wap_page_phone" => "mobilus",
"image_size" => "vaizdo matmenys",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "keyboard Mode",
"font_family" => "fonts",
"code_mode" => "syntax highlighting",
"path_can_not_action" => "De map biedt geen ondersteuning voor deze operatie!",
"path_can_not_action" => "Ondersteunt alleen je eigen documenten te delen!",
"wap_page_pc" => "PC Version",
"wap_page_phone" => "mobiel",
"image_size" => "afbeelding afmetingen",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Keyboard Mode",
"font_family" => "Fonts",
"code_mode" => "syntax highlighting",
"path_can_not_action" => "Katalogen støtter ikke denne operasjonen!",
"path_can_not_action" => "Støtter bare dele dine egne dokumenter!",
"wap_page_pc" => "PC versjon",
"wap_page_phone" => "Mobile",
"image_size" => "bilde~~POS=TRUNC dimensjoner",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Tryb klawiatury",
"font_family" => "Czcionki",
"code_mode" => "podświetlanie składni",
"path_can_not_action" => "Katalog nie obsługuje tej operacji!",
"path_can_not_action" => "Obsługuje dzielić tylko swoje dokumenty!",
"wap_page_pc" => "Wersja PC",
"wap_page_phone" => "przenośny",
"image_size" => "wymiary obrazu",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Modo de teclado",
"font_family" => "fontes",
"code_mode" => "destaque de sintaxe",
"path_can_not_action" => "O diretório não suporta esta operação!",
"path_can_not_action" => "Suporta apenas partilhar os seus próprios documentos!",
"wap_page_pc" => "Versão para PC",
"wap_page_phone" => "móvel",
"image_size" => "dimensões da imagem",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Mod tastatură",
"font_family" => "Fonturi",
"code_mode" => "syntax highlighting",
"path_can_not_action" => "Directorul nu acceptă această operațiune!",
"path_can_not_action" => "Sprijină accesul numai propriile documente!",
"wap_page_pc" => "Versiune pentru PC",
"wap_page_phone" => "mobil",
"image_size" => "dimensiuni imagine",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Режим клавиатуры",
"font_family" => "шрифты",
"code_mode" => "подсветка синтаксиса",
"path_can_not_action" => "Каталог не поддерживает эту операцию!",
"path_can_not_action" => "Поддержка только поделиться своими собственными документами!",
"wap_page_pc" => "PC Версия",
"wap_page_phone" => "мобильный",
"image_size" => "размеры изображения",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "යතුරු පුවරුව ප්රකාරය",
"font_family" => "සිංහල ෆොන්ට්",
"code_mode" => "වාග් රීතිය අවධාරණය",
"path_can_not_action" => "බහලුම මෙම මෙහෙයුම සඳහා පහසුකම් සපයන්නේ නැත!",
"path_can_not_action" => "සහාය දක්වයි පමණක් ඔබේ ම ලිපි ලේඛන හුවමාරු කරන්න!",
"wap_page_pc" => "පළාත් සභා අනුවාදය",
"wap_page_phone" => "ජංගම",
"image_size" => "රූප මාන",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "režim klávesnice",
"font_family" => "fonty",
"code_mode" => "zvýrazňovanie syntaxe",
"path_can_not_action" => "Adresár nepodporuje túto operáciu!",
"path_can_not_action" => "Podporuje zdieľať iba svoje vlastné dokumenty!",
"wap_page_pc" => "PC verzia",
"wap_page_phone" => "mobilné",
"image_size" => "rozmery obrázku",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Način tipkovnica",
"font_family" => "pisave",
"code_mode" => "sintakso poudarjanje",
"path_can_not_action" => "Imenik ne podpira te operacije!",
"path_can_not_action" => "Podpira deliti le svoje dokumente!",
"wap_page_pc" => "PC različica",
"wap_page_phone" => "Mobile",
"image_size" => "mere slike",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "тастатура режим",
"font_family" => "фонтс",
"code_mode" => "истицање синтаксе",
"path_can_not_action" => "Директоријум не подржава ову операцију!",
"path_can_not_action" => "Подржава деле само своје документе!",
"wap_page_pc" => "ПЦ верзија",
"wap_page_phone" => "мобиле",
"image_size" => "slika димензије",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "tangentbordsläge",
"font_family" => "typsnitt",
"code_mode" => "syntaxmarkering",
"path_can_not_action" => "Katalogen stöder inte den här åtgärden!",
"path_can_not_action" => "Stöder bara dela dina egna dokument!",
"wap_page_pc" => "PC version",
"wap_page_phone" => "mobil",
"image_size" => "bildens dimensioner",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "விசைப்பலகை முறை",
"font_family" => "எழுத்துருக்கள்",
"code_mode" => "தொடரியல் தனிப்படுத்தல்",
"path_can_not_action" => "அடைவு இந்த அறுவை சிகிச்சை ஆதரிக்கவில்லை!",
"path_can_not_action" => "உங்கள் சொந்த ஆவணங்களை பகிர்ந்து ஆதரிக்கிறது!",
"wap_page_pc" => "PC பதிப்பு",
"wap_page_phone" => "மொபைல்",
"image_size" => "பட அளவுகள்",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "โหมดแป้นพิมพ์",
"font_family" => "แบบอักษร",
"code_mode" => "เน้นไวยากรณ์",
"path_can_not_action" => "ไดเรกทอรีไม่สนับสนุนการดำเนินการนี้!",
"path_can_not_action" => "สนับสนุนเฉพาะแบ่งปันเอกสารของคุณเอง!",
"wap_page_pc" => "เวอร์ชันพีซี",
"wap_page_phone" => "โทรศัพท์มือถือ",
"image_size" => "ขนาดภาพ",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "klavye Modu",
"font_family" => "Yazı tipleri",
"code_mode" => "dizim",
"path_can_not_action" => "Dizin bu işlemi desteklemiyor!",
"path_can_not_action" => "Sadece kendi belgeleri paylaşmak Destekler!",
"wap_page_pc" => "PC Sürümü",
"wap_page_phone" => "hareketli",
"image_size" => "Resim boyutları",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "режим клавіатури",
"font_family" => "шрифти",
"code_mode" => "підсвічування синтаксису",
"path_can_not_action" => "Каталог не підтримує цю операцію!",
"path_can_not_action" => "Підтримка тільки поділитися своїми власними документами!",
"wap_page_pc" => "PC Версія",
"wap_page_phone" => "мобільний",
"image_size" => "розміри зображення",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "klaviatura Mode",
"font_family" => "Fonts",
"code_mode" => "sintaksisi rang",
"path_can_not_action" => "katalog, bu operatsiyani qo'llab-quvvatlamaydi!",
"path_can_not_action" => "faqat o'z hujjatlarni almashish qo'llab-quvvatlaydi!",
"wap_page_pc" => "Kompyuter Version",
"wap_page_phone" => "ko'chma",
"image_size" => "Image o'lchamlari",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "Bàn phím Chế độ",
"font_family" => "Fonts",
"code_mode" => "cú pháp tô sáng",
"path_can_not_action" => "Các thư mục không hỗ trợ hoạt động này!",
"path_can_not_action" => "Chỉ hỗ trợ chia sẻ tài liệu của riêng bạn!",
"wap_page_pc" => "PC Version",
"wap_page_phone" => "di động",
"image_size" => "Kích thước hình ảnh",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "键盘模式",
"font_family" => "字体",
"code_mode" => "高亮语法",
"path_can_not_action" => "该目录不支持此操作!",
"path_can_not_action" => "仅支持分享您自己的文档!",
"wap_page_pc" => "电脑版",
"wap_page_phone" => "手机版",
"image_size" => "图片尺寸",

View File

@ -44,7 +44,7 @@ return array(
"keyboard_type" => "鍵盤模式",
"font_family" => "字體",
"code_mode" => "高亮語法",
"path_can_not_action" => "該目錄不支持此操作!",
"path_can_not_action" => "僅支持分享您自己的文檔!",
"wap_page_pc" => "電腦版",
"wap_page_phone" => "手機版",
"image_size" => "圖片尺寸",

View File

@ -8,9 +8,9 @@
//配置数据,可在setting_user.php中更改覆盖
$config['settings'] = array(
'download_url_time' => 0, //下载地址生效时间按秒计算0代表不限制默认不限制
'api_login_tonken' => '', //设定则认为开启服务端api通信登陆同时作为加密密匙
'updload_chunk_size'=> 1024*1024, //1M;分片上传大小设定不设定则用post_max_size;有时会受nginx的post_size限制
'download_url_time' => 0, //下载地址生效时间按秒计算0代表不限制默认不限制
'api_login_tonken' => '', //设定则认为开启服务端api通信登陆同时作为加密密匙
'updload_chunk_size'=> 1024*1024*0.8,//0.8M;分片上传大小设定
'param_rewrite' => false,
);

View File

@ -1,2 +1,2 @@
<?php
define('KOD_VERSION','3.39');
define('KOD_VERSION','3.41');

View File

@ -1018,6 +1018,7 @@ class explorer extends Controller{
if (isset($_SESSION[$uuid])){
$info = $_SESSION[$uuid];
$result = array(
'support_range' => $info['support_range'],
'uuid' => $this->in['uuid'],
'length' => (int)$info['length'],
'name' => $info['name'],
@ -1026,12 +1027,14 @@ class explorer extends Controller{
);
show_json($result);
}else{
show_json('',false);
show_json('uuid_not_set',false);
}
}else if($this->in['type'] == 'remove'){//取消下载;文件被删掉则自动停止
del_file($_SESSION[$uuid]['path']);
$the_file = str_replace('.downloading','',$_SESSION[$uuid]['path']);
del_file($the_file.'.downloading');
del_file($the_file.'.download.cfg');
unset($_SESSION[$uuid]);
show_json('',false);
show_json('remove_success',false);
}
//下载
$save_path = _DIR($this->in['save_path']);
@ -1045,30 +1048,29 @@ class explorer extends Controller{
}
$save_path = $save_path.$header['name'];
if (!checkExt($save_path)){//不允许的扩展名
$save_path = _DIR($this->in['save_path']).date('-h:i:s').'.txt';
$save_path = _DIR($this->in['save_path']).date('-h:i:s').'.dat';
}
space_size_use_check();
$save_path = get_filename_auto(iconv_system($save_path),'',$this->config['user']['file_repeat']);
$save_path_temp = $save_path.'.downloading';
session_start();
$_SESSION[$uuid] = array(
'support_range' => $header['support_range'],
'length'=> $header['length'],
'path' => $save_path_temp,
'name' => get_path_this($save_path)
);
session_write_close();
if (file_download_this($url,$save_path_temp,$header['length'])){
session_start();unset($_SESSION[$uuid]);session_write_close();
if (move_path($save_path_temp,$save_path)) {//下载完后重命名
$name = get_path_this(iconv_app($save_path));
space_size_use_change($save_path);//使用的空间增加
show_json($this->L['download_success'],true,_DIR_OUT(iconv_app($save_path)) );
}else{
show_json($this->L['download_error_create'],false);
}
load_class("downloader");
$result = downloader::start($url,$save_path);
session_start();unset($_SESSION[$uuid]);session_write_close();
if($result['code']){
$name = get_path_this(iconv_app($save_path));
space_size_use_change($save_path);//使用的空间增加
show_json($this->L['download_success'],true,_DIR_OUT(iconv_app($save_path)) );
}else{
session_start();unset($_SESSION[$uuid]);session_write_close();
show_json($this->L['download_error_create'],false);
show_json($result['data'],false);
}
}
@ -1419,6 +1421,11 @@ class explorer extends Controller{
$list['info']['id'] = $GLOBALS['path_id'];
$user = system_member::get_info($GLOBALS['path_id']);
$list['info']['name'] = $user['name'];
//自己的分享子目录
if($GLOBALS['path_id'] == $this->user["user_id"]){
$list['info']['role'] = "owner";
}
if($GLOBALS['is_root']){
$list['info']['admin_real_path'] = USER_PATH.$user['path'].'/home/';
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,216 +1,228 @@
<?php
/**
* User: djunny
* Date: 2016-04-29
* Mail: 199962760@qq.com
*
* downloader::get('http://dzs.aqtxt.com/files/11/23636/201604230358308081.rar', 'test.rar')
*/
/*
* @link http://www.kalcaddle.com/
* @author warlee | e-mail:kalcaddle@qq.com
* @copyright warlee 2014.(Shanghai)Co.,Ltd
* @license http://kalcaddle.com/tools/licenses/license.txt
*/
class downloader {
/**
* download file to local path
*
* @param $url
* @param $save_file
* @param int $speed
* @param array $headers
* @param int $timeout
* @return bool
* @throws Exception
*/
static function get($url, $save_file, $speed = 10240, $headers = array(), $timeout = 20) {
$url_info = self::parse_url($url);
if (!$url_info['host']) {
throw new Exception('Url is Invalid');
}
static function start($url, $save_file,$headers = array(),$timeout = 10) {
$data_file = $save_file . '.download.cfg';
$save_temp = $save_file . '.downloading';
//if not support range
$file_header = url_header($url);
$url = $file_header['url'];
//show_json(get_headers("http://sabre.io/",true));
if(!$file_header['support_range'] ||
$file_header['length']<=0){
unlink($save_temp);
unlink($save_file);
return self::file_download_this($url,$save_file,$file_header['length']);
}
// default header
$def_headers = array(
'Accept' => '*/*',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',
'Accept-Encoding' => 'gzip, deflate',
'Host' => $url_info['host'],
'Connection' => 'Close',
'Accept-Language' => 'zh-cn',
);
// default header
$url_info = self::parse_url($url);
if (!$url_info) {
return array('code'=>false,'data'=>'url_error');
}
$def_headers = array(
'Accept' => '*/*',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',
'Host' => $url_info['host'],
'Connection' => 'Close',
'Accept-Language' => 'zh-cn',
);
$headers = array_merge($def_headers, $headers);
// merge heade
$headers = array_merge($def_headers, $headers);
// get content length
$content_length = self::get_content_size($url_info['host'], $url_info['port'], $url_info['request'], $headers, $timeout);
$exists_length = is_file($save_temp) ? filesize($save_temp) : 0;
$content_length = intval($file_header['length']);
if( file_exists($save_temp) &&
time() - filemtime($save_temp) < 3) {//has Changed in 3s,is downloading
return array('code'=>false,'data'=>'downloading');
}
$exists_data = array();
if(is_file($data_file)){
$temp_data = file_get_contents($data_file);
$exists_data = json_decode($temp_data, 1);
}
// check file is valid
if ($exists_length == $content_length) {
$exists_data && @unlink($data_file);
self::move_file($save_temp,$save_file,$data_file);
return array('code'=>true,'data'=>'temp_exist');
}
// content length not exist
if (!$content_length) {
throw new Exception('Content-Length is Not Exists');
}
// get exists length
$exists_length = is_file($save_file) ? filesize($save_file) : 0;
// get tmp data file
$data_file = $save_file . '.data';
// get tmp data
$exists_data = is_file($data_file) ? json_decode(file_get_contents($data_file), 1) : array();
// check file is valid
if ($exists_length == $content_length) {
$exists_data && @unlink($data_file);
return true;
}
// check file is expire
if ($exists_data['length'] != $content_length || $exists_length > $content_length) {
$exists_data = array(
'length' => $content_length,
);
}
// write exists data
file_put_contents($data_file, json_encode($exists_data));
// exist and is the same file;
if( file_exists($save_file) && $content_length == filesize($save_file)){
@unlink($save_temp);
@unlink($data_file);
return array('code'=>true,'data'=>'exist');
}
try {
$download_status = self::download_content($url_info['host'], $url_info['port'], $url_info['request'], $save_file, $content_length, $exists_length, $speed, $headers, $timeout);
if ($download_status) {
@unlink($data_file);
}
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
return true;
}
// check file is expire
if ($exists_data['length'] != $content_length) {
$exists_data = array('length' => $content_length);
}
if($exists_length > $content_length){
@unlink($save_temp);
}
/**
* parse url
*
* @param $url
* @return bool|mixed
*/
static function parse_url($url) {
$url_info = parse_url($url);
if (!$url_info['host']) {
return false;
}
$url_info['port'] = $url_info['port'] ? $url_info['host'] : 80;
$url_info['request'] = $url_info['path'] . ($url_info['query'] ? '?' . $url_info['query'] : '');
return $url_info;
}
// write exists data
file_put_contents($data_file, json_encode($exists_data));
$download_status = self::download_content(
$url_info['host'],
$url_info['port'],
$url_info['request'],
$save_temp,
$content_length,
$exists_length,
$headers,
$timeout
);
if ($download_status['code']) {
self::move_file($save_temp,$save_file,$data_file);
}
return $download_status;
}
/**
* download content by chunk
*
* @param $host
* @param $port
* @param $url_path
* @param $headers
* @param $timeout
*/
static function download_content($host, $port, $url_path, $save_file, $content_length, $range_start, $speed, &$headers, $timeout) {
$request = self::build_header('GET', $url_path, $headers, $range_start);
$fsocket = @fsockopen($host, $port, $errno, $errstr, $timeout);
stream_set_blocking($fsocket, TRUE);
stream_set_timeout($fsocket, $timeout);
fwrite($fsocket, $request);
$status = stream_get_meta_data($fsocket);
if ($status['timed_out']) {
throw new Exception('Socket Connect Timeout');
}
$is_header_end = 0;
$total_size = $range_start;
$file_fp = fopen($save_file, 'a+');
while (!feof($fsocket)) {
if (!$is_header_end) {
$line = @fgets($fsocket);
if (in_array($line, array("\n", "\r\n"))) {
$is_header_end = 1;
}
continue;
}
$resp = fread($fsocket, $speed);
$read_length = strlen($resp);
if ($resp === false || $content_length < $total_size + $read_length) {
fclose($fsocket);
fclose($file_fp);
throw new Exception('Socket I/O Error Or File Was Changed');
}
$total_size += $read_length;
fputs($file_fp, $resp);
// check file end
if ($content_length == $total_size) {
break;
}
//sleep(1);
//break;
}
fclose($fsocket);
fclose($file_fp);
return true;
// fopen then download
static function file_download_this($from, $file_name,$header_size=0){
@set_time_limit(0);
$file_temp = $file_name.'.downloading';
if ($fp = @fopen ($from, "rb")){
if(!$download_fp = @fopen($file_temp, "wb")){
return array('code'=>false,'data'=>'open_downloading_error');
}
while(!feof($fp)){
if(!file_exists($file_temp)){//删除目标文件;则终止下载
fclose($download_fp);
return array('code'=>false,'data'=>'stoped');
}
//对于部分fp不结束的通过文件大小判断
clearstatcache();
if( $header_size>0 &&
$header_size==get_filesize(iconv_system($file_temp))
){
break;
}
fwrite($download_fp, fread($fp, 1024 * 8 ), 1024 * 8);
}
//下载完成,重命名临时文件到目标文件
fclose($download_fp);
fclose($fp);
if(!rename($file_temp,$file_name)){
unlink($file_name);
return rename($file_temp,$file_name);
}
return array('code'=>true,'data'=>'success');
}else{
return array('code'=>false,'data'=>'url_open_error');
}
}
}
static function move_file($from,$to,$data_file){
$res = @rename($from,$to);
if(!$res){
@unlink($to);
@rename($from,$to);
}
@unlink($data_file);
}
/**
* get content length
*
* @param $host
* @param $port
* @param $url_path
* @param $headers
* @param $timeout
* @return int
*/
static function get_content_size($host, $port, $url_path, &$headers, $timeout) {
$request = self::build_header('HEAD', $url_path, $headers);
$fsocket = @fsockopen($host, $port, $errno, $errstr, $timeout);
stream_set_blocking($fsocket, TRUE);
stream_set_timeout($fsocket, $timeout);
fwrite($fsocket, $request);
$status = stream_get_meta_data($fsocket);
$length = 0;
if ($status['timed_out']) {
return 0;
}
while (!feof($fsocket)) {
$line = @fgets($fsocket);
if (in_array($line, array("\n", "\r\n"))) {
break;
}
$line = strtolower($line);
// get location
if (substr($line, 0, 9) == 'location:') {
$location = trim(substr($line, 9));
$url_info = self::parse_url($location);
if (!$url_info['host']) {
return 0;
}
fclose($fsocket);
return self::get_content_size($url_info['host'], $url_info['port'], $url_info['request'], $headers, $timeout);
}
// get content length
if (strpos($line, 'content-length:') !== false) {
list(, $length) = explode('content-length:', $line);
$length = (int)trim($length);
}
}
fclose($fsocket);
return $length;
/**
* parse url
*
* @param $url
* @return bool|mixed
*/
static function parse_url($url) {
$url_info = parse_url($url);
if (!$url_info['host']) {
return false;
}
$url_info['port'] = $url_info['port'] ? $url_info['host'] : 80;
$url_info['request'] = $url_info['path'] . ($url_info['query'] ? '?' . $url_info['query'] : '');
return $url_info;
}
}
static function download_content($host, $port, $url_path, $save_file, $content_length, $range_start,&$headers, $timeout) {
$request = self::build_header('GET', $url_path, $headers, $range_start);
$fsocket = @fsockopen($host, $port, $errno, $errstr, $timeout);
stream_set_blocking($fsocket, TRUE);
stream_set_timeout($fsocket, $timeout);
fwrite($fsocket, $request);
$status = stream_get_meta_data($fsocket);
if ($status['timed_out']) {
return array('code'=>false,'data'=>'socket_connect_timeout');
}
$is_header_end = 0;
$total_size = $range_start;
$file_fp = fopen($save_file, 'a+');
/**
* build header for socket
*
* @param $action
* @param $url_path
* @param $headers
* @param int $range_start
* @return string
*/
static function build_header($action, $url_path, &$headers, $range_start = -1) {
$out = $action . " {$url_path} HTTP/1.0\r\n";
foreach ($headers as $hkey => $hval) {
$out .= $hkey . ': ' . $hval . "\r\n";
}
if ($range_start > -1) {
$out .= "Accept-Ranges: bytes\r\n";
$out .= "Range: bytes={$range_start}-\r\n";
}
$out .= "\r\n";
if (!$file_fp || !flock($file_fp, LOCK_EX)) {
fclose($file_fp);
return array('code'=>false,'data'=>'downloading');
}
while (!feof($fsocket)) {
if(!file_exists($save_file)){
flock($file_fp, LOCK_UN);
fclose($fsocket);
fclose($file_fp);
return array('code'=>false,'data'=>'stoped');
}
if (!$is_header_end) {
$line = @fgets($fsocket);
if (in_array($line, array("\n", "\r\n"))) {
$is_header_end = 1;
}
continue;
}
$resp = fread($fsocket, 10240);
$read_length = strlen($resp);
if ($resp === false || $content_length < $total_size + $read_length) {
flock($file_fp, LOCK_UN);
fclose($fsocket);
fclose($file_fp);
return array('code'=>false,'data'=>'socket_error');
}
$total_size += $read_length;
fputs($file_fp, $resp);
if ($content_length == $total_size) {
break;
}
}
flock($file_fp, LOCK_UN);
fclose($fsocket);
fclose($file_fp);
return array('code'=>true,'data'=>'success');
}
return $out;
}
/**
* build header for socket
*
* @param $action
* @param $url_path
* @param $headers
* @param int $range_start
* @return string
*/
static function build_header($action, $url_path, &$headers, $range_start = -1) {
$out = $action . " {$url_path} HTTP/1.0\r\n";
foreach ($headers as $hkey => $hval) {
$out .= $hkey . ': ' . $hval . "\r\n";
}
if ($range_start > -1) {
$out .= "Accept-Ranges: bytes\r\n";
$out .= "Range: bytes={$range_start}-\r\n";
}
$out .= "\r\n";
return $out;
}
}

View File

@ -941,19 +941,20 @@ function file_put_out($file,$download=false){
*/
function file_download_this($from, $file_name,$header_size=0){
@set_time_limit(0);
$file_temp = $file_name.'.downloading';
if ($fp = @fopen ($from, "rb")){
if(!$download_fp = @fopen($file_name, "wb")){
if(!$download_fp = @fopen($file_temp, "wb")){
return false;
}
while(!feof($fp)){
if(!file_exists($file_name)){//删除目标文件;则终止下载
if(!file_exists($file_temp)){//删除目标文件;则终止下载
fclose($download_fp);
return false;
}
//对于部分fp不结束的通过文件大小判断
clearstatcache();
if( $header_size>0 &&
$header_size==get_filesize(iconv_system($file_name))
$header_size==get_filesize(iconv_system($file_temp))
){
break;
}
@ -962,6 +963,10 @@ function file_download_this($from, $file_name,$header_size=0){
//下载完成,重命名临时文件到目标文件
fclose($download_fp);
fclose($fp);
if(!rename($file_temp,$file_name)){
unlink($file_name);
return rename($file_temp,$file_name);
}
return true;
}else{
return false;

View File

@ -36,8 +36,8 @@ function get_client_ip($b_ip = true){
}
function get_host() {
$protocol = (!empty($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';
&& $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
strlen($_SERVER['HTTP_X_FORWARDED_PROTO']) > 0 ){
@ -91,6 +91,17 @@ function url_header($url){
$length = $header['Content-Length'];
}
}
//301跳转
$file_url = $url;
if(isset($header['location'])){
if(is_string($header['location'])){
$file_url = $header['location'];
}else if(is_array($header['location'])){
$file_url = $header['location'][count($header['location'])-1];
}
}
if(isset($header['Content-Disposition'])){
if(is_array($header['Content-Disposition'])){
$dis = array_pop($header['Content-Disposition']);
@ -106,18 +117,24 @@ function url_header($url){
}
$name = trim($name,'"');
}
}
}
if(isset($header['X-OutFileName'])){
$name = $header['X-OutFileName'];
}
if(!$name){
$name = get_path_this($url);
$name = get_path_this($file_url);
if (stripos($name,'?')) $name = substr($name,0,stripos($name,'?'));
if (!$name) $name = 'index.html';
}
$name = rawurldecode($name);
$name = str_replace(array('/','\\'),'-',$name);//safe;
return array('length'=>$length,'name'=>$name);
$support_range = isset($header["Accept-Ranges"])?true:false;
return array(
'url' => $file_url,
'length' => $length,
'name' => $name,
'support_range' =>$support_range
);
}

View File

@ -21,7 +21,7 @@ function update_check(){
update_clear();
}
//from [3.30~3.35] to last
//from [3.30~3.35]
$system_file = THE_DATA_PATH.'system/system_setting.php';
$system_data = fileCache::load($system_file);
if( file_exists($system_file) &&
@ -59,6 +59,9 @@ function update_clear(){
del_file(THE_DATA_PATH.'2.0-3.23.zip');
del_file(THE_DATA_PATH.'2.0-3.34.zip');
del_file(THE_DATA_PATH.'2.0-3.35.zip');
del_file(THE_DATA_PATH.'2.0-3.37.zip');
del_file(THE_DATA_PATH.'2.0-3.38.zip');
del_file(THE_DATA_PATH.'2.0-3.39.zip');
del_file(THE_DATA_PATH.'2.0-'.UPDATE_VERSION.'.zip');
del_file(BASIC_PATH.'readme.txt');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@ input,button {font-family:"Helvetica Neue","Helvetica","Microsoft Yahei","微软
width:428px;border-radius:4px;padding-bottom: 30px;
background: rgba(255,255,255,0.9);background: #fff \9;
position:absolute;top:46%;left:50%;margin-top:-209px;margin-left: -214px;
z-index: 999;
z-index: 100;
}
a{text-decoration:none;color: #adf;}
.background{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long