update
							parent
							
								
									361aa4bf9b
								
							
						
					
					
						commit
						8239aba9ca
					
				
							
								
								
									
										1854
									
								
								common.php
								
								
								
								
							
							
						
						
									
										1854
									
								
								common.php
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										270
									
								
								conststr.php
								
								
								
								
							
							
						
						
									
										270
									
								
								conststr.php
								
								
								
								
							| 
						 | 
				
			
			@ -18,6 +18,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '日本語',
 | 
			
		||||
        'ko-kr' => '한국어',
 | 
			
		||||
        'fa' => 'فارسی',
 | 
			
		||||
        'ar-sa' => 'السعودية',
 | 
			
		||||
    ],
 | 
			
		||||
    'Week' => [
 | 
			
		||||
        'en-us' => [
 | 
			
		||||
| 
						 | 
				
			
			@ -74,6 +75,15 @@ $constStr = [
 | 
			
		|||
            5 => 'جمعه',
 | 
			
		||||
            6 => 'شنبه',
 | 
			
		||||
        ],
 | 
			
		||||
        'ar-sa' => [
 | 
			
		||||
            6 => 'بيوم الأحد',
 | 
			
		||||
            0 => 'الإثنين',
 | 
			
		||||
            1 => 'الثلاثاء',
 | 
			
		||||
            2 => 'الأربعاء',
 | 
			
		||||
            3 => 'الخميس',
 | 
			
		||||
            4 => 'يوم الجمعة',
 | 
			
		||||
            5 => 'في. يوم السبت',
 | 
			
		||||
        ],
 | 
			
		||||
    ],
 | 
			
		||||
    'EnvironmentsDescription' => [
 | 
			
		||||
        'en-us' => [
 | 
			
		||||
| 
						 | 
				
			
			@ -89,6 +99,7 @@ $constStr = [
 | 
			
		|||
            'disableShowThumb' => 'if 1, the ShowThumbnail button will not display',
 | 
			
		||||
            'disableChangeTheme' => 'if 1, the Theme selection button will not display',
 | 
			
		||||
            'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password',
 | 
			
		||||
            'dontBasicAuth' => 'if 1, will not popup user/pass windows in encrypted folder, but show the page in theme.',
 | 
			
		||||
            'background' => 'Set an url as background photo.',
 | 
			
		||||
            'backgroundm' => 'Set an url as background in mobile phone.',
 | 
			
		||||
            'theme' => 'Select theme.',
 | 
			
		||||
| 
						 | 
				
			
			@ -104,7 +115,7 @@ $constStr = [
 | 
			
		|||
        'zh-cn' => [
 | 
			
		||||
            'admin' => '管理密码,不添加时不显示登录页面且无法登录。',
 | 
			
		||||
            'adminloginpage' => '如果设置,登录按钮及页面隐藏。管理登录的页面不再是\'?admin\',而是\'?此设置的值\'。',
 | 
			
		||||
            'autoJumpFirstDisk' => '用于多盘,如果设1,将会自动跳到第一个盘。',
 | 
			
		||||
            'autoJumpFirstDisk' => '用于多个磁盘,如果为1,则自动跳转到第一个磁盘',
 | 
			
		||||
            'customScript' => '<script>,在所有页都会存在,例如放一个http跳转https',
 | 
			
		||||
            'customCss' => '<style>,在<head>最后面',
 | 
			
		||||
            'customTheme' => 'html格式的主题的url',
 | 
			
		||||
| 
						 | 
				
			
			@ -112,10 +123,11 @@ $constStr = [
 | 
			
		|||
            'diskname' => '这个盘你想显示什么名称。',
 | 
			
		||||
            'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。',
 | 
			
		||||
            'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。',
 | 
			
		||||
            'disableChangeTheme' => '如果填 1, 主题选择切换将被隐藏',
 | 
			
		||||
            'disableChangeTheme' => '如果为 1,则不会显示主题选择按钮',
 | 
			
		||||
            'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
 | 
			
		||||
            'dontBasicAuth' => '如果为 1,加密目录不再弹出用户名密码窗口,只会显示主题自带的页面。',
 | 
			
		||||
            'background' => '设置一个url作为背景。',
 | 
			
		||||
            'backgroundm' => '设置一个url作为手机用的背景。',
 | 
			
		||||
            'backgroundm' => '设置一个url作为手机端用的背景。',
 | 
			
		||||
            'theme' => '选择一个主题。',
 | 
			
		||||
            'timezone' => '设置默认时区。',
 | 
			
		||||
            'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
 | 
			
		||||
| 
						 | 
				
			
			@ -154,13 +166,24 @@ $constStr = [
 | 
			
		|||
        'ja' => [
 | 
			
		||||
            'admin' => 'パスワードを管理する、追加しない場合、ログインページは表示されず、ログインできません。',
 | 
			
		||||
            'adminloginpage' => '設定すると、ログインボタンとページが非表示になります。ログインを管理するためのページは\'?admin \'ではなく、\'?この設定の値\'。',
 | 
			
		||||
            'domain_path' => '複数のカスタムドメイン名を使用する場合、各ドメイン名に表示されるディレクトリを指定します。形式はa1.com:/dirto/path1|b1.com:/path2で、private_pathよりも優先されます。',
 | 
			
		||||
            'diskname' => '',
 | 
			
		||||
            'disktag' => '',
 | 
			
		||||
            'downloadencrypt' => '',
 | 
			
		||||
            'background' => '',
 | 
			
		||||
            'autoJumpFirstDisk' => '複数のディスクを使って、1を設定すると、自動的に最初のディスクにジャンプします。',
 | 
			
		||||
            'customScript' => '<script>は、すべてのページに存在します。例えば、httpを置いてhttpsをジャンプします。',
 | 
			
		||||
            'customCss' => '<style>は、<head>の一番後ろにあります。',
 | 
			
		||||
            'customTheme' => 'htmlフォーマットのテーマのurl',
 | 
			
		||||
            'domain_path' => '複数のドメイン名を使用する場合、ドメイン名ごとに見られるディレクトリを指定します。フォーマットはa 1.com:/dirto/path 1.com:/path 2で、prvate_path優先。',
 | 
			
		||||
            'diskname' => 'このディスクの名前を表示したいですか?',
 | 
			
		||||
            'disktag' => '一つのラベルは保存配置に使い、複数のディスクはurlに表示されます。',
 | 
			
		||||
            'disableShowThumb' => '1を記入すると、「表示サムネイル」ボタンが隠れます。',
 | 
			
		||||
            'disableChangeTheme' => '1を記入すると、テーマ選択の切り替えが隠れます。',
 | 
			
		||||
            'downloadencrypt' => '0または1です。もし1なら、暗号化されたディレクトリ内のファイルはパスワードなしでダウンロードできます。',
 | 
			
		||||
            'background' => '背景にurlを設定します。',
 | 
			
		||||
            'backgroundm' => '携帯電話用の背景としてurlを設定します。',
 | 
			
		||||
            'theme' => 'テーマを選択します。',
 | 
			
		||||
            'timezone' => 'プリセットタイムゾーンを設定します。',
 | 
			
		||||
            'guestup_path' => 'マップベッドのパスを設定します。この値が設定されていない場合、ディレクトリの内容は通常ファイルにリストされ、設定後はアップロードインターフェイスのみが表示されます。',
 | 
			
		||||
            'hideFunctionalityFile' => '0または1です。もし1ならば、いくつかの書類はリストで観光客に見せませんが、その機能は正常です。readme.md',
 | 
			
		||||
            'passfile' => 'カスタムパスワードファイルの名前は、\'pppppp \'、\'aaaa.txt \'などの場合があります。ディレクトリをリストするときには表示されません。パスワードを知っている場合にのみ、このファイルを表示またはダウンロードできます。 パスワードはこのファイルの内容であり、スペースまたは漢字を使用できます。',
 | 
			
		||||
            'domainforproxy' => '会将https://xxxy-my.sharepoint.comこの値に代えて、目標には自分で反世代を設定する必要があります。に加えて&Originndomain=元のドメイン名',
 | 
			
		||||
            'public_path' => 'APIのロングリンクアクセスを使用する場合、ネットワークディスクファイルのパスが表示されますが、設定されていない場合はデフォルトでルートディレクトリになり、private_pathの上位にはなりません(publicはprivate以上のものを見ることができません。それ以外は異なります。)。',
 | 
			
		||||
            'sitename' => 'ウェブサイト名',
 | 
			
		||||
            'Onedrive_ver' => 'Onedriveバージョン',
 | 
			
		||||
| 
						 | 
				
			
			@ -168,13 +191,24 @@ $constStr = [
 | 
			
		|||
        'ko-kr' => [
 | 
			
		||||
            'admin' => '비밀번호를 관리하고 로그인 페이지를 표시하지 않으며 추가하지 않으면 로그인 할 수 없습니다.',
 | 
			
		||||
            'adminloginpage' => '설정하면 로그인 버튼과 페이지가 숨겨집니다. 로그인 관리 페이지는 더 이상 \ ?Admin\'이 아니라 \ ?이 설정의 값 \'입니다.',
 | 
			
		||||
            'domain_path' => '여러 개의 사용자 정의 도메인 이름을 사용하는 경우 각 도메인 이름에 표시되는 디렉토리를 지정하십시오. 형식은 a1.com:/dirto/path1|b1.com:/path2이며 private_path보다 우선합니다.',
 | 
			
		||||
            'diskname' => '이 디스크에 어떤 이름을 표시 하시겠습니까?',
 | 
			
		||||
            'disktag' => '레이블은 구성을 저장하는 데 사용되며 디스크가 여러 개인 경우 URL에 표시됩니다.',
 | 
			
		||||
            'downloadencrypt' => '',
 | 
			
		||||
            'background' => 'URL을 배경으로 설정하거나 표시하는.',
 | 
			
		||||
            'guestup_path' => '방문자의 업로드 경로 (맵 베드 경로)를 설정합니다.이 값을 설정하지 않으면 디렉토리의 내용이 파일로 표시되고 설정 후에는 업로드 인터페이스 만 표시되고 파일은 표시되지 않습니다 (로그인 후 표시).',
 | 
			
		||||
            'passfile' => '사용자 정의 비밀번호 파일의 이름은 \'pppppp\' \'aaaa.txt \'등이 될 수 있으며 디렉토리가 나열되어 있으면 표시되지 않으며 비밀번호를 알고있는 경우에만이 파일을 보거나 다운로드 할 수 있습니다. 암호는이 파일의 내용이며 공백이거나 한국어 일 수 있습니다.',
 | 
			
		||||
            'autoJumpFirstDisk' => '여러 개의 디스크 에 사용 되 며, 1 이 되면 첫 번 째 디스크 로 자동 으로 이동 합 니 다.',
 | 
			
		||||
            'customScript' => '< script > 은 모든 페이지 에 존재 합 니 다. 예 를 들 어 http 을 하나 넣 고 https 로 이동 합 니 다.',
 | 
			
		||||
            'customCss' => '< 스타일 >, < 헤드 > 맨 뒤에',
 | 
			
		||||
            'customTheme' => 'html 형식의 테마 url',
 | 
			
		||||
            'domain_path' => '도 메 인 이름 을 여러 개 사용자 정의 할 때 도 메 인 이름 마다 보 이 는 디 렉 터 리 를 지정 합 니 다.형식 은 a1. com: / dirto / path 1 | b1. com: / path 2, privatepath 우선.',
 | 
			
		||||
            'diskname' => '이 접시 에 당신 은 어떤 명칭 을 표시 하고 싶 습 니까?',
 | 
			
		||||
            'disktag' => '디스크가 여러 개인 경우 구성을 저장하는 데 사용되는 레이블이 url에 표시됩니다.',
 | 
			
		||||
            'disableShowThumb' => '1을 입력하면 “썸네일 표시”버튼이 숨겨집니다.',
 | 
			
		||||
            'disableChangeTheme' => '1이면 테마 선택 버튼이 표시되지 않습니다.',
 | 
			
		||||
            'downloadencrypt' => '0 또는 1 1이면 암호화 된 디렉토리의 파일을 암호없이 다운로드 할 수 있습니다.',
 | 
			
		||||
            'background' => 'URL을 배경으로 설정하십시오.',
 | 
			
		||||
            'backgroundm' => 'URL을 휴대폰의 배경으로 설정합니다.',
 | 
			
		||||
            'theme' => '주제를 선택하십시오.',
 | 
			
		||||
            'timezone' => '기본 시간대를 설정합니다.',
 | 
			
		||||
            'guestup_path' => '게스트 업로드 경로 (사진 침대 경로)를 설정합니다.이 값을 설정하지 않으면 디렉토리의 내용이 파일로 나열됩니다. 설정 후 업로드 인터페이스 만 표시되지 않습니다 (로그인 후 표시됨).',
 | 
			
		||||
            'hideFunctionalityFile' => '0 또는 1 1 인 경우 일부 파일이 관광객 용으로 나열되지 않지만 readme.md와 같은 기능은 정상입니다.',
 | 
			
		||||
            'passfile' => '사용자 지정 암호 파일의 이름은 \ “pppppp \”또는 \ “aaaa.txt \”등이 될 수 있습니다. 디렉터리가 나열 될 때 표시되지 않으며 암호를 알고있는 경우에만 파일을 보거나 다운로드 할 수 있습니다. 암호는이 파일의 내용이며 공백이거나 중국어 일 수 있습니다.',
 | 
			
		||||
            'domainforproxy' => 'https://xxxxx-my.sharepoint.com을이 값으로 바꾸고 대상에서 안티 생성을 설정해야합니다. & Origindomain = Original domain name 을 추가합니다.',
 | 
			
		||||
            'public_path' => 'API 긴 링크 액세스를 사용하는 경우 네트워크 디스크 파일의 경로가 표시됩니다. 설정되지 않은 경우 기본적으로 루트 디렉토리로 설정됩니다.',
 | 
			
		||||
            'sitename' => '웹 사이트 이름',
 | 
			
		||||
            'Onedrive_ver' => 'Onedrive 버전',
 | 
			
		||||
| 
						 | 
				
			
			@ -193,6 +227,31 @@ $constStr = [
 | 
			
		|||
            'sitename' => 'نام سایت',
 | 
			
		||||
            'Onedrive_ver' => 'ورژن Onedrive',
 | 
			
		||||
        ],
 | 
			
		||||
        'ar-sa' => [
 | 
			
		||||
            'admin' => ' إدارة كلمة السر ، لا يمكنك عرض صفحة تسجيل الدخول دون إضافة',
 | 
			
		||||
            'adminloginpage' => 'إذا كان الإعداد ، زر تسجيل الدخول و الصفحة المخفية   إدارة صفحة تسجيل الدخول لم تعد قيمة هذا الإعداد ؟',
 | 
			
		||||
            'autoJumpFirstDisk' => 'على أقراص متعددة ، إذا كان واحد ، ثم الانتقال تلقائيا إلى القرص الأول',
 | 
			
		||||
            'customScript' => 'في جميع الصفحات ، على سبيل المثال ، وضع النص المتشعب القفز HTTPS',
 | 
			
		||||
            'customCss' => '<style>,في الجزء الخلفي من',
 | 
			
		||||
            'customTheme' => 'أتش تي أم أل شكل عنوان الموضوع',
 | 
			
		||||
            'domain_path' => 'عند استخدام العديد من أسماء النطاقات المخصصة ، حدد الدليل الذي يرى كل اسم النطاق   هذا هو القانون ؛   بات اولا',
 | 
			
		||||
            'diskname' => 'ما اسم هذا القرص الذي تريد أن تظهر ؟',
 | 
			
		||||
            'disktag' => 'العلامة التي تستخدم لحفظ التكوين ، يتم عرضها في عناوين المواقع عند تعدد الأقراص',
 | 
			
		||||
            'disableShowThumb' => 'إذا كنت ملء ، زر عرض الاختصارات سوف تكون مخفية',
 | 
			
		||||
            'disableChangeTheme' => 'إذا كان واحد ، لا يتم عرض زر اختيار الموضوع',
 | 
			
		||||
            'downloadencrypt' => 'أو واحد   إذا كان واحد ، ثم تشفير الملفات في الدليل يمكن تحميلها بدون كلمة السر',
 | 
			
		||||
            'background' => 'وضع رابط كخلفية',
 | 
			
		||||
            'backgroundm' => 'وضع رابط كخلفية على الهاتف',
 | 
			
		||||
            'theme' => 'اختر موضوع واحد',
 | 
			
		||||
            'timezone' => 'تعيين المنطقة الزمنية الافتراضية',
 | 
			
		||||
            'guestup_path' => 'إذا كنت لا تضع هذه القيمة ، محتويات الدليل سوف تظهر بشكل صحيح ، فقط واجهة تحميل بعد الإعداد ، لا تظهر الملفات بعد تسجيل الدخول.',
 | 
			
		||||
            'hideFunctionalityFile' => 'أو واحد   إذا كان واحد ، بعض الملفات لا تظهر في قائمة الزوار ، ولكن وظيفتها هي طبيعية ، مثل   قراءة',
 | 
			
		||||
            'passfile' => 'يمكنك تحديد اسم ملف كلمة السر الخاصة بك ؟   النص   انتظر ، لا تظهر في الكتالوج إلا إذا كنت تعرف كلمة السر ، يمكنك عرض أو تحميل هذا الملف   كلمة السر هي محتوى هذه الوثيقة ، يمكنك الفضاء ، يمكنك الصينية ؛',
 | 
			
		||||
            'domainforproxy' => 'سوف   لا شيء   استبدال هذه القيمة ، تحتاج إلى تعيين جيل معاكس في الهدف الخاص بك   إضافة اسم النطاق الأصلي',
 | 
			
		||||
            'public_path' => 'عند استخدام API وصلة طويلة للوصول إلى عرض مسار الملف على القرص ، إذا لم يتم تعيين الافتراضي هو الجذر ، لا يمكن أن يكون private ش   لا يمكن أن نرى أكثر من private publics ، أو لا',
 | 
			
		||||
            'sitename' => 'اسم الموقع',
 | 
			
		||||
            'Onedrive_ver' => 'أوندريف',
 | 
			
		||||
        ],
 | 
			
		||||
    ],
 | 
			
		||||
    'SetSecretsFirst' => [
 | 
			
		||||
        'en-us' => 'Set API in Config first! or reinstall.',
 | 
			
		||||
| 
						 | 
				
			
			@ -201,6 +260,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '最初に環境変数にAPIを設定してください!',
 | 
			
		||||
        'ko-kr' => '먼저 환경 변수에서 API를 설정하십시오! 또는 다시 설치하십시오.',
 | 
			
		||||
        'fa' => 'ابتدا API را در پیکربندی تنظیم کنید! یا دوباره نصب کنید.',
 | 
			
		||||
        'ar-sa' => 'وضع المعهد في بيئة متغيرة   أو أعد التحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'RefreshtoLogin' => [
 | 
			
		||||
        'en-us' => '<font color="red">Refresh</font> and login.',
 | 
			
		||||
| 
						 | 
				
			
			@ -209,6 +269,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ページを<font color = "red">更新</font>して、再度ログインしてください',
 | 
			
		||||
        'ko-kr' => '페이지를 <font color = "red"> 새로 고침 </ font> 하시고 다시 로그인하십시오',
 | 
			
		||||
        'fa' => '<font color="red">رفرش</font> و لاگین.',
 | 
			
		||||
        'ar-sa' => 'الرجاء إعادة تسجيل الدخول بعد تحديث الصفحة',
 | 
			
		||||
    ],
 | 
			
		||||
    'AdminLogin' => [
 | 
			
		||||
        'en-us' => 'Admin Login',
 | 
			
		||||
| 
						 | 
				
			
			@ -217,6 +278,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ログインを管理する',
 | 
			
		||||
        'ko-kr' => '로그인 관리',
 | 
			
		||||
        'fa' => 'ورود ادمین',
 | 
			
		||||
        'ar-sa' => 'إدارة تسجيل الدخول',
 | 
			
		||||
    ],
 | 
			
		||||
    'LoginSuccess' => [
 | 
			
		||||
        'en-us' => 'Login Success!',
 | 
			
		||||
| 
						 | 
				
			
			@ -225,6 +287,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ログイン成功、ジャンプ',
 | 
			
		||||
        'ko-kr' => '로그인 성공, 점프',
 | 
			
		||||
        'fa' => 'ورود با موفقیت انجام شد!',
 | 
			
		||||
        'ar-sa' => 'تسجيل الدخول بنجاح ، القفز',
 | 
			
		||||
    ],
 | 
			
		||||
    'InputPassword' => [
 | 
			
		||||
        'en-us' => 'Input Password',
 | 
			
		||||
| 
						 | 
				
			
			@ -233,6 +296,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'パスワードを入力してください',
 | 
			
		||||
        'ko-kr' => '비밀번호 입력',
 | 
			
		||||
        'fa' => 'رمز عبور را وارد کنید',
 | 
			
		||||
        'ar-sa' => 'أدخل كلمة المرور',
 | 
			
		||||
    ],
 | 
			
		||||
    'Login' => [
 | 
			
		||||
        'en-us' => 'Login',
 | 
			
		||||
| 
						 | 
				
			
			@ -241,6 +305,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'サインイン',
 | 
			
		||||
        'ko-kr' => '로그인',
 | 
			
		||||
        'fa' => 'ورود',
 | 
			
		||||
        'ar-sa' => 'تسجيل الدخول',
 | 
			
		||||
    ],
 | 
			
		||||
    'Encrypt' => [
 | 
			
		||||
        'en-us' => 'Encrypt',
 | 
			
		||||
| 
						 | 
				
			
			@ -249,6 +314,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '暗号化',
 | 
			
		||||
        'ko-kr' => '암호화',
 | 
			
		||||
        'fa' => 'رمزگذاری',
 | 
			
		||||
        'ar-sa' => 'مشفر',
 | 
			
		||||
    ],
 | 
			
		||||
    'SetpassfileBfEncrypt' => [
 | 
			
		||||
        'en-us' => 'Set \'passfile\' in Environments before encrypt',
 | 
			
		||||
| 
						 | 
				
			
			@ -257,6 +323,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '最初に暗号化する環境変数にパスファイルを設定します',
 | 
			
		||||
        'ko-kr' => '암호화하기 전에 환경 변수에 패스 파일을 설정하십시오',
 | 
			
		||||
        'fa' => 'قبل از رمزگذاری \"pass file \" را در محیط تنظیم کنید',
 | 
			
		||||
        'ar-sa' => 'أولا تعيين متغير البيئة passfile لتشفير',
 | 
			
		||||
    ],
 | 
			
		||||
    'updateProgram' => [
 | 
			
		||||
        'en-us' => 'Update Program',
 | 
			
		||||
| 
						 | 
				
			
			@ -265,6 +332,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ワンクリック更新',
 | 
			
		||||
        'ko-kr' => '원 클릭 업데이트',
 | 
			
		||||
        'fa' => 'برنامه را به روز کنید',
 | 
			
		||||
        'ar-sa' => 'تحديث',
 | 
			
		||||
    ],
 | 
			
		||||
    'UpdateSuccess' => [
 | 
			
		||||
        'en-us' => 'Program update Success!',
 | 
			
		||||
| 
						 | 
				
			
			@ -273,6 +341,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'プログラムのアップグレードに成功しました!',
 | 
			
		||||
        'ko-kr' => '프로그램 업그레이드 성공!',
 | 
			
		||||
        'fa' => 'موفقیت به روز رسانی برنامه!',
 | 
			
		||||
        'ar-sa' => 'ترقية البرنامج بنجاح',
 | 
			
		||||
    ],
 | 
			
		||||
    'Setup' => [
 | 
			
		||||
        'en-us' => 'Setup',
 | 
			
		||||
| 
						 | 
				
			
			@ -281,6 +350,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '設定する',
 | 
			
		||||
        'ko-kr' => '설정',
 | 
			
		||||
        'fa' => 'نصب',
 | 
			
		||||
        'ar-sa' => 'إعداد',
 | 
			
		||||
    ],
 | 
			
		||||
    'Back' => [
 | 
			
		||||
        'en-us' => 'Back',
 | 
			
		||||
| 
						 | 
				
			
			@ -289,11 +359,16 @@ $constStr = [
 | 
			
		|||
        'ja' => 'back',
 | 
			
		||||
        'ko-kr' => '돌아 가기',
 | 
			
		||||
        'fa' => 'بازگشت',
 | 
			
		||||
        'ar-sa' => 'رجع',
 | 
			
		||||
    ],
 | 
			
		||||
    'Theme' => [
 | 
			
		||||
        'en-us' => 'Theme',
 | 
			
		||||
        'zh-cn' => '主题',
 | 
			
		||||
        'zh-tw' => '主題',
 | 
			
		||||
        'ja' => 'テーマ',
 | 
			
		||||
        'ko-kr' => '주제.',
 | 
			
		||||
        'fa' => 'عنوان',
 | 
			
		||||
        'ar-sa' => 'الثيمات',
 | 
			
		||||
    ],
 | 
			
		||||
    'NotNeedUpdate' => [
 | 
			
		||||
        'en-us' => 'Not Need Update',
 | 
			
		||||
| 
						 | 
				
			
			@ -302,6 +377,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '更新不要',
 | 
			
		||||
        'ko-kr' => '업데이트가 필요하지 않습니다',
 | 
			
		||||
        'fa' => 'آپدیت لازم نیست',
 | 
			
		||||
        'ar-sa' => 'لا تحتاج إلى تحديث',
 | 
			
		||||
    ],
 | 
			
		||||
    'PlatformConfig' => [
 | 
			
		||||
        'en-us' => 'Platform Config',
 | 
			
		||||
| 
						 | 
				
			
			@ -310,6 +386,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'プラットフォーム変数',
 | 
			
		||||
        'ko-kr' => '플랫폼 변수',
 | 
			
		||||
        'fa' => 'پیکربندی پلتفرم',
 | 
			
		||||
        'ar-sa' => 'منصة متغير',
 | 
			
		||||
    ],
 | 
			
		||||
    'DragSort' => [
 | 
			
		||||
        'en-us' => 'Drag to Sort Disk',
 | 
			
		||||
| 
						 | 
				
			
			@ -328,19 +405,30 @@ $constStr = [
 | 
			
		|||
        'ja' => 'このディスクを削除',
 | 
			
		||||
        'ko-kr' => '이 디스크를 삭제',
 | 
			
		||||
        'fa' => 'پاک کردن این دیسک',
 | 
			
		||||
        'ar-sa' => 'حذف هذا القرص',
 | 
			
		||||
    ],
 | 
			
		||||
    'CopyDisk' => [
 | 
			
		||||
        'en-us' => 'Copy this Disk',
 | 
			
		||||
        'zh-cn' => '复制此盘',
 | 
			
		||||
    ],
 | 
			
		||||
    'RenameDisk' => [
 | 
			
		||||
        'en-us' => 'Rename Disk Tag',
 | 
			
		||||
        'zh-cn' => '改变标签',
 | 
			
		||||
        'zh-tw' => '修改標籤',
 | 
			
		||||
        'ar-sa' => 'تغيير التسمية',
 | 
			
		||||
    ],
 | 
			
		||||
    'ChangeOnedrivetype' => [
 | 
			
		||||
        'en-us' => 'Change Onedrive/Sharepoint',
 | 
			
		||||
        'zh-cn' => '切换Onedrive/Sharepoint',
 | 
			
		||||
    ],
 | 
			
		||||
    'AddDisk' => [
 | 
			
		||||
        'en-us' => 'Add Onedrive Disk',
 | 
			
		||||
        'zh-cn' => '添加Onedrive盘',
 | 
			
		||||
        'zh-tw' => '新增Onedrive盤',
 | 
			
		||||
        'ja' => 'Onedriveを追加',
 | 
			
		||||
        'ko-kr' => 'Onedrive 추가',
 | 
			
		||||
        'fa' => 'اضافه کردن دیسک Onedrive',
 | 
			
		||||
        'en-us' => 'Add Disk',
 | 
			
		||||
        'zh-cn' => '添加盘',
 | 
			
		||||
        'zh-tw' => '新增盤',
 | 
			
		||||
        'ja' => 'を追加',
 | 
			
		||||
        'ko-kr' => '추가',
 | 
			
		||||
        'fa' => 'اضافه کردن دیسک ',
 | 
			
		||||
        'ar-sa' => 'إضافة قرص',
 | 
			
		||||
    ],
 | 
			
		||||
    'Home' => [
 | 
			
		||||
        'en-us' => 'Home',
 | 
			
		||||
| 
						 | 
				
			
			@ -349,16 +437,25 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ホーム',
 | 
			
		||||
        'ko-kr' => '홈',
 | 
			
		||||
        'fa' => 'خانه',
 | 
			
		||||
        'ar-sa' => 'فرونت بيج',
 | 
			
		||||
    ],
 | 
			
		||||
    'Preview' => [
 | 
			
		||||
        'en-us' => 'Preview',
 | 
			
		||||
        'zh-cn' => '预览',
 | 
			
		||||
        'zh-tw' => '預覽',
 | 
			
		||||
        'ja' => 'プレビュー',
 | 
			
		||||
        'ko-kr' => '미리보기',
 | 
			
		||||
        'fa' => 'پیشنمایش',
 | 
			
		||||
        'ar-sa' => 'معاينة',
 | 
			
		||||
    ],
 | 
			
		||||
    'List' => [
 | 
			
		||||
        'en-us' => 'List',
 | 
			
		||||
        'zh-cn' => '列表',
 | 
			
		||||
        'zh-tw' => '列表',
 | 
			
		||||
        'ja' => 'リスト',
 | 
			
		||||
        'ko-kr' => '리스트',
 | 
			
		||||
        'fa' => 'فهرست',
 | 
			
		||||
        'ar-sa' => 'الليست',
 | 
			
		||||
    ],
 | 
			
		||||
    'NeedUpdate' => [
 | 
			
		||||
        'en-us' => 'Program can update<br>Click setup in Operate at top.',
 | 
			
		||||
| 
						 | 
				
			
			@ -367,6 +464,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'プログラムをアップグレードできます<br>上記の管理メニューで<br>アップグレードする設定ページに入ります',
 | 
			
		||||
        'ko-kr' => '프로그램을 업그레이드 할 수 있습니다. <br> 위의 관리 메뉴에서 <br> 업그레이드 할 설정 페이지를 입력하십시오.',
 | 
			
		||||
        'fa' => 'برنامه می تواند آپدیت شود<br>روی گزینه نصب در بالای صفحه کلیک کنید.',
 | 
			
		||||
        'ar-sa' => 'يمكن ترقية البرنامج في القائمة أعلاه إدارة',
 | 
			
		||||
    ],
 | 
			
		||||
    'Operate' => [
 | 
			
		||||
        'en-us' => 'Operate',
 | 
			
		||||
| 
						 | 
				
			
			@ -375,14 +473,16 @@ $constStr = [
 | 
			
		|||
        'ja' => '管理',
 | 
			
		||||
        'ko-kr' => '관리',
 | 
			
		||||
        'fa' => 'مدیریت',
 | 
			
		||||
        'ar-sa' => 'الإدارة',
 | 
			
		||||
    ],
 | 
			
		||||
    'Logout' => [
 | 
			
		||||
        'en-us' => 'Logout',
 | 
			
		||||
        'zh-cn' => '登出',
 | 
			
		||||
        'zh-cn' => '退出',
 | 
			
		||||
        'zh-tw' => '登出',
 | 
			
		||||
        'ja' => 'ログアウトする',
 | 
			
		||||
        'ko-kr' => '로그 아웃',
 | 
			
		||||
        'fa' => 'خروج',
 | 
			
		||||
        'ar-sa' => 'انسحب',
 | 
			
		||||
    ],
 | 
			
		||||
    'Create' => [
 | 
			
		||||
        'en-us' => 'Create',
 | 
			
		||||
| 
						 | 
				
			
			@ -391,6 +491,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '新しい',
 | 
			
		||||
        'ko-kr' => '새로운',
 | 
			
		||||
        'fa' => 'ایجاد کردن',
 | 
			
		||||
        'ar-sa' => 'بنيت حديثا',
 | 
			
		||||
    ],
 | 
			
		||||
    'Download' => [
 | 
			
		||||
        'en-us' => 'download',
 | 
			
		||||
| 
						 | 
				
			
			@ -399,6 +500,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ダウンロードする',
 | 
			
		||||
        'ko-kr' => '다운로드',
 | 
			
		||||
        'fa' => 'دانلود',
 | 
			
		||||
        'ar-sa' => 'داون لود',
 | 
			
		||||
    ],
 | 
			
		||||
    'ClicktoEdit' => [
 | 
			
		||||
        'en-us' => 'Click to edit',
 | 
			
		||||
| 
						 | 
				
			
			@ -407,6 +509,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'クリック後に編集',
 | 
			
		||||
        'ko-kr' => '클릭 후 편집',
 | 
			
		||||
        'fa' => 'برای ویرایش کلیک کنید',
 | 
			
		||||
        'ar-sa' => 'انقر فوق تحرير',
 | 
			
		||||
    ],
 | 
			
		||||
    'Save' => [
 | 
			
		||||
        'en-us' => 'Save',
 | 
			
		||||
| 
						 | 
				
			
			@ -415,6 +518,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '保存する',
 | 
			
		||||
        'ko-kr' => '저장',
 | 
			
		||||
        'fa' => 'ذخیره',
 | 
			
		||||
        'ar-sa' => 'حفظ',
 | 
			
		||||
    ],
 | 
			
		||||
    'FileNotSupport' => [
 | 
			
		||||
        'en-us' => 'File not support preview.',
 | 
			
		||||
| 
						 | 
				
			
			@ -423,6 +527,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ファイル形式はプレビューをサポートしていません',
 | 
			
		||||
        'ko-kr' => '파일 형식은 미리보기를 지원하지 않습니다',
 | 
			
		||||
        'fa' => 'پیش نمایش برای این فایل پشتیبانی نمی شود.',
 | 
			
		||||
        'ar-sa' => 'معاينة الملف غير معتمد',
 | 
			
		||||
    ],
 | 
			
		||||
    'File' => [
 | 
			
		||||
        'en-us' => 'File',
 | 
			
		||||
| 
						 | 
				
			
			@ -431,6 +536,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ファイル',
 | 
			
		||||
        'ko-kr' => '파일',
 | 
			
		||||
        'fa' => 'فایل',
 | 
			
		||||
        'ar-sa' => 'فايل',
 | 
			
		||||
    ],
 | 
			
		||||
    'ShowThumbnails' => [
 | 
			
		||||
        'en-us' => 'Thumbnails',
 | 
			
		||||
| 
						 | 
				
			
			@ -439,11 +545,16 @@ $constStr = [
 | 
			
		|||
        'ja' => '画像のサムネイル',
 | 
			
		||||
        'ko-kr' => '사진 섬네일',
 | 
			
		||||
        'fa' => 'تصویر بندانگشتی',
 | 
			
		||||
        'ar-sa' => 'تجاهل الصورة',
 | 
			
		||||
    ],
 | 
			
		||||
    'OriginalPic' => [
 | 
			
		||||
        'en-us' => 'OriginalPic',
 | 
			
		||||
        'zh-cn' => '原图',
 | 
			
		||||
        'zh-tw' => '原圖',
 | 
			
		||||
        'ja' => '原図',
 | 
			
		||||
        'ko-kr' => '원 도',
 | 
			
		||||
        'fa' => 'تصویر اصلی',
 | 
			
		||||
        'ar-sa' => 'الصورة الأصلية',
 | 
			
		||||
    ],
 | 
			
		||||
    'CopyAllDownloadUrl' => [
 | 
			
		||||
        'en-us' => 'CopyAllDownloadUrl',
 | 
			
		||||
| 
						 | 
				
			
			@ -452,11 +563,16 @@ $constStr = [
 | 
			
		|||
        'ja' => 'すべてのダウンロードリンクをコピー',
 | 
			
		||||
        'ko-kr' => '모든 다운로드 링크 복사',
 | 
			
		||||
        'fa' => 'کپی از تمام لینک ها',
 | 
			
		||||
        'ar-sa' => 'نسخ جميع روابط التحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'Search' => [
 | 
			
		||||
        'en-us' => 'Search',
 | 
			
		||||
        'zh-cn' => '搜索',
 | 
			
		||||
        'zh-tw' => '搜尋',
 | 
			
		||||
        'ja' => '検索',
 | 
			
		||||
        'ko-kr' => '수색 하 다.',
 | 
			
		||||
        'fa' => 'جستجو',
 | 
			
		||||
        'ar-sa' => 'بحث',
 | 
			
		||||
    ],
 | 
			
		||||
    'EditTime' => [
 | 
			
		||||
        'en-us' => 'EditTime',
 | 
			
		||||
| 
						 | 
				
			
			@ -465,6 +581,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '変更時間',
 | 
			
		||||
        'ko-kr' => '수정 시간',
 | 
			
		||||
        'fa' => 'زمان ویرایش',
 | 
			
		||||
        'ar-sa' => 'تعديل الوقت',
 | 
			
		||||
    ],
 | 
			
		||||
    'Size' => [
 | 
			
		||||
        'en-us' => 'Size',
 | 
			
		||||
| 
						 | 
				
			
			@ -473,6 +590,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'サイズ ',
 | 
			
		||||
        'ko-kr' => '사이즈',
 | 
			
		||||
        'fa' => 'سایز',
 | 
			
		||||
        'ar-sa' => 'مقاس',
 | 
			
		||||
    ],
 | 
			
		||||
    'Rename' => [
 | 
			
		||||
        'en-us' => 'Rename',
 | 
			
		||||
| 
						 | 
				
			
			@ -481,6 +599,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '名前を変更',
 | 
			
		||||
        'ko-kr' => '이름 바꾸기',
 | 
			
		||||
        'fa' => 'تغییر نام',
 | 
			
		||||
        'ar-sa' => 'إعادة تسمية',
 | 
			
		||||
    ],
 | 
			
		||||
    'Move' => [
 | 
			
		||||
        'en-us' => 'Move',
 | 
			
		||||
| 
						 | 
				
			
			@ -489,6 +608,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '移動する',
 | 
			
		||||
        'ko-kr' => '이동',
 | 
			
		||||
        'fa' => 'انتقال',
 | 
			
		||||
        'ar-sa' => 'تحرك',
 | 
			
		||||
    ],
 | 
			
		||||
    'Copy' => [
 | 
			
		||||
        'en-us' => 'Copy',
 | 
			
		||||
| 
						 | 
				
			
			@ -497,6 +617,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'コピー',
 | 
			
		||||
        'ko-kr' => '복사',
 | 
			
		||||
        'fa' => 'کپی',
 | 
			
		||||
        'ar-sa' => 'نسخ',
 | 
			
		||||
    ],
 | 
			
		||||
    'CannotMove' => [
 | 
			
		||||
        'en-us' => 'Can not Move!',
 | 
			
		||||
| 
						 | 
				
			
			@ -505,6 +626,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '動かない!',
 | 
			
		||||
        'ko-kr' => '움직일 수 없어!',
 | 
			
		||||
        'fa' => 'نمیتواند منتقل شود!',
 | 
			
		||||
        'ar-sa' => 'لا تتحرك',
 | 
			
		||||
    ],
 | 
			
		||||
    'Delete' => [
 | 
			
		||||
        'en-us' => 'Delete',
 | 
			
		||||
| 
						 | 
				
			
			@ -513,6 +635,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '削除する',
 | 
			
		||||
        'ko-kr' => '삭제',
 | 
			
		||||
        'fa' => 'حذف کردن',
 | 
			
		||||
        'ar-sa' => 'حذف',
 | 
			
		||||
    ],
 | 
			
		||||
    'PrePage' => [
 | 
			
		||||
        'en-us' => 'PrePage',
 | 
			
		||||
| 
						 | 
				
			
			@ -521,6 +644,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '前へ',
 | 
			
		||||
        'ko-kr' => '이전',
 | 
			
		||||
        'fa' => 'صفحه قبل',
 | 
			
		||||
        'ar-sa' => 'الصفحة السابقة',
 | 
			
		||||
    ],
 | 
			
		||||
    'NextPage' => [
 | 
			
		||||
        'en-us' => 'NextPage',
 | 
			
		||||
| 
						 | 
				
			
			@ -529,6 +653,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '次のページ',
 | 
			
		||||
        'ko-kr' => '다음 페이지',
 | 
			
		||||
        'fa' => 'صفحه بعد',
 | 
			
		||||
        'ar-sa' => 'الصفحة التالية',
 | 
			
		||||
    ],
 | 
			
		||||
    'Upload' => [
 | 
			
		||||
        'en-us' => 'Upload',
 | 
			
		||||
| 
						 | 
				
			
			@ -537,16 +662,25 @@ $constStr = [
 | 
			
		|||
        'ja' => 'アップロードする',
 | 
			
		||||
        'ko-kr' => '업로드',
 | 
			
		||||
        'fa' => 'آپلود',
 | 
			
		||||
        'ar-sa' => 'ابلود',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadFile' => [
 | 
			
		||||
        'en-us' => 'Upload File(s)',
 | 
			
		||||
        'zh-cn' => '上传文件',
 | 
			
		||||
        'zh-tw' => '上傳文件',
 | 
			
		||||
        'ja' => 'ファイルをアップロード',
 | 
			
		||||
        'ko-kr' => '문건 을 업로드 하 다',
 | 
			
		||||
        'fa' => 'بارگذاری پرونده',
 | 
			
		||||
        'ar-sa' => 'تحميل الملف',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadFolder' => [
 | 
			
		||||
        'en-us' => 'Upload Folder',
 | 
			
		||||
        'zh-cn' => '上传文件夹',
 | 
			
		||||
        'zh-tw' => '上傳資料夾',
 | 
			
		||||
        'ja' => 'フォルダをアップロード',
 | 
			
		||||
        'ko-kr' => '폴 더 업로드',
 | 
			
		||||
        'fa' => 'بارگذاری پوشه',
 | 
			
		||||
        'ar-sa' => 'تحميل ملف',
 | 
			
		||||
    ],
 | 
			
		||||
    'FileSelected' => [
 | 
			
		||||
        'en-us' => 'Select File',
 | 
			
		||||
| 
						 | 
				
			
			@ -555,6 +689,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ファイルを選択',
 | 
			
		||||
        'ko-kr' => '파일 선택',
 | 
			
		||||
        'fa' => 'انتخاب فایل',
 | 
			
		||||
        'ar-sa' => 'اختر ملف',
 | 
			
		||||
    ],
 | 
			
		||||
    'NoFileSelected' => [
 | 
			
		||||
        'en-us' => 'Not Select File',
 | 
			
		||||
| 
						 | 
				
			
			@ -563,6 +698,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ファイルが選択されていません',
 | 
			
		||||
        'ko-kr' => '선택된 파일이 없습니다',
 | 
			
		||||
        'fa' => 'فایل را انتخاب نکنید',
 | 
			
		||||
        'ar-sa' => 'لا يوجد ملف محدد',
 | 
			
		||||
    ],
 | 
			
		||||
    'Submit' => [
 | 
			
		||||
        'en-us' => 'Submit',
 | 
			
		||||
| 
						 | 
				
			
			@ -571,6 +707,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '確認する',
 | 
			
		||||
        'ko-kr' => '확인',
 | 
			
		||||
        'fa' => 'ارسال',
 | 
			
		||||
        'ar-sa' => 'أكد',
 | 
			
		||||
    ],
 | 
			
		||||
    'Close' => [
 | 
			
		||||
        'en-us' => '×',
 | 
			
		||||
| 
						 | 
				
			
			@ -579,6 +716,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '×',
 | 
			
		||||
        'ko-kr' => '×',
 | 
			
		||||
        'fa' => '×',
 | 
			
		||||
        'ar-sa' => '×',
 | 
			
		||||
    ],
 | 
			
		||||
    'InputPasswordUWant' => [
 | 
			
		||||
        'en-us' => 'Input Password you Want',
 | 
			
		||||
| 
						 | 
				
			
			@ -587,6 +725,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '設定するパスワードを入力してください',
 | 
			
		||||
        'ko-kr' => '설정하려는 비밀번호를 입력하십시오',
 | 
			
		||||
        'fa' => 'پسورد خود را وارد کنید',
 | 
			
		||||
        'ar-sa' => 'أدخل كلمة السر التي تريد تعيين',
 | 
			
		||||
    ],
 | 
			
		||||
    'ParentDir' => [
 | 
			
		||||
        'en-us' => 'Parent Dir',
 | 
			
		||||
| 
						 | 
				
			
			@ -595,6 +734,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '親ディレクトリ',
 | 
			
		||||
        'ko-kr' => '부모 디렉토리',
 | 
			
		||||
        'fa' => 'مسیر',
 | 
			
		||||
        'ar-sa' => 'الدليل السابق',
 | 
			
		||||
    ],
 | 
			
		||||
    'Folder' => [
 | 
			
		||||
        'en-us' => 'Folder',
 | 
			
		||||
| 
						 | 
				
			
			@ -603,6 +743,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'フォルダー',
 | 
			
		||||
        'ko-kr' => '폴더',
 | 
			
		||||
        'fa' => 'پوشه',
 | 
			
		||||
        'ar-sa' => 'فولدر',
 | 
			
		||||
    ],
 | 
			
		||||
    'Name' => [
 | 
			
		||||
        'en-us' => 'Name',
 | 
			
		||||
| 
						 | 
				
			
			@ -611,6 +752,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '名前',
 | 
			
		||||
        'ko-kr' => '이름',
 | 
			
		||||
        'fa' => 'نام',
 | 
			
		||||
        'ar-sa' => 'إسم',
 | 
			
		||||
    ],
 | 
			
		||||
    'Content' => [
 | 
			
		||||
        'en-us' => 'Content',
 | 
			
		||||
| 
						 | 
				
			
			@ -619,6 +761,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '内容',
 | 
			
		||||
        'ko-kr' => '내용',
 | 
			
		||||
        'fa' => 'محتوا',
 | 
			
		||||
        'ar-sa' => 'المحتويات',
 | 
			
		||||
    ],
 | 
			
		||||
    'CancelEdit' => [
 | 
			
		||||
        'en-us' => 'Cancel Edit',
 | 
			
		||||
| 
						 | 
				
			
			@ -627,6 +770,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '編集をキャンセル',
 | 
			
		||||
        'ko-kr' => '편집 취소',
 | 
			
		||||
        'fa' => 'لغو ویرایش',
 | 
			
		||||
        'ar-sa' => 'إلغاء تحرير',
 | 
			
		||||
    ],
 | 
			
		||||
    'GetFileNameFail' => [
 | 
			
		||||
        'en-us' => 'Fail to Get File Name!',
 | 
			
		||||
| 
						 | 
				
			
			@ -635,6 +779,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ファイル名を取得できませんでした!',
 | 
			
		||||
        'ko-kr' => '파일 이름을 가져 오지 못했습니다!',
 | 
			
		||||
        'fa' => 'نام فایل به دست نیامد!',
 | 
			
		||||
        'ar-sa' => 'فشل الحصول على اسم الملف',
 | 
			
		||||
    ],
 | 
			
		||||
    'GetUploadLink' => [
 | 
			
		||||
        'en-us' => 'Get Upload Link',
 | 
			
		||||
| 
						 | 
				
			
			@ -643,11 +788,16 @@ $constStr = [
 | 
			
		|||
        'ja' => 'アップロードリンクを取得',
 | 
			
		||||
        'ko-kr' => '업로드 링크 받기',
 | 
			
		||||
        'fa' => 'دریافت لینک آپلود',
 | 
			
		||||
        'ar-sa' => 'الحصول على رابط التحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'Calculate' => [
 | 
			
		||||
        'en-us' => 'Calculate',
 | 
			
		||||
        'zh-cn' => '计算',
 | 
			
		||||
        'zh-tw' => '計算',
 | 
			
		||||
        'ja' => '計算する',
 | 
			
		||||
        'ko-kr' => '계산 하 다.',
 | 
			
		||||
        'fa' => 'محاسبه',
 | 
			
		||||
        'ar-sa' => 'محسوب',
 | 
			
		||||
    ],
 | 
			
		||||
    'UpFileTooLarge' => [
 | 
			
		||||
        'en-us' => 'The File is too Large!',
 | 
			
		||||
| 
						 | 
				
			
			@ -656,6 +806,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '超えると、アップロードは終了します。',
 | 
			
		||||
        'ko-kr' => '파일이 너무 커서 업로드가 종료되었습니다.',
 | 
			
		||||
        'fa' => 'فایل خیلی بزرگ است!',
 | 
			
		||||
        'ar-sa' => 'الملف كبير جدا ، إنهاء التحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadStart' => [
 | 
			
		||||
        'en-us' => 'Upload Start',
 | 
			
		||||
| 
						 | 
				
			
			@ -664,6 +815,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'アップロードを開始',
 | 
			
		||||
        'ko-kr' => '업로드 시작',
 | 
			
		||||
        'fa' => 'شروع آپلود',
 | 
			
		||||
        'ar-sa' => 'بدء التحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadStartAt' => [
 | 
			
		||||
        'en-us' => 'Start At',
 | 
			
		||||
| 
						 | 
				
			
			@ -672,6 +824,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'で開始',
 | 
			
		||||
        'ko-kr' => '에서 시작',
 | 
			
		||||
        'fa' => 'شروع از',
 | 
			
		||||
        'ar-sa' => 'تبدأ في',
 | 
			
		||||
    ],
 | 
			
		||||
    'ThisTime' => [
 | 
			
		||||
        'en-us' => 'This Time',
 | 
			
		||||
| 
						 | 
				
			
			@ -680,6 +833,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '今回は',
 | 
			
		||||
        'ko-kr' => '이번에는',
 | 
			
		||||
        'fa' => 'این زمان',
 | 
			
		||||
        'ar-sa' => 'هذه المرة',
 | 
			
		||||
    ],
 | 
			
		||||
    'LastUpload' => [
 | 
			
		||||
        'en-us' => 'Last time Upload',
 | 
			
		||||
| 
						 | 
				
			
			@ -688,6 +842,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '上回は',
 | 
			
		||||
        'ko-kr' => '마지막 업로드',
 | 
			
		||||
        'fa' => 'آخرین زمان آپلود',
 | 
			
		||||
        'ar-sa' => 'آخر تحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'AverageSpeed' => [
 | 
			
		||||
        'en-us' => 'AverageSpeed',
 | 
			
		||||
| 
						 | 
				
			
			@ -696,6 +851,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '平均速度',
 | 
			
		||||
        'ko-kr' => '평균 속도',
 | 
			
		||||
        'fa' => 'میانگین سرعت',
 | 
			
		||||
        'ar-sa' => 'متوسط السرعة',
 | 
			
		||||
    ],
 | 
			
		||||
    'CurrentSpeed' => [
 | 
			
		||||
        'en-us' => 'CurrentSpeed',
 | 
			
		||||
| 
						 | 
				
			
			@ -704,6 +860,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'インスタントスピード',
 | 
			
		||||
        'ko-kr' => '즉각적인 속도',
 | 
			
		||||
        'fa' => 'سرعت فعلی',
 | 
			
		||||
        'ar-sa' => 'سرعة فورية',
 | 
			
		||||
    ],
 | 
			
		||||
    'Expect' => [
 | 
			
		||||
        'en-us' => 'Expect',
 | 
			
		||||
| 
						 | 
				
			
			@ -712,6 +869,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '期待される',
 | 
			
		||||
        'ko-kr' => '예상',
 | 
			
		||||
        'fa' => 'انتظار',
 | 
			
		||||
        'ar-sa' => 'ومن المتوقع أيضا',
 | 
			
		||||
    ],
 | 
			
		||||
    'EndAt' => [
 | 
			
		||||
        'en-us' => 'End At',
 | 
			
		||||
| 
						 | 
				
			
			@ -720,6 +878,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'で終了',
 | 
			
		||||
        'ko-kr' => '에 끝남',
 | 
			
		||||
        'fa' => 'پایان از',
 | 
			
		||||
        'ar-sa' => 'نهاية',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadErrorUpAgain' => [
 | 
			
		||||
        'en-us' => 'Maybe error, do upload again.',
 | 
			
		||||
| 
						 | 
				
			
			@ -728,6 +887,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '間違っている可能性があります。もう一度アップロードしてください。',
 | 
			
		||||
        'ko-kr' => '잘못되었을 수 있습니다. 다시 업로드하십시오.',
 | 
			
		||||
        'fa' => 'خطا، دوباره آپلود کنید',
 | 
			
		||||
        'ar-sa' => 'قد تكون خاطئة ، إعادة تحميل',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadComplete' => [
 | 
			
		||||
        'en-us' => 'Upload Complete',
 | 
			
		||||
| 
						 | 
				
			
			@ -736,6 +896,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'アップロード完了',
 | 
			
		||||
        'ko-kr' => '업로드 완료',
 | 
			
		||||
        'fa' => 'آپلود با موفقیت انجام شد',
 | 
			
		||||
        'ar-sa' => 'تحميل كامل',
 | 
			
		||||
    ],
 | 
			
		||||
    'UploadFail23' => [
 | 
			
		||||
        'en-us' => 'Upload Fail, contain #.',
 | 
			
		||||
| 
						 | 
				
			
			@ -744,6 +905,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ディレクトリまたはファイル名に#が含まれています。アップロードに失敗しました。',
 | 
			
		||||
        'ko-kr' => '디렉토리 또는 파일 이름에 #이 포함되어 있습니다. 업로드하지 못했습니다.',
 | 
			
		||||
        'fa' => 'بارگذاری ناموفق، حاوی #.',
 | 
			
		||||
        'ar-sa' => 'دليل أو اسم الملف يحتوي على تحميل فشلت',
 | 
			
		||||
    ],
 | 
			
		||||
    'defaultSitename' => [
 | 
			
		||||
        'en-us' => 'OneManager',
 | 
			
		||||
| 
						 | 
				
			
			@ -755,6 +917,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'refresh_tokenを保存しています!',
 | 
			
		||||
        'ko-kr' => 'refresh_token 저장 중!',
 | 
			
		||||
        'fa' => 'در حال ذخیره refresh_token!',
 | 
			
		||||
        'ar-sa' => 'حفظ refresh ش   توكن',
 | 
			
		||||
    ],
 | 
			
		||||
    'MayinEnv' => [
 | 
			
		||||
        'en-us' => 'The \'Drive_ver\' may in Config',
 | 
			
		||||
| 
						 | 
				
			
			@ -763,6 +926,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'Drive_verは環境変数に書き込まれている必要があります',
 | 
			
		||||
        'ko-kr' => 'Drive_verが書き込まれている必要があります',
 | 
			
		||||
        'fa' => 'The \'Drive_ver\' may in Config',
 | 
			
		||||
        'ar-sa' => 'درايو   يجب أن يكون مكتوب على',
 | 
			
		||||
    ],
 | 
			
		||||
    'Wait' => [
 | 
			
		||||
        'en-us' => 'Wait',
 | 
			
		||||
| 
						 | 
				
			
			@ -771,6 +935,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'ちょっと待って',
 | 
			
		||||
        'ko-kr' => '잠깐만',
 | 
			
		||||
        'fa' => 'منتظر بمانید',
 | 
			
		||||
        'ar-sa' => 'انتظر لحظة',
 | 
			
		||||
    ],
 | 
			
		||||
    'WaitJumpIndex' => [
 | 
			
		||||
        'en-us' => 'Wait 5s jump to Home page',
 | 
			
		||||
| 
						 | 
				
			
			@ -779,6 +944,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '5秒待ってホームページにジャンプします',
 | 
			
		||||
        'ko-kr' => '5 초 동안 홈페이지로 이동',
 | 
			
		||||
        'fa' => '۵ دقیقه صبر کنید تا به صفحه نخست برگردید',
 | 
			
		||||
        'ar-sa' => 'انتظر 5S القفز إلى الصفحة الرئيسية',
 | 
			
		||||
    ],
 | 
			
		||||
    'JumptoOffice' => [
 | 
			
		||||
        'en-us' => 'Login Office and Get a refresh_token',
 | 
			
		||||
| 
						 | 
				
			
			@ -787,27 +953,34 @@ $constStr = [
 | 
			
		|||
        'ja' => 'Officeにジャンプしてログインし、refresh_tokenを取得します',
 | 
			
		||||
        'ko-kr' => '사무실로 이동하여 로그인하여 refresh_token을 받으십시오.',
 | 
			
		||||
        'fa' => 'وارد Office شوید و یک refresh_token دریافت کنید',
 | 
			
		||||
        'ar-sa' => 'Login Office and Get a refresh_token',
 | 
			
		||||
    ],
 | 
			
		||||
    'OnedriveDiskTag' => [
 | 
			
		||||
        'en-us' => 'Onedrive Disk Tag',
 | 
			
		||||
        'zh-cn' => 'Onedrive 标签',
 | 
			
		||||
        'zh-tw' => 'Onedrive 標籤',
 | 
			
		||||
        'ja' => 'Onedriveタグ',
 | 
			
		||||
        'ko-kr' => 'Onedrive 태그',
 | 
			
		||||
        'fa' => 'برچسب دیسک Onedrive',
 | 
			
		||||
    'DiskTag' => [
 | 
			
		||||
        'en-us' => 'Disk Tag',
 | 
			
		||||
        'zh-cn' => '标签',
 | 
			
		||||
        'zh-tw' => '標籤',
 | 
			
		||||
        'ja' => 'タグ',
 | 
			
		||||
        'ko-kr' => '태그',
 | 
			
		||||
        'fa' => 'برچسب دیسک ',
 | 
			
		||||
        'ar-sa' => 'تاغ',
 | 
			
		||||
    ],
 | 
			
		||||
    'OnedriveDiskName' => [
 | 
			
		||||
        'en-us' => 'Onedrive Showed Name',
 | 
			
		||||
        'zh-cn' => 'Onedrive 显示名称',
 | 
			
		||||
        'zh-tw' => 'Onedrive 顯示名稱',
 | 
			
		||||
        'ja' => 'Onedrive表示名',
 | 
			
		||||
        'ko-kr' => 'Onedrive 표시 이름',
 | 
			
		||||
        'fa' => 'نام نشان داده شده Onedrive',
 | 
			
		||||
    'DiskName' => [
 | 
			
		||||
        'en-us' => 'Showed Name',
 | 
			
		||||
        'zh-cn' => '显示名称',
 | 
			
		||||
        'zh-tw' => '顯示名稱',
 | 
			
		||||
        'ja' => '表示名',
 | 
			
		||||
        'ko-kr' => '표시 이름',
 | 
			
		||||
        'fa' => 'نام نشان داده شده ',
 | 
			
		||||
        'ar-sa' => 'عرض الاسم',
 | 
			
		||||
    ],
 | 
			
		||||
    'DriveVerMS' => [
 | 
			
		||||
        'en-us' => 'Onedrive, Onedrive for business',
 | 
			
		||||
        'zh-cn' => '国际版(商业版与个人版)',
 | 
			
		||||
        'zh-tw' => '國際版(商業版與個人版)',
 | 
			
		||||
        'ja' => '国際版(商業版と個人版)',
 | 
			
		||||
        'ko-kr' => '국제 판 (상업 판 과 개인 판)',
 | 
			
		||||
        'fa' => 'International Edition (Business Edition and Personal Edition)',
 | 
			
		||||
        'ar-sa' => 'الأعمال التجارية الدولية الطبعة الطبعة الشخصية',
 | 
			
		||||
    ],
 | 
			
		||||
    'DriveVerCN' => [
 | 
			
		||||
        'en-us' => 'Onedrive in China',
 | 
			
		||||
| 
						 | 
				
			
			@ -816,6 +989,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '中国のOnedrive',
 | 
			
		||||
        'ko-kr' => '중국 Onedrive',
 | 
			
		||||
        'fa' => 'Onedrive در چین',
 | 
			
		||||
        'ar-sa' => 'Onedrive النسخة الصينية',
 | 
			
		||||
    ],
 | 
			
		||||
    'DriveVerShareurl' => [
 | 
			
		||||
        'en-us' => 'A share link of a folder',
 | 
			
		||||
| 
						 | 
				
			
			@ -824,16 +998,17 @@ $constStr = [
 | 
			
		|||
    ],
 | 
			
		||||
    'UseShareLink' => [
 | 
			
		||||
        'en-us' => 'Share a folder in Onedrive (enable EDIT for everyone), input the link url below.',
 | 
			
		||||
        'zh-cn' => '对一个Onedrive文件夹共享,允许所有人编辑,然后将共享链接填在下方',
 | 
			
		||||
        'zh-cn' => '<font color="red">只有国际版能用,</font>对一个Onedrive文件夹共享,允许所有人编辑,然后将共享链接填在下方',
 | 
			
		||||
        'zh-tw' => '對一個Onedrive資料夾共享,允許所有人編輯,然後將共享連結填在下方',
 | 
			
		||||
    ],
 | 
			
		||||
    'CustomIdSecret' => [
 | 
			
		||||
        'en-us' => 'Use custom client id & secret instead of OneManager default',
 | 
			
		||||
        'zh-cn' => '自己申请应用ID与机密,不用OneManager默认的',
 | 
			
		||||
        'zh-tw' => '自己申請應用ID與機密,不用OneManager預設的',
 | 
			
		||||
        'zh-cn' => '用自己申请的应用ID与机密,不用OneManager默认的',
 | 
			
		||||
        'zh-tw' => '用自己申請的應用ID與機密,不用OneManager預設的',
 | 
			
		||||
        'ja' => 'アプリケーションIDとシークレットを自分で申請する',
 | 
			
		||||
        'ko-kr' => '응용 프로그램 ID 및 비밀 신청',
 | 
			
		||||
        'fa' => 'به طور پیش فرض اما از شناسه برنامه و سکرت استفاده کنید',
 | 
			
		||||
        'ar-sa' => 'استخدام التطبيق الخاص بك معرف وسرية ، لا أحد مدير الافتراضية',
 | 
			
		||||
    ],
 | 
			
		||||
    'GetSecretIDandKEY' => [
 | 
			
		||||
        'en-us' => 'Get custom client id & secret',
 | 
			
		||||
| 
						 | 
				
			
			@ -841,6 +1016,7 @@ $constStr = [
 | 
			
		|||
        'zh-tw' => '申請應用ID與機密',
 | 
			
		||||
        'ja' => 'アプリケーションIDとシークレット',
 | 
			
		||||
        'fa' => 'دریافت شناسه برنامه و سکرت',
 | 
			
		||||
        'ar-sa' => 'تطبيق الهوية والسرية',
 | 
			
		||||
    ],
 | 
			
		||||
    'UseSharepointInstead' => [
 | 
			
		||||
        'en-us' => 'Use space in Sharepoint website instead of Onedrive',
 | 
			
		||||
| 
						 | 
				
			
			@ -862,6 +1038,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'タグは、文字で始まり、文字または数字で終わる必要があります。少なくとも2つ',
 | 
			
		||||
        'ko-kr' => '태그는 문자로 시작하고 문자 또는 숫자로 끝나야합니다 (2 이상).',
 | 
			
		||||
        'fa' => 'برچسب باید با یک حرف شروع شود، با یک حرف یا رقم پایان یابد و تنها میتواند حاوی حروف کوچک، ارقام و خط فاصله، حداقل ۲ حرف باشد!',
 | 
			
		||||
        'ar-sa' => 'التسمية يمكن أن تبدأ فقط مع الحروف ، وتنتهي مع الحروف أو الأرقام ، على الأقل',
 | 
			
		||||
    ],
 | 
			
		||||
    'ClickInstall' => [
 | 
			
		||||
        'en-us' => 'Click to install the project',
 | 
			
		||||
| 
						 | 
				
			
			@ -870,6 +1047,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'クリックしてインストールプロセスを開始します',
 | 
			
		||||
        'ko-kr' => '설치 과정을 시작하려면 클릭',
 | 
			
		||||
        'fa' => 'برای نصب پروژه کلیک کنید',
 | 
			
		||||
        'ar-sa' => 'انقر فوق بدء الإعداد',
 | 
			
		||||
    ],
 | 
			
		||||
    'LogintoBind' => [
 | 
			
		||||
        'en-us' => 'then login and bind your onedrive in setup',
 | 
			
		||||
| 
						 | 
				
			
			@ -878,6 +1056,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '次に、ログインして、設定でonedriveをバインドします。',
 | 
			
		||||
        'ko-kr' => '그런 다음 로그인하여 onedrive를 설정에 바인딩하십시오.',
 | 
			
		||||
        'fa' => 'پس از آن وارد سیستم شوید و تنظیمات خود را در onedrive متصل کنید',
 | 
			
		||||
        'ar-sa' => 'ثم قم بتسجيل الدخول بعد ربط أحد السائقين في الإعدادات',
 | 
			
		||||
    ],
 | 
			
		||||
    'MakesuerWriteable' => [
 | 
			
		||||
        'en-us' => 'Plase make sure the config.php is writeable. run writeable.sh.',
 | 
			
		||||
| 
						 | 
				
			
			@ -886,6 +1065,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'config.phpが書き込み可能であることを確認してください。',
 | 
			
		||||
        'ko-kr' => 'config.php가 쓰기 가능한지 확인하십시오.',
 | 
			
		||||
        'fa' => 'اطمینان حاصل کنید که config.php قابل نوشتن است. writeable.sh را اجرا کنید.',
 | 
			
		||||
        'ar-sa' => 'أكد   بي إتش بي   قابل للكتابة',
 | 
			
		||||
    ],
 | 
			
		||||
    'MakesuerRewriteOn' => [
 | 
			
		||||
        'en-us' => 'Plase make sure the RewriteEngine is On.',
 | 
			
		||||
| 
						 | 
				
			
			@ -894,16 +1074,25 @@ $constStr = [
 | 
			
		|||
        'ja' => '書き換え(擬似静的)機能が有効になっていることを確認します。',
 | 
			
		||||
        'ko-kr' => '다시 쓰기 (의사 정적) 기능이 활성화되어 있는지 확인하십시오.',
 | 
			
		||||
        'fa' => 'لطفاً مطمئن شوید که RewriteEngine روشن است.',
 | 
			
		||||
        'ar-sa' => 'يؤكد أن الكتابة يمكن أن تكون وظيفة شبه استاتي',
 | 
			
		||||
    ],
 | 
			
		||||
    'CopyUrl' => [
 | 
			
		||||
        'en-us' => 'Copy URL',
 | 
			
		||||
        'zh-cn' => '复制链接',
 | 
			
		||||
        'zh-tw' => '複製連結',
 | 
			
		||||
        'ja' => 'リンクをコピー',
 | 
			
		||||
        'ko-kr' => '링크 복사',
 | 
			
		||||
        'fa' => 'کپی ارتباط',
 | 
			
		||||
        'ar-sa' => 'نسخ الرابط',
 | 
			
		||||
    ],
 | 
			
		||||
    'Success' => [
 | 
			
		||||
        'en-us' => 'Success',
 | 
			
		||||
        'zh-cn' => '成功',
 | 
			
		||||
        'zh-tw' => '成功',
 | 
			
		||||
        'ja' => '成功',
 | 
			
		||||
        'ko-kr' => '성공 하 다.',
 | 
			
		||||
        'fa' => 'موفقیت',
 | 
			
		||||
        'ar-sa' => 'نجح',
 | 
			
		||||
    ],
 | 
			
		||||
    'SetAdminPassword' => [
 | 
			
		||||
        'en-us' => 'Set Admin Password',
 | 
			
		||||
| 
						 | 
				
			
			@ -917,6 +1106,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'リフレッシュ',
 | 
			
		||||
        'ko-kr' => '새로 고침',
 | 
			
		||||
        'fa' => 'رفرش',
 | 
			
		||||
        'ar-sa' => 'منعش',
 | 
			
		||||
    ],
 | 
			
		||||
    'SelectLanguage' => [
 | 
			
		||||
        'en-us' => 'Select Language',
 | 
			
		||||
| 
						 | 
				
			
			@ -925,6 +1115,7 @@ $constStr = [
 | 
			
		|||
        'ja' => '言語を選択してください',
 | 
			
		||||
        'ko-kr' => '언어를 선택하십시오',
 | 
			
		||||
        'fa' => 'زبان را انتخاب کنید',
 | 
			
		||||
        'ar-sa' => 'اختيار اللغة',
 | 
			
		||||
    ],
 | 
			
		||||
    'RefreshCache' => [
 | 
			
		||||
        'en-us' => 'RefreshCache',
 | 
			
		||||
| 
						 | 
				
			
			@ -933,6 +1124,7 @@ $constStr = [
 | 
			
		|||
        'ja' => 'キャッシュを再構築',
 | 
			
		||||
        'ko-kr' => '캐시 플러시',
 | 
			
		||||
        'fa' => 'رفرش cache',
 | 
			
		||||
        'ar-sa' => 'تحديث الكاش',
 | 
			
		||||
    ],
 | 
			
		||||
    'CannotOneKeyUpate' => [
 | 
			
		||||
        'en-us' => 'Can not update by a click! run update.sh',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,726 @@
 | 
			
		|||
<?php
 | 
			
		||||
 | 
			
		||||
class Aliyundrive {
 | 
			
		||||
    protected $access_token;
 | 
			
		||||
    protected $disktag;
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->auth_url = 'https://websv.aliyundrive.com/token/refresh';
 | 
			
		||||
        $this->api_url = 'https://api.aliyundrive.com/v2';
 | 
			
		||||
        $res = $this->get_access_token(getConfig('refresh_token', $tag));
 | 
			
		||||
        $this->default_drive_id = getConfig('default_drive_id', $tag);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public function isfine()
 | 
			
		||||
    {
 | 
			
		||||
        if (!$this->access_token) return false;
 | 
			
		||||
        else return true;
 | 
			
		||||
    }
 | 
			
		||||
    public function show_base_class()
 | 
			
		||||
    {
 | 
			
		||||
        return get_class();
 | 
			
		||||
        //$tmp[0] = get_class();
 | 
			
		||||
        //$tmp[1] = get_class($this);
 | 
			
		||||
        //return $tmp;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function ext_show_innerenv()
 | 
			
		||||
    {
 | 
			
		||||
        return [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function list_files($path = '/')
 | 
			
		||||
    {
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        $files = $this->list_path($path);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        return $this->files_format($files);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function files_format($files)
 | 
			
		||||
    {
 | 
			
		||||
        //return $files;
 | 
			
		||||
        if ($files['type']=='file') {
 | 
			
		||||
            $tmp['type'] = 'file';
 | 
			
		||||
            $tmp['id'] = $files['file_id'];
 | 
			
		||||
            if (isset($files['name'])) $tmp['name'] = $files['name'];
 | 
			
		||||
            elseif (isset($files['file_name'])) $tmp['name'] = $files['file_name'];
 | 
			
		||||
            $tmp['time'] = $files['updated_at'];
 | 
			
		||||
            $tmp['size'] = $files['size'];
 | 
			
		||||
            $tmp['mime'] = $files['file']['mimeType'];
 | 
			
		||||
            $tmp['url'] = $files['download_url'];
 | 
			
		||||
            $tmp['content'] = $files['content'];
 | 
			
		||||
            if (isset($files['exist'])) $tmp['exist'] = $files['exist'];
 | 
			
		||||
            if (isset($files['rapid_upload'])) $tmp['rapid_upload'] = $files['rapid_upload'];
 | 
			
		||||
        } elseif ($files['type']=='folder'||isset($files['items'])) {
 | 
			
		||||
            $tmp['type'] = 'folder';
 | 
			
		||||
            $tmp['id'] = $files['file_id'];
 | 
			
		||||
            if (isset($files['name'])) $tmp['name'] = $files['name'];
 | 
			
		||||
            elseif (isset($files['file_name'])) $tmp['name'] = $files['file_name'];
 | 
			
		||||
            $tmp['time'] = $files['updated_at'];
 | 
			
		||||
            $tmp['size'] = $files['size'];
 | 
			
		||||
            //$tmp['page'] = $files['folder']['page'];
 | 
			
		||||
            foreach ($files['items'] as $file) {
 | 
			
		||||
                $filename = strtolower($file['name']);
 | 
			
		||||
                if ($file['type']=='file') {
 | 
			
		||||
                    $tmp['list'][$filename]['type'] = 'file';
 | 
			
		||||
                    $tmp['list'][$filename]['url'] = $file['download_url'];
 | 
			
		||||
                    $tmp['list'][$filename]['mime'] = $file['file']['content_type'];
 | 
			
		||||
                } elseif ($file['type']=='folder') {
 | 
			
		||||
                    $tmp['list'][$filename]['type'] = 'folder';
 | 
			
		||||
                }
 | 
			
		||||
                //$tmp['id'] = $file['parent_file_id'];
 | 
			
		||||
                $tmp['list'][$filename]['id'] = $file['file_id'];
 | 
			
		||||
                $tmp['list'][$filename]['name'] = $file['name'];
 | 
			
		||||
                $tmp['list'][$filename]['time'] = $file['updated_at'];
 | 
			
		||||
                $tmp['list'][$filename]['size'] = $file['size'];
 | 
			
		||||
                $tmp['childcount']++;
 | 
			
		||||
            }
 | 
			
		||||
        } elseif (isset($files['code'])) {
 | 
			
		||||
            return $files;
 | 
			
		||||
        }
 | 
			
		||||
        //error_log1(json_encode($tmp));
 | 
			
		||||
        return $tmp;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function list_path($path = '/')
 | 
			
		||||
    {
 | 
			
		||||
        global $exts;
 | 
			
		||||
        while (substr($path, -1)=='/') $path = substr($path, 0, -1);
 | 
			
		||||
        //$files = getcache('path_' . $path, $this->disktag);
 | 
			
		||||
        //if (!$files) {
 | 
			
		||||
        //if (!($files = getcache('path_' . $path, $this->disktag))) {
 | 
			
		||||
            if ($path == '/' || $path == '') {
 | 
			
		||||
                $files = $this->fileList('root');
 | 
			
		||||
                //error_log1('root_id' . $files['id']);
 | 
			
		||||
                $files['file_id'] = 'root';
 | 
			
		||||
                $files['type'] = 'folder';
 | 
			
		||||
            } else {
 | 
			
		||||
                $tmp = splitlast($path, '/');
 | 
			
		||||
                $parent_path = $tmp[0];
 | 
			
		||||
                $filename = urldecode($tmp[1]);
 | 
			
		||||
                $parent_folder = $this->list_path($parent_path);
 | 
			
		||||
                foreach ($parent_folder['items'] as $item) {
 | 
			
		||||
                    if ($item['name']==$filename) {
 | 
			
		||||
                        if ($item['type']=='folder') {
 | 
			
		||||
                            $files = $this->fileList($item['file_id']);
 | 
			
		||||
                            $files['type'] = 'folder';
 | 
			
		||||
                            $files['file_id'] = $item['file_id'];
 | 
			
		||||
                            $files['name'] = $item['name'];
 | 
			
		||||
                            $files['time'] = $item['updated_at'];
 | 
			
		||||
                            $files['size'] = $item['size'];
 | 
			
		||||
                        } else $files = $item;
 | 
			
		||||
                        
 | 
			
		||||
                    }
 | 
			
		||||
                    
 | 
			
		||||
                }
 | 
			
		||||
                //echo $files['name'];
 | 
			
		||||
            }
 | 
			
		||||
            if ($files['type']=='file') {
 | 
			
		||||
                if (in_array(splitlast($files['name'],'.')[1], $exts['txt'])) {
 | 
			
		||||
                    if (!(isset($files['content'])&&$files['content']['stat']==200)) {
 | 
			
		||||
                        $content1 = curl('GET', $files['download_url']);
 | 
			
		||||
                        $files['content'] = $content1;
 | 
			
		||||
                        savecache('path_' . $path, $files, $this->disktag);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (!$files) {
 | 
			
		||||
                $files['error']['code'] = 'Not Found';
 | 
			
		||||
                $files['error']['message'] = 'Not Found';
 | 
			
		||||
                $files['error']['stat'] = 404;
 | 
			
		||||
            } elseif (isset($files['stat'])) {
 | 
			
		||||
                $tmp['error']['stat'] = $files['stat'];
 | 
			
		||||
                $files['error']['code'] = 'Error';
 | 
			
		||||
                $files['error']['message'] = $files['body'];
 | 
			
		||||
            } else {
 | 
			
		||||
                savecache('path_' . $path, $files, $this->disktag, 600);
 | 
			
		||||
            }
 | 
			
		||||
        //}
 | 
			
		||||
        //error_log1('path:' . $path . ', files:' . json_encode($files));
 | 
			
		||||
        return $files;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function fileGet($file_id)
 | 
			
		||||
    {
 | 
			
		||||
        $url = $this->api_url . '/file/get';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['file_id'] = $file_id;
 | 
			
		||||
 | 
			
		||||
        $res = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
        if ($res['stat']==200) return json_decode($res['body'], true);
 | 
			
		||||
        else return $res;
 | 
			
		||||
    }
 | 
			
		||||
    protected function fileList($parent_file_id)
 | 
			
		||||
    {
 | 
			
		||||
        $url = $this->api_url . '/file/list';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['limit'] = 50;
 | 
			
		||||
        $data['marker'] = NULL;
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['parent_file_id'] = $parent_file_id;
 | 
			
		||||
        $data['image_thumbnail_process'] = 'image/resize,w_160/format,jpeg';
 | 
			
		||||
        $data['image_url_process'] = 'image/resize,w_1920/format,jpeg';
 | 
			
		||||
        $data['video_thumbnail_process'] = 'video/snapshot,t_0,f_jpg,w_300';
 | 
			
		||||
        $data['fields'] = '*';
 | 
			
		||||
        $data['order_by'] = 'updated_at';
 | 
			
		||||
        $data['order_direction'] = 'DESC';
 | 
			
		||||
 | 
			
		||||
        $res = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
        if ($res['stat']==200) return json_decode($res['body'], true);
 | 
			
		||||
        else return $res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function Rename($file, $newname) {
 | 
			
		||||
        $url = $this->api_url . '/file/update';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['check_name_mode'] = 'refuse';
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['file_id'] = $file['id'];
 | 
			
		||||
        $data['name'] = $newname;
 | 
			
		||||
        //$data['parent_file_id'] = 'root';
 | 
			
		||||
 | 
			
		||||
        $result = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
        //savecache('path_' . $file['path'], json_decode('{}',true), $this->disktag, 1);
 | 
			
		||||
        //error_log1('decode:' . json_encode($result));
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        //return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Delete($file) {
 | 
			
		||||
        $url = $this->api_url . '/batch';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['resource'] = 'file';
 | 
			
		||||
        $data['requests'][0]['url'] = '/file/delete';
 | 
			
		||||
        $data['requests'][0]['method'] = 'DELETE';
 | 
			
		||||
        $data['requests'][0]['id'] = $file['id'];
 | 
			
		||||
        $data['requests'][0]['headers']['Content-Type'] = 'application/json';
 | 
			
		||||
        $data['requests'][0]['body']['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['requests'][0]['body']['file_id'] = $file['id'];
 | 
			
		||||
 | 
			
		||||
        $result = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
        //savecache('path_' . $file['path'], json_decode('{}',true), $this->disktag, 1);
 | 
			
		||||
        //error_log1('result:' . json_encode($result));
 | 
			
		||||
        //return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        $res = json_decode($result['body'], true)['responses'][0];
 | 
			
		||||
        if (isset($res['status'])) return output($res['id'], $res['status']);
 | 
			
		||||
        else return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Encrypt($folder, $passfilename, $pass) {
 | 
			
		||||
        $existfile = $this->list_path($folder['path'] . '/' . $passfilename);
 | 
			
		||||
        if (isset($existfile['type'])) { // 删掉原文件
 | 
			
		||||
            $this->Delete(['id'=>$existfile['file_id']]);
 | 
			
		||||
        }
 | 
			
		||||
        if ($pass==='') {
 | 
			
		||||
            // 如果为空,上面已经删除了
 | 
			
		||||
            return output('Success', 200);
 | 
			
		||||
        }
 | 
			
		||||
        if (!$folder['id']) {
 | 
			
		||||
            $res = $this->list_path($folder['path']);
 | 
			
		||||
            //error_log1('res:' . json_encode($res));
 | 
			
		||||
            $folder['id'] = $res['file_id'];
 | 
			
		||||
        }
 | 
			
		||||
        $tmp = '/tmp/' . $passfilename;
 | 
			
		||||
        file_put_contents($tmp, $pass);
 | 
			
		||||
 | 
			
		||||
        $result = $this->tmpfileCreate($folder['id'], $tmp, $passfilename);
 | 
			
		||||
 | 
			
		||||
        if ($result['stat']==201) {
 | 
			
		||||
            //error_log1('1,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
            $res = json_decode($result['body'], true);
 | 
			
		||||
            $url = $res['part_info_list'][0]['upload_url'];
 | 
			
		||||
            if (!$url) { // 无url,应该算秒传
 | 
			
		||||
                return output('no up url', 200);
 | 
			
		||||
            }
 | 
			
		||||
            $file_id = $res['file_id'];
 | 
			
		||||
            $upload_id = $res['upload_id'];
 | 
			
		||||
            $result = curl('PUT', $url, $pass, [], 1);
 | 
			
		||||
            if ($result['stat']==200) { // 块1传好
 | 
			
		||||
                $tmp1['part_number'] = 1;
 | 
			
		||||
                $tmp1['etag'] = $result['returnhead']['ETag'];
 | 
			
		||||
                $result = $this->fileComplete($file_id, $upload_id, [ $tmp1 ]);
 | 
			
		||||
                return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //error_log1('2,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Move($file, $folder) {
 | 
			
		||||
        if (!$folder['id']) {
 | 
			
		||||
            $res = $this->list_path($folder['path']);
 | 
			
		||||
            //error_log1('res:' . json_encode($res));
 | 
			
		||||
            $folder['id'] = $res['file_id'];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $url = $this->api_url . '/batch';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['resource'] = 'file';
 | 
			
		||||
        $data['requests'][0]['url'] = '/file/move';
 | 
			
		||||
        $data['requests'][0]['method'] = 'POST';
 | 
			
		||||
        $data['requests'][0]['id'] = $file['id'];
 | 
			
		||||
        $data['requests'][0]['headers']['Content-Type'] = 'application/json';
 | 
			
		||||
        $data['requests'][0]['body']['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['requests'][0]['body']['file_id'] = $file['id'];
 | 
			
		||||
        $data['requests'][0]['body']['auto_rename'] = true;
 | 
			
		||||
        $data['requests'][0]['body']['to_parent_file_id'] = $folder['id'];
 | 
			
		||||
 | 
			
		||||
        $result = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
        //savecache('path_' . $file['path'], json_decode('{}',true), $this->disktag, 1);
 | 
			
		||||
        //error_log1('result:' . json_encode($result));
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Copy($file) {
 | 
			
		||||
        if (!$file['id']) {
 | 
			
		||||
            $oldfile = $this->list_path($file['path'] . '/' . $file['name']);
 | 
			
		||||
            //error_log1('res:' . json_encode($res));
 | 
			
		||||
            //$file['id'] = $res['file_id'];
 | 
			
		||||
        } else {
 | 
			
		||||
            $oldfile = $this->fileGet($file['id']);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $url = $this->api_url . '/file/create';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['check_name_mode'] = 'auto_rename'; // ignore, auto_rename, refuse.
 | 
			
		||||
        $data['content_hash'] = $oldfile['content_hash'];
 | 
			
		||||
        $data['content_hash_name'] = 'sha1';
 | 
			
		||||
        $data['content_type'] = $oldfile['content_type'];
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['ignoreError'] = false;
 | 
			
		||||
        $data['name'] = $oldfile['name'];
 | 
			
		||||
        $data['parent_file_id'] = $oldfile['parent_file_id'];
 | 
			
		||||
        $data['part_info_list'][0]['part_number'] = 1;
 | 
			
		||||
        $data['size'] = $oldfile['size'];
 | 
			
		||||
        $data['type'] = 'file';
 | 
			
		||||
 | 
			
		||||
        $result = curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
 | 
			
		||||
        if ($result['stat']==201) {
 | 
			
		||||
            //error_log1('1,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
            $res = json_decode($result['body'], true);
 | 
			
		||||
            $url = $res['part_info_list'][0]['upload_url'];
 | 
			
		||||
            if (!$url) { // 无url,应该算秒传
 | 
			
		||||
                return output('no up url', 200);
 | 
			
		||||
            } else {
 | 
			
		||||
                return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
            }
 | 
			
		||||
            /*$file_id = $res['file_id'];
 | 
			
		||||
            $upload_id = $res['upload_id'];
 | 
			
		||||
            $result = curl('PUT', $url, $content, [], 1);
 | 
			
		||||
            if ($result['stat']==200) { // 块1传好
 | 
			
		||||
                $etag = $result['returnhead']['ETag'];
 | 
			
		||||
                $result = $this->fileComplete($file_id, $upload_id, $etag);
 | 
			
		||||
                if ($result['stat']!=200) return output($result['body'], $result['stat']);
 | 
			
		||||
                else return output('success', 0);
 | 
			
		||||
            }*/
 | 
			
		||||
        }
 | 
			
		||||
        //error_log1('2,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Edit($file, $content) {
 | 
			
		||||
        $tmp = splitlast($file['path'], '/');
 | 
			
		||||
        $folderpath = $tmp[0];
 | 
			
		||||
        $filename = $tmp[1];
 | 
			
		||||
        $existfile = $this->list_path($file['path']);
 | 
			
		||||
        if (isset($existfile['type'])) { // 删掉原文件
 | 
			
		||||
            $this->Delete(['id'=>$existfile['file_id']]);
 | 
			
		||||
        }
 | 
			
		||||
        $tmp1 = '/tmp/' . $filename;
 | 
			
		||||
        file_put_contents($tmp1, $content);
 | 
			
		||||
 | 
			
		||||
        $result = $this->tmpfileCreate($this->list_path($folderpath)['file_id'], $tmp1, $filename);
 | 
			
		||||
 | 
			
		||||
        if ($result['stat']==201) {
 | 
			
		||||
            //error_log1('1,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
            $res = json_decode($result['body'], true);
 | 
			
		||||
            $url = $res['part_info_list'][0]['upload_url'];
 | 
			
		||||
            if (!$url) { // 无url,应该算秒传
 | 
			
		||||
                return output('no up url', 0);
 | 
			
		||||
            }
 | 
			
		||||
            $file_id = $res['file_id'];
 | 
			
		||||
            $upload_id = $res['upload_id'];
 | 
			
		||||
            $result = curl('PUT', $url, $content, [], 1);
 | 
			
		||||
            if ($result['stat']==200) { // 块1传好
 | 
			
		||||
                $tmp2['part_number'] = 1;
 | 
			
		||||
                $tmp2['etag'] = $result['returnhead']['ETag'];
 | 
			
		||||
                $result = $this->fileComplete($file_id, $upload_id, [ $tmp2 ]);
 | 
			
		||||
                if ($result['stat']!=200) return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
                else return output('success', 0);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //error_log1('2,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Create($folder, $type, $name, $content = '') {
 | 
			
		||||
        if (!$folder['id']) {
 | 
			
		||||
            $res = $this->list_path($folder['path']);
 | 
			
		||||
            //error_log1('res:' . json_encode($res));
 | 
			
		||||
            $folder['id'] = $res['file_id'];
 | 
			
		||||
        }
 | 
			
		||||
        if ($type=='folder') {
 | 
			
		||||
            $result = $this->folderCreate($folder['id'], $name);
 | 
			
		||||
            //error_log1('res:' . json_encode($result));
 | 
			
		||||
            return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        }
 | 
			
		||||
        if ($type=='file') {
 | 
			
		||||
            $tmp = '/tmp/' . $name;
 | 
			
		||||
            file_put_contents($tmp, $content);
 | 
			
		||||
 | 
			
		||||
            $result = $this->tmpfileCreate($folder['id'], $tmp, $name);
 | 
			
		||||
 | 
			
		||||
            if ($result['stat']==201) {
 | 
			
		||||
                //error_log1('1,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
                $res = json_decode($result['body'], true);
 | 
			
		||||
                if (isset($res['exist'])&&$res['exist']!=false) {
 | 
			
		||||
                    // 已经有
 | 
			
		||||
                    //error_log1('exist:' . json_encode($res));
 | 
			
		||||
                    return output('{"type":"file","name":"' . $name . '", "exist":true}', 200);
 | 
			
		||||
                }
 | 
			
		||||
                if (isset($res['rapid_upload'])&&$res['rapid_upload']!=false) {
 | 
			
		||||
                    // 秒传
 | 
			
		||||
                    //error_log1('rapid up:' . json_encode($res));
 | 
			
		||||
                    return output('{"type":"file","name":"' . $name . '", "rapid_upload":true}', 200);
 | 
			
		||||
                }
 | 
			
		||||
                $url = $res['part_info_list'][0]['upload_url'];
 | 
			
		||||
                $file_id = $res['file_id'];
 | 
			
		||||
                $upload_id = $res['upload_id'];
 | 
			
		||||
                $result = curl('PUT', $url, $content, [], 1);
 | 
			
		||||
                //error_log1('2,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
                if ($result['stat']==200) { // 块1传好
 | 
			
		||||
                    $tmp1['part_number'] = 1;
 | 
			
		||||
                    $tmp1['etag'] = $result['returnhead']['ETag'];
 | 
			
		||||
                    $result = $this->fileComplete($file_id, $upload_id, [ $tmp1 ]);
 | 
			
		||||
                    //error_log1('3,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
                    return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            //error_log1('4,url:' . $url .' res:' . json_encode($result));
 | 
			
		||||
            return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        }
 | 
			
		||||
        return output('Type not folder or file.', 500);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function folderCreate($parentId, $folderName) {
 | 
			
		||||
        if (strrpos($folderName, '/')) {
 | 
			
		||||
            $tmp = splitlast($folderName, '/');
 | 
			
		||||
            $parentId = json_decode($this->folderCreate($parentId, $tmp[0])['body'], true)['file_id'];
 | 
			
		||||
            $folderName = $tmp[1];
 | 
			
		||||
        }
 | 
			
		||||
        $url = $this->api_url . '/file/create';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['check_name_mode'] = 'refuse'; // ignore, auto_rename, refuse.
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['name'] = $folderName;
 | 
			
		||||
        $data['parent_file_id'] = $parentId;
 | 
			
		||||
        $data['type'] = 'folder';
 | 
			
		||||
 | 
			
		||||
        return curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
    }
 | 
			
		||||
    protected function fileCreate($parentId, $fileName, $sha1, $size) {
 | 
			
		||||
        $url = $this->api_url . '/file/create';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
    
 | 
			
		||||
        $data['check_name_mode'] = 'refuse'; // ignore, auto_rename, refuse.
 | 
			
		||||
        $data['content_hash'] = $sha1;
 | 
			
		||||
        $data['content_hash_name'] = 'sha1';
 | 
			
		||||
        $data['content_type'] = '';
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['ignoreError'] = false;
 | 
			
		||||
        $data['name'] = $fileName;
 | 
			
		||||
        $data['parent_file_id'] = $parentId;
 | 
			
		||||
        $data['part_info_list'][0]['part_number'] = 1;
 | 
			
		||||
        $data['size'] = (int)$size;
 | 
			
		||||
        $data['type'] = 'file';
 | 
			
		||||
 | 
			
		||||
        return curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
    }
 | 
			
		||||
    protected function tmpfileCreate($parentId, $tmpFilePath, $tofileName = '') {
 | 
			
		||||
        $sha1 = sha1_file($tmpFilePath);
 | 
			
		||||
        if ($tofileName == '') $tofileName = splitlast($tmpFilePath, '/')[1];
 | 
			
		||||
        $url = $this->api_url . '/file/create';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['check_name_mode'] = 'refuse'; // ignore, auto_rename, refuse.
 | 
			
		||||
        $data['content_hash'] = $sha1;
 | 
			
		||||
        $data['content_hash_name'] = 'sha1';
 | 
			
		||||
        $data['content_type'] = 'text/plain'; // now only txt
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['ignoreError'] = false;
 | 
			
		||||
        $data['name'] = $tofileName;
 | 
			
		||||
        $data['parent_file_id'] = $parentId;
 | 
			
		||||
        $data['part_info_list'][0]['part_number'] = 1; // now only txt
 | 
			
		||||
        $data['size'] = filesize($tmpFilePath);
 | 
			
		||||
        $data['type'] = 'file';
 | 
			
		||||
 | 
			
		||||
        return curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
    }
 | 
			
		||||
    protected function fileComplete($file_id, $upload_id, $etags) {
 | 
			
		||||
        $url = $this->api_url . '/file/complete';
 | 
			
		||||
 | 
			
		||||
        $header["content-type"] = "application/json; charset=utf-8";
 | 
			
		||||
        $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
 | 
			
		||||
        $data['drive_id'] = $this->default_drive_id;
 | 
			
		||||
        $data['file_id'] = $file_id;
 | 
			
		||||
        $data['ignoreError'] = false;
 | 
			
		||||
        foreach ($etags as $etag) {
 | 
			
		||||
            $data['part_info_list'][$etag['part_number'] - 1]['part_number'] = $etag['part_number'];
 | 
			
		||||
            $data['part_info_list'][$etag['part_number'] - 1]['etag'] = $etag['etag'];
 | 
			
		||||
        }
 | 
			
		||||
        $data['upload_id'] = $upload_id;
 | 
			
		||||
 | 
			
		||||
        return curl('POST', $url, json_encode($data), $header);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function get_thumbnails_url($path = '/')
 | 
			
		||||
    {
 | 
			
		||||
        $res = $this->list_path($path);
 | 
			
		||||
        $thumb_url = $res['thumbnail'];
 | 
			
		||||
        return $thumb_url;
 | 
			
		||||
    }
 | 
			
		||||
    public function bigfileupload($path)
 | 
			
		||||
    {
 | 
			
		||||
        if (isset($_POST['uploadid'])) {
 | 
			
		||||
            // Complete
 | 
			
		||||
            $result = $this->fileComplete($_POST['fileid'], $_POST['uploadid'], $_POST['etag']);
 | 
			
		||||
            return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        } else {
 | 
			
		||||
            if ($_POST['upbigfilename']=='') return output('error: no file name', 400);
 | 
			
		||||
            if (!is_numeric($_POST['filesize'])) return output('error: no file size', 400);
 | 
			
		||||
            if (!isset($_POST['filesha1'])) return output('error: no file sha1', 400);
 | 
			
		||||
 | 
			
		||||
            $tmp = splitlast($_POST['upbigfilename'], '/');
 | 
			
		||||
            if ($tmp[1]!='') {
 | 
			
		||||
                $fileinfo['name'] = $tmp[1];
 | 
			
		||||
                if ($_SERVER['admin']) $fileinfo['path'] = $tmp[0];
 | 
			
		||||
            } else {
 | 
			
		||||
                $fileinfo['name'] = $_POST['upbigfilename'];
 | 
			
		||||
            }
 | 
			
		||||
            $fileinfo['size'] = $_POST['filesize'];
 | 
			
		||||
            $fileinfo['filelastModified'] = $_POST['filelastModified'];
 | 
			
		||||
            if ($_SERVER['admin']) {
 | 
			
		||||
                $filename = $fileinfo['name'];
 | 
			
		||||
            } else {
 | 
			
		||||
                $tmp1 = splitlast($fileinfo['name'], '.');
 | 
			
		||||
                if ($tmp1[0]==''||$tmp1[1]=='') $filename = $_POST['filesha1'];
 | 
			
		||||
                else $filename = $_POST['filesha1'] . '.' . $tmp1[1];
 | 
			
		||||
            }
 | 
			
		||||
            /*if ($fileinfo['size']>10*1024*1024) {
 | 
			
		||||
                $cachefilename = spurlencode( $fileinfo['path'] . '/.' . $fileinfo['filelastModified'] . '_' . $fileinfo['size'] . '_' . $fileinfo['name'] . '.tmp', '/');
 | 
			
		||||
                $getoldupinfo=$this->list_path(path_format($path . '/' . $cachefilename));
 | 
			
		||||
                //echo json_encode($getoldupinfo, JSON_PRETTY_PRINT);
 | 
			
		||||
                if ($getoldupinfo['type']=='file'&&$getoldupinfo['size']<5120) {
 | 
			
		||||
                    $getoldupinfo_j = curl('GET', $getoldupinfo['url']);
 | 
			
		||||
                    $getoldupinfo = json_decode($getoldupinfo_j['body'], true);
 | 
			
		||||
                    //if ( json_decode( curl('GET', $getoldupinfo['uploadUrl'])['body'], true)['@odata.context']!='' ) return output($getoldupinfo_j['body'], $getoldupinfo_j['stat']);
 | 
			
		||||
                }
 | 
			
		||||
            }*/
 | 
			
		||||
            $parent = $this->list_path($path . '/' . $fileinfo['path']);
 | 
			
		||||
            if (isset($parent['file_id'])) {
 | 
			
		||||
                $parent_file_id = $parent['file_id'];
 | 
			
		||||
            } else {
 | 
			
		||||
                $res = $this->folderCreate($this->list_path($path)['file_id'], $fileinfo['path']);
 | 
			
		||||
                //error_log1($res['body']);
 | 
			
		||||
                $parent_file_id = json_decode($res['body'], true)['file_id'];
 | 
			
		||||
            }
 | 
			
		||||
            $response = $this->fileCreate($parent_file_id, $filename, $_POST['filesha1'], $fileinfo['size']);
 | 
			
		||||
            $res = json_decode($response['body'], true);
 | 
			
		||||
            if (isset($res['exist'])) {
 | 
			
		||||
                // 已经有
 | 
			
		||||
                //error_log1('exist:' . json_encode($res));
 | 
			
		||||
                return output(json_encode($this->files_format(json_decode($response['body'], true))), $response['stat']);
 | 
			
		||||
                //return output('{"type":"file","name":"' . $_POST['upbigfilename'] . '", "exist":true}', 200);
 | 
			
		||||
            }
 | 
			
		||||
            if (isset($res['rapid_upload'])&&$res['rapid_upload']!=false) {
 | 
			
		||||
                // 秒传
 | 
			
		||||
                //error_log1('rapid up:' . json_encode($res));
 | 
			
		||||
                return output(json_encode($this->files_format(json_decode($response['body'], true))), $response['stat']);
 | 
			
		||||
                //return output('{"type":"file","name":"' . $_POST['upbigfilename'] . '", "rapid upload":true}', 200);
 | 
			
		||||
            }
 | 
			
		||||
            //if ($response['stat']<500) {
 | 
			
		||||
            //    $responsearry = json_decode($response['body'], true);
 | 
			
		||||
            //    if (isset($responsearry['error'])) return output($response['body'], $response['stat']);
 | 
			
		||||
            //    $fileinfo['uploadUrl'] = $responsearry['uploadUrl'];
 | 
			
		||||
            //    if ($fileinfo['size']>10*1024*1024) $this->MSAPI('PUT', path_format($path . '/' . $cachefilename), json_encode($fileinfo, JSON_PRETTY_PRINT), $this->access_token);
 | 
			
		||||
            //}
 | 
			
		||||
            return output($response['body'], $response['stat']);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function AddDisk() {
 | 
			
		||||
        global $constStr;
 | 
			
		||||
        global $EnvConfigs;
 | 
			
		||||
 | 
			
		||||
        $envs = '';
 | 
			
		||||
        foreach ($EnvConfigs as $env => $v) if (isCommonEnv($env)) $envs .= '\'' . $env . '\', ';
 | 
			
		||||
        $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['install0']) && $_POST['disktag_add']!='') {
 | 
			
		||||
            $_POST['disktag_add'] = preg_replace('/[^0-9a-zA-Z|_]/i', '', $_POST['disktag_add']);
 | 
			
		||||
            $f = substr($_POST['disktag_add'], 0, 1);
 | 
			
		||||
            if (strlen($_POST['disktag_add'])==1) $_POST['disktag_add'] .= '_';
 | 
			
		||||
            if (isCommonEnv($_POST['disktag_add'])) {
 | 
			
		||||
                return message('Do not input ' . $envs . '<br><button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>
 | 
			
		||||
                <script>
 | 
			
		||||
                var expd = new Date();
 | 
			
		||||
                expd.setTime(expd.getTime()+1);
 | 
			
		||||
                var expires = "expires="+expd.toGMTString();
 | 
			
		||||
                document.cookie=\'disktag=; path=/; \'+expires;
 | 
			
		||||
                </script>', 'Error', 201);
 | 
			
		||||
            } elseif (!(('a'<=$f && $f<='z') || ('A'<=$f && $f<='Z'))) {
 | 
			
		||||
                return message('Please start with letters<br><button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>
 | 
			
		||||
                <script>
 | 
			
		||||
                var expd = new Date();
 | 
			
		||||
                expd.setTime(expd.getTime()+1);
 | 
			
		||||
                var expires = "expires="+expd.toGMTString();
 | 
			
		||||
                document.cookie=\'disktag=; path=/; \'+expires;
 | 
			
		||||
                </script>', 'Error', 201);
 | 
			
		||||
            }
 | 
			
		||||
            $res = curl('POST', $this->auth_url, json_encode([ 'refresh_token' => $_POST['refresh_token'] ]), ["content-type"=>"application/json; charset=utf-8"]);
 | 
			
		||||
            //return output($res['body']);
 | 
			
		||||
            if ($res['stat']!=200) {
 | 
			
		||||
                return message($res['body'], $res['stat'], $res['stat']);
 | 
			
		||||
            }
 | 
			
		||||
            //var_dump($res['body']);
 | 
			
		||||
            $result = json_decode($res['body'], true);
 | 
			
		||||
 | 
			
		||||
            $tmp = null;
 | 
			
		||||
            foreach ($EnvConfigs as $env => $v) if (isInnerEnv($env)) $tmp[$env] = '';
 | 
			
		||||
 | 
			
		||||
            $tmp['refresh_token'] = $result['refresh_token'];
 | 
			
		||||
            $tmp['default_drive_id'] = $result['default_drive_id'];
 | 
			
		||||
            $tmp['default_sbox_drive_id'] = $result['default_sbox_drive_id'];
 | 
			
		||||
            $tmp['token_expires'] = time()+7*24*60*60;
 | 
			
		||||
            $tmp['Driver'] = 'Aliyundrive';
 | 
			
		||||
            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
			
		||||
            $tmp['diskname'] = $_POST['diskname'];
 | 
			
		||||
            //error_log(json_encode($tmp));
 | 
			
		||||
 | 
			
		||||
            $response = setConfigResponse( setConfig($tmp, $this->disktag) );
 | 
			
		||||
            if (api_error($response)) {
 | 
			
		||||
                $html = api_error_msg($response);
 | 
			
		||||
                $title = 'Error';
 | 
			
		||||
                return message($html, $title, 201);
 | 
			
		||||
            } else {
 | 
			
		||||
                savecache('access_token', $result['access_token'], $this->disktag, $result['expires_in'] - 60);
 | 
			
		||||
                $str .= '<meta http-equiv="refresh" content="5;URL=' . $url . '">
 | 
			
		||||
                <script>
 | 
			
		||||
                var expd = new Date();
 | 
			
		||||
                expd.setTime(expd.getTime()+1);
 | 
			
		||||
                var expires = "expires="+expd.toGMTString();
 | 
			
		||||
                document.cookie=\'disktag=; path=/; \'+expires;
 | 
			
		||||
                </script>';
 | 
			
		||||
                return message($str, getconstStr('WaitJumpIndex'), 201);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            /*$api = $this->api_url . '/user/get';
 | 
			
		||||
            $header['authorization'] = 'Bearer ' . $this->access_token;
 | 
			
		||||
            return json_encode(curl('GET', $api, '', $header));*/
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $html = '
 | 
			
		||||
<div>
 | 
			
		||||
    <form id="form1" action="" method="post" onsubmit="return notnull(this);">
 | 
			
		||||
        ' . getconstStr('DiskTag') . ': (' . getConfig('disktag') . ')
 | 
			
		||||
        <input type="text" name="disktag_add" placeholder="' . getconstStr('EnvironmentsDescription')['disktag'] . '" style="width:100%"><br>
 | 
			
		||||
        ' . getconstStr('DiskName') . ':
 | 
			
		||||
        <input type="text" name="diskname" placeholder="' . getconstStr('EnvironmentsDescription')['diskname'] . '" style="width:100%"><br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <div>填入refresh_token:
 | 
			
		||||
            <input type="text" name="refresh_token" placeholder="' . getconstStr(' ') . '" style="width:100%"><br>
 | 
			
		||||
        </div>
 | 
			
		||||
        <br>
 | 
			
		||||
 | 
			
		||||
        <input type="submit" value="' . getconstStr('Submit') . '">
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
    <script>
 | 
			
		||||
        function notnull(t)
 | 
			
		||||
        {
 | 
			
		||||
            if (t.disktag_add.value==\'\') {
 | 
			
		||||
                alert(\'' . getconstStr('DiskTag') . '\');
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            envs = [' . $envs . '];
 | 
			
		||||
            if (envs.indexOf(t.disktag_add.value)>-1) {
 | 
			
		||||
                alert("Do not input ' . $envs . '");
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            var reg = /^[a-zA-Z]([_a-zA-Z0-9]{1,20})$/;
 | 
			
		||||
            if (!reg.test(t.disktag_add.value)) {
 | 
			
		||||
                alert(\'' . getconstStr('TagFormatAlert') . '\');
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (t.refresh_token.value==\'\') {
 | 
			
		||||
                    alert(\'Input refresh_token\');
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            document.getElementById("form1").action="?install0&disktag=" + t.disktag_add.value + "&AddDisk=Aliyundrive";
 | 
			
		||||
            //var expd = new Date();
 | 
			
		||||
            //expd.setTime(expd.getTime()+(2*60*60*1000));
 | 
			
		||||
            //var expires = "expires="+expd.toGMTString();
 | 
			
		||||
            //document.cookie=\'disktag=\'+t.disktag_add.value+\'; path=/; \'+expires;
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
    </script>';
 | 
			
		||||
        $title = 'Select Account Type';
 | 
			
		||||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    protected function get_access_token($refresh_token) {
 | 
			
		||||
        if (!($this->access_token = getcache('access_token', $this->disktag))) {
 | 
			
		||||
            $p=0;
 | 
			
		||||
            $tmp1['refresh_token'] = $refresh_token;
 | 
			
		||||
            while ($response['stat']==0&&$p<3) {
 | 
			
		||||
                $response = curl('POST', $this->auth_url, json_encode($tmp1), ["content-type"=>"application/json; charset=utf-8"]);
 | 
			
		||||
                $p++;
 | 
			
		||||
            }
 | 
			
		||||
            error_log1(json_encode($response));
 | 
			
		||||
            if ($response['stat']==200) $ret = json_decode($response['body'], true);
 | 
			
		||||
            if (!isset($ret['access_token'])) {
 | 
			
		||||
                error_log1('failed to get [' . $this->disktag . '] access_token. response' . json_encode($ret));
 | 
			
		||||
                $response['body'] = json_encode(json_decode($response['body']), JSON_PRETTY_PRINT);
 | 
			
		||||
                $response['body'] .= '\nfailed to get [' . $this->disktag . '] access_token.';
 | 
			
		||||
                return $response;
 | 
			
		||||
            }
 | 
			
		||||
            $tmp = $ret;
 | 
			
		||||
            $tmp['access_token'] = '******';
 | 
			
		||||
            $tmp['refresh_token'] = '******';
 | 
			
		||||
            error_log1('[' . $this->disktag . '] Get access token:' . json_encode($tmp, JSON_PRETTY_PRINT));
 | 
			
		||||
            $this->access_token = $ret['access_token'];
 | 
			
		||||
            savecache('access_token', $this->access_token, $this->disktag, $ret['expires_in'] - 300);
 | 
			
		||||
            if (time()>getConfig('token_expires', $this->disktag)) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ], $this->disktag);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,973 @@
 | 
			
		|||
<?php
 | 
			
		||||
 | 
			
		||||
class Onedrive {
 | 
			
		||||
    protected $access_token;
 | 
			
		||||
    protected $disktag;
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->redirect_uri = 'https://scfonedrive.github.io';
 | 
			
		||||
        if (getConfig('client_id', $tag) && getConfig('client_secret', $tag)) {
 | 
			
		||||
            $this->client_id = getConfig('client_id', $tag);
 | 
			
		||||
            $this->client_secret = getConfig('client_secret', $tag);
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->client_id = '734ef928-d74c-4555-8d1b-d942fa0a1a41';
 | 
			
		||||
            $this->client_secret = ':EK[e0/4vQ@mQgma8LmnWb6j4_C1CSIW';
 | 
			
		||||
        }
 | 
			
		||||
        $this->oauth_url = 'https://login.microsoftonline.com/common/oauth2/v2.0/';
 | 
			
		||||
        $this->api_url = 'https://graph.microsoft.com/v1.0';
 | 
			
		||||
        $this->scope = 'https://graph.microsoft.com/Files.ReadWrite.All offline_access';
 | 
			
		||||
        $res = $this->get_access_token(getConfig('refresh_token', $tag));
 | 
			
		||||
 | 
			
		||||
        $this->client_secret = urlencode($this->client_secret);
 | 
			
		||||
        $this->scope = urlencode($this->scope);
 | 
			
		||||
        $this->DownurlStrName = '@microsoft.graph.downloadUrl';
 | 
			
		||||
        $this->ext_api_url = '/me/drive/root';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function isfine()
 | 
			
		||||
    {
 | 
			
		||||
        if (!$this->access_token) return false;
 | 
			
		||||
        else return true;
 | 
			
		||||
    }
 | 
			
		||||
    public function show_base_class()
 | 
			
		||||
    {
 | 
			
		||||
        return get_class();
 | 
			
		||||
        //$tmp[0] = get_class();
 | 
			
		||||
        //$tmp[1] = get_class($this);
 | 
			
		||||
        //return $tmp;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function ext_show_innerenv()
 | 
			
		||||
    {
 | 
			
		||||
        return [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function list_files($path = '/')
 | 
			
		||||
    {
 | 
			
		||||
        global $exts;
 | 
			
		||||
        if (!($files = getcache('path_' . $path, $this->disktag))) {
 | 
			
		||||
            // https://docs.microsoft.com/en-us/graph/api/driveitem-get?view=graph-rest-1.0
 | 
			
		||||
            // https://docs.microsoft.com/zh-cn/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http
 | 
			
		||||
            // https://developer.microsoft.com/zh-cn/graph/graph-explorer
 | 
			
		||||
            $pos = splitlast($path, '/');
 | 
			
		||||
            $parentpath = $pos[0];
 | 
			
		||||
            if ($parentpath=='') $parentpath = '/';
 | 
			
		||||
            $filename = $pos[1];
 | 
			
		||||
            if ($parentfiles = getcache('path_' . $parentpath, $this->disktag)) {
 | 
			
		||||
                if (isset($parentfiles['children'][$filename][$this->DownurlStrName])) {
 | 
			
		||||
                    if (in_array(splitlast($filename,'.')[1], $exts['txt'])) {
 | 
			
		||||
                        if (!(isset($parentfiles['children'][$filename]['content'])&&$parentfiles['children'][$filename]['content']['stat']==200)) {
 | 
			
		||||
                            $content1 = curl('GET', $parentfiles['children'][$filename][$this->DownurlStrName]);
 | 
			
		||||
                            $parentfiles['children'][$filename]['content'] = $content1;
 | 
			
		||||
                            savecache('path_' . $parentpath, $parentfiles, $this->disktag);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    return $this->files_format($parentfiles['children'][$filename]);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $url = $this->api_url . $this->ext_api_url;
 | 
			
		||||
            if ($path !== '/') {
 | 
			
		||||
                $url .= ':' . $path;
 | 
			
		||||
                if (substr($url,-1)=='/') $url=substr($url,0,-1);
 | 
			
		||||
            }
 | 
			
		||||
            $url .= '?expand=children(select=id,name,size,file,folder,parentReference,lastModifiedDateTime,'.$this->DownurlStrName.')';
 | 
			
		||||
            $retry = 0;
 | 
			
		||||
            $arr = [];
 | 
			
		||||
            while ($retry<3&&!$arr['stat']) {
 | 
			
		||||
                $arr = curl('GET', $url, '', ['Authorization' => 'Bearer ' . $this->access_token], 1);
 | 
			
		||||
                $retry++;
 | 
			
		||||
            }
 | 
			
		||||
            //echo $url . '<br><pre>' . json_encode($arr, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
            if ($arr['stat']<500) {
 | 
			
		||||
                $files = json_decode($arr['body'], true);
 | 
			
		||||
                //echo '<pre>' . json_encode($files, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
                if (isset($files['folder'])) {
 | 
			
		||||
                    if ($files['folder']['childCount']>200) {
 | 
			
		||||
                        // files num > 200 , then get nextlink
 | 
			
		||||
                        $page = $_POST['pagenum']==''?1:$_POST['pagenum'];
 | 
			
		||||
                        if ($page>1)
 | 
			
		||||
                        //if (!($files = getcache('path_1' . $path . '_' . $page, $this->disktag)))
 | 
			
		||||
                        {
 | 
			
		||||
                            $children = $this->fetch_files_children($path, $page);
 | 
			
		||||
                            //echo '<pre>' . json_encode($children, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
                            $files['children'] = $children['value'];
 | 
			
		||||
                            //$files['children'] = children_name($files['children']);
 | 
			
		||||
                            $files['folder']['page'] = $page;
 | 
			
		||||
                            //savecache('path_' . $path . '_' . $page, $files, $this->disktag);
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                    // files num < 200 , then cache
 | 
			
		||||
                        //if (isset($files['children'])) {
 | 
			
		||||
                            //$files['children'] = children_name($files['children']);
 | 
			
		||||
                        //}
 | 
			
		||||
                        savecache('path_' . $path, $files, $this->disktag);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (isset($files['file'])) {
 | 
			
		||||
                    if (in_array(splitlast($files['name'],'.')[1], $exts['txt'])) {
 | 
			
		||||
                        if (!(isset($files['content'])&&$files['content']['stat']==200)) {
 | 
			
		||||
                            $content1 = curl('GET', $files[$this->DownurlStrName]);
 | 
			
		||||
                            $files['content'] = $content1;
 | 
			
		||||
                            savecache('path_' . $path, $files, $this->disktag);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if (isset($files['error'])) {
 | 
			
		||||
                    $files['error']['stat'] = $arr['stat'];
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                //error_log1($arr['body']);
 | 
			
		||||
                $files = json_decode($arr['body'], true);
 | 
			
		||||
                if (isset($files['error'])) {
 | 
			
		||||
                    $files['error']['stat'] = $arr['stat'];
 | 
			
		||||
                } else {
 | 
			
		||||
                    $files['error']['stat'] = 503;
 | 
			
		||||
                    $files['error']['code'] = 'unknownError';
 | 
			
		||||
                    $files['error']['message'] = 'unknownError';
 | 
			
		||||
                }
 | 
			
		||||
                //$files = json_decode( '{"unknownError":{ "stat":'.$arr['stat'].',"message":"'.$arr['body'].'"}}', true);
 | 
			
		||||
                //error_log1(json_encode($files, JSON_PRETTY_PRINT));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //echo '<pre>' . json_encode($files, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
        return $this->files_format($files);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function files_format($files)
 | 
			
		||||
    {
 | 
			
		||||
        if (isset($files['file'])) {
 | 
			
		||||
            $tmp['type'] = 'file';
 | 
			
		||||
            $tmp['id'] = $files['id'];
 | 
			
		||||
            $tmp['name'] = $files['name'];
 | 
			
		||||
            $tmp['time'] = $files['lastModifiedDateTime'];
 | 
			
		||||
            $tmp['size'] = $files['size'];
 | 
			
		||||
            $tmp['mime'] = $files['file']['mimeType'];
 | 
			
		||||
            $tmp['url'] = $files[$this->DownurlStrName];
 | 
			
		||||
            $tmp['content'] = $files['content'];
 | 
			
		||||
        } elseif (isset($files['folder'])) {
 | 
			
		||||
            $tmp['type'] = 'folder';
 | 
			
		||||
            $tmp['id'] = $files['id'];
 | 
			
		||||
            $tmp['name'] = $files['name'];
 | 
			
		||||
            $tmp['time'] = $files['lastModifiedDateTime'];
 | 
			
		||||
            $tmp['size'] = $files['size'];
 | 
			
		||||
            $tmp['childcount'] = $files['folder']['childCount'];
 | 
			
		||||
            $tmp['page'] = $files['folder']['page'];
 | 
			
		||||
            foreach ($files['children'] as $file) {
 | 
			
		||||
                $filename = strtolower($file['name']);
 | 
			
		||||
                if (isset($file['file'])) {
 | 
			
		||||
                    $tmp['list'][$filename]['type'] = 'file';
 | 
			
		||||
                    //var_dump($file);
 | 
			
		||||
                    //echo $file['name'] . ':' . $this->DownurlStrName . ':' . $file[$this->DownurlStrName] . PHP_EOL;
 | 
			
		||||
                    $tmp['list'][$filename]['url'] = $file[$this->DownurlStrName];
 | 
			
		||||
                    $tmp['list'][$filename]['mime'] = $file['file']['mimeType'];
 | 
			
		||||
                } elseif (isset($file['folder'])) {
 | 
			
		||||
                    $tmp['list'][$filename]['type'] = 'folder';
 | 
			
		||||
                }
 | 
			
		||||
                $tmp['list'][$filename]['id'] = $file['id'];
 | 
			
		||||
                $tmp['list'][$filename]['name'] = $file['name'];
 | 
			
		||||
                $tmp['list'][$filename]['time'] = $file['lastModifiedDateTime'];
 | 
			
		||||
                $tmp['list'][$filename]['size'] = $file['size'];
 | 
			
		||||
            }
 | 
			
		||||
        } elseif (isset($files['error'])) {
 | 
			
		||||
            return $files;
 | 
			
		||||
        }
 | 
			
		||||
        //error_log1(json_encode($tmp));
 | 
			
		||||
        return $tmp;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function fetch_files_children($path, $page, $getNextlink = false) {
 | 
			
		||||
        $children = getcache('files_' . $path . '_page_' . $page, $this->disktag);
 | 
			
		||||
        if (!$children) {
 | 
			
		||||
            $url = $this->api_url . $this->ext_api_url;
 | 
			
		||||
            if ($path !== '/') {
 | 
			
		||||
                $url .= ':' . $path;
 | 
			
		||||
                if (substr($url,-1)=='/') $url=substr($url,0,-1);
 | 
			
		||||
                $url .= ':';
 | 
			
		||||
            }
 | 
			
		||||
            $url .= '/children?$top=' . ($page-1)*200 . '&$select=id,name,size,file,folder,parentReference,lastModifiedDateTime,' . $this->DownurlStrName;
 | 
			
		||||
            $children_tmp = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
            //echo $url . '<br><pre>' . json_encode($children_tmp, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
            $p = 1;
 | 
			
		||||
            $i = 0;
 | 
			
		||||
            foreach ($children_tmp['value'] as $child) {
 | 
			
		||||
                $i++;
 | 
			
		||||
                $value_name = 'child_' . $p;
 | 
			
		||||
                ${$value_name}['value'][] = $child;
 | 
			
		||||
                if ($i==200) {
 | 
			
		||||
                    savecache('files_' . $path . '_page_' . $p, ${$value_name}, $this->disktag);
 | 
			
		||||
                    unset(${$value_name});
 | 
			
		||||
                    $i = 0;
 | 
			
		||||
                    $p++;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $url = $children_tmp['@odata.nextLink'];
 | 
			
		||||
            $children_tmp = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
            //echo $url . '<br><pre>' . json_encode($children_tmp, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
            $p = $page;
 | 
			
		||||
            $i = 0;
 | 
			
		||||
            foreach ($children_tmp['value'] as $child) {
 | 
			
		||||
                $i++;
 | 
			
		||||
                $value_name = 'child_' . $p;
 | 
			
		||||
                ${$value_name}['value'][] = $child;
 | 
			
		||||
                if ($i==200) {
 | 
			
		||||
                    savecache('files_' . $path . '_page_' . $p, ${$value_name}, $this->disktag);
 | 
			
		||||
                    //unset(${$value_name});
 | 
			
		||||
                    $i = 0;
 | 
			
		||||
                    $p++;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if ($i!=0) savecache('files_' . $path . '_page_' . $p, ${$value_name}, $this->disktag);
 | 
			
		||||
            $value_name = 'child_' . $page;
 | 
			
		||||
            return ${$value_name};
 | 
			
		||||
        }
 | 
			
		||||
        return $children;
 | 
			
		||||
        
 | 
			
		||||
        /*if ($getNextlink) {
 | 
			
		||||
            if (isset($children['@odata.nextLink'])) {
 | 
			
		||||
                return $children;
 | 
			
		||||
            } else {
 | 
			
		||||
                if ($page*200>9800) {
 | 
			
		||||
                    $children_tmp = fetch_files_children($path, floor($page/49)*49, 1);
 | 
			
		||||
                    $url = $children_tmp['@odata.nextLink'];
 | 
			
		||||
                    $children = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }*/
 | 
			
		||||
    }
 | 
			
		||||
    protected function fetch_files_children1($files, $path, $page)
 | 
			
		||||
    {
 | 
			
		||||
        $maxpage = ceil($files['folder']['childCount']/200);
 | 
			
		||||
        if (!($children = getcache('files_' . $path . '_page_' . $page, $this->disktag))) {
 | 
			
		||||
            $pageinfochange=0;
 | 
			
		||||
            for ($page1=$page;$page1>=1;$page1--) {
 | 
			
		||||
                $page3=$page1-1;
 | 
			
		||||
                $url = getcache('nextlink_' . $path . '_page_' . $page3, $this->disktag);
 | 
			
		||||
                if ($url == '') {
 | 
			
		||||
                    if ($page1==1) {
 | 
			
		||||
                        $url = $this->api_url . $this->ext_api_url;
 | 
			
		||||
                        if ($path !== '/') {
 | 
			
		||||
                            $url .= ':' . $path;
 | 
			
		||||
                            if (substr($url,-1)=='/') $url=substr($url,0,-1);
 | 
			
		||||
                            $url .= ':';
 | 
			
		||||
                        }
 | 
			
		||||
                        $url .= '/children?$select=id,name,size,file,folder,parentReference,lastModifiedDateTime,'.$this->DownurlStrName;
 | 
			
		||||
                        $children = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
                        // echo $url . '<br><pre>' . json_encode($children, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
                        savecache('files_' . $path . '_page_' . $page1, $children, $this->disktag);
 | 
			
		||||
                        $nextlink=getcache('nextlink_' . $path . '_page_' . $page1, $this->disktag);
 | 
			
		||||
                        if ($nextlink!=$children['@odata.nextLink']) {
 | 
			
		||||
                            savecache('nextlink_' . $path . '_page_' . $page1, $children['@odata.nextLink'], $this->disktag);
 | 
			
		||||
                            $pageinfocache['nextlink_' . $path . '_page_' . $page1] = $children['@odata.nextLink'];
 | 
			
		||||
                            $pageinfocache = clearbehindvalue($path,$page1,$maxpage,$pageinfocache);
 | 
			
		||||
                            $pageinfochange = 1;
 | 
			
		||||
                        }
 | 
			
		||||
                        $url = $children['@odata.nextLink'];
 | 
			
		||||
                        for ($page2=$page1+1;$page2<=$page;$page2++) {
 | 
			
		||||
                            sleep(1);
 | 
			
		||||
                            $children = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
                            savecache('files_' . $path . '_page_' . $page2, $children, $this->disktag);
 | 
			
		||||
                            $nextlink=getcache('nextlink_' . $path . '_page_' . $page2, $this->disktag);
 | 
			
		||||
                            if ($nextlink!=$children['@odata.nextLink']) {
 | 
			
		||||
                                savecache('nextlink_' . $path . '_page_' . $page2, $children['@odata.nextLink'], $this->disktag);
 | 
			
		||||
                                $pageinfocache['nextlink_' . $path . '_page_' . $page2] = $children['@odata.nextLink'];
 | 
			
		||||
                                $pageinfocache = clearbehindvalue($path,$page2,$maxpage,$pageinfocache);
 | 
			
		||||
                                $pageinfochange = 1;
 | 
			
		||||
                            }
 | 
			
		||||
                            $url = $children['@odata.nextLink'];
 | 
			
		||||
                        }
 | 
			
		||||
                        //echo $url . '<br><pre>' . json_encode($children, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
                        return $children;
 | 
			
		||||
                        /*
 | 
			
		||||
                        $files['children'] = $children['value'];
 | 
			
		||||
                        $files['folder']['page']=$page;
 | 
			
		||||
                        $pageinfocache['filenum'] = $files['folder']['childCount'];
 | 
			
		||||
                        $pageinfocache['dirsize'] = $files['size'];
 | 
			
		||||
                        $pageinfocache['cachesize'] = $cachefile['size'];
 | 
			
		||||
                        $pageinfocache['size'] = $files['size']-$cachefile['size'];
 | 
			
		||||
                        if ($pageinfochange == 1) $this->MSAPI('PUT', path_format($path.'/'.$cachefilename), json_encode($pageinfocache, JSON_PRETTY_PRINT), $this->access_token)['body'];
 | 
			
		||||
                        return $files;*/
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    for ($page2=$page3+1;$page2<=$page;$page2++) {
 | 
			
		||||
                        sleep(1);
 | 
			
		||||
                        $children = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
                        savecache('files_' . $path . '_page_' . $page2, $children, $this->disktag, 3300);
 | 
			
		||||
                        $nextlink=getcache('nextlink_' . $path . '_page_' . $page2, $this->disktag);
 | 
			
		||||
                        if ($nextlink!=$children['@odata.nextLink']) {
 | 
			
		||||
                            savecache('nextlink_' . $path . '_page_' . $page2, $children['@odata.nextLink'], $this->disktag, 3300);
 | 
			
		||||
                            $pageinfocache['nextlink_' . $path . '_page_' . $page2] = $children['@odata.nextLink'];
 | 
			
		||||
                            $pageinfocache = clearbehindvalue($path,$page2,$maxpage,$pageinfocache);
 | 
			
		||||
                            $pageinfochange = 1;
 | 
			
		||||
                        }
 | 
			
		||||
                        $url = $children['@odata.nextLink'];
 | 
			
		||||
                    }
 | 
			
		||||
                    //echo $url . '<br><pre>' . json_encode($children, JSON_PRETTY_PRINT) . '</pre>';
 | 
			
		||||
                    return $children;
 | 
			
		||||
 | 
			
		||||
                    /*$files['children'] = $children['value'];
 | 
			
		||||
                    $files['folder']['page']=$page;
 | 
			
		||||
                    $pageinfocache['filenum'] = $files['folder']['childCount'];
 | 
			
		||||
                    $pageinfocache['dirsize'] = $files['size'];
 | 
			
		||||
                    $pageinfocache['cachesize'] = $cachefile['size'];
 | 
			
		||||
                    $pageinfocache['size'] = $files['size']-$cachefile['size'];
 | 
			
		||||
                    if ($pageinfochange == 1) $this->MSAPI('PUT', path_format($path.'/'.$cachefilename), json_encode($pageinfocache, JSON_PRETTY_PRINT), $this->access_token)['body'];
 | 
			
		||||
                    return $files;*/
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }/* else {
 | 
			
		||||
            $files['folder']['page']=$page;
 | 
			
		||||
            for ($page4=1;$page4<=$maxpage;$page4++) {
 | 
			
		||||
                if (!($url = getcache('nextlink_' . $path . '_page_' . $page4, $this->disktag))) {
 | 
			
		||||
                    if ($files['folder'][$path.'_'.$page4]!='') savecache('nextlink_' . $path . '_page_' . $page4, $files['folder'][$path.'_'.$page4], $this->disktag);
 | 
			
		||||
                } else {
 | 
			
		||||
                    $files['folder'][$path.'_'.$page4] = $url;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }*/
 | 
			
		||||
        return $children;
 | 
			
		||||
        //return $files;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function Rename($file, $newname) {
 | 
			
		||||
        $oldname = spurlencode($file['name']);
 | 
			
		||||
        $oldname = path_format($file['path'] . '/' . $oldname);
 | 
			
		||||
        $data = '{"name":"' . $newname . '"}';
 | 
			
		||||
                //echo $oldname;
 | 
			
		||||
        $result = $this->MSAPI('PATCH', $oldname, $data, $this->access_token);
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Delete($file) {
 | 
			
		||||
        $filename = spurlencode($file['name']);
 | 
			
		||||
        $filename = path_format($file['path'] . '/' . $filename);
 | 
			
		||||
                //echo $filename;
 | 
			
		||||
        $result = $this->MSAPI('DELETE', $filename, '', $this->access_token);
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Encrypt($folder, $passfilename, $pass) {
 | 
			
		||||
        $filename = path_format($folder['path'] . '/' . urlencode($passfilename));
 | 
			
		||||
        if ($pass==='') {
 | 
			
		||||
            $result = $this->MSAPI('DELETE', $filename, '', $this->access_token);
 | 
			
		||||
        } else {
 | 
			
		||||
            $result = $this->MSAPI('PUT', $filename, $pass, $this->access_token);
 | 
			
		||||
        }
 | 
			
		||||
        $path1 = $folder['path'];
 | 
			
		||||
        if ($path1!='/'&&substr($path1, -1)=='/') $path1 = substr($path1, 0, -1);
 | 
			
		||||
        savecache('path_' . $path1 . '/?password', '', $this->disktag, 1);
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Move($file, $folder) {
 | 
			
		||||
        $filename = spurlencode($file['name']);
 | 
			
		||||
        $filename = path_format($file['path'] . '/' . $filename);
 | 
			
		||||
        $data = '{"parentReference":{"path": "/drive/root:' . $folder['path'] . '"}}';
 | 
			
		||||
        $result = $this->MSAPI('PATCH', $filename, $data, $this->access_token);
 | 
			
		||||
        $path2 = spurlencode($folder['path'], '/');
 | 
			
		||||
        if ($path2!='/'&&substr($path2, -1)=='/') $path2 = substr($path2, 0, -1);
 | 
			
		||||
        savecache('path_' . $path2, json_decode('{}', true), $this->disktag, 1);
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Copy($file) {
 | 
			
		||||
        $filename = spurlencode($file['name']);
 | 
			
		||||
        $filename = path_format($file['path'] . '/' . $filename);
 | 
			
		||||
        $namearr = splitlast($file['name'], '.');
 | 
			
		||||
        date_default_timezone_set('UTC');
 | 
			
		||||
        if ($namearr[0]!='') {
 | 
			
		||||
            $newname = $namearr[0] . ' (' . date("Ymd\THis\Z") . ')';
 | 
			
		||||
            if ($namearr[1]!='') $newname .= '.' . $namearr[1];
 | 
			
		||||
        } else {
 | 
			
		||||
            $newname = '.' . $namearr[1] . ' (' . date("Ymd\THis\Z") . ')';
 | 
			
		||||
        }
 | 
			
		||||
        $data = '{ "name": "' . $newname . '" }';
 | 
			
		||||
        $result = $this->MSAPI('copy', $filename, $data, $this->access_token);
 | 
			
		||||
        /*$num = 0;
 | 
			
		||||
        while ($result['stat']==409 && json_decode($result['body'], true)['error']['code']=='nameAlreadyExists') {
 | 
			
		||||
            $num++;
 | 
			
		||||
            if ($namearr[0]!='') {
 | 
			
		||||
                $newname = $namearr[0] . ' (' . getconstStr('Copy') . ' ' . $num . ')';
 | 
			
		||||
                if ($namearr[1]!='') $newname .= '.' . $namearr[1];
 | 
			
		||||
            } else {
 | 
			
		||||
                $newname = '.' . $namearr[1] . ' ('.getconstStr('Copy'). ' ' . $num .')';
 | 
			
		||||
            }
 | 
			
		||||
            //$newname = spurlencode($newname);
 | 
			
		||||
            $data = '{ "name": "' . $newname . '" }';
 | 
			
		||||
            $result = $this->MSAPI('copy', $filename, $data, $this->access_token);
 | 
			
		||||
        }*/
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
    public function Edit($file, $content) {
 | 
			
		||||
        /*TXT一般不会超过4M,不用二段上传
 | 
			
		||||
        $filename = $path1 . ':/createUploadSession';
 | 
			
		||||
        $response=MSAPI('POST',$filename,'{"item": { "@microsoft.graph.conflictBehavior": "replace"  }}',$_SERVER['access_token']);
 | 
			
		||||
        $uploadurl=json_decode($response,true)['uploadUrl'];
 | 
			
		||||
        echo MSAPI('PUT',$uploadurl,$data,$_SERVER['access_token']);*/
 | 
			
		||||
        $result = $this->MSAPI('PUT', $file['path'], $content, $this->access_token);
 | 
			
		||||
        //return output($result['body'], $result['stat']);
 | 
			
		||||
        //echo $result;
 | 
			
		||||
        $resultarry = json_decode($result['body'],true);
 | 
			
		||||
        if (isset($resultarry['error'])) return message($resultarry['error']['message']. '<hr><a href="javascript:history.back(-1)">'.getconstStr('Back').'</a>','Error', 403);
 | 
			
		||||
        else return output('success', 0);
 | 
			
		||||
    }
 | 
			
		||||
    public function Create($parent, $type, $name, $content = '') {
 | 
			
		||||
        if ($type=='file') {
 | 
			
		||||
            $filename = spurlencode($name);
 | 
			
		||||
            $filename = path_format($parent['path'] . '/' . $filename);
 | 
			
		||||
            $result = $this->MSAPI('PUT', $filename, $content, $this->access_token);
 | 
			
		||||
        }
 | 
			
		||||
        if ($type=='folder') {
 | 
			
		||||
            $data = '{ "name": "' . $name . '",  "folder": { },  "@microsoft.graph.conflictBehavior": "rename" }';
 | 
			
		||||
            $result = $this->MSAPI('children', $parent['path'], $data, $this->access_token);
 | 
			
		||||
        }
 | 
			
		||||
        //savecache('path_' . $path1, json_decode('{}',true), $_SERVER['disktag'], 1);
 | 
			
		||||
        return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
 | 
			
		||||
        return output($result['body'], $result['stat']);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function AddDisk() {
 | 
			
		||||
        global $constStr;
 | 
			
		||||
        global $EnvConfigs;
 | 
			
		||||
 | 
			
		||||
        $envs = '';
 | 
			
		||||
        foreach ($EnvConfigs as $env => $v) if (isCommonEnv($env)) $envs .= '\'' . $env . '\', ';
 | 
			
		||||
        $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
			
		||||
        //$this->api_url = splitfirst($_SERVER['api_url'], '/v1.0')[0] . '/v1.0';
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['Finish'])) {
 | 
			
		||||
            if ($this->access_token == '') {
 | 
			
		||||
                $refresh_token = getConfig('refresh_token', $this->disktag);
 | 
			
		||||
                if (!$refresh_token) {
 | 
			
		||||
                    $html = 'No refresh_token config, please AddDisk again or wait minutes.<br>' . $this->disktag;
 | 
			
		||||
                    $title = 'Error';
 | 
			
		||||
                    return message($html, $title, 201);
 | 
			
		||||
                }
 | 
			
		||||
                $response = $this->get_access_token($refresh_token);
 | 
			
		||||
                if (isset($response['stat'])) return message($response['body'], 'Error', $response['stat']);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $tmp = null;
 | 
			
		||||
            if ($_POST['DriveType']=='Onedrive') {
 | 
			
		||||
                /*$api = $this->api_url . '/me';
 | 
			
		||||
                $arr = curl('GET', $api, '', [ 'Authorization' => 'Bearer ' . $this->access_token ], 1);
 | 
			
		||||
                if ($arr['stat']==200) {
 | 
			
		||||
                    $userid = json_decode($arr['body'], true)['id'];
 | 
			
		||||
                    $api = $this->api_url . '/users/' . $userid . '/drive';
 | 
			
		||||
                    $arr = curl('GET', $api, '', [ 'Authorization' => 'Bearer ' . $this->access_token ], 1);
 | 
			
		||||
                    if ($arr['stat']!=200) return message($arr['stat'] . '<br>' . $api . '<br>' . $arr['body'], 'Get User Drive ID', $arr['stat']);
 | 
			
		||||
                    $tmp['DriveId'] = json_decode($arr['body'], true)['id'];
 | 
			
		||||
                } elseif ($arr['stat']==403||$arr['stat']==401) {
 | 
			
		||||
                    // 403:世纪不让列me,401:个人也不给拿
 | 
			
		||||
                    $api = $this->api_url . '/me/drive';
 | 
			
		||||
                } else {
 | 
			
		||||
                    return message($arr['stat'] . $arr['body'], 'Get User ID', $arr['stat']);
 | 
			
		||||
                }*/
 | 
			
		||||
                if (get_class($this)=='Sharepoint') $tmp['Driver'] = 'Onedrive';
 | 
			
		||||
                elseif (get_class($this)=='SharepointCN') $tmp['Driver'] = 'OnedriveCN';
 | 
			
		||||
                $tmp['sharepointSite'] = '';
 | 
			
		||||
                $tmp['siteid'] = '';
 | 
			
		||||
            } elseif ($_POST['DriveType']=='Custom') {
 | 
			
		||||
                // sitename计算siteid
 | 
			
		||||
                $tmp1 = $this->get_siteid($_POST['sharepointSite']);
 | 
			
		||||
                if (isset($tmp1['stat'])) return message($arr['stat'] . $tmp1['body'], 'Get Sharepoint Site ID ' . $_POST['sharepointSite'], $tmp1['stat']);
 | 
			
		||||
                $siteid = $tmp1;
 | 
			
		||||
                //$api = $this->api_url . '/sites/' . $siteid . '/drive/';
 | 
			
		||||
                //$arr = curl('GET', $api, '', [ 'Authorization' => 'Bearer ' . $this->access_token ], 1);
 | 
			
		||||
                //if ($arr['stat']!=200) return message($arr['stat'] . $arr['body'], 'Get Sharepoint Drive ID ' . $_POST['DriveType'], $arr['stat']);
 | 
			
		||||
                $tmp['siteid'] = $siteid;
 | 
			
		||||
                $tmp['sharepointSite'] = $_POST['sharepointSite'];
 | 
			
		||||
                if (get_class($this)=='Onedrive') $tmp['Driver'] = 'Sharepoint';
 | 
			
		||||
                elseif (get_class($this)=='OnedriveCN') $tmp['Driver'] = 'SharepointCN';
 | 
			
		||||
            } else {
 | 
			
		||||
                // 直接是siteid
 | 
			
		||||
                $tmp['siteid'] = $_POST['DriveType'];
 | 
			
		||||
                $tmp['sharepointSite'] = $_POST['sharepointSiteUrl'];
 | 
			
		||||
                if (get_class($this)=='Onedrive') $tmp['Driver'] = 'Sharepoint';
 | 
			
		||||
                elseif (get_class($this)=='OnedriveCN') $tmp['Driver'] = 'SharepointCN';
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $response = setConfigResponse( setConfig($tmp, $this->disktag) );
 | 
			
		||||
            if (api_error($response)) {
 | 
			
		||||
                $html = api_error_msg($response);
 | 
			
		||||
                $title = 'Error';
 | 
			
		||||
                return message($html, $title, 201);
 | 
			
		||||
            } else {
 | 
			
		||||
                $str .= '<meta http-equiv="refresh" content="5;URL=' . $url . '">
 | 
			
		||||
                <script>
 | 
			
		||||
                var expd = new Date();
 | 
			
		||||
                expd.setTime(expd.getTime()+1);
 | 
			
		||||
                var expires = "expires="+expd.toGMTString();
 | 
			
		||||
                document.cookie=\'disktag=; path=/; \'+expires;
 | 
			
		||||
                </script>';
 | 
			
		||||
                return message($str, getconstStr('WaitJumpIndex'), 201);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['SelectDrive'])) {
 | 
			
		||||
            if (get_class($this)=='Sharelink') return message('Can not change to other.', 'Back', 201);
 | 
			
		||||
            if ($this->access_token == '') {
 | 
			
		||||
                $refresh_token = getConfig('refresh_token', $this->disktag);
 | 
			
		||||
                if (!$refresh_token) {
 | 
			
		||||
                    $html = 'No refresh_token config, please AddDisk again or wait minutes.<br>' . $this->disktag;
 | 
			
		||||
                    $title = 'Error';
 | 
			
		||||
                    return message($html, $title, 201);
 | 
			
		||||
                }
 | 
			
		||||
                $response = $this->get_access_token($refresh_token);
 | 
			
		||||
                if (isset($response['stat'])) return message($response['body'], 'Error', $response['stat']);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $api = $this->api_url . '/sites/root';
 | 
			
		||||
            $arr = curl('GET', $api, '', [ 'Authorization' => 'Bearer ' . $this->access_token ]);
 | 
			
		||||
            $Tenant = json_decode($arr['body'], true)['webUrl'];
 | 
			
		||||
 | 
			
		||||
            $api = $this->api_url . '/me/followedSites';
 | 
			
		||||
            $arr = curl('GET', $api, '', [ 'Authorization' => 'Bearer ' . $this->access_token ]);
 | 
			
		||||
            if (!($arr['stat']==200||$arr['stat']==403||$arr['stat']==400||$arr['stat']==404)) return message($arr['stat'] . json_encode(json_decode($arr['body']), JSON_PRETTY_PRINT), 'Get followedSites', $arr['stat']);
 | 
			
		||||
            error_log1($arr['body']);
 | 
			
		||||
            $sites = json_decode($arr['body'], true)['value'];
 | 
			
		||||
 | 
			
		||||
            $title = 'Select Driver';
 | 
			
		||||
            $html = '
 | 
			
		||||
<div>
 | 
			
		||||
    <form action="?Finish&disktag=' . $_GET['disktag'] . '&AddDisk=' . get_class($this) . '" method="post" onsubmit="return notnull(this);">
 | 
			
		||||
        <label><input type="radio" name="DriveType" value="Onedrive" checked>' . 'Use Onedrive ' . getconstStr(' ') . '</label><br>';
 | 
			
		||||
            if ($sites[0]!='') foreach ($sites as $k => $v) {
 | 
			
		||||
                $html .= '
 | 
			
		||||
        <label>
 | 
			
		||||
            <input type="radio" name="DriveType" value="' . $v['id'] . '" onclick="document.getElementById(\'sharepointSiteUrl\').value=\'' . $v['webUrl'] . '\';">' . 'Use Sharepoint: <br><div style="width:100%;margin:0px 35px">webUrl: ' . $v['webUrl'] . '<br>siteid: ' . $v['id'] . '</div>
 | 
			
		||||
        </label>';
 | 
			
		||||
            }
 | 
			
		||||
            $html .= '
 | 
			
		||||
        <input type="hidden" id="sharepointSiteUrl" name="sharepointSiteUrl" value="">
 | 
			
		||||
        <label>
 | 
			
		||||
            <input type="radio" name="DriveType" value="Custom" id="Custom">' . 'Use Other Sharepoint:' . getconstStr(' ') . '<br>
 | 
			
		||||
            <div style="width:100%;margin:0px 35px"><a href="' . $Tenant . '/_layouts/15/sharepoint.aspx" target="_blank">' . getconstStr('GetSharepointSiteAddress') . '</a><br>
 | 
			
		||||
                <input type="text" name="sharepointSite" style="width:100%;" placeholder="' . getconstStr('InputSharepointSiteAddress') . '" onclick="document.getElementById(\'Custom\').checked=\'checked\';">
 | 
			
		||||
            </div>
 | 
			
		||||
        </label><br>
 | 
			
		||||
        ';
 | 
			
		||||
            $html .= '
 | 
			
		||||
        <input type="submit" value="' . getconstStr('Submit') . '">
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
<script>
 | 
			
		||||
        function notnull(t)
 | 
			
		||||
        {
 | 
			
		||||
            if (t.DriveType.value==\'\') {
 | 
			
		||||
                    alert(\'Select a Disk\');
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (t.DriveType.value==\'Custom\') {
 | 
			
		||||
                if (t.sharepointSite.value==\'\') {
 | 
			
		||||
                    alert(\'sharepoint Site Address\');
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
    </script>
 | 
			
		||||
    ';
 | 
			
		||||
            return message($html, $title, 201);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['install2']) && isset($_GET['code'])) {
 | 
			
		||||
            $tmp = curl('POST', $this->oauth_url . 'token', 'client_id=' . $this->client_id .'&client_secret=' . $this->client_secret . '&grant_type=authorization_code&requested_token_use=on_behalf_of&redirect_uri=' . $this->redirect_uri . '&code=' . $_GET['code']);
 | 
			
		||||
            if ($tmp['stat']==200) $ret = json_decode($tmp['body'], true);
 | 
			
		||||
            if (isset($ret['refresh_token'])) {
 | 
			
		||||
                $refresh_token = $ret['refresh_token'];
 | 
			
		||||
                $str = '
 | 
			
		||||
        refresh_token :<br>';
 | 
			
		||||
                $str .= '
 | 
			
		||||
        <textarea readonly style="width: 95%">' . $refresh_token . '</textarea><br><br>
 | 
			
		||||
        ' . getconstStr('SavingToken') . '
 | 
			
		||||
        <script>
 | 
			
		||||
            var texta=document.getElementsByTagName(\'textarea\');
 | 
			
		||||
            for(i=0;i<texta.length;i++) {
 | 
			
		||||
                texta[i].style.height = texta[i].scrollHeight + \'px\';
 | 
			
		||||
            }
 | 
			
		||||
        </script>';
 | 
			
		||||
                $tmptoken['refresh_token'] = $refresh_token;
 | 
			
		||||
                $tmptoken['token_expires'] = time()+7*24*60*60;
 | 
			
		||||
                $response = setConfigResponse( setConfig($tmptoken, $this->disktag) );
 | 
			
		||||
                if (api_error($response)) {
 | 
			
		||||
                    $html = api_error_msg($response);
 | 
			
		||||
                    $title = 'Error';
 | 
			
		||||
                    return message($html, $title, 201);
 | 
			
		||||
                } else {
 | 
			
		||||
                    savecache('access_token', $ret['access_token'], $this->disktag, $ret['expires_in'] - 60);
 | 
			
		||||
                    $str .= '
 | 
			
		||||
                <meta http-equiv="refresh" content="3;URL=' . $url . '?AddDisk=' . get_class($this) . '&disktag=' . $_GET['disktag'] . '&SelectDrive">';
 | 
			
		||||
                    return message($str, getconstStr('Wait') . ' 3s', 201);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return message('<pre>' . json_encode(json_decode($tmp['body']), JSON_PRETTY_PRINT) . '</pre>', $tmp['stat']);
 | 
			
		||||
            //return message('<pre>' . json_encode($ret, JSON_PRETTY_PRINT) . '</pre>', 500);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['install1'])) {
 | 
			
		||||
            if (get_class($this)=='Onedrive' || get_class($this)=='OnedriveCN') {
 | 
			
		||||
                return message('
 | 
			
		||||
    <a href="" id="a1">' . getconstStr('JumptoOffice') . '</a>
 | 
			
		||||
    <script>
 | 
			
		||||
        url=location.protocol + "//" + location.host + "' . $url . '?install2&disktag=' . $_GET['disktag'] . '&AddDisk=' . get_class($this) . '";
 | 
			
		||||
        url="' . $this->oauth_url . 'authorize?scope=' . $this->scope . '&response_type=code&client_id=' . $this->client_id . '&redirect_uri=' . $this->redirect_uri . '&state=' . '"+encodeURIComponent(url);
 | 
			
		||||
        document.getElementById(\'a1\').href=url;
 | 
			
		||||
        //window.open(url,"_blank");
 | 
			
		||||
        location.href = url;
 | 
			
		||||
    </script>
 | 
			
		||||
    ', getconstStr('Wait') . ' 1s', 201);
 | 
			
		||||
            } else {
 | 
			
		||||
                return message('Something error, retry after a few seconds.', 'Retry', 201);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (isset($_GET['install0'])) {
 | 
			
		||||
            if ($_POST['disktag_add']!='') {
 | 
			
		||||
                $_POST['disktag_add'] = preg_replace('/[^0-9a-zA-Z|_]/i', '', $_POST['disktag_add']);
 | 
			
		||||
                $f = substr($_POST['disktag_add'], 0, 1);
 | 
			
		||||
                if (strlen($_POST['disktag_add'])==1) $_POST['disktag_add'] .= '_';
 | 
			
		||||
                if (isCommonEnv($_POST['disktag_add'])) {
 | 
			
		||||
                    return message('Do not input ' . $envs . '<br><button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>', 'Error', 201);
 | 
			
		||||
                } elseif (!(('a'<=$f && $f<='z') || ('A'<=$f && $f<='Z'))) {
 | 
			
		||||
                    return message('Please start with letters<br><button onclick="location.href = location.href;">'.getconstStr('Refresh').'</button>
 | 
			
		||||
                    <script>
 | 
			
		||||
                    var expd = new Date();
 | 
			
		||||
                    expd.setTime(expd.getTime()+1);
 | 
			
		||||
                    var expires = "expires="+expd.toGMTString();
 | 
			
		||||
                    document.cookie=\'disktag=; path=/; \'+expires;
 | 
			
		||||
                    </script>', 'Error', 201);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                $tmp = null;
 | 
			
		||||
                // clear envs
 | 
			
		||||
                foreach ($EnvConfigs as $env => $v) if (isInnerEnv($env)) $tmp[$env] = '';
 | 
			
		||||
 | 
			
		||||
                //$this->disktag = $_POST['disktag_add'];
 | 
			
		||||
                $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
			
		||||
                $tmp['diskname'] = $_POST['diskname'];
 | 
			
		||||
                $tmp['Driver'] = $_POST['Drive_ver'];
 | 
			
		||||
                if ($_POST['Drive_ver']=='Sharelink') {
 | 
			
		||||
                    $tmp['shareurl'] = $_POST['shareurl'];
 | 
			
		||||
                } else {
 | 
			
		||||
                    if ($_POST['Drive_ver']=='Onedrive' && $_POST['NT_Drive_custom']=='on') {
 | 
			
		||||
                        $tmp['client_id'] = $_POST['NT_client_id'];
 | 
			
		||||
                        $tmp['client_secret'] = $_POST['NT_client_secret'];
 | 
			
		||||
                    } elseif ($_POST['Drive_ver']=='OnedriveCN' && $_POST['CN_Drive_custom']=='on') {
 | 
			
		||||
                        $tmp['client_id'] = $_POST['CN_client_id'];
 | 
			
		||||
                        $tmp['client_secret'] = $_POST['CN_client_secret'];
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                $response = setConfigResponse( setConfig($tmp, $this->disktag) );
 | 
			
		||||
                if (api_error($response)) {
 | 
			
		||||
                    $html = api_error_msg($response);
 | 
			
		||||
                    $title = 'Error';
 | 
			
		||||
                } else {
 | 
			
		||||
                    $title = getconstStr('MayinEnv');
 | 
			
		||||
                    $html = getconstStr('Wait') . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '?install1&disktag=' . $_GET['disktag'] . '&AddDisk=' . $_POST['Drive_ver'] . '">';
 | 
			
		||||
                    if ($_POST['Drive_ver']=='Sharelink') $html = getconstStr('Wait') . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '">';
 | 
			
		||||
                }
 | 
			
		||||
                return message($html, $title, 201);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $html = '
 | 
			
		||||
<div>
 | 
			
		||||
    <form id="form1" action="" method="post" onsubmit="return notnull(this);">
 | 
			
		||||
        ' . getconstStr('DiskTag') . ': (' . getConfig('disktag') . ')
 | 
			
		||||
        <input type="text" name="disktag_add" placeholder="' . getconstStr('EnvironmentsDescription')['disktag'] . '" style="width:100%"><br>
 | 
			
		||||
        ' . getconstStr('DiskName') . ':
 | 
			
		||||
        <input type="text" name="diskname" placeholder="' . getconstStr('EnvironmentsDescription')['diskname'] . '" style="width:100%"><br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <div>
 | 
			
		||||
            <label><input type="radio" name="Drive_ver" value="Onedrive" onclick="document.getElementById(\'NT_custom\').style.display=\'\';document.getElementById(\'CN_custom\').style.display=\'none\';document.getElementById(\'inputshareurl\').style.display=\'none\';">MS: ' . getconstStr('DriveVerMS') . '</label><br>
 | 
			
		||||
            <div id="NT_custom" style="display:none;margin:0px 35px">
 | 
			
		||||
                <label><input type="checkbox" name="NT_Drive_custom" onclick="document.getElementById(\'NT_secret\').style.display=(this.checked?\'\':\'none\');">' . getconstStr('CustomIdSecret') . '</label><br>
 | 
			
		||||
                <div id="NT_secret" style="display:none;margin:10px 35px">
 | 
			
		||||
                    <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps" target="_blank">' . getconstStr('GetSecretIDandKEY') . '</a><br>
 | 
			
		||||
                    return_uri(Reply URL):<br>https://scfonedrive.github.io/<br>
 | 
			
		||||
                    client_id:<input type="text" name="NT_client_id" style="width:100%" placeholder="a1b2c345-90ab-cdef-ghij-klmnopqrstuv"><br>
 | 
			
		||||
                    client_secret:<input type="text" name="NT_client_secret" style="width:100%"><br>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div><br>
 | 
			
		||||
            <label><input type="radio" name="Drive_ver" value="OnedriveCN" onclick="document.getElementById(\'CN_custom\').style.display=\'\';document.getElementById(\'NT_custom\').style.display=\'none\';document.getElementById(\'inputshareurl\').style.display=\'none\';">CN: ' . getconstStr('DriveVerCN') . '</label><br>
 | 
			
		||||
            <div id="CN_custom" style="display:none;margin:0px 35px">
 | 
			
		||||
                <label><input type="checkbox" name="CN_Drive_custom" onclick="document.getElementById(\'CN_secret\').style.display=(this.checked?\'\':\'none\');">' . getconstStr('CustomIdSecret') . '</label><br>
 | 
			
		||||
                <div id="CN_secret" style="display:none;margin:10px 35px">
 | 
			
		||||
                    <a href="https://portal.azure.cn/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps" target="_blank">' . getconstStr('GetSecretIDandKEY') . '</a><br>
 | 
			
		||||
                    return_uri(Reply URL):<br>https://scfonedrive.github.io/<br>
 | 
			
		||||
                    client_id:<input type="text" name="CN_client_id" style="width:100%" placeholder="a1b2c345-90ab-cdef-ghij-klmnopqrstuv"><br>
 | 
			
		||||
                    client_secret:<input type="text" name="CN_client_secret" style="width:100%"><br>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div><br>
 | 
			
		||||
            <label><input type="radio" name="Drive_ver" value="Sharelink" onclick="document.getElementById(\'CN_custom\').style.display=\'none\';document.getElementById(\'inputshareurl\').style.display=\'\';document.getElementById(\'NT_custom\').style.display=\'none\';">Sharelink: ' . getconstStr('DriveVerShareurl') . '</label><br>
 | 
			
		||||
            <div id="inputshareurl" style="display:none;margin:0px 35px">
 | 
			
		||||
                ' . getconstStr('UseShareLink') . '
 | 
			
		||||
                <input type="text" name="shareurl" style="width:100%" placeholder="https://xxxx.sharepoint.com/:f:/g/personal/xxxxxxxx/mmmmmmmmm?e=XXXX"><br>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <br>';
 | 
			
		||||
        if ($_SERVER['language']=='zh-cn') $html .= '你要理解 scfonedrive.github.io 是github上的静态网站,<br>除非github真的挂掉了,<br>不然,稍后你如果连不上,请检查你的运营商或其它“你懂的”问题!<br>';
 | 
			
		||||
        $html .='
 | 
			
		||||
        <input type="submit" value="' . getconstStr('Submit') . '">
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
    <script>
 | 
			
		||||
        function notnull(t)
 | 
			
		||||
        {
 | 
			
		||||
            if (t.disktag_add.value==\'\') {
 | 
			
		||||
                alert(\'' . getconstStr('DiskTag') . '\');
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            envs = [' . $envs . '];
 | 
			
		||||
            if (envs.indexOf(t.disktag_add.value)>-1) {
 | 
			
		||||
                alert("Do not input ' . $envs . '");
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            var reg = /^[a-zA-Z]([_a-zA-Z0-9]{1,20})$/;
 | 
			
		||||
            if (!reg.test(t.disktag_add.value)) {
 | 
			
		||||
                alert(\'' . getconstStr('TagFormatAlert') . '\');
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (t.Drive_ver.value==\'\') {
 | 
			
		||||
                    alert(\'Select a Driver\');
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (t.Drive_ver.value==\'Sharelink\') {
 | 
			
		||||
                if (t.shareurl.value==\'\') {
 | 
			
		||||
                    alert(\'shareurl\');
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            } else {
 | 
			
		||||
                if ((t.Drive_ver.value==\'Onedrive\') && t.NT_Drive_custom.checked==true) {
 | 
			
		||||
                    if (t.NT_client_secret.value==\'\'||t.NT_client_id.value==\'\') {
 | 
			
		||||
                        alert(\'client_id & client_secret\');
 | 
			
		||||
                        return false;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                if ((t.Drive_ver.value==\'OnedriveCN\') && t.CN_Drive_custom.checked==true) {
 | 
			
		||||
                    if (t.CN_client_secret.value==\'\'||t.CN_client_id.value==\'\') {
 | 
			
		||||
                        alert(\'client_id & client_secret\');
 | 
			
		||||
                        return false;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            document.getElementById("form1").action="?install0&disktag=" + t.disktag_add.value + "&AddDisk=" + t.Drive_ver.value;
 | 
			
		||||
            //var expd = new Date();
 | 
			
		||||
            //expd.setTime(expd.getTime()+(2*60*60*1000));
 | 
			
		||||
            //var expires = "expires="+expd.toGMTString();
 | 
			
		||||
            //document.cookie=\'disktag=\'+t.disktag_add.value+\'; path=/; \'+expires;
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
    </script>';
 | 
			
		||||
        $title = 'Select Account Type';
 | 
			
		||||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function get_access_token($refresh_token) {
 | 
			
		||||
        if (!($this->access_token = getcache('access_token', $this->disktag))) {
 | 
			
		||||
            $p=0;
 | 
			
		||||
            while ($response['stat']==0&&$p<3) {
 | 
			
		||||
                $response = curl('POST', $this->oauth_url . 'token', 'client_id=' . $this->client_id . '&client_secret=' . $this->client_secret . '&grant_type=refresh_token&requested_token_use=on_behalf_of&refresh_token=' . $refresh_token );
 | 
			
		||||
                $p++;
 | 
			
		||||
            }
 | 
			
		||||
            if ($response['stat']==200) $ret = json_decode($response['body'], true);
 | 
			
		||||
            if (!isset($ret['access_token'])) {
 | 
			
		||||
                error_log1($this->oauth_url . 'token' . '?client_id=' . $this->client_id . '&client_secret=' . $this->client_secret . '&grant_type=refresh_token&requested_token_use=on_behalf_of&refresh_token=' . substr($refresh_token, 0, 20) . '******' . substr($refresh_token, -20));
 | 
			
		||||
                error_log1('failed to get [' . $this->disktag . '] access_token. response' . json_encode($ret));
 | 
			
		||||
                $response['body'] = json_encode(json_decode($response['body']), JSON_PRETTY_PRINT);
 | 
			
		||||
                $response['body'] .= '\nfailed to get [' . $this->disktag . '] access_token.';
 | 
			
		||||
                return $response;
 | 
			
		||||
                //throw new Exception($response['stat'].', failed to get ['.$this->disktag.'] access_token.'.$response['body']);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp = $ret;
 | 
			
		||||
            $tmp['access_token'] = '******';
 | 
			
		||||
            $tmp['refresh_token'] = '******';
 | 
			
		||||
            error_log1('[' . $this->disktag . '] Get access token:' . json_encode($tmp, JSON_PRETTY_PRINT));
 | 
			
		||||
            $this->access_token = $ret['access_token'];
 | 
			
		||||
            savecache('access_token', $this->access_token, $this->disktag, $ret['expires_in'] - 300);
 | 
			
		||||
            if (time()>getConfig('token_expires', $this->disktag)) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ], $this->disktag);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function get_siteid($sharepointSite)
 | 
			
		||||
    {
 | 
			
		||||
        //$sharepointSite = getConfig('sharepointSite', $this->disktag);
 | 
			
		||||
        while (substr($sharepointSite, -1)=='/') $sharepointSite = substr($sharepointSite, 0, -1);
 | 
			
		||||
        $tmp = splitlast($sharepointSite, '/');
 | 
			
		||||
        if ($tmp[1]==urldecode($tmp[1])) {
 | 
			
		||||
            $sharepointname = urlencode($tmp[1]);
 | 
			
		||||
        } else {
 | 
			
		||||
            $sharepointname = $tmp[1];
 | 
			
		||||
        }
 | 
			
		||||
        $tmp = splitlast($tmp[0], '/');
 | 
			
		||||
        if (getConfig('Driver', $this->disktag)=='Onedrive') $url = 'https://graph.microsoft.com/v1.0/sites/root:/' . $tmp[1] . '/' . $sharepointname;
 | 
			
		||||
        if (getConfig('Driver', $this->disktag)=='OnedriveCN') $url = 'https://microsoftgraph.chinacloudapi.cn/v1.0/sites/root:/' . $tmp[1] . '/' . $sharepointname;
 | 
			
		||||
 | 
			
		||||
        $i=0;
 | 
			
		||||
        $response = [];
 | 
			
		||||
        while ($url!=''&&$response['stat']!=200&&$i<4) {
 | 
			
		||||
            $response = curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token]);
 | 
			
		||||
            $i++;
 | 
			
		||||
        }
 | 
			
		||||
        if ($response['stat']!=200) {
 | 
			
		||||
            error_log1('failed to get siteid. response' . json_encode($response));
 | 
			
		||||
            $response['body'] .= '\nfailed to get siteid.';
 | 
			
		||||
            return $response;
 | 
			
		||||
            //throw new Exception($response['stat'].', failed to get siteid.'.$response['body']);
 | 
			
		||||
        }
 | 
			
		||||
        return json_decode($response['body'],true)['id'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function del_upload_cache($path)
 | 
			
		||||
    {
 | 
			
		||||
        error_log1('del.tmp:GET,'.json_encode($_GET,JSON_PRETTY_PRINT));
 | 
			
		||||
        $tmp = splitlast($_GET['filename'], '/');
 | 
			
		||||
        if ($tmp[1]!='') {
 | 
			
		||||
            $filename = $tmp[0] . '/.' . $_GET['filelastModified'] . '_' . $_GET['filesize'] . '_' . $tmp[1] . '.tmp';
 | 
			
		||||
        } else {
 | 
			
		||||
            $filename = '.' . $_GET['filelastModified'] . '_' . $_GET['filesize'] . '_' . $_GET['filename'] . '.tmp';
 | 
			
		||||
        }
 | 
			
		||||
        $filename = path_format( path_format($_SERVER['list_path'] . path_format($path)) . '/' . spurlencode($filename, '/') );
 | 
			
		||||
        $tmp = $this->MSAPI('DELETE', $filename, '', $this->access_token);
 | 
			
		||||
        $path1 = path_format($_SERVER['list_path'] . path_format($path));
 | 
			
		||||
        if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1,0,-1);
 | 
			
		||||
        savecache('path_' . $path1, json_decode('{}',true), $this->disktag, 1);
 | 
			
		||||
        return output($tmp['body'],$tmp['stat']);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function get_thumbnails_url($path = '/')
 | 
			
		||||
    {
 | 
			
		||||
        $thumb_url = getcache('thumb_'.$path, $this->disktag);
 | 
			
		||||
        if ($thumb_url=='') {
 | 
			
		||||
            $url = $this->api_url . $this->ext_api_url;
 | 
			
		||||
            if ($path !== '/') {
 | 
			
		||||
                $url .= ':' . $path;
 | 
			
		||||
                if (substr($url,-1)=='/') $url=substr($url,0,-1);
 | 
			
		||||
            }
 | 
			
		||||
            $url .= ':/thumbnails/0/medium';
 | 
			
		||||
            $files = json_decode(curl('GET', $url, false, ['Authorization' => 'Bearer ' . $this->access_token])['body'], true);
 | 
			
		||||
            if (isset($files['url'])) {
 | 
			
		||||
                savecache('thumb_' . $path, $files['url'], $this->disktag);
 | 
			
		||||
                $thumb_url = $files['url'];
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return $thumb_url;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function bigfileupload($path)
 | 
			
		||||
    {
 | 
			
		||||
        if ($_POST['upbigfilename']=='') return output('error: no file name', 400);
 | 
			
		||||
        if (!is_numeric($_POST['filesize'])) return output('error: no file size', 400);
 | 
			
		||||
        if (!$_SERVER['admin']) if (!isset($_POST['filemd5'])) return output('error: no file md5', 400);
 | 
			
		||||
 | 
			
		||||
        $tmp = splitlast($_POST['upbigfilename'], '/');
 | 
			
		||||
        if ($tmp[1]!='') {
 | 
			
		||||
            $fileinfo['name'] = $tmp[1];
 | 
			
		||||
            if ($_SERVER['admin']) $fileinfo['path'] = $tmp[0];
 | 
			
		||||
        } else {
 | 
			
		||||
            $fileinfo['name'] = $_POST['upbigfilename'];
 | 
			
		||||
        }
 | 
			
		||||
        $fileinfo['size'] = $_POST['filesize'];
 | 
			
		||||
        $fileinfo['filelastModified'] = $_POST['filelastModified'];
 | 
			
		||||
        if ($_SERVER['admin']) {
 | 
			
		||||
            $filename = spurlencode($_POST['upbigfilename'], '/');
 | 
			
		||||
        } else {
 | 
			
		||||
            $tmp1 = splitlast($fileinfo['name'], '.');
 | 
			
		||||
            if ($tmp1[0]==''||$tmp1[1]=='') $filename = $_POST['filemd5'];
 | 
			
		||||
            else $filename = $_POST['filemd5'] . '.' . $tmp1[1];
 | 
			
		||||
        }
 | 
			
		||||
        if ($fileinfo['size']>10*1024*1024) {
 | 
			
		||||
            $cachefilename = spurlencode( $fileinfo['path'] . '/.' . $fileinfo['filelastModified'] . '_' . $fileinfo['size'] . '_' . $fileinfo['name'] . '.tmp', '/');
 | 
			
		||||
            $getoldupinfo=$this->list_files(path_format($path . '/' . $cachefilename));
 | 
			
		||||
            //echo json_encode($getoldupinfo, JSON_PRETTY_PRINT);
 | 
			
		||||
            if (isset($getoldupinfo['file'])&&$getoldupinfo['size']<5120) {
 | 
			
		||||
                $getoldupinfo_j = curl('GET', $getoldupinfo['url']);
 | 
			
		||||
                $getoldupinfo = json_decode($getoldupinfo_j['body'], true);
 | 
			
		||||
                if ( json_decode( curl('GET', $getoldupinfo['uploadUrl'])['body'], true)['@odata.context']!='' ) return output($getoldupinfo_j['body'], $getoldupinfo_j['stat']);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        $response = $this->MSAPI('createUploadSession', path_format($path . '/' . $filename), '{"item": { "@microsoft.graph.conflictBehavior": "fail" }}', $this->access_token);
 | 
			
		||||
        if ($response['stat']<500) {
 | 
			
		||||
            $responsearry = json_decode($response['body'],true);
 | 
			
		||||
            if (isset($responsearry['error'])) return output($response['body'], $response['stat']);
 | 
			
		||||
            $fileinfo['uploadUrl'] = $responsearry['uploadUrl'];
 | 
			
		||||
            if ($fileinfo['size']>10*1024*1024) $this->MSAPI('PUT', path_format($path . '/' . $cachefilename), json_encode($fileinfo, JSON_PRETTY_PRINT), $this->access_token);
 | 
			
		||||
        }
 | 
			
		||||
        return output($response['body'], $response['stat']);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function MSAPI($method, $path, $data = '', $access_token)
 | 
			
		||||
    {
 | 
			
		||||
        if (substr($path,0,7) == 'http://' or substr($path,0,8) == 'https://') {
 | 
			
		||||
            $url=$path;
 | 
			
		||||
            $lenth=strlen($data);
 | 
			
		||||
            $headers['Content-Length'] = $lenth;
 | 
			
		||||
            $lenth--;
 | 
			
		||||
            $headers['Content-Range'] = 'bytes 0-' . $lenth . '/' . $headers['Content-Length'];
 | 
			
		||||
        } else {
 | 
			
		||||
            $url = $this->api_url . $this->ext_api_url;
 | 
			
		||||
            if ($path=='' or $path=='/') {
 | 
			
		||||
                $url .= '/';
 | 
			
		||||
            } else {
 | 
			
		||||
                $url .= ':' . $path;
 | 
			
		||||
                if (substr($url,-1)=='/') $url=substr($url,0,-1);
 | 
			
		||||
            }
 | 
			
		||||
            if ($method=='PUT') {
 | 
			
		||||
                if ($path=='' or $path=='/') {
 | 
			
		||||
                    $url .= 'content';
 | 
			
		||||
                } else {
 | 
			
		||||
                    $url .= ':/content';
 | 
			
		||||
                }
 | 
			
		||||
                $headers['Content-Type'] = 'text/plain';
 | 
			
		||||
            } elseif ($method=='PATCH') {
 | 
			
		||||
                $headers['Content-Type'] = 'application/json';
 | 
			
		||||
            } elseif ($method=='POST') {
 | 
			
		||||
                $headers['Content-Type'] = 'application/json';
 | 
			
		||||
            } elseif ($method=='DELETE') {
 | 
			
		||||
                $headers['Content-Type'] = 'application/json';
 | 
			
		||||
            } else {
 | 
			
		||||
                if ($path=='' or $path=='/') {
 | 
			
		||||
                    $url .= $method;
 | 
			
		||||
                } else {
 | 
			
		||||
                    $url .= ':/' . $method;
 | 
			
		||||
                }
 | 
			
		||||
                $method='POST';
 | 
			
		||||
                $headers['Content-Type'] = 'application/json';
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        $headers['Authorization'] = 'Bearer ' . $access_token;
 | 
			
		||||
        if (!isset($headers['Accept'])) $headers['Accept'] = '*/*';
 | 
			
		||||
        //if (!isset($headers['Referer'])) $headers['Referer'] = $url;*
 | 
			
		||||
        $sendHeaders = array();
 | 
			
		||||
        foreach ($headers as $headerName => $headerVal) {
 | 
			
		||||
            $sendHeaders[] = $headerName . ': ' . $headerVal;
 | 
			
		||||
        }
 | 
			
		||||
        $ch = curl_init();
 | 
			
		||||
        curl_setopt($ch, CURLOPT_URL, $url);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_HEADER, 0);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 | 
			
		||||
        //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 | 
			
		||||
        curl_setopt($ch, CURLOPT_HTTPHEADER, $sendHeaders);
 | 
			
		||||
        $response['body'] = curl_exec($ch);
 | 
			
		||||
        $response['stat'] = curl_getinfo($ch,CURLINFO_HTTP_CODE);
 | 
			
		||||
        //$response['Location'] = curl_getinfo($ch);
 | 
			
		||||
        curl_close($ch);
 | 
			
		||||
        error_log1($response['stat'].'
 | 
			
		||||
    '.$response['body'].'
 | 
			
		||||
    '.$url.'
 | 
			
		||||
    ');
 | 
			
		||||
        return $response;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
<?php
 | 
			
		||||
if (!class_exists('Onedrive')) require 'Onedrive.php';
 | 
			
		||||
 | 
			
		||||
class OnedriveCN extends Onedrive {
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->redirect_uri = 'https://scfonedrive.github.io';
 | 
			
		||||
        if (getConfig('client_id', $tag) && getConfig('client_secret', $tag)) {
 | 
			
		||||
            $this->client_id = getConfig('client_id', $tag);
 | 
			
		||||
            $this->client_secret = getConfig('client_secret', $tag);
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->client_id = '31f3bed5-b9d9-4173-86a4-72c73d278617';
 | 
			
		||||
            $this->client_secret = 'P5-ZNtFK-tT90J.We_-DcsuB8uV7AfjL8Y';
 | 
			
		||||
        }
 | 
			
		||||
        $this->oauth_url = 'https://login.partner.microsoftonline.cn/common/oauth2/v2.0/';
 | 
			
		||||
        $this->api_url = 'https://microsoftgraph.chinacloudapi.cn/v1.0';
 | 
			
		||||
        $this->scope = 'https://microsoftgraph.chinacloudapi.cn/Files.ReadWrite.All offline_access';
 | 
			
		||||
        $res = $this->get_access_token(getConfig('refresh_token', $tag));
 | 
			
		||||
 | 
			
		||||
        $this->client_secret = urlencode($this->client_secret);
 | 
			
		||||
        $this->scope = urlencode($this->scope);
 | 
			
		||||
        $this->DownurlStrName = '@microsoft.graph.downloadUrl';
 | 
			
		||||
        $this->ext_api_url = '/me/drive/root';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,64 @@
 | 
			
		|||
<?php
 | 
			
		||||
if (!class_exists('Onedrive')) require 'Onedrive.php';
 | 
			
		||||
 | 
			
		||||
class Sharelink extends Onedrive {
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->redirect_uri = 'https://scfonedrive.github.io';
 | 
			
		||||
        $this->api_url = getConfig('shareapiurl', $tag);
 | 
			
		||||
        $res = $this->get_access_token(1);
 | 
			
		||||
        //$this->ext_api_url = '/me/drive/root';
 | 
			
		||||
        $this->DownurlStrName = '@content.downloadUrl';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function ext_show_innerenv()
 | 
			
		||||
    {
 | 
			
		||||
        return [ 'shareurl' ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function get_access_token($refresh_token) {
 | 
			
		||||
        if (!($this->access_token = getcache('access_token', $this->disktag))) {
 | 
			
		||||
            $shareurl = getConfig('shareurl', $this->disktag);
 | 
			
		||||
            if (!($this->sharecookie = getcache('sharecookie', $this->disktag))) {
 | 
			
		||||
                $this->sharecookie = curl('GET', $shareurl, false, [], 1)['returnhead']['Set-Cookie'];
 | 
			
		||||
                //$tmp = curl_request($shareurl, false, [], 1);
 | 
			
		||||
                //$tmp['body'] .= json_encode($tmp['returnhead'],JSON_PRETTY_PRINT);
 | 
			
		||||
                //return $tmp;
 | 
			
		||||
                //$_SERVER['sharecookie'] = $tmp['returnhead']['Set-Cookie'];
 | 
			
		||||
                //if ($tmp['stat']==302) $url = $tmp['returnhead']['Location'];
 | 
			
		||||
                //return curl('GET', $url, [ 'Accept' => 'application/json;odata=verbose', 'Content-Type' => 'application/json;odata=verbose', 'Cookie' => $_SERVER['sharecookie'] ]);
 | 
			
		||||
                savecache('sharecookie', $this->sharecookie, $this->disktag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp1 = splitlast($shareurl, '/')[0];
 | 
			
		||||
            $account = splitlast($tmp1, '/')[1];
 | 
			
		||||
            $domain = splitlast($shareurl, '/:')[0];
 | 
			
		||||
            $response = curl('POST', 
 | 
			
		||||
                $domain . "/personal/" . $account . "/_api/web/GetListUsingPath(DecodedUrl=@a1)/RenderListDataAsStream?@a1='" . urlencode("/personal/" . $account . "/Documents") . "'&RootFolder=" . urlencode("/personal/" . $account . "/Documents/") . "&TryNewExperienceSingle=TRUE",
 | 
			
		||||
                '{"parameters":{"__metadata":{"type":"SP.RenderListDataParameters"},"RenderOptions":136967,"AllowMultipleValueFilterForTaxonomyFields":true,"AddRequiredFields":true}}',
 | 
			
		||||
                [ 'Accept' => 'application/json;odata=verbose', 'Content-Type' => 'application/json;odata=verbose', 'origin' => $domain, 'Cookie' => $this->sharecookie ]
 | 
			
		||||
            );
 | 
			
		||||
            if ($response['stat']==200) $ret = json_decode($response['body'], true);
 | 
			
		||||
            $this->access_token = splitlast($ret['ListSchema']['.driveAccessToken'],'=')[1];
 | 
			
		||||
            $this->api_url = $ret['ListSchema']['.driveUrl'].'/root';
 | 
			
		||||
            if (!$this->access_token) {
 | 
			
		||||
                error_log1($domain . "/personal/" . $account . "/_api/web/GetListUsingPath(DecodedUrl=@a1)/RenderListDataAsStream?@a1='" . urlencode("/personal/" . $account . "/Documents") . "'&RootFolder=" . urlencode("/personal/" . $account . "/Documents/") . "&TryNewExperienceSingle=TRUE");
 | 
			
		||||
                error_log1('failed to get share access_token. response' . json_encode($ret));
 | 
			
		||||
                $response['body'] = json_encode(json_decode($response['body']), JSON_PRETTY_PRINT);
 | 
			
		||||
                $response['body'] .= '\nfailed to get shareurl access_token.';
 | 
			
		||||
                return $response;
 | 
			
		||||
                //throw new Exception($response['stat'].', failed to get share access_token.'.$response['body']);
 | 
			
		||||
            }
 | 
			
		||||
            //$tmp = $ret;
 | 
			
		||||
            //$tmp['access_token'] = '******';
 | 
			
		||||
            //error_log1('['.$this->disktag.'] Get access token:'.json_encode($tmp, JSON_PRETTY_PRINT));
 | 
			
		||||
            savecache('access_token', $this->access_token, $this->disktag);
 | 
			
		||||
            $tmp1 = null;
 | 
			
		||||
            if (getConfig('shareapiurl', $this->disktag)!=$this->api_url) $tmp1['shareapiurl'] = $this->api_url;
 | 
			
		||||
            //if (getConfig('sharecookie', $this->disktag)!=$this->sharecookie) $tmp1['sharecookie'] = $this->sharecookie;
 | 
			
		||||
            if (!!$tmp1) setConfig($tmp1);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
<?php
 | 
			
		||||
if (!class_exists('Onedrive')) require 'Onedrive.php';
 | 
			
		||||
 | 
			
		||||
class Sharepoint extends Onedrive {
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->redirect_uri = 'https://scfonedrive.github.io';
 | 
			
		||||
        if (getConfig('client_id', $tag) && getConfig('client_secret', $tag)) {
 | 
			
		||||
            $this->client_id = getConfig('client_id', $tag);
 | 
			
		||||
            $this->client_secret = getConfig('client_secret', $tag);
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->client_id = '734ef928-d74c-4555-8d1b-d942fa0a1a41';
 | 
			
		||||
            $this->client_secret = ':EK[e0/4vQ@mQgma8LmnWb6j4_C1CSIW';
 | 
			
		||||
        }
 | 
			
		||||
        $this->oauth_url = 'https://login.microsoftonline.com/common/oauth2/v2.0/';
 | 
			
		||||
        $this->api_url = 'https://graph.microsoft.com/v1.0';
 | 
			
		||||
        $this->scope = 'https://graph.microsoft.com/Files.ReadWrite.All offline_access';
 | 
			
		||||
        $res = $this->get_access_token(getConfig('refresh_token', $tag));
 | 
			
		||||
 | 
			
		||||
        $this->client_secret = urlencode($this->client_secret);
 | 
			
		||||
        $this->scope = urlencode($this->scope);
 | 
			
		||||
        $this->DownurlStrName = '@microsoft.graph.downloadUrl';
 | 
			
		||||
        $this->ext_api_url = '/sites/' . getConfig('siteid', $tag) . '/drive/root';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function ext_show_innerenv()
 | 
			
		||||
    {
 | 
			
		||||
        return [ 'sharepointSite', 'siteid' ];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
<?php
 | 
			
		||||
if (!class_exists('Onedrive')) require 'Onedrive.php';
 | 
			
		||||
 | 
			
		||||
class SharepointCN extends Onedrive {
 | 
			
		||||
 | 
			
		||||
    function __construct($tag) {
 | 
			
		||||
        $this->disktag = $tag;
 | 
			
		||||
        $this->redirect_uri = 'https://scfonedrive.github.io';
 | 
			
		||||
        if (getConfig('client_id', $tag) && getConfig('client_secret', $tag)) {
 | 
			
		||||
            $this->client_id = getConfig('client_id', $tag);
 | 
			
		||||
            $this->client_secret = getConfig('client_secret', $tag);
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->client_id = '31f3bed5-b9d9-4173-86a4-72c73d278617';
 | 
			
		||||
            $this->client_secret = 'P5-ZNtFK-tT90J.We_-DcsuB8uV7AfjL8Y';
 | 
			
		||||
        }
 | 
			
		||||
        $this->oauth_url = 'https://login.partner.microsoftonline.cn/common/oauth2/v2.0/';
 | 
			
		||||
        $this->api_url = 'https://microsoftgraph.chinacloudapi.cn/v1.0';
 | 
			
		||||
        $this->scope = 'https://microsoftgraph.chinacloudapi.cn/Files.ReadWrite.All offline_access';
 | 
			
		||||
        $res = $this->get_access_token(getConfig('refresh_token', $tag));
 | 
			
		||||
 | 
			
		||||
        $this->client_secret = urlencode($this->client_secret);
 | 
			
		||||
        $this->scope = urlencode($this->scope);
 | 
			
		||||
        $this->DownurlStrName = '@microsoft.graph.downloadUrl';
 | 
			
		||||
        $this->ext_api_url = '/sites/' . getConfig('siteid', $tag) . '/drive/root';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function ext_show_innerenv()
 | 
			
		||||
    {
 | 
			
		||||
        return [ 'sharepointSite', 'siteid' ];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										30
									
								
								index.php
								
								
								
								
							
							
						
						
									
										30
									
								
								index.php
								
								
								
								
							| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
<?php
 | 
			
		||||
error_reporting(E_ALL & ~E_NOTICE);
 | 
			
		||||
//error_reporting(E_ALL & ~E_NOTICE);
 | 
			
		||||
error_reporting(0);
 | 
			
		||||
include 'vendor/autoload.php';
 | 
			
		||||
include 'conststr.php';
 | 
			
		||||
include 'common.php';
 | 
			
		||||
| 
						 | 
				
			
			@ -15,8 +16,6 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
 | 
			
		|||
    //else include 'platform/HuaweiFG_env.php';
 | 
			
		||||
    echo 'FG' . PHP_EOL;
 | 
			
		||||
} elseif ($_SERVER['BCE_CFC_RUNTIME_NAME']=='php7') {
 | 
			
		||||
    //set_include_path(get_include_path() . PATH_SEPARATOR . '/opt/php');
 | 
			
		||||
    //include 'BaiduBce.phar';
 | 
			
		||||
    include 'platform/BaiduCFC.php';
 | 
			
		||||
} elseif (isset($_SERVER['HEROKU_APP_DIR'])&&$_SERVER['HEROKU_APP_DIR']==='/app') {
 | 
			
		||||
    include 'platform/Heroku.php';
 | 
			
		||||
| 
						 | 
				
			
			@ -136,28 +135,3 @@ function handler($event, $context)
 | 
			
		|||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// used by Aliyun FC
 | 
			
		||||
function myErrorHandler($errno, $errstr, $errfile, $errline) {
 | 
			
		||||
    if (!(error_reporting() & $errno)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    switch ($errno) {
 | 
			
		||||
    case E_USER_ERROR:
 | 
			
		||||
        $errInfo = array(
 | 
			
		||||
            "errorMessage" => $errstr,
 | 
			
		||||
            "errorType"    => \ServerlessFC\friendly_error_type($errno),
 | 
			
		||||
            "stackTrace"   => array(
 | 
			
		||||
                "file" => $errfile,
 | 
			
		||||
                "line" => $errline,
 | 
			
		||||
            ),
 | 
			
		||||
        );
 | 
			
		||||
        throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
    default: // E_USER_WARNING | E_USER_NOTICE
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,6 +28,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $pos = strpos($cookievalues,"=");
 | 
			
		||||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    if (isset($event['headers']['Authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['Authorization'][0], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['FC_SERVER_PATH'] = '/var/fc/runtime/php7.2';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -57,17 +62,15 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if (in_array($str, $InnerEnv)) {
 | 
			
		||||
    if (isInnerEnv($str)) {
 | 
			
		||||
        if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
        $env = json_decode(getenv($disktag), true);
 | 
			
		||||
        if (isset($env[$str])) {
 | 
			
		||||
            if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
 | 
			
		||||
            if (isBase64Env($str)) return base64y_decode($env[$str]);
 | 
			
		||||
            else return $env[$str];
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
 | 
			
		||||
        if (isBase64Env($str)) return base64y_decode(getenv($str));
 | 
			
		||||
        else return getenv($str);
 | 
			
		||||
    }
 | 
			
		||||
    return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -75,8 +78,6 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $disktags = explode("|", getConfig('disktag'));
 | 
			
		||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
			
		||||
| 
						 | 
				
			
			@ -84,8 +85,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
            else $diskconfig[$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -95,10 +96,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $tmp[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $tmp[$newtag] = getConfig($v);
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            else $tmp[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -109,7 +115,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $tmp['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp['disktag'] = implode('|', $tags);
 | 
			
		||||
            $tmp[$arr['disktag_newname']] = getConfig($arr['disktag_rename']);
 | 
			
		||||
            $tmp[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -245,7 +256,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -321,7 +332,8 @@ function updateEnvironment($Envs, $accountId, $region, $service_name, $function_
 | 
			
		|||
        $tmp_env[$key1] = $value1;
 | 
			
		||||
    }
 | 
			
		||||
    $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
 | 
			
		||||
    ksort($tmp_env);
 | 
			
		||||
    //ksort($tmp_env);
 | 
			
		||||
    sortConfig($tmp_env);
 | 
			
		||||
 | 
			
		||||
    $tmpdata['environmentVariables'] = $tmp_env;
 | 
			
		||||
    return FCAPI2016($config, 'PUT', json_encode($tmpdata));
 | 
			
		||||
| 
						 | 
				
			
			@ -457,3 +469,25 @@ function addFileToZip($zip, $rootpath, $path = '')
 | 
			
		|||
    }
 | 
			
		||||
    @closedir($path);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function myErrorHandler($errno, $errstr, $errfile, $errline) {
 | 
			
		||||
    if (!(error_reporting() & $errno)) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    switch ($errno) {
 | 
			
		||||
    case E_USER_ERROR:
 | 
			
		||||
        $errInfo = array(
 | 
			
		||||
            "errorMessage" => $errstr,
 | 
			
		||||
            "errorType"    => \ServerlessFC\friendly_error_type($errno),
 | 
			
		||||
            "stackTrace"   => array(
 | 
			
		||||
                "file" => $errfile,
 | 
			
		||||
                "line" => $errline,
 | 
			
		||||
            ),
 | 
			
		||||
        );
 | 
			
		||||
        throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
 | 
			
		||||
        break;
 | 
			
		||||
    default: // E_USER_WARNING | E_USER_NOTICE
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_USER_AGENT'] = $event['headers']['User-Agent'];
 | 
			
		||||
    if (isset($event['headers']['authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['authorization'], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
 | 
			
		||||
    $_SERVER['BCE_CFC_RUNTIME_NAME'] = 'php7';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -47,17 +52,15 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if (in_array($str, $InnerEnv)) {
 | 
			
		||||
    if (isInnerEnv($str)) {
 | 
			
		||||
        if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
        $env = json_decode(getenv($disktag), true);
 | 
			
		||||
        if (isset($env[$str])) {
 | 
			
		||||
            if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
 | 
			
		||||
            if (isBase64Env($str)) return base64y_decode($env[$str]);
 | 
			
		||||
            else return $env[$str];
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
 | 
			
		||||
        if (isBase64Env($str)) return base64y_decode(getenv($str));
 | 
			
		||||
        else return getenv($str);
 | 
			
		||||
    }
 | 
			
		||||
    return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -65,8 +68,6 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $disktags = explode("|",getConfig('disktag'));
 | 
			
		||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
			
		||||
| 
						 | 
				
			
			@ -74,8 +75,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
            else $diskconfig[$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -85,10 +86,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $tmp[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $tmp[$newtag] = getConfig($v);
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            else $tmp[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -99,7 +105,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $tmp['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp['disktag'] = implode('|', $tags);
 | 
			
		||||
            $tmp[$arr['disktag_newname']] = getConfig($arr['disktag_rename']);
 | 
			
		||||
            $tmp[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -232,7 +243,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -302,7 +313,8 @@ function updateEnvironment($Envs, $SecretId, $SecretKey)
 | 
			
		|||
        $tmp_env[$key1] = $value1;
 | 
			
		||||
    }
 | 
			
		||||
    $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
 | 
			
		||||
    ksort($tmp_env);
 | 
			
		||||
    //ksort($tmp_env);
 | 
			
		||||
    sortConfig($tmp_env);
 | 
			
		||||
 | 
			
		||||
    $tmp['Environment']['Variables'] = $tmp_env;
 | 
			
		||||
    $data = json_encode($tmp);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,14 +15,14 @@ function getpath()
 | 
			
		|||
 | 
			
		||||
function getGET()
 | 
			
		||||
{
 | 
			
		||||
    //error_log('POST:' . json_encode($_POST));
 | 
			
		||||
    //error_log1('POST:' . json_encode($_POST));
 | 
			
		||||
    if (!$_POST) {
 | 
			
		||||
        if (!!$HTTP_RAW_POST_DATA) {
 | 
			
		||||
            $tmpdata = $HTTP_RAW_POST_DATA;
 | 
			
		||||
            //error_log('RAW:' . $tmpdata);
 | 
			
		||||
            //error_log1('RAW:' . $tmpdata);
 | 
			
		||||
        } else {
 | 
			
		||||
            $tmpdata = file_get_contents('php://input');
 | 
			
		||||
            //error_log('PHPINPUT:' . $tmpdata);
 | 
			
		||||
            //error_log1('PHPINPUT:' . $tmpdata);
 | 
			
		||||
        }
 | 
			
		||||
        if (!!$tmpdata) {
 | 
			
		||||
            $postbody = explode("&", $tmpdata);
 | 
			
		||||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ function getGET()
 | 
			
		|||
                $pos = strpos($postvalues,"=");
 | 
			
		||||
                $_POST[urldecode(substr($postvalues,0,$pos))]=urldecode(substr($postvalues,$pos+1));
 | 
			
		||||
            }
 | 
			
		||||
            //error_log('POSTformPHPINPUT:' . json_encode($_POST));
 | 
			
		||||
            //error_log1('POSTformPHPINPUT:' . json_encode($_POST));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $p = strpos($_SERVER['REQUEST_URI'],'?');
 | 
			
		||||
| 
						 | 
				
			
			@ -58,17 +58,15 @@ function getGET()
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if (in_array($str, $InnerEnv)) {
 | 
			
		||||
    if (isInnerEnv($str)) {
 | 
			
		||||
        if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
        $env = json_decode(getenv($disktag), true);
 | 
			
		||||
        if (isset($env[$str])) {
 | 
			
		||||
            if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
 | 
			
		||||
            if (isBase64Env($str)) return base64y_decode($env[$str]);
 | 
			
		||||
            else return $env[$str];
 | 
			
		||||
	}
 | 
			
		||||
    } else {
 | 
			
		||||
	if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
 | 
			
		||||
        if (isBase64Env($str)) return base64y_decode(getenv($str));
 | 
			
		||||
        else return getenv($str);
 | 
			
		||||
    }
 | 
			
		||||
    return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -76,8 +74,6 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $disktags = explode("|",getConfig('disktag'));
 | 
			
		||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
			
		||||
| 
						 | 
				
			
			@ -85,8 +81,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
            else $diskconfig[$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -96,10 +92,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $tmp[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $tmp[$newtag] = getConfig($v);
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            else $tmp[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -110,7 +111,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $tmp['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp['disktag'] = implode('|', $tags);
 | 
			
		||||
            $tmp[$arr['disktag_newname']] = getConfig($arr['disktag_rename']);
 | 
			
		||||
            $tmp[$arr['disktag_rename']] = null;
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -121,9 +127,9 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    foreach ($tmp as $key => $val) if ($val=='') $tmp[$key]=null;
 | 
			
		||||
//    echo '正式设置:'.json_encode($tmp,JSON_PRETTY_PRINT).'
 | 
			
		||||
//';
 | 
			
		||||
 | 
			
		||||
    return setHerokuConfig($tmp, getConfig('function_name'), getConfig('APIKey'));
 | 
			
		||||
    error_log1(json_encode($arr, JSON_PRETTY_PRINT) . ' => tmp:' . json_encode($tmp, JSON_PRETTY_PRINT));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function install()
 | 
			
		||||
| 
						 | 
				
			
			@ -214,7 +220,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -231,7 +237,7 @@ function HerokuAPI($method, $url, $data = '', $apikey)
 | 
			
		|||
    foreach ($headers as $headerName => $headerVal) {
 | 
			
		||||
        $sendHeaders[] = $headerName . ': ' . $headerVal;
 | 
			
		||||
    }
 | 
			
		||||
    error_log($method . $url . $data . $apikey);
 | 
			
		||||
    error_log1($method . $url . $data . $apikey);
 | 
			
		||||
    $ch = curl_init();
 | 
			
		||||
    curl_setopt($ch, CURLOPT_URL, $url);
 | 
			
		||||
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST,$method);
 | 
			
		||||
| 
						 | 
				
			
			@ -246,7 +252,7 @@ function HerokuAPI($method, $url, $data = '', $apikey)
 | 
			
		|||
    $response['body'] = curl_exec($ch);
 | 
			
		||||
    $response['stat'] = curl_getinfo($ch,CURLINFO_HTTP_CODE);
 | 
			
		||||
    curl_close($ch);
 | 
			
		||||
    error_log($response['stat'].'
 | 
			
		||||
    error_log1($response['stat'].'
 | 
			
		||||
'.$response['body'].'
 | 
			
		||||
');
 | 
			
		||||
    return $response;
 | 
			
		||||
| 
						 | 
				
			
			@ -260,7 +266,7 @@ function getHerokuConfig($function_name, $apikey)
 | 
			
		|||
function setHerokuConfig($env, $function_name, $apikey)
 | 
			
		||||
{
 | 
			
		||||
    $data = json_encode($env);
 | 
			
		||||
    return HerokuAPI('PATCH', 'https://api.heroku.com/apps/' . $function_name . '/config-vars', $data, $apikey);
 | 
			
		||||
    if (substr($data, 0, 1)=='{') return HerokuAPI('PATCH', 'https://api.heroku.com/apps/' . $function_name . '/config-vars', $data, $apikey);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function updateHerokuapp($function_name, $apikey, $source)
 | 
			
		||||
| 
						 | 
				
			
			@ -285,8 +291,7 @@ function_name:' . $_SERVER['function_name'] . '<br>
 | 
			
		|||
 | 
			
		||||
function OnekeyUpate($auth = 'BingoKingo', $project = 'Tfo', $branch = 'master')
 | 
			
		||||
{
 | 
			
		||||
    //'original:https://github.com/qkqpttgf/OneManager-php/tarball/master/';
 | 
			
		||||
    //'mine:https://https://github.com/BingoKingo/Tfo/tarball/master/';
 | 
			
		||||
    //'https://github.com/BingoKingo/Tfo/tarball/master/';
 | 
			
		||||
    $source = 'https://github.com/' . $auth . '/' . $project . '/tarball/' . urlencode($branch) . '/';
 | 
			
		||||
    return updateHerokuapp(getConfig('function_name'), getConfig('APIKey'), $source);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,6 +40,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_USER_AGENT'] = $event['headers']['user-agent'];
 | 
			
		||||
    if (isset($event['headers']['authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['authorization'], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
 | 
			
		||||
    $_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -69,18 +74,16 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    global $contextUserData;
 | 
			
		||||
    if (in_array($str, $InnerEnv)) {
 | 
			
		||||
    if (isInnerEnv($str)) {
 | 
			
		||||
        if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
        $env = json_decode($contextUserData->getUserData($disktag), true);
 | 
			
		||||
        if (isset($env[$str])) {
 | 
			
		||||
            if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
 | 
			
		||||
            if (isBase64Env($str)) return base64y_decode($env[$str]);
 | 
			
		||||
            else return $env[$str];
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (in_array($str, $Base64Env)) return base64y_decode($contextUserData->getUserData($str));
 | 
			
		||||
        if (isBase64Env($str)) return base64y_decode($contextUserData->getUserData($str));
 | 
			
		||||
        else return $contextUserData->getUserData($str);
 | 
			
		||||
    }
 | 
			
		||||
    return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -88,8 +91,6 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    global $contextUserData;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $disktags = explode("|",getConfig('disktag'));
 | 
			
		||||
| 
						 | 
				
			
			@ -98,8 +99,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
            else $diskconfig[$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -109,10 +110,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $tmp[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $tmp[$newtag] = getConfig($v);
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            else $tmp[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -123,7 +129,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $tmp['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp['disktag'] = implode('|', $tags);
 | 
			
		||||
            $tmp[$arr['disktag_newname']] = getConfig($arr['disktag_rename']);
 | 
			
		||||
            $tmp[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -278,7 +289,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -357,7 +368,8 @@ function updateEnvironment($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		|||
        $tmp_env[$key1] = $value1;
 | 
			
		||||
    }
 | 
			
		||||
    $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
 | 
			
		||||
    ksort($tmp_env);
 | 
			
		||||
    //ksort($tmp_env);
 | 
			
		||||
    sortConfig($tmp_env);
 | 
			
		||||
 | 
			
		||||
    $tmpdata['handler'] = 'index.handler';
 | 
			
		||||
    $tmpdata['memory_size'] = $contextUserData->getMemorySize()+1-1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,6 +40,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_USER_AGENT'] = $event['headers']['user-agent'];
 | 
			
		||||
    if (isset($event['headers']['authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['authorization'], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_TRANSLATE'] = $event['headers']['translate'];//'f'
 | 
			
		||||
    $_SERVER['_APP_SHARE_DIR'] = '/var/share/CFF/processrouter';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -69,23 +74,23 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    //include 'config.php';
 | 
			
		||||
    $s = file_get_contents(__DIR__ . '/../config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
 | 
			
		||||
    global $slash;
 | 
			
		||||
    $projectPath = splitlast(__DIR__, $slash)[0];
 | 
			
		||||
    $configPath = $projectPath . $slash . '.data' . $slash . 'config.php';
 | 
			
		||||
    $s = file_get_contents($configPath);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') {
 | 
			
		||||
        $envs = json_decode($configs, true);
 | 
			
		||||
        if (in_array($str, $InnerEnv)) {
 | 
			
		||||
        if (isInnerEnv($str)) {
 | 
			
		||||
            if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
            if (isset($envs[$disktag][$str])) {
 | 
			
		||||
                if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
 | 
			
		||||
                if (isBase64Env($str)) return base64y_decode($envs[$disktag][$str]);
 | 
			
		||||
                else return $envs[$disktag][$str];
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            if (isset($envs[$str])) {
 | 
			
		||||
                if (in_array($str, $Base64Env)) return base64y_decode($envs[$str]);
 | 
			
		||||
                if (isBase64Env($str)) return base64y_decode($envs[$str]);
 | 
			
		||||
                else return $envs[$str];
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -95,20 +100,20 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    //include 'config.php';
 | 
			
		||||
    $s = file_get_contents(__DIR__ . '/../config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    global $slash;
 | 
			
		||||
    $projectPath = splitlast(__DIR__, $slash)[0];
 | 
			
		||||
    $configPath = $projectPath . $slash . '.data' . $slash . 'config.php';
 | 
			
		||||
    $s = file_get_contents($configPath);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') $envs = json_decode($configs, true);
 | 
			
		||||
    $disktags = explode("|",getConfig('disktag'));
 | 
			
		||||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $envs[$disktag][$k] = base64y_encode($v);
 | 
			
		||||
            else $envs[$disktag][$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -118,10 +123,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $envs[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $envs[$newtag] = $envs[$v];
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $envs[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $envs[$k] = base64y_encode($v);
 | 
			
		||||
            else $envs[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -133,7 +143,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $envs['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $envs['disktag'] = implode('|', $tags);
 | 
			
		||||
            $envs[$arr['disktag_newname']] = $envs[$arr['disktag_rename']];
 | 
			
		||||
            $envs[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +159,7 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $envs = array_filter($envs, 'array_value_isnot_null');
 | 
			
		||||
    ksort($envs);
 | 
			
		||||
    //ksort($envs);
 | 
			
		||||
    $response = updateEnvironment($envs, getConfig('HW_urn'), getConfig('HW_key'), getConfig('HW_secret'));
 | 
			
		||||
    return $response;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -288,7 +303,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -377,9 +392,8 @@ function copyFolder($from, $to)
 | 
			
		|||
 | 
			
		||||
function updateEnvironment($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    sortConfig($Envs);
 | 
			
		||||
    //echo json_encode($Envs,JSON_PRETTY_PRINT);
 | 
			
		||||
    global $contextUserData;
 | 
			
		||||
    $source = '/tmp/code.zip';
 | 
			
		||||
    $outPath = '/tmp/code/';
 | 
			
		||||
    $oldcode = '/tmp/oldcode.zip';
 | 
			
		||||
| 
						 | 
				
			
			@ -392,7 +406,7 @@ function updateEnvironment($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		|||
    // 将配置写入
 | 
			
		||||
    $prestr = '<?php $configs = \'' . PHP_EOL;
 | 
			
		||||
    $aftstr = PHP_EOL . '\';';
 | 
			
		||||
    file_put_contents($outPath . 'config.php', $prestr . json_encode($Envs, JSON_PRETTY_PRINT) . $aftstr);
 | 
			
		||||
    file_put_contents($outPath . '.data/config.php', $prestr . json_encode($Envs, JSON_PRETTY_PRINT) . $aftstr);
 | 
			
		||||
 | 
			
		||||
    // 将目录中文件打包成zip
 | 
			
		||||
    //$zip=new ZipArchive();
 | 
			
		||||
| 
						 | 
				
			
			@ -407,6 +421,7 @@ function updateEnvironment($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		|||
 | 
			
		||||
function SetbaseConfig($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		||||
{
 | 
			
		||||
    global $slash;
 | 
			
		||||
    //echo json_encode($Envs,JSON_PRETTY_PRINT);
 | 
			
		||||
    if ($Envs['ONEMANAGER_CONFIG_SAVE'] == 'file') $envs = Array( 'ONEMANAGER_CONFIG_SAVE' => 'file' );
 | 
			
		||||
    else {
 | 
			
		||||
| 
						 | 
				
			
			@ -448,15 +463,17 @@ function SetbaseConfig($Envs, $HW_urn, $HW_key, $HW_secret)
 | 
			
		|||
    if (api_error(setConfigResponse($response))) {
 | 
			
		||||
        return $response;
 | 
			
		||||
    }
 | 
			
		||||
    $s = file_get_contents(__DIR__ . '/../config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
 | 
			
		||||
    $projectPath = splitlast(__DIR__, $slash)[0];
 | 
			
		||||
    $configPath = $projectPath . $slash . '.data' . $slash . 'config.php';
 | 
			
		||||
    $s = file_get_contents($configPath);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') $tmp_env = json_decode($configs, true);
 | 
			
		||||
    foreach ($Envs as $k => $v) {
 | 
			
		||||
        $tmp_env[$k] = $v;
 | 
			
		||||
    }
 | 
			
		||||
    $tmp_env = array_filter($tmp_env, 'array_value_isnot_null');
 | 
			
		||||
    ksort($tmp_env);
 | 
			
		||||
    //ksort($tmp_env);
 | 
			
		||||
    $response = updateEnvironment($tmp_env, $HW_urn, $HW_key, $HW_secret);
 | 
			
		||||
    return $response;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -538,7 +555,7 @@ function OnekeyUpate($auth = 'BingoKingo', $project = 'Tfo', $branch = 'master')
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    // 放入配置文件
 | 
			
		||||
    file_put_contents($outPath . '/config.php', file_get_contents(__DIR__.'/../config.php'));
 | 
			
		||||
    file_put_contents($outPath . '/.data/config.php', file_get_contents(__DIR__ . '/../.data/config.php'));
 | 
			
		||||
 | 
			
		||||
    // 将目录中文件打包成zip
 | 
			
		||||
    //$zip=new ZipArchive();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,27 +58,22 @@ function getGET()
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
 | 
			
		||||
    $slash = '/';
 | 
			
		||||
    if (strpos(__DIR__, ':')) $slash = '\\';
 | 
			
		||||
    global $slash;
 | 
			
		||||
    $projectPath = splitlast(__DIR__, $slash)[0];
 | 
			
		||||
    $configPath = $projectPath . $slash . '.data' . $slash . 'config.php';
 | 
			
		||||
    $s = file_get_contents($configPath);
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') {
 | 
			
		||||
        $envs = json_decode($configs, true);
 | 
			
		||||
        if (in_array($str, $InnerEnv)) {
 | 
			
		||||
        if (isInnerEnv($str)) {
 | 
			
		||||
            if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
            if (isset($envs[$disktag][$str])) {
 | 
			
		||||
                if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
 | 
			
		||||
                if (isBase64Env($str)) return base64y_decode($envs[$disktag][$str]);
 | 
			
		||||
                else return $envs[$disktag][$str];
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            if (isset($envs[$str])) {
 | 
			
		||||
                if (in_array($str, $Base64Env)) return base64y_decode($envs[$str]);
 | 
			
		||||
                if (isBase64Env($str)) return base64y_decode($envs[$str]);
 | 
			
		||||
                else return $envs[$str];
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -88,23 +83,19 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    global $slash;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $slash = '/';
 | 
			
		||||
    if (strpos(__DIR__, ':')) $slash = '\\';
 | 
			
		||||
    $projectPath = splitlast(__DIR__, $slash)[0];
 | 
			
		||||
    $configPath = $projectPath . $slash . '.data' . $slash . 'config.php';
 | 
			
		||||
    $s = file_get_contents($configPath);
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') $envs = json_decode($configs, true);
 | 
			
		||||
    $disktags = explode("|", getConfig('disktag'));
 | 
			
		||||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $envs[$disktag][$k] = base64y_encode($v);
 | 
			
		||||
            else $envs[$disktag][$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -114,10 +105,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $envs[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $envs[$newtag] = $envs[$v];
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $envs[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $envs[$k] = base64y_encode($v);
 | 
			
		||||
            else $envs[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -129,7 +125,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $envs['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $envs['disktag'] = implode('|', $tags);
 | 
			
		||||
            $envs[$arr['disktag_newname']] = $envs[$arr['disktag_rename']];
 | 
			
		||||
            unset($envs[$arr['disktag_rename']]);
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -140,7 +141,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $envs = array_filter($envs, 'array_value_isnot_null');
 | 
			
		||||
    ksort($envs);
 | 
			
		||||
    //ksort($envs);
 | 
			
		||||
    sortConfig($envs);
 | 
			
		||||
    
 | 
			
		||||
    //echo '<pre>'. json_encode($envs, JSON_PRETTY_PRINT).'</pre>';
 | 
			
		||||
    $prestr = '<?php $configs = \'' . PHP_EOL;
 | 
			
		||||
| 
						 | 
				
			
			@ -260,7 +262,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -292,7 +294,7 @@ function setConfigResponse($response)
 | 
			
		|||
    return json_decode($response, true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch = 'master')
 | 
			
		||||
function OnekeyUpate($auth = 'BingoKingo', $project = 'Tfo', $branch = 'master')
 | 
			
		||||
{
 | 
			
		||||
    $slash = '/';
 | 
			
		||||
    if (strpos(__DIR__, ':')) $slash = '\\';
 | 
			
		||||
| 
						 | 
				
			
			@ -324,7 +326,7 @@ function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch =
 | 
			
		|||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    //error_log($outPath);
 | 
			
		||||
    //error_log1($outPath);
 | 
			
		||||
    if ($outPath=='') return 0;
 | 
			
		||||
 | 
			
		||||
    //unlink($outPath.'/config.php');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_USER_AGENT'] = $event['headers']['user-agent'];
 | 
			
		||||
    if (isset($event['headers']['authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['authorization'], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_TRANSLATE']==$event['headers']['translate'];//'f'
 | 
			
		||||
    $_SERVER['USER'] = 'qcloud';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -54,17 +59,15 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if (in_array($str, $InnerEnv)) {
 | 
			
		||||
    if (isInnerEnv($str)) {
 | 
			
		||||
        if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
        $env = json_decode(getenv($disktag), true);
 | 
			
		||||
        if (isset($env[$str])) {
 | 
			
		||||
            if (in_array($str, $Base64Env)) return base64y_decode($env[$str]);
 | 
			
		||||
            if (isBase64Env($str)) return base64y_decode($env[$str]);
 | 
			
		||||
            else return $env[$str];
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (in_array($str, $Base64Env)) return base64y_decode(getenv($str));
 | 
			
		||||
        if (isBase64Env($str)) return base64y_decode(getenv($str));
 | 
			
		||||
        else return getenv($str);
 | 
			
		||||
    }
 | 
			
		||||
    return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -72,8 +75,6 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    $disktags = explode("|",getConfig('disktag'));
 | 
			
		||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
			
		||||
| 
						 | 
				
			
			@ -81,8 +82,8 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (isBase64Env($k)) $diskconfig[$k] = base64y_encode($v);
 | 
			
		||||
            else $diskconfig[$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_add') {
 | 
			
		||||
| 
						 | 
				
			
			@ -92,10 +93,15 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $tmp[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $tmp[$newtag] = getConfig($v);
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            if (isBase64Env($k)) $tmp[$k] = base64y_encode($v);
 | 
			
		||||
            else $tmp[$k] = $v;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +112,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $tmp['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $tmp['disktag'] = implode('|', $tags);
 | 
			
		||||
            $tmp[$arr['disktag_newname']] = getConfig($arr['disktag_rename']);
 | 
			
		||||
            $tmp[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -256,7 +267,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -324,7 +335,8 @@ function updateEnvironment($Envs, $function_name, $Region, $Namespace, $SecretId
 | 
			
		|||
    }
 | 
			
		||||
    $tmp_env = array_filter($tmp_env, 'array_value_isnot_null'); // remove null. 清除空值
 | 
			
		||||
    //$tmp_env['Region'] = $Region;
 | 
			
		||||
    ksort($tmp_env);
 | 
			
		||||
    //ksort($tmp_env);
 | 
			
		||||
    sortConfig($tmp_env);
 | 
			
		||||
 | 
			
		||||
    $i = 0;
 | 
			
		||||
    foreach ($tmp_env as $key1 => $value1) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,11 @@ function GetGlobalVariable($event)
 | 
			
		|||
        $_COOKIE[urldecode(substr($cookievalues,0,$pos))]=urldecode(substr($cookievalues,$pos+1));
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_USER_AGENT'] = $event['headers']['user-agent'];
 | 
			
		||||
    if (isset($event['headers']['authorization'])) {
 | 
			
		||||
        $basicAuth = splitfirst(base64_decode(splitfirst($event['headers']['authorization'], 'Basic ')[1]), ':');
 | 
			
		||||
        $_SERVER['PHP_AUTH_USER'] = $basicAuth[0];
 | 
			
		||||
        $_SERVER['PHP_AUTH_PW'] = $basicAuth[1];
 | 
			
		||||
    }
 | 
			
		||||
    $_SERVER['HTTP_TRANSLATE']==$event['headers']['translate'];//'f'
 | 
			
		||||
    $_SERVER['USER'] = 'qcloud';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -54,15 +59,13 @@ function GetPathSetting($event, $context)
 | 
			
		|||
 | 
			
		||||
function getConfig($str, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    //include 'config.php';
 | 
			
		||||
    $s = file_get_contents('config.php');
 | 
			
		||||
    $s = file_get_contents('.data/config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') {
 | 
			
		||||
        $envs = json_decode($configs, true);
 | 
			
		||||
        if (in_array($str, $InnerEnv)) {
 | 
			
		||||
        if (isInnerEnv($str)) {
 | 
			
		||||
            if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
            if (isset($envs[$disktag][$str])) {
 | 
			
		||||
                if (in_array($str, $Base64Env)) return base64y_decode($envs[$disktag][$str]);
 | 
			
		||||
| 
						 | 
				
			
			@ -80,11 +83,9 @@ function getConfig($str, $disktag = '')
 | 
			
		|||
 | 
			
		||||
function setConfig($arr, $disktag = '')
 | 
			
		||||
{
 | 
			
		||||
    global $InnerEnv;
 | 
			
		||||
    global $Base64Env;
 | 
			
		||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
			
		||||
    //include 'config.php';
 | 
			
		||||
    $s = file_get_contents('config.php');
 | 
			
		||||
    $s = file_get_contents('.data/config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') $envs = json_decode($configs, true);
 | 
			
		||||
| 
						 | 
				
			
			@ -92,7 +93,7 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    $indisk = 0;
 | 
			
		||||
    $operatedisk = 0;
 | 
			
		||||
    foreach ($arr as $k => $v) {
 | 
			
		||||
        if (in_array($k, $InnerEnv)) {
 | 
			
		||||
        if (isInnerEnv($k)) {
 | 
			
		||||
            if (in_array($k, $Base64Env)) $envs[$disktag][$k] = base64y_encode($v);
 | 
			
		||||
            else $envs[$disktag][$k] = $v;
 | 
			
		||||
            $indisk = 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -103,6 +104,11 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
            $disktags = array_diff($disktags, [ $v ]);
 | 
			
		||||
            $envs[$v] = '';
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_copy') {
 | 
			
		||||
            $newtag = $v . '_' . date("Ymd_His");
 | 
			
		||||
            $envs[$newtag] = $envs[$v];
 | 
			
		||||
            array_push($disktags, $newtag);
 | 
			
		||||
            $operatedisk = 1;
 | 
			
		||||
        } elseif ($k=='disktag_rename' || $k=='disktag_newname') {
 | 
			
		||||
            if ($arr['disktag_rename']!=$arr['disktag_newname']) $operatedisk = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +124,12 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
    }
 | 
			
		||||
    if ($operatedisk) {
 | 
			
		||||
        if (isset($arr['disktag_newname']) && $arr['disktag_newname']!='') {
 | 
			
		||||
            $envs['disktag'] = str_replace($arr['disktag_rename'], $arr['disktag_newname'], getConfig('disktag'));
 | 
			
		||||
            $tags = [];
 | 
			
		||||
            foreach ($disktags as $tag) {
 | 
			
		||||
                if ($tag==$arr['disktag_rename']) array_push($tags, $arr['disktag_newname']);
 | 
			
		||||
                else array_push($tags, $tag);
 | 
			
		||||
            }
 | 
			
		||||
            $envs['disktag'] = implode('|', $tags);
 | 
			
		||||
            $envs[$arr['disktag_newname']] = $envs[$arr['disktag_rename']];
 | 
			
		||||
            $envs[$arr['disktag_rename']] = '';
 | 
			
		||||
        } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -129,7 +140,7 @@ function setConfig($arr, $disktag = '')
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $envs = array_filter($envs, 'array_value_isnot_null');
 | 
			
		||||
    ksort($envs);
 | 
			
		||||
    //ksort($envs);
 | 
			
		||||
    $response = updateEnvironment($envs, $_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey'));
 | 
			
		||||
    WaitSCFStat($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey'));
 | 
			
		||||
    return $response;
 | 
			
		||||
| 
						 | 
				
			
			@ -268,7 +279,7 @@ language:<br>';
 | 
			
		|||
        return message($html, $title, 201);
 | 
			
		||||
    }
 | 
			
		||||
    $html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
 | 
			
		||||
    $title = 'Error';
 | 
			
		||||
    $title = 'Install';
 | 
			
		||||
    return message($html, $title, 201);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -366,6 +377,7 @@ function copyFolder($from, $to)
 | 
			
		|||
 | 
			
		||||
function updateEnvironment($Envs, $function_name, $Region, $Namespace, $SecretId, $SecretKey)
 | 
			
		||||
{
 | 
			
		||||
    sortConfig($Envs);
 | 
			
		||||
    // 获取当前代码并解压
 | 
			
		||||
    //$codeurl = json_decode(getfunctioncodeurl($function_name, $Region, $Namespace, $SecretId, $SecretKey), true)['Response']['Url'];
 | 
			
		||||
    //$codezip = '/tmp/oldcode.zip';
 | 
			
		||||
| 
						 | 
				
			
			@ -382,7 +394,7 @@ function updateEnvironment($Envs, $function_name, $Region, $Namespace, $SecretId
 | 
			
		|||
    // 将配置写入
 | 
			
		||||
    $prestr = '<?php $configs = \'' . PHP_EOL;
 | 
			
		||||
    $aftstr = PHP_EOL . '\';';
 | 
			
		||||
    file_put_contents($outPath . 'config.php', $prestr . json_encode($Envs, JSON_PRETTY_PRINT) . $aftstr);
 | 
			
		||||
    file_put_contents($outPath . '.data/config.php', $prestr . json_encode($Envs, JSON_PRETTY_PRINT) . $aftstr);
 | 
			
		||||
 | 
			
		||||
    // 将目录中文件打包成zip
 | 
			
		||||
    $source = '/tmp/code.zip';
 | 
			
		||||
| 
						 | 
				
			
			@ -395,7 +407,7 @@ function updateEnvironment($Envs, $function_name, $Region, $Namespace, $SecretId
 | 
			
		|||
 | 
			
		||||
    return updateProgram($function_name, $Region, $namespace, $SecretId, $SecretKey, $source);
 | 
			
		||||
    $tmp1['Response']['Error']['Message'] = $codeurl;
 | 
			
		||||
    error_log($tmp1['Response']['Error']['Message']);
 | 
			
		||||
    error_log1($tmp1['Response']['Error']['Message']);
 | 
			
		||||
    return json_encode($tmp1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -451,7 +463,7 @@ function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $S
 | 
			
		|||
    }
 | 
			
		||||
    WaitSCFStat($function_name, $Region, $Namespace, $SecretId, $SecretKey);
 | 
			
		||||
 | 
			
		||||
    $s = file_get_contents('config.php');
 | 
			
		||||
    $s = file_get_contents('.data/config.php');
 | 
			
		||||
    //$configs = substr($s, 18, -2);
 | 
			
		||||
    $configs = '{' . splitlast(splitfirst($s, '{')[1], '}')[0] . '}';
 | 
			
		||||
    if ($configs!='') $envs = json_decode($configs, true);
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +471,7 @@ function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $S
 | 
			
		|||
        $envs[$k] = $v;
 | 
			
		||||
    }
 | 
			
		||||
    $envs = array_filter($envs, 'array_value_isnot_null');
 | 
			
		||||
    ksort($envs);
 | 
			
		||||
    //ksort($envs);
 | 
			
		||||
    $response = updateEnvironment($envs, $function_name, $Region, $Namespace, $SecretId, $SecretKey);
 | 
			
		||||
    return $response;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -538,7 +550,7 @@ function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKe
 | 
			
		|||
    //    .' -H "X-TC-Version: '.$version.'"'
 | 
			
		||||
    //    .' -H "X-TC-Region: '.$region.'"'
 | 
			
		||||
    //    ." -d '".$payload."'";
 | 
			
		||||
    //error_log( $curl.PHP_EOL );
 | 
			
		||||
    //error_log1( $curl.PHP_EOL );
 | 
			
		||||
    //return '{"response": {"Error": {"Message":"' . $curl . '"}}}';
 | 
			
		||||
    $headers['Authorization'] = $authorization;
 | 
			
		||||
    $headers['Content-Type'] = 'application/json; charset=utf-8';
 | 
			
		||||
| 
						 | 
				
			
			@ -593,7 +605,7 @@ function OnekeyUpate($auth = 'BingoKingo', $project = 'Tfo', $branch = 'master')
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    // 放入配置文件
 | 
			
		||||
    file_put_contents($outPath . '/config.php', file_get_contents(__DIR__.'/../config.php'));
 | 
			
		||||
    file_put_contents($outPath . '/.data/config.php', file_get_contents(__DIR__ . '/../.data/config.php'));
 | 
			
		||||
 | 
			
		||||
    // 将目录中文件打包成zip
 | 
			
		||||
    //$zip=new ZipArchive();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								readme.md
								
								
								
								
							
							
						
						
									
										21
									
								
								readme.md
								
								
								
								
							| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
# **Tfo**
 | 
			
		||||
###### A website for two-point filestorage online (tfo)(20210115). 
 | 
			
		||||
###### A website for two-point filestorage online (tfo)(20210201). 
 | 
			
		||||
 | 
			
		||||
<img src="https://tfo.herokuapp.com/index/Uploaded/WebContents/Github/Tfo/Tfo.logo.svg" alt="Tfo's Logo" width="250" height="250"/>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -29,11 +29,16 @@
 | 
			
		|||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr> 
 | 
			
		||||
            <td rowspan="7">UpdateAddress</td> 
 | 
			
		||||
            <td rowspan="8">UpdateAddress</td> 
 | 
			
		||||
            <td>
 | 
			
		||||
                <a href="./platform/Heroku.php" title="Heroku.php">Heroku.php</a>
 | 
			
		||||
            </td>
 | 
			
		||||
            <td rowspan="7">Address to update is changed for easy management and updating</td> 
 | 
			
		||||
            <td rowspan="8">Address to update is changed for easy management and updating</td> 
 | 
			
		||||
        </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
            <td>
 | 
			
		||||
                <a href="./platform/AliyunFC.php" title="AliyunFC.php">AliyunFC.php</a>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr> 
 | 
			
		||||
            <td>
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +47,7 @@
 | 
			
		|||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td>
 | 
			
		||||
                <a href="./platform/AliyunFC.php" title="AliyunFC.php">AliyunFC.php</a>
 | 
			
		||||
                <a href="./platform/Normal.php" title="Normal.php">Normal.php</a>
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        <tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -82,14 +87,14 @@
 | 
			
		|||
Official: https://heroku.com  
 | 
			
		||||
Demo: https://herooneindex.herokuapp.com/  
 | 
			
		||||
 | 
			
		||||
How to Install: Click the button [](https://heroku.com/deploy?template=https://github.com/qkqpttgf/OneManager-php) to Deploy a new app, or create an app then deploy via connect to your github fork.  
 | 
			
		||||
How to Install: Click the button [](https://heroku.com/deploy?template=https://github.com/BingoKingo/Tfo) to Deploy a new app, or create an app then deploy via connect to your github fork.  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Deploy to Glitch  
 | 
			
		||||
Official: https://glitch.com/  
 | 
			
		||||
Demo: https://onemanager.glitch.me/  
 | 
			
		||||
 | 
			
		||||
How to Install: New Project -> Import form Github -> paste "https://github.com/qkqpttgf/OneManager-php", after done, Show -> In a New Window.  
 | 
			
		||||
How to Install: New Project -> Import form Github -> paste "https://github.com/BingoKingo/Tfo", after done, Show -> In a New Window.  
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Deploy to Tencent Serverless Cloud Function (SCF 腾讯无服务器云函数)  
 | 
			
		||||
| 
						 | 
				
			
			@ -117,8 +122,8 @@ How to Install:
 | 
			
		|||
    开启伪静态(重写)功能,规则在.htaccess文件中,ngnix从里面复制,我们的目的是不管访问什么都让index.php来处理。  
 | 
			
		||||
    3.Upload code.  
 | 
			
		||||
    上传好代码。  
 | 
			
		||||
    4.Change the file config.php can be read&write (666 is suggested).  
 | 
			
		||||
    让代码中的config.php文件程序可读写,推荐chmod 666 config.php。  
 | 
			
		||||
    4.Change the file .data/config.php can be read&write (666 is suggested).  
 | 
			
		||||
    使web身份可读写代码中的.data/config.php文件,推荐chmod 666 .data/config.php。    
 | 
			
		||||
    5.View the website in chrome or other.  
 | 
			
		||||
    在浏览器中访问。  
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,6 +19,7 @@
 | 
			
		|||
    <meta charset=utf-8>
 | 
			
		||||
    <meta http-equiv=X-UA-Compatible content="IE=edge">
 | 
			
		||||
    <meta name=viewport content="width=device-width,initial-scale=1">
 | 
			
		||||
    <meta name="referrer" content="no-referrer">
 | 
			
		||||
    <meta name="keywords" content="<!--Keywords-->">
 | 
			
		||||
    <meta name="description" content="<!--Description-->">
 | 
			
		||||
    <link rel="icon" href="<!--base_path-->favicon.ico" type="image/x-icon">
 | 
			
		||||
| 
						 | 
				
			
			@ -249,7 +250,7 @@
 | 
			
		|||
                            </li>
 | 
			
		||||
<!--AdminEnd-->
 | 
			
		||||
                            <ion-icon name="folder"></ion-icon>
 | 
			
		||||
                            <a id="file_a<!--filenum-->" name="folderlist" href="<!--FileEncodeReplaceUrl-->/"><!--FileEncodeReplaceName--></a>
 | 
			
		||||
                            <a id="file_a<!--filenum-->" name="folderlist" href="<!--FileEncodeReplaceUrl-->/" fileid="<!--FileId-->"><!--FileEncodeReplaceName--></a>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td class="updated_at" id="folder_time<!--filenum-->"><!--lastModifiedDateTime--></td>
 | 
			
		||||
                        <td class="size" id="folder_size<!--filenum-->"><!--size--></td>
 | 
			
		||||
| 
						 | 
				
			
			@ -269,7 +270,7 @@
 | 
			
		|||
                            </li>
 | 
			
		||||
<!--AdminEnd-->
 | 
			
		||||
                            <ion-icon name="<!--IconValue-->"></ion-icon>
 | 
			
		||||
                            <a id="file_a<!--filenum-->" name="filelist" href="<!--FileEncodeReplaceUrl-->?preview" target=_blank><!--FileEncodeReplaceName--></a>
 | 
			
		||||
                            <a id="file_a<!--filenum-->" name="filelist" href="<!--FileEncodeReplaceUrl-->?preview" fileid="<!--FileId-->" target=_blank><!--FileEncodeReplaceName--></a>
 | 
			
		||||
                            <a class="download" href="<!--FileEncodeReplaceUrl-->"><ion-icon name="download"></ion-icon></a>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td class="updated_at" id="file_time<!--filenum-->"><!--lastModifiedDateTime--></td>
 | 
			
		||||
| 
						 | 
				
			
			@ -357,6 +358,7 @@
 | 
			
		|||
                <label id="rename_label"></label><br><br><a onclick="operatediv_close('rename')" class="operatediv_close"><!--constStr@Close--></a>
 | 
			
		||||
                <form id="rename_form" onsubmit="return submit_operate('rename');">
 | 
			
		||||
                <input id="rename_sid" name="rename_sid" type="hidden" value="">
 | 
			
		||||
                <input id="rename_fileid" name="rename_fileid" type="hidden" value="">
 | 
			
		||||
                <input id="rename_hidden" name="rename_oldname" type="hidden" value="">
 | 
			
		||||
                <input id="rename_input" name="rename_newname" type="text" value="">
 | 
			
		||||
                <input name="operate_action" type="submit" value="<!--constStr@Rename-->">
 | 
			
		||||
| 
						 | 
				
			
			@ -370,6 +372,7 @@
 | 
			
		|||
                <form id="delete_form" onsubmit="return submit_operate('delete');">
 | 
			
		||||
                <label id="delete_input"><!--constStr@Delete-->?</label>
 | 
			
		||||
                <input id="delete_sid" name="delete_sid" type="hidden" value="">
 | 
			
		||||
                <input id="delete_fileid" name="delete_fileid" type="hidden" value="">
 | 
			
		||||
                <input id="delete_hidden" name="delete_name" type="hidden" value="">
 | 
			
		||||
                <input name="operate_action" type="submit" value="<!--constStr@Submit-->">
 | 
			
		||||
                </form>
 | 
			
		||||
| 
						 | 
				
			
			@ -380,6 +383,7 @@
 | 
			
		|||
                <label id="encrypt_label"></label><br><br><a onclick="operatediv_close('encrypt')" class="operatediv_close"><!--constStr@Close--></a>
 | 
			
		||||
                <form id="encrypt_form" onsubmit="return submit_operate('encrypt');">
 | 
			
		||||
                <input id="encrypt_sid" name="encrypt_sid" type="hidden" value="">
 | 
			
		||||
                <input id="encrypt_fileid" name="encrypt_fileid" type="hidden" value="">
 | 
			
		||||
                <input id="encrypt_hidden" name="encrypt_folder" type="hidden" value="">
 | 
			
		||||
                <input id="encrypt_input" name="encrypt_newpass" type="text" value="" placeholder="<!--constStr@InputPasswordUWant-->">
 | 
			
		||||
                <!--EncryptBtnStart--><input name="operate_action" type="submit" value="<!--constStr@Encrypt-->"><!--EncryptBtnEnd--><!--EncryptAlertStart--><br><label><!--constStr@SetpassfileBfEncrypt--></label><!--EncryptAlertEnd-->
 | 
			
		||||
| 
						 | 
				
			
			@ -391,6 +395,7 @@
 | 
			
		|||
                <label id="copy_label"></label><br><br><a onclick="operatediv_close('copy')" class="operatediv_close"><!--constStr@Close--></a>
 | 
			
		||||
                <form id="copy_form" onsubmit="return submit_operate('copy');">
 | 
			
		||||
                <input id="copy_sid" name="copy_sid" type="hidden" value="">
 | 
			
		||||
                <input id="copy_fileid" name="copy_fileid" type="hidden" value="">
 | 
			
		||||
                <input id="copy_hidden" name="copy_name" type="hidden" value="">
 | 
			
		||||
                <input id="copy_input" name="copy_input" type="hidden" value="">
 | 
			
		||||
                <input name="operate_action" type="submit" value="<!--constStr@Copy-->">
 | 
			
		||||
| 
						 | 
				
			
			@ -402,6 +407,7 @@
 | 
			
		|||
                <label id="move_label"></label><br><br><a onclick="operatediv_close('move')" class="operatediv_close"><!--constStr@Close--></a>
 | 
			
		||||
                <form id="move_form" onsubmit="return submit_operate('move');">
 | 
			
		||||
                <input id="move_sid" name="move_sid" type="hidden" value="">
 | 
			
		||||
                <input id="move_fileid" name="move_fileid" type="hidden" value="">
 | 
			
		||||
                <input id="move_hidden" name="move_name" type="hidden" value="">
 | 
			
		||||
                <select id="move_input" name="move_folder">
 | 
			
		||||
<!--MoveRootStart-->
 | 
			
		||||
| 
						 | 
				
			
			@ -420,6 +426,7 @@
 | 
			
		|||
                <a onclick="operatediv_close('create')" class="operatediv_close"><!--constStr@Close--></a>
 | 
			
		||||
                <form id="create_form" onsubmit="return submit_operate('create');">
 | 
			
		||||
                    <input id="create_sid" name="create_sid" type="hidden" value="">
 | 
			
		||||
                    <input id="create_fileid" name="create_fileid" type="hidden" value="">
 | 
			
		||||
                    <input id="create_hidden" type="hidden" value="">
 | 
			
		||||
                    <table>
 | 
			
		||||
                        <tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -472,6 +479,7 @@
 | 
			
		|||
<!--MdRequireStart--><link rel="stylesheet" href="//unpkg.zhimg.com/github-markdown-css@3.0.1/github-markdown.css">
 | 
			
		||||
<script type="text/javascript" src="//unpkg.zhimg.com/marked@0.6.2/marked.min.js"></script><!--MdRequireEnd-->
 | 
			
		||||
<!--GuestUploadStart--><script type="text/javascript" src="//cdn.bootcss.com/spark-md5/3.0.0/spark-md5.min.js"></script><!--GuestUploadEnd-->
 | 
			
		||||
<!--AliyundriveUploadJsStart--><script src="//cdn.bootcdn.net/ajax/libs/js-sha1/0.6.0/sha1.min.js"></script><!--AliyundriveUploadJsEnd-->
 | 
			
		||||
<!--IsFileStart--><!--IspdfFileStart--><script src="//cdn.bootcss.com/pdf.js/2.3.200/pdf.min.js"></script><!--IspdfFileEnd--><!--IsFileEnd-->
 | 
			
		||||
<!--ListEnd-->
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
| 
						 | 
				
			
			@ -485,27 +493,7 @@
 | 
			
		|||
        location.href = location.href;
 | 
			
		||||
    }
 | 
			
		||||
<!--ListStart-->
 | 
			
		||||
    /*var root = '<!--base_disk_path-->';
 | 
			
		||||
    function path_format(path) {
 | 
			
		||||
        path = '/' + path + '/';
 | 
			
		||||
        while (path.indexOf('//') !== -1) {
 | 
			
		||||
            path = path.replace('//', '/')
 | 
			
		||||
        }
 | 
			
		||||
        return path
 | 
			
		||||
    }
 | 
			
		||||
    document.querySelectorAll('.table-header').forEach(function (e) {
 | 
			
		||||
        var path = e.innerText;
 | 
			
		||||
        if (path.substr(path.length-1)=='/') path = path.substr(0, path.length-1);
 | 
			
		||||
        var paths = path.split('/');
 | 
			
		||||
        e.innerHTML = '/ ';
 | 
			
		||||
        if (paths <= 2) return;
 | 
			
		||||
        for (var i = 1; i < paths.length - 1; i++) {
 | 
			
		||||
            var to = path_format(root + paths.slice(0, i + 1).join('/'));
 | 
			
		||||
            e.innerHTML += '<a href="' + to + '">' + paths[i] + '</a> / '
 | 
			
		||||
        }
 | 
			
		||||
        e.innerHTML += paths[paths.length - 1];
 | 
			
		||||
        e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
 | 
			
		||||
    });*/
 | 
			
		||||
 | 
			
		||||
<!--IsFileStart-->
 | 
			
		||||
    var $url = document.getElementById('url');
 | 
			
		||||
    if ($url) {
 | 
			
		||||
| 
						 | 
				
			
			@ -796,6 +784,24 @@
 | 
			
		|||
        alert(tmptextarea.innerHTML+"<!--constStr@Success-->");
 | 
			
		||||
    }
 | 
			
		||||
<!--UploadJsStart-->
 | 
			
		||||
    function size_format(num) {
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' B';
 | 
			
		||||
        }
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' KB';
 | 
			
		||||
        }
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' MB';
 | 
			
		||||
        }
 | 
			
		||||
        return num.toFixed(2) + ' GB';
 | 
			
		||||
    }
 | 
			
		||||
    function uploadbuttonhide() {
 | 
			
		||||
        document.getElementById('upload_btns').style.display='none';
 | 
			
		||||
        /*document.getElementById('upload_submit').disabled='disabled';
 | 
			
		||||
| 
						 | 
				
			
			@ -810,6 +816,8 @@
 | 
			
		|||
        document.getElementById('upload_submit').style.display='';
 | 
			
		||||
        document.getElementById('upload_file').style.display='';*/
 | 
			
		||||
    }
 | 
			
		||||
<!--UploadJsEnd-->
 | 
			
		||||
<!--OnedriveUploadJsStart-->
 | 
			
		||||
    function preup() {
 | 
			
		||||
        uploadbuttonhide();
 | 
			
		||||
        var files=document.getElementById('upload_file').files;
 | 
			
		||||
| 
						 | 
				
			
			@ -849,6 +857,7 @@
 | 
			
		|||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
 | 
			
		||||
            var filemd5='';
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            function getext(str) {
 | 
			
		||||
                strarry=str.split('.');
 | 
			
		||||
| 
						 | 
				
			
			@ -880,13 +889,13 @@
 | 
			
		|||
            if (asize < file.size) {
 | 
			
		||||
                readblob(asize);
 | 
			
		||||
            } else {
 | 
			
		||||
                var filemd5 = spark.end();
 | 
			
		||||
                filemd5 = spark.end();
 | 
			
		||||
                td2.innerHTML='md5: '+filemd5;
 | 
			
		||||
                upbigfilename = filemd5+ext;
 | 
			
		||||
<!--GuestEnd-->
 | 
			
		||||
            td2.innerHTML='<!--constStr@GetUploadLink--> ...';
 | 
			
		||||
            var xhr1 = new XMLHttpRequest();
 | 
			
		||||
            xhr1.open("GET", '?action=upbigfile&upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&lastModified='+ file.lastModified);
 | 
			
		||||
            xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
            xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
            xhr1.onprogress = function(e){
 | 
			
		||||
                td2.innerHTML+='.';
 | 
			
		||||
| 
						 | 
				
			
			@ -921,7 +930,7 @@
 | 
			
		|||
                    getuplink(i);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            xhr1.send(null);
 | 
			
		||||
            xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5);
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -929,24 +938,7 @@
 | 
			
		|||
        }
 | 
			
		||||
        uploadbuttonshow();
 | 
			
		||||
    }
 | 
			
		||||
    function size_format(num) {
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' B';
 | 
			
		||||
        }
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' KB';
 | 
			
		||||
        }
 | 
			
		||||
        if (num>1024) {
 | 
			
		||||
            num=num/1024;
 | 
			
		||||
        } else {
 | 
			
		||||
            return num.toFixed(2) + ' MB';
 | 
			
		||||
        }
 | 
			
		||||
        return num.toFixed(2) + ' GB';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function binupfile(file,url,tdnum,filename){
 | 
			
		||||
        var label=document.getElementById('upfile_td2_'+tdnum);
 | 
			
		||||
        var reader = new FileReader();
 | 
			
		||||
| 
						 | 
				
			
			@ -1052,7 +1044,193 @@
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
<!--UploadJsEnd-->
 | 
			
		||||
<!--OnedriveUploadJsEnd-->
 | 
			
		||||
<!--AliyundriveUploadJsStart-->
 | 
			
		||||
    function preup() {
 | 
			
		||||
        uploadbuttonhide();
 | 
			
		||||
        var files=document.getElementById('upload_file').files;
 | 
			
		||||
	    if (files.length<1) {
 | 
			
		||||
            uploadbuttonshow();
 | 
			
		||||
            return;
 | 
			
		||||
        };
 | 
			
		||||
        var table1=document.createElement('table');
 | 
			
		||||
        document.getElementById('upload_div').appendChild(table1);
 | 
			
		||||
        table1.setAttribute('class','list-table');
 | 
			
		||||
        var timea=new Date().getTime();
 | 
			
		||||
        var i=0;
 | 
			
		||||
        getuplink(i);
 | 
			
		||||
        function getuplink(i, r=0) {
 | 
			
		||||
            var file=files[i];
 | 
			
		||||
            var td1;
 | 
			
		||||
            var td2;
 | 
			
		||||
            if (r==0) {
 | 
			
		||||
                var tr1=document.createElement('tr');
 | 
			
		||||
                table1.appendChild(tr1);
 | 
			
		||||
                tr1.setAttribute('data-to',1);
 | 
			
		||||
                td1=document.createElement('td');
 | 
			
		||||
                tr1.appendChild(td1);
 | 
			
		||||
                td1.setAttribute('style','width:30%;word-break:break-word;');
 | 
			
		||||
                td1.setAttribute('id','upfile_td1_'+timea+'_'+i);
 | 
			
		||||
                td1.innerHTML=(file.webkitRelativePath||file.name)+'<br>'+size_format(file.size);
 | 
			
		||||
                td2=document.createElement('td');
 | 
			
		||||
                tr1.appendChild(td2);
 | 
			
		||||
                td2.setAttribute('id','upfile_td2_'+timea+'_'+i);
 | 
			
		||||
            }
 | 
			
		||||
            var tdnum = timea+'_'+i;
 | 
			
		||||
            td1=document.getElementById('upfile_td1_'+tdnum);
 | 
			
		||||
            td2=document.getElementById('upfile_td2_'+tdnum);
 | 
			
		||||
            if (file.size>100*1024*1024*1024) {
 | 
			
		||||
                td2.innerHTML='<font color="red"><!--constStr@UpFileTooLarge--></font>';
 | 
			
		||||
                uploadbuttonshow();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
 | 
			
		||||
            td2.innerHTML='计算SHA1 ...';
 | 
			
		||||
            var reader = new FileReader();
 | 
			
		||||
            reader.readAsArrayBuffer(file);
 | 
			
		||||
            reader.onload = function(e){
 | 
			
		||||
                var filesha1 = sha1(this.result);
 | 
			
		||||
                td2.innerHTML='<!--constStr@GetUploadLink--> ...';
 | 
			
		||||
                var xhr1 = new XMLHttpRequest();
 | 
			
		||||
                xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
                xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
                xhr1.onload = function(e){
 | 
			
		||||
                    //console.log(xhr1.status+xhr1.responseText);
 | 
			
		||||
                    td2.innerHTML='<font color="red">'+xhr1.responseText+'</font>';
 | 
			
		||||
                    if (xhr1.status==201) {
 | 
			
		||||
                        if (xhr1.responseText=='') {
 | 
			
		||||
                            getuplink(i,1);
 | 
			
		||||
                            return;
 | 
			
		||||
                        }
 | 
			
		||||
                        var html=JSON.parse(xhr1.responseText);
 | 
			
		||||
                        //console.log(html);
 | 
			
		||||
                        if (!html['part_info_list']) {
 | 
			
		||||
                            if (html.name!='') {
 | 
			
		||||
                                if (html.exist==true) td2.innerHTML=html.name+' 文件名已有';
 | 
			
		||||
                                else if (html.rapid_upload==true) td2.innerHTML=html.name+' 秒传';
 | 
			
		||||
                                else td2.innerHTML='<font color="red">'+xhr1.responseText+'</font><br>';
 | 
			
		||||
                                td1.innerHTML='<div style="color:green"><a href="<!--base_disk_path--><!--Path-->'+html.name+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+td1.innerHTML+'</a><br><a href="<!--base_disk_path--><!--Path-->'+html.name+'" id="upfile_a1_'+tdnum+'"></a><!--constStr@UploadComplete--><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <!--AdminStart--> style="display:none"<!--AdminEnd--> ><!--constStr@CopyUrl--></button></div>';
 | 
			
		||||
                            } else {
 | 
			
		||||
                                td2.innerHTML='<font color="red">'+xhr1.responseText+'</font><br>';
 | 
			
		||||
                            }
 | 
			
		||||
                        } else {
 | 
			
		||||
                            td2.innerHTML='<!--constStr@UploadStart--> ...';
 | 
			
		||||
                            console.log(html['part_info_list'][0]['upload_url']);
 | 
			
		||||
                            binupfile(file,html['part_info_list'][0]['upload_url'],timea+'_'+i, upbigfilename, filesha1,html['file_id'],html['upload_id']);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if (i<files.length-1) {
 | 
			
		||||
                        i++;
 | 
			
		||||
                        getuplink(i);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        uploadbuttonshow();
 | 
			
		||||
    }
 | 
			
		||||
    function binupfile(file,url,tdnum,filename,filesha1,fileid,uploadid){
 | 
			
		||||
        // xhr.getResponseHeader
 | 
			
		||||
        var label=document.getElementById('upfile_td2_'+tdnum);
 | 
			
		||||
        var reader = new FileReader();
 | 
			
		||||
        var StartStr='';
 | 
			
		||||
        var MiddleStr='';
 | 
			
		||||
        var StartTime;
 | 
			
		||||
        var EndTime;
 | 
			
		||||
        var newstartsize = 0;
 | 
			
		||||
        if(!!file){
 | 
			
		||||
            var asize=0;
 | 
			
		||||
            var totalsize=file.size;
 | 
			
		||||
            var newstartsize=0;
 | 
			
		||||
            StartTime = new Date();
 | 
			
		||||
            asize = newstartsize;
 | 
			
		||||
            if (newstartsize==0) {
 | 
			
		||||
                StartStr='<!--constStr@UploadStartAt-->:' +StartTime.toLocaleString()+'<br>' ;
 | 
			
		||||
            } else {
 | 
			
		||||
                StartStr='<!--constStr@LastUpload-->'+size_format(newstartsize)+ '<br><!--constStr@ThisTime--><!--constStr@UploadStartAt-->:' +StartTime.toLocaleString()+'<br>' ;
 | 
			
		||||
            }
 | 
			
		||||
            //var chunksize=5*1024*1024; // chunk size, max 60M. 每小块上传大小
 | 
			
		||||
            //if (totalsize>200*1024*1024) chunksize=10*1024*1024;
 | 
			
		||||
            function readblob(start) {
 | 
			
		||||
                //var end=start+chunksize;
 | 
			
		||||
                //var blob = file.slice(start,end);
 | 
			
		||||
                //reader.readAsArrayBuffer(blob);
 | 
			
		||||
                reader.readAsArrayBuffer(file);
 | 
			
		||||
            }
 | 
			
		||||
            readblob(asize);
 | 
			
		||||
 | 
			
		||||
            reader.onload = function(e){
 | 
			
		||||
                var binary = this.result;
 | 
			
		||||
                var xhr = new XMLHttpRequest();
 | 
			
		||||
                xhr.open("PUT", url, true);
 | 
			
		||||
                //xhr.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
                bsize=asize+e.loaded-1;
 | 
			
		||||
                xhr.setRequestHeader('Content-Range', 'bytes ' + asize + '-' + bsize +'/'+ totalsize);
 | 
			
		||||
                xhr.upload.onprogress = function(e){
 | 
			
		||||
                    if (e.lengthComputable) {
 | 
			
		||||
                        var tmptime = new Date();
 | 
			
		||||
                        var tmpspeed = e.loaded*1000/(tmptime.getTime()-C_starttime.getTime());
 | 
			
		||||
                        var remaintime = (totalsize-asize-e.loaded)/tmpspeed;
 | 
			
		||||
                        label.innerHTML=StartStr+'<!--constStr@Upload--> ' +size_format(asize+e.loaded)+ ' / '+size_format(totalsize) + ' = ' + ((asize+e.loaded)*100/totalsize).toFixed(2) + '% <!--constStr@AverageSpeed-->:'+size_format((asize+e.loaded-newstartsize)*1000/(tmptime.getTime()-StartTime.getTime()))+'/s<br><!--constStr@CurrentSpeed--> '+size_format(tmpspeed)+'/s <!--constStr@Expect--> '+remaintime.toFixed(1)+'s';
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                var C_starttime = new Date();
 | 
			
		||||
                xhr.onload = function(e){
 | 
			
		||||
                    if (xhr.status<500) {
 | 
			
		||||
                        //console.log(xhr.responseText);
 | 
			
		||||
                        //console.log(xhr.getResponseHeader('ETag'));
 | 
			
		||||
                    //var response=JSON.parse(xhr.responseText);
 | 
			
		||||
                    if (xhr.responseText==''&&xhr.getResponseHeader('ETag')!='') {
 | 
			
		||||
                        // 有ETag说明上传成功
 | 
			
		||||
                        var xhr1 = new XMLHttpRequest();
 | 
			
		||||
                        xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
                        //xhr1.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
 | 
			
		||||
                        xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
                        xhr1.send('uploadid='+ uploadid +'&fileid='+ fileid +'&etag='+ xhr.getResponseHeader('ETag'));
 | 
			
		||||
                        xhr1.onload = function(e){
 | 
			
		||||
                            console.log(xhr1.responseText+','+xhr1.status);
 | 
			
		||||
<!--AdminStart-->
 | 
			
		||||
                            var html=JSON.parse(xhr1.responseText);
 | 
			
		||||
                            //response.name=file.webkitRelativePath||response.name;
 | 
			
		||||
                            addelement(html);
 | 
			
		||||
<!--AdminEnd-->
 | 
			
		||||
                        }
 | 
			
		||||
                        if (totalsize>10*1024*1024) {
 | 
			
		||||
                            var xhr3 = new XMLHttpRequest();
 | 
			
		||||
                            xhr3.open("GET", '?action=del_upload_cache&filelastModified='+file.lastModified+'&filesize='+file.size+'&filename='+filename);
 | 
			
		||||
                            xhr3.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
                            xhr3.send(null);
 | 
			
		||||
                            xhr3.onload = function(e){
 | 
			
		||||
                                console.log(xhr3.responseText+','+xhr3.status);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        EndTime=new Date();
 | 
			
		||||
                        MiddleStr = '<!--constStr@EndAt-->:'+EndTime.toLocaleString()+'<br>';
 | 
			
		||||
                        if (newstartsize==0) {
 | 
			
		||||
                            MiddleStr += '<!--constStr@AverageSpeed-->:'+size_format(totalsize*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
 | 
			
		||||
                        } else {
 | 
			
		||||
                            MiddleStr += '<!--constStr@ThisTime--><!--constStr@AverageSpeed-->:'+size_format((totalsize-newstartsize)*1000/(EndTime.getTime()-StartTime.getTime()))+'/s<br>';
 | 
			
		||||
                        }
 | 
			
		||||
                        while (filename.indexOf('%2F')>0) filename = filename.replace('%2F', '/');
 | 
			
		||||
                        document.getElementById('upfile_td1_'+tdnum).innerHTML='<div style="color:green"><a href="<!--base_disk_path--><!--Path-->'+filename+'?preview" id="upfile_a_'+tdnum+'" target="_blank">'+document.getElementById('upfile_td1_'+tdnum).innerHTML+'</a><br><a href="<!--base_disk_path--><!--Path-->'+filename+'" id="upfile_a1_'+tdnum+'"></a><!--constStr@UploadComplete--><button onclick="CopyAllDownloadUrl(\'#upfile_a1_'+tdnum+'\');" id="upfile_cpbt_'+tdnum+'" <!--AdminStart--> style="display:none"<!--AdminEnd--> ><!--constStr@CopyUrl--></button></div>';
 | 
			
		||||
                        label.innerHTML=StartStr+MiddleStr;
 | 
			
		||||
                        label.style.color='green';
 | 
			
		||||
                        // uploadbuttonshow();
 | 
			
		||||
                    } else {
 | 
			
		||||
                        if (!response['nextExpectedRanges']) {
 | 
			
		||||
                            label.innerHTML='<font color="red">'+xhr.responseText+'</font><br>';
 | 
			
		||||
                        } else {
 | 
			
		||||
                            var a=response['nextExpectedRanges'][0];
 | 
			
		||||
                            asize=Number( a.slice(0,a.indexOf("-")) );
 | 
			
		||||
                            readblob(asize);
 | 
			
		||||
                        }
 | 
			
		||||
                    } } else readblob(asize);
 | 
			
		||||
                }
 | 
			
		||||
                xhr.send(binary);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
<!--AliyundriveUploadJsEnd-->
 | 
			
		||||
<!--ListEnd-->
 | 
			
		||||
    function operatediv_close(operate) {
 | 
			
		||||
        document.getElementById(operate+'_div').style.display='none';
 | 
			
		||||
| 
						 | 
				
			
			@ -1060,7 +1238,10 @@
 | 
			
		|||
    }
 | 
			
		||||
<!--AdminStart-->
 | 
			
		||||
    function logout() {
 | 
			
		||||
        document.cookie = "admin=; path=/";
 | 
			
		||||
        var expd = new Date();
 | 
			
		||||
        expd.setTime(expd.getTime()+1000);
 | 
			
		||||
        var expires = "expires="+expd.toGMTString();
 | 
			
		||||
        document.cookie = "admin=; path=/; "+expires;
 | 
			
		||||
        location.href = location.href;
 | 
			
		||||
    }
 | 
			
		||||
<!--IsFolderStart-->
 | 
			
		||||
| 
						 | 
				
			
			@ -1074,16 +1255,19 @@
 | 
			
		|||
        document.getElementById('mask').style.height=document.documentElement.scrollHeight<window.innerHeight?window.innerHeight:document.documentElement.scrollHeight+'px';
 | 
			
		||||
        if (num=='') {
 | 
			
		||||
            var str='';
 | 
			
		||||
            var fileid='';
 | 
			
		||||
        } else {
 | 
			
		||||
            var str=decodeURIComponent(document.getElementById('file_a'+num).href);
 | 
			
		||||
            if (str.substr(-1)==' ') str=str.substr(0, str.length-1);
 | 
			
		||||
            if (str.substr(-1)=='/') str=str.substr(0, str.length-1);
 | 
			
		||||
            if (str.substr(-8)=='?preview') str=str.substr(0, str.length-8);
 | 
			
		||||
            if (str.lastIndexOf('/')>-1) str=str.substr(str.lastIndexOf('/')+1);
 | 
			
		||||
            var fileid=document.getElementById('file_a'+num).attributes['fileid'].nodeValue;
 | 
			
		||||
        }
 | 
			
		||||
        document.getElementById(action + '_div').style.display='';
 | 
			
		||||
        document.getElementById(action + '_label').innerText=str;//.replace(/&/,'&');
 | 
			
		||||
        document.getElementById(action + '_sid').value=num;
 | 
			
		||||
        document.getElementById(action + '_fileid').value=fileid;
 | 
			
		||||
        document.getElementById(action + '_hidden').value=str;
 | 
			
		||||
        if (action=='rename') document.getElementById(action + '_input').value=str;
 | 
			
		||||
        var $e = event || window.event;
 | 
			
		||||
| 
						 | 
				
			
			@ -1129,6 +1313,7 @@
 | 
			
		|||
                    html=JSON.parse(xhr.responseText);
 | 
			
		||||
                    addelement(html);
 | 
			
		||||
                }
 | 
			
		||||
                //alert('success');
 | 
			
		||||
            } else alert(xhr.status+'\n'+xhr.responseText);
 | 
			
		||||
            document.getElementById(str+'_div').style.display='none';
 | 
			
		||||
            document.getElementById('mask').style.display='none';
 | 
			
		||||
| 
						 | 
				
			
			@ -1147,15 +1332,16 @@
 | 
			
		|||
        a1.target='_blank';
 | 
			
		||||
        var td2=document.createElement('td');
 | 
			
		||||
        td2.setAttribute('class','updated_at');
 | 
			
		||||
        td2.innerText=html.lastModifiedDateTime.replace(/T/,' ').replace(/Z/,'');
 | 
			
		||||
        if (!!html.time) td2.innerText=html.time.replace(/T/,' ').replace(/Z/,'');
 | 
			
		||||
        var td3=document.createElement('td');
 | 
			
		||||
        td3.setAttribute('class','size');
 | 
			
		||||
        td3.innerText=size_format(html.size);
 | 
			
		||||
        if (!!html.folder) {
 | 
			
		||||
        if (!!html.size) td3.innerText=size_format(html.size);
 | 
			
		||||
        else td3.innerText='0 B';
 | 
			
		||||
        if (html.type=='folder') {
 | 
			
		||||
            a1.href+='/';
 | 
			
		||||
            document.getElementById('tr0').parentNode.insertBefore(tr1,document.getElementById('tr0').nextSibling);
 | 
			
		||||
        }
 | 
			
		||||
        if (!!html.file) {
 | 
			
		||||
        if (html.type=='file') {
 | 
			
		||||
            a1.href+='?preview';
 | 
			
		||||
            a1.name='filelist';
 | 
			
		||||
            document.getElementById('tr0').parentNode.appendChild(tr1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1032,10 +1032,10 @@ return false;
 | 
			
		|||
                uploadbuttonshow();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            var filemd5 = '';
 | 
			
		||||
            var xhr1 = new XMLHttpRequest();
 | 
			
		||||
            xhr1.open("GET", '?action=upbigfile&upbigfilename='+ encodeURIComponent((file.webkitRelativePath||file.name)) +'&filesize='+ file.size +'&lastModified='+ file.lastModified);
 | 
			
		||||
            xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
            xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
            xhr1.send(null);
 | 
			
		||||
            xhr1.onload = function(e){
 | 
			
		||||
                td2.innerHTML='<font color="red">'+xhr1.responseText+'</font>';
 | 
			
		||||
                if (xhr1.status==200) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1054,6 +1054,7 @@ return false;
 | 
			
		|||
                    getuplink(i);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            xhr1.send('upbigfilename='+ encodeURIComponent((file.webkitRelativePath||file.name)) +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    function size_format(num) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -807,6 +807,7 @@
 | 
			
		|||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
 | 
			
		||||
            var filemd5='';
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            function getext(str) {
 | 
			
		||||
                strarry=str.split('.');
 | 
			
		||||
| 
						 | 
				
			
			@ -843,7 +844,7 @@
 | 
			
		|||
<!--GuestEnd-->
 | 
			
		||||
            td2.innerHTML='<!--constStr@GetUploadLink--> ...';
 | 
			
		||||
            var xhr1 = new XMLHttpRequest();
 | 
			
		||||
            xhr1.open("GET", '?action=upbigfile&upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&lastModified='+ file.lastModified);
 | 
			
		||||
            xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
            xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
            xhr1.onprogress = function(e){
 | 
			
		||||
                td2.innerHTML+='.';
 | 
			
		||||
| 
						 | 
				
			
			@ -878,7 +879,7 @@
 | 
			
		|||
                    getuplink(i);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            xhr1.send(null);
 | 
			
		||||
            xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5);
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -849,6 +849,7 @@
 | 
			
		|||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name));
 | 
			
		||||
            var filemd5='';
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            function getext(str) {
 | 
			
		||||
                strarry=str.split('.');
 | 
			
		||||
| 
						 | 
				
			
			@ -885,7 +886,7 @@
 | 
			
		|||
<!--GuestEnd-->
 | 
			
		||||
            td2.innerHTML='<!--constStr@GetUploadLink--> ...';
 | 
			
		||||
            var xhr1 = new XMLHttpRequest();
 | 
			
		||||
            xhr1.open("GET", '?action=upbigfile&upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&lastModified='+ file.lastModified);
 | 
			
		||||
            xhr1.open("POST", '?action=upbigfile');
 | 
			
		||||
            xhr1.setRequestHeader('x-requested-with','XMLHttpRequest');
 | 
			
		||||
            xhr1.onprogress = function(e){
 | 
			
		||||
                td2.innerHTML+='.';
 | 
			
		||||
| 
						 | 
				
			
			@ -920,7 +921,7 @@
 | 
			
		|||
                    getuplink(i);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            xhr1.send(null);
 | 
			
		||||
            xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified +'&filemd5='+ filemd5);
 | 
			
		||||
<!--GuestStart-->
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@
 | 
			
		|||
/>
 | 
			
		||||
<title><!--Title--></title>
 | 
			
		||||
<meta name="description" content="A Onemanager-PHP site with Theme-renexmoe" />
 | 
			
		||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.2/css/app.css"><meta name="theme-color" content="#fff" />
 | 
			
		||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/css/app.css"><meta name="theme-color" content="#fff" />
 | 
			
		||||
<!--BackgroundStart-->
 | 
			
		||||
<style>
 | 
			
		||||
  body {
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,24 @@
 | 
			
		|||
  window.disableddarkmode = true;
 | 
			
		||||
</script>
 | 
			
		||||
<!--BackgroundEnd-->
 | 
			
		||||
<!--BackgroundMStart-->
 | 
			
		||||
<style>
 | 
			
		||||
  body {
 | 
			
		||||
    --bg: url("<!--BackgroundMUrl-->");
 | 
			
		||||
    background-repeat: no-repeat;
 | 
			
		||||
    background-size: cover;
 | 
			
		||||
    background-attachment: fixed;
 | 
			
		||||
    background-image: var(--bg);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .mdui-shadow-3 {
 | 
			
		||||
    background: rgba(255, 255, 255, 0.5);
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
<script>
 | 
			
		||||
  window.disableddarkmode = true;
 | 
			
		||||
</script>
 | 
			
		||||
<!--BackgroundMEnd-->
 | 
			
		||||
  </head>
 | 
			
		||||
  <body
 | 
			
		||||
    class="mdui-appbar-with-toolbar mdui-theme-layout-auto mdui-loaded mdui-theme-accent-pink"
 | 
			
		||||
| 
						 | 
				
			
			@ -47,13 +64,11 @@
 | 
			
		|||
  <div class="mdui-toolbar">
 | 
			
		||||
  <span
 | 
			
		||||
    class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white"
 | 
			
		||||
    mdui-tooltip="{content: '菜单'}"
 | 
			
		||||
    onclick='mdui.$("body").toggleClass("mdui-drawer-body-left");'
 | 
			
		||||
    id="toggle-drawer"
 | 
			
		||||
    ><i class="mdui-icon material-icons">menu</i></span
 | 
			
		||||
  >
 | 
			
		||||
  <a
 | 
			
		||||
    mdui-tooltip="{content: '返回'}"
 | 
			
		||||
    class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white mdui-hidden-sm-up"
 | 
			
		||||
    onclick="window.history.back()"
 | 
			
		||||
  >
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +88,6 @@
 | 
			
		|||
  <!--AdminStart--><a
 | 
			
		||||
    href="javascript:;"
 | 
			
		||||
    class="mdui-btn mdui-btn-icon mdui-ripple mdui-hidden-sm-up refresh"
 | 
			
		||||
    mdui-tooltip="{content: '刷新缓存'}"
 | 
			
		||||
    ><i class="mdui-icon material-icons">refresh</i></a
 | 
			
		||||
  >
 | 
			
		||||
  <!--AdminEnd-->
 | 
			
		||||
| 
						 | 
				
			
			@ -127,20 +141,26 @@
 | 
			
		|||
        href="<!--base_path-->"
 | 
			
		||||
        class="mdui-list-item-icon mdui-icon material-icons"
 | 
			
		||||
        >home</a
 | 
			
		||||
      ><a href="<!--base_path-->" class="mdui-list-item-content">
 | 
			
		||||
      ><a href="<!--base_path-->" class="mdui-list-item-content" id="home">
 | 
			
		||||
        <!--constStr@Home--></a
 | 
			
		||||
      >
 | 
			
		||||
    </li>
 | 
			
		||||
    <!--MultiDiskAreaStart-->
 | 
			
		||||
<div class="mdui-divider"></div>
 | 
			
		||||
<!--MultiDisksStart--><a
 | 
			
		||||
  href="<!--MultiDisksUrl-->"
 | 
			
		||||
  class="mdui-list-item mdui-ripple"
 | 
			
		||||
  ><i class="mdui-list-item-icon mdui-icon material-icons">cloud</i>
 | 
			
		||||
  <div class="mdui-list-item-content">
 | 
			
		||||
<!--MultiDisksStart-->
 | 
			
		||||
<li class="mdui-list-item mdui-ripple">
 | 
			
		||||
  <a
 | 
			
		||||
    href="<!--MultiDisksUrl-->"
 | 
			
		||||
    class="mdui-list-item-icon mdui-icon material-icons"
 | 
			
		||||
    >cloud</a
 | 
			
		||||
  >
 | 
			
		||||
  <a
 | 
			
		||||
    href="<!--MultiDisksUrl-->"
 | 
			
		||||
    class="mdui-list-item-content mdui-text-truncate disk_name"
 | 
			
		||||
  >
 | 
			
		||||
    <!--MultiDisksName-->
 | 
			
		||||
  </div>
 | 
			
		||||
</a>
 | 
			
		||||
  </a>
 | 
			
		||||
</li>
 | 
			
		||||
<!--MultiDisksEnd-->
 | 
			
		||||
<div class="mdui-divider"></div>
 | 
			
		||||
<!--MultiDiskAreaEnd-->
 | 
			
		||||
| 
						 | 
				
			
			@ -187,7 +207,7 @@
 | 
			
		|||
      <div class="mdui-textfield mdui-textfield-floating-label">
 | 
			
		||||
        <i class="mdui-icon material-icons">lock</i
 | 
			
		||||
        ><label class="mdui-textfield-label">密码</label
 | 
			
		||||
        ><input class="mdui-textfield-input" name="password1" type="new-password" />
 | 
			
		||||
        ><input class="mdui-textfield-input" name="password1" type="password" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="mdui-dialog-actions">
 | 
			
		||||
| 
						 | 
				
			
			@ -278,7 +298,7 @@
 | 
			
		|||
      </div>
 | 
			
		||||
    </li>
 | 
			
		||||
    <!--BackArrowStart-->
 | 
			
		||||
    <li class="mdui-list-item mdui-ripple">
 | 
			
		||||
    <li class="mdui-list-item mdui-ripple back-page">
 | 
			
		||||
      <div class="mdui-row mdui-col-sm-12">
 | 
			
		||||
        <a href="<!--BackArrowUrl-->">
 | 
			
		||||
          <div class="mdui-col-xs-7">
 | 
			
		||||
| 
						 | 
				
			
			@ -381,7 +401,7 @@
 | 
			
		|||
 | 
			
		||||
<!--IsFolderEnd-->
 | 
			
		||||
 <!--IsFileStart-->
 | 
			
		||||
<div id="file">
 | 
			
		||||
<div id="file" class="mdui-shadow-3" style="padding: 5px;margin: 20px 0px;padding: 20px;border-radius: 8px;">
 | 
			
		||||
  <!--IsimgFileStart-->
 | 
			
		||||
<img class="mdui-img-fluid mdui-center mdui-m-t-5" src="<!--FileDownUrl-->" />
 | 
			
		||||
<!--IsimgFileEnd-->
 | 
			
		||||
| 
						 | 
				
			
			@ -391,12 +411,18 @@
 | 
			
		|||
  src="<!--FileDownUrl-->"
 | 
			
		||||
  controls
 | 
			
		||||
  autoplay
 | 
			
		||||
  style="width: 100%; margin-top: 10%"
 | 
			
		||||
></audio>
 | 
			
		||||
  style="width: 100%; margin-top: 10%; margin-bottom: 10%"
 | 
			
		||||
>
 | 
			
		||||
  >
 | 
			
		||||
</audio>
 | 
			
		||||
<!--IsmusicFileEnd-->
 | 
			
		||||
 | 
			
		||||
  <!--IsvideoFileStart-->
 | 
			
		||||
<video class="mdui-video-fluid" controls style="margin-top: 20px">
 | 
			
		||||
<video
 | 
			
		||||
  class="mdui-video-fluid"
 | 
			
		||||
  controls
 | 
			
		||||
  style="margin-top: 20px; margin-bottom: 20px"
 | 
			
		||||
>
 | 
			
		||||
  <source src="<!--FileDownUrl-->" />
 | 
			
		||||
  <p>
 | 
			
		||||
    Your browser doesn't support HTML5 video. Here is a
 | 
			
		||||
| 
						 | 
				
			
			@ -430,7 +456,7 @@
 | 
			
		|||
    '<li class="mdui-menu-item"><a href="javascript:void(0);"class="mdui-ripple highlight"><i class="mdui-menu-item-icon mdui-icon material-icons">style</i>markdown解析</a></li>';
 | 
			
		||||
  document.querySelector(
 | 
			
		||||
    ".mdui-toolbar"
 | 
			
		||||
  ).innerHTML += `<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-hidden-sm-up highlight" mdui-tooltip="{content: 'markdown解析'}"><i class="mdui-icon material-icons">style</i></a>`;
 | 
			
		||||
  ).innerHTML += `<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-hidden-sm-up highlight"><i class="mdui-icon material-icons">style</i></a>`;
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<!--IstxtFileEnd-->
 | 
			
		||||
| 
						 | 
				
			
			@ -450,7 +476,7 @@
 | 
			
		|||
    '<li class="mdui-menu-item"><a href="javascript:void(0);"class="mdui-ripple downloadurl"><i class="mdui-menu-item-icon mdui-icon material-icons">cloud_download</i>下载链接</a></li>';
 | 
			
		||||
  document.querySelector(
 | 
			
		||||
    ".mdui-toolbar"
 | 
			
		||||
  ).innerHTML += `<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-hidden-sm-up downloadurl" mdui-tooltip="{content: '下载链接'}"><i class="mdui-icon material-icons">cloud_download</i></a>`;
 | 
			
		||||
  ).innerHTML += `<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-ripple mdui-hidden-sm-up downloadurl"><i class="mdui-icon material-icons">cloud_download</i></a>`;
 | 
			
		||||
</script>
 | 
			
		||||
<!--IsFileEnd-->
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -461,6 +487,5 @@
 | 
			
		|||
  { "music":"audiotrack", "video":"ondemand_video", "img":"image",
 | 
			
		||||
  "pdf":"picture_as_pdf", "default":"insert_drive_file"}
 | 
			
		||||
  <!--IconValuesEnd-->
 | 
			
		||||
  <script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.2/js/webpack-runtime.2c4e79a563c6e0c1c74f.js"></script>
 | 
			
		||||
    <script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.2/js/app.7a662c514027ed87a34e.js"></script>
 | 
			
		||||
  <script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~1b381f3c.5004ff1e7fccf38af990.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~28a13772.d11317064b292bf02fea.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~34e3d95a.1bd1a5e8637cbfb8c667.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~5d2cf59e.f43e55be3ceb6bd06cc7.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~798ab416.8cdd2e29b70683103071.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~7c420fd4.7520935b3261cc2558df.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~df18e074.72b37a5a3dc42ae7080e.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~f0256996.b71376c975fe3aff5b8b.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/app~f1cc13fd.7155493f51961fa66d7e.js"></script><script src="https://cdn.jsdelivr.net/gh/186526/renexmoe-cdn@v1.1.5/js/webpack-runtime.a94291540399944c9e47.js"></script>
 | 
			
		||||
</html>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								version
								
								
								
								
							
							
						
						
									
										11
									
								
								version
								
								
								
								
							| 
						 | 
				
			
			@ -1,7 +1,16 @@
 | 
			
		|||
20210118-1600.31
 | 
			
		||||
can change Ondrive to Sharepoint, can copy a disk. fix a bug that 500 error in setup.
 | 
			
		||||
Onedrive跟Sharepoint可以切换了,可以复制一个盘。修复bug。
 | 
			
		||||
 | 
			
		||||
20210115-1111.30
 | 
			
		||||
<font color=red>v3, after update, please AddDisk again, please set passfile again.</font> themes of php deleted, or you can use branch v2_last.
 | 
			
		||||
<font color=red>v3,一键升级后请重新添加盘,passfile失效,重新设置。</font>php主题删掉了,要么就用v2_last分支。
 | 
			
		||||
20201229.29
 | 
			
		||||
Modify tags, change sequence of disk.
 | 
			
		||||
可以修改标签,移动标签顺序。
 | 
			
		||||
20201215-1400.28
 | 
			
		||||
fix: hackers can upload files to ANY folder (or create a new folder) in your Onedrive. add language zh-tw. now, on heroku, xhr can post. fix: 2 or more space in file name cause bugs.
 | 
			
		||||
修复:构造代码后可以上传文件到你Onedrive的任意目录(甚至创建新目录)。新增zh-tw语言。xhr的post在heroku会接收了,改回post。修复:文件名有多个空格相连时造成bug。
 | 
			
		||||
 | 
			
		||||
20201106-1730.27
 | 
			
		||||
Add theme. A code used in CloudFlare Workers. Admin not need password in folder. Add caddy2 rewrite rule. Add new platform Glitch. <font color=red>web hosting and VPS user should backup your config.php, after update, copy it to .data foloder.</font>
 | 
			
		||||
添加主题。添加一段用于CF workers的代码。加密目录管理员不需要密码了。添加caddy2伪静态。新增Glitch平台。<font color=red>虚拟主机与VPS用户请备份config.php,升级后,手动将它覆盖到.data目录。</font>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue