未验证 提交 4f9ad01e 编写于 作者: Q qkqpttgf 提交者: GitHub

Add files via upload

上级 2d18cc81
{
"name": "herokuOnedrive",
"description": "Deploy herokuOnedrive to heroku",
"website": "https://github.com/qkqpttgf/herokuOnedrive",
"repository": "https://github.com/qkqpttgf/herokuOnedrive",
"success_url": "/"
}
\ No newline at end of file
<?php $configs = '
{
}
';
<?php <?php
global $exts; global $exts;
global $constStr; global $constStr;
...@@ -14,343 +13,397 @@ $constStr = [ ...@@ -14,343 +13,397 @@ $constStr = [
'languages' => [ 'languages' => [
'en-us' => 'English', 'en-us' => 'English',
'zh-cn' => '中文', 'zh-cn' => '中文',
'ja' => '日本語',
], ],
'Week' => [ 'Week' => [
0 => [ 'en-us' => [
'en-us' => 'Sunday', 0 => 'Sunday',
'zh-cn' => '星期日', 1 => 'Monday',
], 2 => 'Tuesday',
1 => [ 3 => 'Wednesday',
'en-us' => 'Monday', 4 => 'Thursday',
'zh-cn' => '星期一', 5 => 'Friday',
], 6 => 'Saturday',
2 => [
'en-us' => 'Tuesday',
'zh-cn' => '星期二',
],
3 => [
'en-us' => 'Wednesday',
'zh-cn' => '星期三',
], ],
4 => [ 'zh-cn' => [
'en-us' => 'Thursday', 0 => '星期日',
'zh-cn' => '星期四', 1 => '星期一',
2 => '星期二',
3 => '星期三',
4 => '星期四',
5 => '星期五',
6 => '星期六',
], ],
5 => [ 'ja' => [
'en-us' => 'Friday', 0 => '日曜日',
'zh-cn' => '星期五', 1 => '月曜日',
], 2 => '火曜日',
6 => [ 3 => '水曜日',
'en-us' => 'Saturday', 4 => '木曜日',
'zh-cn' => '星期六', 5 => '金曜日',
6 => '土曜日',
], ],
], ],
'EnvironmentsDescription' => [ 'EnvironmentsDescription' => [
'admin' => [ 'en-us' => [
'en-us' => 'The admin password, Login button will not show when empty', 'admin' => 'The admin password, Login button will not show when empty',
'zh-cn' => '管理密码,不添加时不显示登录页面且无法登录。', 'adminloginpage' => 'if set, the Login button will not display, and the login page no longer \'?admin\', it is \'?{this value}\'.',
], 'domain_path' => 'more custom domain, format is a1.com:/dirto/path1|b2.com:/path2',
'adminloginpage' => [ 'guestup_path' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
'en-us' => 'if set, the Login button will not display, and the login page no longer \'?admin\', it is \'?{this value}\'.', 'passfile' => 'The password of dir will save in this file.',
'zh-cn' => '如果设置,登录按钮及页面隐藏。管理登录的页面不再是\'?admin\',而是\'?此设置的值\'。', 'public_path' => 'Show this Onedrive dir when through the long url of API Gateway; public show files less than private.',
], 'sitename' => 'sitename',
'domain_path' => [ 'Onedrive_ver' => 'Onedrive version',
'en-us' => 'more custom domain, format is a1.com:/dirto/path1|b2.com:/path2',
'zh-cn' => '使用多个自定义域名时,指定每个域名看到的目录。格式为a1.com:/dirto/path1|b1.com:/path2,比private_path优先。',
],
'imgup_path' => [
'en-us' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
'zh-cn' => '设置图床路径,不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
], ],
'passfile' => [ 'zh-cn' => [
'en-us' => 'The password of dir will save in this file.', 'admin' => '管理密码,不添加时不显示登录页面且无法登录。',
'zh-cn' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;', 'adminloginpage' => '如果设置,登录按钮及页面隐藏。管理登录的页面不再是\'?admin\',而是\'?此设置的值\'。',
'domain_path' => '使用多个自定义域名时,指定每个域名看到的目录。格式为a1.com:/dirto/path1|b1.com:/path2,比private_path优先。',
'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
'passfile' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;',
'public_path' => '使用API长链接访问时,显示网盘文件的路径,不设置时默认为根目录;不能是private_path的上级(public看到的不能比private多,要么看到的就不一样)。',
'sitename' => '网站的名称',
'Onedrive_ver' => 'Onedrive版本',
], ],
'private_path' => [ 'ja' => [
'en-us' => 'Show this Onedrive dir when through custom domain, default is \'/\'.', 'admin' => 'パスワードを管理する、追加しない場合、ログインページは表示されず、ログインできません。',
'zh-cn' => '使用自定义域名访问时,显示网盘文件的路径,不设置时默认为根目录。', 'adminloginpage' => '設定すると、ログインボタンとページが非表示になります。ログインを管理するためのページは\'?admin \'ではなく、\'?この設定の値\'。',
], 'domain_path' => '複数のカスタムドメイン名を使用する場合、各ドメイン名に表示されるディレクトリを指定します。形式はa1.com:/dirto/path1|b1.com:/path2で、private_pathよりも優先されます。',
'public_path' => [ 'guestup_path' => 'マップベッドのパスを設定します。この値が設定されていない場合、ディレクトリの内容は通常ファイルにリストされ、設定後はアップロードインターフェイスのみが表示されます。',
'en-us' => 'Show this Onedrive dir when through the long url of API Gateway; public show files less than private.', 'passfile' => 'カスタムパスワードファイルの名前は、\'pppppp \'、\'aaaa.txt \'などの場合があります。ディレクトリをリストするときには表示されません。パスワードを知っている場合にのみ、このファイルを表示またはダウンロードできます。 パスワードはこのファイルの内容であり、スペースまたは漢字を使用できます。',
'zh-cn' => '使用API长链接访问时,显示网盘文件的路径,不设置时默认为根目录;不能是private_path的上级(public看到的不能比private多,要么看到的就不一样)。', 'public_path' => 'APIのロングリンクアクセスを使用する場合、ネットワークディスクファイルのパスが表示されますが、設定されていない場合はデフォルトでルートディレクトリになり、private_pathの上位にはなりません(publicはprivate以上のものを見ることができません。それ以外は異なります。)。',
], 'sitename' => 'ウェブサイト名',
'sitename' => [ 'Onedrive_ver' => 'Onedriveバージョン',
'en-us' => 'sitename',
'zh-cn' => '网站的名称',
],
'language' => [
'en-us' => 'en-us or zh-cn',
'zh-cn' => '目前en-us 或 zh-cn',
],
'APIKey' => [
'en-us' => 'the APIKey of Heroku',
'zh-cn' => 'Heroku的API Key',
],
'Onedrive_ver' => [
'en-us' => 'Onedrive version',
'zh-cn' => 'Onedrive版本',
], ],
], ],
'SetSecretsFirst' => [ 'SetSecretsFirst' => [
'en-us' => 'Set APIKey in Config vars first! Then reflesh.', 'en-us' => 'Set APIKey in Config vars first! Then reflesh.',
'zh-cn' => '先在环境变量设置APIKey!再刷新。', 'zh-cn' => '先在环境变量设置APIKey!再刷新。',
'ja' => '最初に環境変数にAPIKeyを設定してください! 再度更新します。',
], ],
'RefleshtoLogin' => [ 'RefleshtoLogin' => [
'en-us' => '<font color="red">Reflesh</font> and login.', 'en-us' => '<font color="red">Reflesh</font> and login.',
'zh-cn' => '请<font color="red">刷新</font>页面后重新登录', 'zh-cn' => '请<font color="red">刷新</font>页面后重新登录',
'ja' => 'ページを<font color = "red">更新</font>して、再度ログインしてください',
], ],
'AdminLogin' => [ 'AdminLogin' => [
'en-us' => 'Admin Login', 'en-us' => 'Admin Login',
'zh-cn' => '管理登录', 'zh-cn' => '管理登录',
'ja' => 'ログインを管理する',
], ],
'LoginSuccess' => [ 'LoginSuccess' => [
'en-us' => 'Login Success!', 'en-us' => 'Login Success!',
'zh-cn' => '登录成功,正在跳转', 'zh-cn' => '登录成功,正在跳转',
'ja' => 'ログイン成功、ジャンプ',
], ],
'InputPassword' => [ 'InputPassword' => [
'en-us' => 'Input Password', 'en-us' => 'Input Password',
'zh-cn' => '输入密码', 'zh-cn' => '输入密码',
'ja' => 'パスワードを入力してください',
], ],
'Login' => [ 'Login' => [
'en-us' => 'Login', 'en-us' => 'Login',
'zh-cn' => '登录', 'zh-cn' => '登录',
'ja' => 'サインイン',
], ],
'encrypt' => [ 'encrypt' => [
'en-us' => 'Encrypt', 'en-us' => 'Encrypt',
'zh-cn' => '加密', 'zh-cn' => '加密',
'ja' => '暗号化',
], ],
'SetpassfileBfEncrypt' => [ 'SetpassfileBfEncrypt' => [
'en-us' => 'Set \'passfile\' in Environments before encrypt', 'en-us' => 'Set \'passfile\' in Environments before encrypt',
'zh-cn' => '先在环境变量设置passfile才能加密', 'zh-cn' => '先在环境变量设置passfile才能加密',
'ja' => '最初に暗号化する環境変数にパスファイルを設定します',
], ],
'updateProgram' => [ 'updateProgram' => [
'en-us' => 'Update Program', 'en-us' => 'Update Program',
'zh-cn' => '一键更新', 'zh-cn' => '一键更新',
'ja' => 'ワンクリック更新',
], ],
'UpdateSuccess' => [ 'UpdateSuccess' => [
'en-us' => 'Program update Success!', 'en-us' => 'Program update Success!',
'zh-cn' => '程序升级成功!', 'zh-cn' => '程序升级成功!',
'ja' => 'プログラムのアップグレードに成功しました!',
], ],
'Setup' => [ 'Setup' => [
'en-us' => 'Setup', 'en-us' => 'Setup',
'zh-cn' => '设置', 'zh-cn' => '设置',
'ja' => '設定する',
], ],
'Back' => [ 'Back' => [
'en-us' => 'Back', 'en-us' => 'Back',
'zh-cn' => '返回', 'zh-cn' => '返回',
'ja' => 'back',
], ],
'NotNeedUpdate' => [ 'NotNeedUpdate' => [
'en-us' => 'Not Need Update', 'en-us' => 'Not Need Update',
'zh-cn' => '不需要更新', 'zh-cn' => '不需要更新',
'ja' => '更新不要',
], ],
'Home' => [ 'Home' => [
'en-us' => 'Home', 'en-us' => 'Home',
'zh-cn' => '首页', 'zh-cn' => '首页',
'ja' => 'ホーム',
], ],
'NeedUpdate' => [ 'NeedUpdate' => [
'en-us' => 'Program can update<br>Click setup in Operate at top.', 'en-us' => 'Program can update<br>Click setup in Operate at top.',
'zh-cn' => '可以升级程序<br>在上方管理菜单中<br>进入设置页面升级', 'zh-cn' => '可以升级程序<br>在上方管理菜单中<br>进入设置页面升级',
'ja' => 'プログラムをアップグレードできます<br>上記の管理メニューで<br>アップグレードする設定ページに入ります',
], ],
'Operate' => [ 'Operate' => [
'en-us' => 'Operate', 'en-us' => 'Operate',
'zh-cn' => '管理', 'zh-cn' => '管理',
'ja' => '管理',
], ],
'Logout' => [ 'Logout' => [
'en-us' => 'Logout', 'en-us' => 'Logout',
'zh-cn' => '登出', 'zh-cn' => '登出',
'ja' => 'ログアウトする',
], ],
'Create' => [ 'Create' => [
'en-us' => 'Create', 'en-us' => 'Create',
'zh-cn' => '新建', 'zh-cn' => '新建',
'ja' => '新しい',
], ],
'Download' => [ 'Download' => [
'en-us' => 'download', 'en-us' => 'download',
'zh-cn' => '下载', 'zh-cn' => '下载',
'ja' => 'ダウンロードする',
], ],
'ClicktoEdit' => [ 'ClicktoEdit' => [
'en-us' => 'Click to edit', 'en-us' => 'Click to edit',
'zh-cn' => '点击后编辑', 'zh-cn' => '点击后编辑',
'ja' => 'クリック後に編集',
], ],
'Save' => [ 'Save' => [
'en-us' => 'Save', 'en-us' => 'Save',
'zh-cn' => '保存', 'zh-cn' => '保存',
'ja' => '保存する',
], ],
'FileNotSupport' => [ 'FileNotSupport' => [
'en-us' => 'File not support preview.', 'en-us' => 'File not support preview.',
'zh-cn' => '文件格式不支持预览', 'zh-cn' => '文件格式不支持预览',
'ja' => 'ファイル形式はプレビューをサポートしていません',
], ],
'File' => [ 'File' => [
'en-us' => 'File', 'en-us' => 'File',
'zh-cn' => '文件', 'zh-cn' => '文件',
'ja' => 'ファイル',
], ],
'ShowThumbnails' => [ 'ShowThumbnails' => [
'en-us' => 'Thumbnails', 'en-us' => 'Thumbnails',
'zh-cn' => '图片缩略', 'zh-cn' => '图片缩略',
'ja' => '画像のサムネイル',
], ],
'EditTime' => [ 'EditTime' => [
'en-us' => 'EditTime', 'en-us' => 'EditTime',
'zh-cn' => '修改时间', 'zh-cn' => '修改时间',
'ja' => '変更時間',
], ],
'Size' => [ 'Size' => [
'en-us' => 'Size', 'en-us' => 'Size',
'zh-cn' => '大小', 'zh-cn' => '大小',
'ja' => 'サイズ ',
], ],
'Rename' => [ 'Rename' => [
'en-us' => 'Rename', 'en-us' => 'Rename',
'zh-cn' => '重命名', 'zh-cn' => '重命名',
'ja' => '名前を変更',
], ],
'Move' => [ 'Move' => [
'en-us' => 'Move', 'en-us' => 'Move',
'zh-cn' => '移动', 'zh-cn' => '移动',
'ja' => '移動する',
], ],
'Delete' => [ 'Delete' => [
'en-us' => 'Delete', 'en-us' => 'Delete',
'zh-cn' => '删除', 'zh-cn' => '删除',
'ja' => '削除する',
], ],
'PrePage' => [ 'PrePage' => [
'en-us' => 'PrePage', 'en-us' => 'PrePage',
'zh-cn' => '上一页', 'zh-cn' => '上一页',
'ja' => '前へ',
], ],
'NextPage' => [ 'NextPage' => [
'en-us' => 'NextPage', 'en-us' => 'NextPage',
'zh-cn' => '下一页', 'zh-cn' => '下一页',
'ja' => '次のページ',
], ],
'Upload' => [ 'Upload' => [
'en-us' => 'Upload', 'en-us' => 'Upload',
'zh-cn' => '上传', 'zh-cn' => '上传',
'ja' => 'アップロードする',
], ],
'Submit' => [ 'Submit' => [
'en-us' => 'Submit', 'en-us' => 'Submit',
'zh-cn' => '确认', 'zh-cn' => '确认',
'ja' => '確認する',
], ],
'Close' => [ 'Close' => [
'en-us' => 'Close', 'en-us' => 'Close',
'zh-cn' => '关闭', 'zh-cn' => '关闭',
'ja' => '閉じる',
], ],
'InputPasswordUWant' => [ 'InputPasswordUWant' => [
'en-us' => 'Input Password you Want', 'en-us' => 'Input Password you Want',
'zh-cn' => '输入想要设置的密码', 'zh-cn' => '输入想要设置的密码',
'ja' => '設定するパスワードを入力してください',
], ],
'ParentDir' => [ 'ParentDir' => [
'en-us' => 'Parent Dir', 'en-us' => 'Parent Dir',
'zh-cn' => '上一级目录', 'zh-cn' => '上一级目录',
'ja' => '親ディレクトリ',
], ],
'Folder' => [ 'Folder' => [
'en-us' => 'Folder', 'en-us' => 'Folder',
'zh-cn' => '文件夹', 'zh-cn' => '文件夹',
'ja' => 'フォルダー',
], ],
'Name' => [ 'Name' => [
'en-us' => 'Name', 'en-us' => 'Name',
'zh-cn' => '名称', 'zh-cn' => '名称',
'ja' => '名前',
], ],
'Content' => [ 'Content' => [
'en-us' => 'Content', 'en-us' => 'Content',
'zh-cn' => '内容', 'zh-cn' => '内容',
'ja' => '内容',
], ],
'CancelEdit' => [ 'CancelEdit' => [
'en-us' => 'Cancel Edit', 'en-us' => 'Cancel Edit',
'zh-cn' => '取消编辑', 'zh-cn' => '取消编辑',
'ja' => '編集をキャンセル',
], ],
'GetFileNameFail' => [ 'GetFileNameFail' => [
'en-us' => 'Fail to Get File Name!', 'en-us' => 'Fail to Get File Name!',
'zh-cn' => '获取文件名失败!', 'zh-cn' => '获取文件名失败!',
'ja' => 'ファイル名を取得できませんでした!',
], ],
'GetUploadLink' => [ 'GetUploadLink' => [
'en-us' => 'Get Upload Link', 'en-us' => 'Get Upload Link',
'zh-cn' => '获取上传链接', 'zh-cn' => '获取上传链接',
'ja' => 'アップロードリンクを取得',
], ],
'UpFileTooLarge' => [ 'UpFileTooLarge' => [
'en-us' => 'The File is too Large!', 'en-us' => 'The File is too Large!',
'zh-cn' => '文件过大,终止上传。', 'zh-cn' => '文件过大,终止上传。',
'ja' => '超えると、アップロードは終了します。',
], ],
'UploadStart' => [ 'UploadStart' => [
'en-us' => 'Upload Start', 'en-us' => 'Upload Start',
'zh-cn' => '开始上传', 'zh-cn' => '开始上传',
'ja' => 'アップロードを開始',
], ],
'UploadStartAt' => [ 'UploadStartAt' => [
'en-us' => 'Start At', 'en-us' => 'Start At',
'zh-cn' => '开始于', 'zh-cn' => '开始于',
'ja' => 'で開始',
], ],
'ThisTime' => [ 'ThisTime' => [
'en-us' => 'This Time', 'en-us' => 'This Time',
'zh-cn' => '本次', 'zh-cn' => '本次',
'ja' => '今回は',
], ],
'LastUpload' => [ 'LastUpload' => [
'en-us' => 'Last time Upload', 'en-us' => 'Last time Upload',
'zh-cn' => '上次上传', 'zh-cn' => '上次上传',
'ja' => '上回は',
], ],
'AverageSpeed' => [ 'AverageSpeed' => [
'en-us' => 'AverageSpeed', 'en-us' => 'AverageSpeed',
'zh-cn' => '平均速度', 'zh-cn' => '平均速度',
'ja' => '平均速度',
], ],
'CurrentSpeed' => [ 'CurrentSpeed' => [
'en-us' => 'CurrentSpeed', 'en-us' => 'CurrentSpeed',
'zh-cn' => '即时速度', 'zh-cn' => '即时速度',
'ja' => 'インスタントスピード',
], ],
'Expect' => [ 'Expect' => [
'en-us' => 'Expect', 'en-us' => 'Expect',
'zh-cn' => '预计还要', 'zh-cn' => '预计还要',
'ja' => '期待される',
], ],
'EndAt' => [ 'EndAt' => [
'en-us' => 'End At', 'en-us' => 'End At',
'zh-cn' => '结束于', 'zh-cn' => '结束于',
'ja' => 'で終了',
], ],
'UploadErrorUpAgain' => [ 'UploadErrorUpAgain' => [
'en-us' => 'Maybe error, do upload again.', 'en-us' => 'Maybe error, do upload again.',
'zh-cn' => '可能出错,重新上传。', 'zh-cn' => '可能出错,重新上传。',
'ja' => '間違っている可能性があります。もう一度アップロードしてください。',
], ],
'UploadComplete' => [ 'UploadComplete' => [
'en-us' => 'Upload Complete', 'en-us' => 'Upload Complete',
'zh-cn' => '上传完成', 'zh-cn' => '上传完成',
'ja' => 'アップロード完了',
], ],
'UploadFail23' => [ 'UploadFail23' => [
'en-us' => 'Upload Fail, contain #.', 'en-us' => 'Upload Fail, contain #.',
'zh-cn' => '目录或文件名含有#,上传失败。', 'zh-cn' => '目录或文件名含有#,上传失败。',
'ja' => 'ディレクトリまたはファイル名に#が含まれています。アップロードに失敗しました。',
], ],
'defaultSitename' => [ 'defaultSitename' => [
'en-us' => 'Set sitename in Environments', 'en-us' => 'OneManager',
'zh-cn' => '请在环境变量添加sitename', 'zh-cn' => 'OneManager',
'ja' => 'OneManager',
], ],
'MayinEnv' => [ 'MayinEnv' => [
'en-us' => 'The \'Onedrive_ver\' may in Environments', 'en-us' => 'The \'Onedrive_ver\' may in Config',
'zh-cn' => 'Onedrive_ver应该已经写入环境变量', 'zh-cn' => 'Onedrive_ver应该已经写入',
'ja' => 'Onedrive_verは環境変数に書き込まれている必要があります',
], ],
'Wait' => [ 'Wait' => [
'en-us' => 'Wait', 'en-us' => 'Wait',
'zh-cn' => '稍等', 'zh-cn' => '稍等',
'ja' => 'ちょっと待って',
], ],
'WaitJumpIndex' => [ 'WaitJumpIndex' => [
'en-us' => 'Wait 5s jump to Home page', 'en-us' => 'Wait 5s jump to Home page',
'zh-cn' => '等5s跳到首页', 'zh-cn' => '等5s跳到首页',
'ja' => '5秒待ってホームページにジャンプします',
], ],
'JumptoOffice' => [ 'JumptoOffice' => [
'en-us' => 'Login Office and Get a refresh_token', 'en-us' => 'Login Office and Get a refresh_token',
'zh-cn' => '跳转到Office,登录获取refresh_token', 'zh-cn' => '跳转到Office,登录获取refresh_token',
'ja' => 'Officeにジャンプしてログインし、refresh_tokenを取得します',
], ],
'OndriveVerMS' => [ 'OndriveVerMS' => [
'en-us' => 'default(Onedrive, Onedrive for business)', 'en-us' => 'default(Onedrive, Onedrive for business)',
'zh-cn' => '默认(支持商业版与个人版)', 'zh-cn' => '默认(支持商业版与个人版)',
'ja' => 'デフォルト(商用版および個人版をサポート)',
], ],
'OndriveVerCN' => [ 'OndriveVerCN' => [
'en-us' => 'Onedrive in China', 'en-us' => 'Onedrive in China',
'zh-cn' => '世纪互联版', 'zh-cn' => '世纪互联版',
'ja' => '中国のOnedrive',
], ],
'OndriveVerMSC' =>[ 'OndriveVerMSC' =>[
'en-us' => 'default but use customer app id & secret', 'en-us' => 'default but use customer app id & secret',
'zh-cn' => '国际版,自己申请应用ID与机密', 'zh-cn' => '国际版,自己申请应用ID与机密',
'ja' => '国際版、アプリケーションIDとシークレットを自分で申請する',
], ],
'GetSecretIDandKEY' =>[ 'GetSecretIDandKEY' =>[
'en-us' => 'Get customer app id & secret', 'en-us' => 'Get customer app id & secret',
'zh-cn' => '申请应用ID与机密', 'zh-cn' => '申请应用ID与机密',
'ja' => 'アプリケーションIDとシークレット',
], ],
'Reflesh' => [ 'Reflesh' => [
'en-us' => 'Reflesh', 'en-us' => 'Reflesh',
'zh-cn' => '刷新', 'zh-cn' => '刷新',
'ja' => '再表示',
], ],
'SelectLanguage' => [ 'SelectLanguage' => [
'en-us' => 'Select Language', 'en-us' => 'Select Language',
'zh-cn' => '选择语言', 'zh-cn' => '选择语言',
'ja' => '言語を選択してください',
],
'RefreshCache' => [
'en-us' => 'RefreshCache',
'zh-cn' => '刷新缓存',
'ja' => 'キャッシュを再構築',
], ],
]; ];
?>
此差异已折叠。
<?php
function getpath()
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
else $path = $_SERVER['REQUEST_URI'];
$path = path_format( substr($path, strlen($_SERVER['base_path'])) );
return $path;
//return spurlencode($path, '/');
}
function getGET()
{
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) {
$getstr = substr($_SERVER['REQUEST_URI'], $p+1);
$getstrarr = explode("&",$getstr);
foreach ($getstrarr as $getvalues) {
if ($getvalues != '') {
$pos = strpos($getvalues, "=");
//echo $pos;
if ($pos > 0) {
$getarry[urldecode(substr($getvalues, 0, $pos))] = urldecode(substr($getvalues, $pos + 1));
} else {
$getarry[urldecode($getvalues)] = true;
}
}
}
}
if (isset($getarry)) {
return $getarry;
} else {
return [];
}
}
function get_refresh_token()
{
global $constStr;
$url = path_format($_SERVER['PHP_SELF'] . '/');
if ($_GET['authorization_code'] && isset($_GET['code'])) {
$tmp = curl_request($_SERVER['oauth_url'] . 'token', 'client_id=' . $_SERVER['client_id'] .'&client_secret=' . $_SERVER['client_secret'] . '&grant_type=authorization_code&requested_token_use=on_behalf_of&redirect_uri=' . $_SERVER['redirect_uri'] .'&code=' . $_GET['code']);
if ($tmp['stat']==200) $ret = json_decode($tmp['body'], true);
if (isset($ret['refresh_token'])) {
$tmptoken = $ret['refresh_token'];
$str = '
refresh_token :<br>';
/*for ($i=1;strlen($tmptoken)>0;$i++) {
$t['t' . $i] = substr($tmptoken,0,128);
$str .= '
t' . $i . ':<textarea readonly style="width: 95%">' . $t['t' . $i] . '</textarea><br><br>';
$tmptoken=substr($tmptoken,128);
}
$str .= '
Add t1-t'.--$i.' to environments.*/
$str .= '
<textarea readonly style="width: 95%">' . $tmptoken . '</textarea><br><br>
Adding refresh_token to Config.
<script>
var texta=document.getElementsByTagName(\'textarea\');
for(i=0;i<texta.length;i++) {
texta[i].style.height = texta[i].scrollHeight + \'px\';
}
document.cookie=\'language=; path=/\';
</script>';
setConfig([ 'refresh_token' => $tmptoken ]);
savecache('access_token', $ret['access_token'], $ret['expires_in'] - 60);
$str .= '
<meta http-equiv="refresh" content="5;URL=' . $url . '">';
return message($str, getconstStr('WaitJumpIndex'));
}
return message('<pre>' . $tmp['body'] . '</pre>', $tmp['stat']);
//return message('<pre>' . json_encode($ret, JSON_PRETTY_PRINT) . '</pre>', 500);
}
if ($_GET['install3']) {
if (getConfig('Onedrive_ver')=='MS' || getConfig('Onedrive_ver')=='CN' || getConfig('Onedrive_ver')=='MSC') {
return message('
<a href="" id="a1">'.getconstStr('JumptoOffice').'</a>
<script>
url=location.protocol + "//" + location.host + "'.$url.'";
url="'. $_SERVER['oauth_url'] .'authorize?scope='. $_SERVER['scope'] .'&response_type=code&client_id='. $_SERVER['client_id'] .'&redirect_uri='. $_SERVER['redirect_uri'] . '&state=' .'"+encodeURIComponent(url);
document.getElementById(\'a1\').href=url;
//window.open(url,"_blank");
location.href = url;
</script>
', getconstStr('Wait').' 1s', 201);
}
}
if ($_GET['install2']) {
// echo $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC') {
$tmp['Onedrive_ver'] = $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MSC') {
$tmp['client_id'] = $_POST['client_id'];
$tmp['client_secret'] = $_POST['client_secret'];
}
$response = json_decode(setConfig($tmp)['body'], true);
$title = getconstStr('MayinEnv');
$html = getconstStr('Wait') . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '?install3">';
if (isset($response['id'])&&isset($response['message'])) {
$html = $response['id'] . '<br>
' . $response['message'] . '<br><br>
function_name:' . $_SERVER['function_name'] . '<br>
<button onclick="location.href = location.href;">'.$constStr['Reflesh'][$constStr['language']].'</button>';
$title = 'Error';
}
return message($html, $title, 201);
}
}
if ($_GET['install1']) {
if ($_POST['admin']!='') {
$tmp['admin'] = $_POST['admin'];
$tmp['language'] = $_POST['language'];
$APIKey = getConfig('APIKey');
if ($APIKey=='') {
$APIKey = $_POST['APIKey'];
$tmp['APIKey'] = $APIKey;
}
$function_name = getConfig('function_name');
if ($function_name=='') {
$tmp1 = substr($_SERVER['HTTP_HOST'], 0, strrpos($_SERVER['HTTP_HOST'], '.'));
$maindomain = substr($tmp1, strrpos($tmp1, '.')+1);
if ($maindomain=='herokuapp') $function_name = substr($tmp1, 0, strrpos($tmp1, '.'));
else $function_name = 'visit from x.herokuapp.com';
$tmp['function_name'] = $function_name;
}
$response = json_decode(setHerokuConfig($tmp, $function_name, $APIKey)['body'], true);
if (isset($response['id'])&&isset($response['message'])) {
$html = $response['id'] . '<br>
' . $response['message'] . '<br><br>
function_name:' . $_SERVER['function_name'] . '<br>
<button onclick="location.href = location.href;">'.$constStr['Reflesh'][$constStr['language']].'</button>';
$title = 'Error';
} else {
if ($constStr['language']!='zh-cn') {
$linklang='en-us';
} else $linklang='zh-cn';
$ru = "https://developer.microsoft.com/".$linklang."/graph/quick-start?appID=_appId_&appName=_appName_&redirectUrl=".$_SERVER['redirect_uri']."&platform=option-php";
$deepLink = "/quickstart/graphIO?publicClientSupport=false&appName=OneManager&redirectUrl=".$_SERVER['redirect_uri']."&allowImplicitFlow=false&ru=".urlencode($ru);
$app_url = "https://apps.dev.microsoft.com/?deepLink=".urlencode($deepLink);
$html = '
<form action="?install2" method="post">
Onedrive_Ver:<br>
<label><input type="radio" name="Onedrive_ver" value="MS" checked>MS: '.getconstStr('OndriveVerMS').'</label><br>
<label><input type="radio" name="Onedrive_ver" value="CN">CN: '.getconstStr('OndriveVerCN').'</label><br>
<label><input type="radio" name="Onedrive_ver" value="MSC" onclick="document.getElementById(\'secret\').style.display=\'\';">MSC: '.getconstStr('OndriveVerMSC').'
<div id="secret" style="display:none">
<a href="'.$app_url.'" target="_blank">'.getconstStr('GetSecretIDandKEY').'</a><br>
client_secret:<input type="text" name="client_secret"><br>
client_id(12345678-90ab-cdef-ghij-klmnopqrstuv):<input type="text" name="client_id"><br>
</div>
</label><br>
<input type="submit" value="'.getconstStr('Submit').'">
</form>';
$title = 'Install';
}
return message($html, $title, 201);
}
}
if ($_GET['install0']) {
$html .= '
<form action="?install1" method="post" onsubmit="return notnull(this);">
language:<br>';
foreach ($constStr['languages'] as $key1 => $value1) {
$html .= '
<label><input type="radio" name="language" value="'.$key1.'" '.($key1==$constStr['language']?'checked':'').' onclick="changelanguage(\''.$key1.'\')">'.$value1.'</label><br>';
}
if (getConfig('APIKey')=='') $html .= '
<a href="https://dashboard.heroku.com/account" target="_blank">'.getconstStr('Create').' API Key</a><br>
<label>API Key:<input name="APIKey" type="text" placeholder="" size=""></label><br>';
$html .= '
<label>admin:<input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"></label><br>';
$html .= '
<input type="submit" value="'.getconstStr('Submit').'">
</form>
<script>
function changelanguage(str)
{
document.cookie=\'language=\'+str+\'; path=/\';
location.href = location.href;
}
function notnull(t)
{
if (t.admin.value==\'\') {
alert(\'input admin\');
return false;
}';
if (getConfig('APIKey')=='') $html .= '
if (t.SecretId.value==\'\') {
alert(\'input SecretId\');
return false;
}
if (t.SecretKey.value==\'\') {
alert(\'input SecretKey\');
return false;
}';
$html .= '
return true;
}
</script>';
$title = getconstStr('SelectLanguage');
return message($html, $title, 201);
}
$html .= 'refresh_token not exist, <a href="?install0">click to install.</a>';
$title = 'Error';
return message($html, $title, 201);
}
function getConfig($str)
{
return getenv($str);
}
function array_value_isnot_null($arr)
{
return $arr!=='';
}
function setConfig($arr)
{
return setHerokuConfig($arr, getConfig('function_name'), getConfig('APIKey'));
}
function HerokuAPI($method, $url, $data = '', $apikey)
{
if ($method=='PATCH') {
$headers['Content-Type'] = 'application/json';
}
$headers['Authorization'] = 'Bearer ' . $apikey;
$headers['Accept'] = 'application/vnd.heroku+json; version=3';
//if (!isset($headers['Accept'])) $headers['Accept'] = '*/*';
//if (!isset($headers['Referer'])) $headers['Referer'] = $url;
$sendHeaders = array();
foreach ($headers as $headerName => $headerVal) {
$sendHeaders[] = $headerName . ': ' . $headerVal;
}
error_log($method . $url . $data . $apikey);
$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_HTTPHEADER, $sendHeaders);
$response['body'] = curl_exec($ch);
$response['stat'] = curl_getinfo($ch,CURLINFO_HTTP_CODE);
curl_close($ch);
error_log($response['stat'].'
'.$response['body'].'
');
return $response;
}
function getHerokuConfig($function_name, $apikey)
{
return HerokuAPI('GET', 'https://api.heroku.com/apps/' . $function_name . '/config-vars', '', $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);
}
function EnvOpt($function_name, $needUpdate = 0)
{
global $constStr;
$constEnv = [
//'admin',
'adminloginpage', 'domain_path', 'guestup_path', 'passfile',
//'private_path',
'public_path', 'sitename', 'language', 'theme'
];
asort($constEnv);
$html = '<title>OneManager '.getconstStr('Setup').'</title>';
/*if ($_POST['updateProgram']==getconstStr('updateProgram')) {
$response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
if (isset($response['Error'])) {
$html = $response['Error']['Code'] . '<br>
' . $response['Error']['Message'] . '<br><br>
function_name:' . $_SERVER['function_name'] . '<br>
Region:' . $_SERVER['Region'] . '<br>
namespace:' . $namespace . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
} else {
$html .= getconstStr('UpdateSuccess') . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = getconstStr('Setup');
}
return message($html, $title);
}*/
if ($_POST['submit1']) {
foreach ($_POST as $k => $v) {
if (in_array($k, $constEnv)) {
//if (!(getConfig($k)==''&&$v==''))
$tmp[$k] = $v;
}
}
/*if ($tmp['domain_path']!='') {
$tmp1 = explode("|",$tmp['domain_path']);
$tmparr = [];
foreach ($tmp1 as $multidomain_paths){
$pos = strpos($multidomain_paths,":");
if ($pos>0) $tmparr[substr($multidomain_paths, 0, $pos)] = path_format(substr($multidomain_paths, $pos+1));
}
$tmp['domain_path'] = $tmparr;
}*/
$response = setConfig($tmp);
if (!$response) {
$html = $response . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
} else {
$html .= '<script>location.href=location.href</script>';
}
}
if ($_GET['preview']) {
$preurl = $_SERVER['PHP_SELF'] . '?preview';
} else {
$preurl = path_format($_SERVER['PHP_SELF'] . '/');
}
$html .= '
<a href="'.$preurl.'">'.getconstStr('Back').'</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/qkqpttgf/OneManager-php">Github</a><br>';
/*if ($needUpdate) {
$html .= '<pre>' . $_SERVER['github_version'] . '</pre>
<form action="" method="post">
<input type="submit" name="updateProgram" value="'.getconstStr('updateProgram').'">
</form>';
} else {
$html .= getconstStr('NotNeedUpdate');
}*/
$html .= '
<form action="" method="post">
<table border=1 width=100%>';
foreach ($constEnv as $key) {
if ($key=='language') {
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%>
<select name="' . $key .'">';
foreach ($constStr['languages'] as $key1 => $value1) {
$html .= '
<option value="'.$key1.'" '.($key1==getConfig($key)?'selected="selected"':'').'>'.$value1.'</option>';
}
$html .= '
</select>
</td>
</tr>';
} elseif ($key=='theme') {
$theme_arr = scandir('theme');
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%>
<select name="' . $key .'">';
foreach ($theme_arr as $v1) {
if ($v1!='.' && $v1!='..') $html .= '
<option value="'.$v1.'" '.($v1==getConfig($key)?'selected="selected"':'').'>'.$v1.'</option>';
}
$html .= '
</select>
</td>
</tr>';
} /*elseif ($key=='domain_path') {
$tmp = getConfig($key);
$domain_path = '';
foreach ($tmp as $k1 => $v1) {
$domain_path .= $k1 . ':' . $v1 . '|';
}
$domain_path = substr($domain_path, 0, -1);
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%><input type="text" name="' . $key .'" value="' . $domain_path . '" placeholder="' . getconstStr('EnvironmentsDescription')[$key] . '" style="width:100%"></td>
</tr>';
}*/ else $html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%><input type="text" name="' . $key .'" value="' . getConfig($key) . '" placeholder="' . getconstStr('EnvironmentsDescription')[$key] . '" style="width:100%"></td>
</tr>';
}
$html .= '</table>
<input type="submit" name="submit1" value="'.getconstStr('Setup').'">
</form>';
return message($html, getconstStr('Setup'));
}
<?php
function getpath()
{
$_SERVER['base_path'] = path_format(substr($_SERVER['SCRIPT_NAME'], 0, -10) . '/');
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) $path = substr($_SERVER['REQUEST_URI'], 0, $p);
else $path = $_SERVER['REQUEST_URI'];
$path = path_format( substr($path, strlen($_SERVER['base_path'])) );
return $path;
//return spurlencode($path, '/');
}
function getGET()
{
$p = strpos($_SERVER['REQUEST_URI'],'?');
if ($p>0) {
$getstr = substr($_SERVER['REQUEST_URI'], $p+1);
$getstrarr = explode("&",$getstr);
foreach ($getstrarr as $getvalues) {
if ($getvalues != '') {
$pos = strpos($getvalues, "=");
//echo $pos;
if ($pos > 0) {
$getarry[urldecode(substr($getvalues, 0, $pos))] = urldecode(substr($getvalues, $pos + 1));
} else {
$getarry[urldecode($getvalues)] = true;
}
}
}
}
if (isset($getarry)) {
return $getarry;
} else {
return [];
}
}
function get_refresh_token()
{
global $constStr;
$url = path_format($_SERVER['PHP_SELF'] . '/');
if ($_GET['authorization_code'] && isset($_GET['code'])) {
$tmp = curl_request($_SERVER['oauth_url'] . 'token', 'client_id=' . $_SERVER['client_id'] .'&client_secret=' . $_SERVER['client_secret'] . '&grant_type=authorization_code&requested_token_use=on_behalf_of&redirect_uri=' . $_SERVER['redirect_uri'] .'&code=' . $_GET['code']);
if ($tmp['stat']==200) $ret = json_decode($tmp['body'], true);
if (isset($ret['refresh_token'])) {
$tmptoken = $ret['refresh_token'];
$str = '
refresh_token :<br>';
/*for ($i=1;strlen($tmptoken)>0;$i++) {
$t['t' . $i] = substr($tmptoken,0,128);
$str .= '
t' . $i . ':<textarea readonly style="width: 95%">' . $t['t' . $i] . '</textarea><br><br>';
$tmptoken=substr($tmptoken,128);
}
$str .= '
Add t1-t'.--$i.' to environments.*/
$str .= '
<textarea readonly style="width: 95%">' . $tmptoken . '</textarea><br><br>
Adding refresh_token to Config.
<script>
var texta=document.getElementsByTagName(\'textarea\');
for(i=0;i<texta.length;i++) {
texta[i].style.height = texta[i].scrollHeight + \'px\';
}
document.cookie=\'language=; path=/\';
</script>';
setConfig([ 'refresh_token' => $tmptoken ]);
savecache('access_token', $ret['access_token'], $ret['expires_in'] - 60);
$str .= '
<meta http-equiv="refresh" content="5;URL=' . $url . '">';
return message($str, getconstStr('WaitJumpIndex'));
}
return message('<pre>' . $tmp['body'] . '</pre>', $tmp['stat']);
//return message('<pre>' . json_encode($ret, JSON_PRETTY_PRINT) . '</pre>', 500);
}
if ($_GET['install3']) {
if (getConfig('Onedrive_ver')=='MS' || getConfig('Onedrive_ver')=='CN' || getConfig('Onedrive_ver')=='MSC') {
return message('
<a href="" id="a1">'.getconstStr('JumptoOffice').'</a>
<script>
url=location.protocol + "//" + location.host + "'.$url.'";
url="'. $_SERVER['oauth_url'] .'authorize?scope='. $_SERVER['scope'] .'&response_type=code&client_id='. $_SERVER['client_id'] .'&redirect_uri='. $_SERVER['redirect_uri'] . '&state=' .'"+encodeURIComponent(url);
document.getElementById(\'a1\').href=url;
//window.open(url,"_blank");
location.href = url;
</script>
', getconstStr('Wait').' 1s', 201);
}
}
if ($_GET['install2']) {
// echo $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC') {
$tmp['Onedrive_ver'] = $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MSC') {
$tmp['client_id'] = $_POST['client_id'];
$tmp['client_secret'] = $_POST['client_secret'];
}
$response = setConfig($tmp);
$title = getconstStr('MayinEnv');
$html = getconstStr('Wait') . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '?install3">';
if (!$response) {
$html = $response . '<br>
Can not write config to file.<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
}
return message($html, $title, 201);
}
}
if ($_GET['install1']) {
if ($_POST['admin']!='') {
$tmp['admin'] = $_POST['admin'];
$tmp['language'] = $_POST['language'];
$response = setConfig($tmp);
if ($response) {
if ($constStr['language']!='zh-cn') {
$linklang='en-us';
} else $linklang='zh-cn';
$ru = "https://developer.microsoft.com/".$linklang."/graph/quick-start?appID=_appId_&appName=_appName_&redirectUrl=".$_SERVER['redirect_uri']."&platform=option-php";
$deepLink = "/quickstart/graphIO?publicClientSupport=false&appName=OneManager&redirectUrl=".$_SERVER['redirect_uri']."&allowImplicitFlow=false&ru=".urlencode($ru);
$app_url = "https://apps.dev.microsoft.com/?deepLink=".urlencode($deepLink);
$html = '
<form action="?install2" method="post">
Onedrive_Ver:<br>
<label><input type="radio" name="Onedrive_ver" value="MS" checked>MS: '.getconstStr('OndriveVerMS').'</label><br>
<label><input type="radio" name="Onedrive_ver" value="CN">CN: '.getconstStr('OndriveVerCN').'</label><br>
<label><input type="radio" name="Onedrive_ver" value="MSC" onclick="document.getElementById(\'secret\').style.display=\'\';">MSC: '.getconstStr('OndriveVerMSC').'
<div id="secret" style="display:none">
<a href="'.$app_url.'" target="_blank">'.getconstStr('GetSecretIDandKEY').'</a><br>
client_secret:<input type="text" name="client_secret"><br>
client_id(12345678-90ab-cdef-ghij-klmnopqrstuv):<input type="text" name="client_id"><br>
</div>
</label><br>
<input type="submit" value="'.getconstStr('Submit').'">
</form>';
$title = 'Install';
} else {
$html = $response . '<br>
Can not write config to file.<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
}
return message($html, $title, 201);
}
}
if ($_GET['install0']) {
if (!ConfigWriteable()) {
$html .= 'Plase make sure the config.php is writeable.
run Writeable.sh.';
$title = 'Error';
return message($html, $title, 201);
}
if (!RewriteEngineOn()) {
$html .= 'Plase make sure the RewriteEngine is On.';
$title = 'Error';
return message($html, $title, 201);
}
$html .= '
<form action="?install1" method="post" onsubmit="return adminnotnull(this);">
language:<br>';
foreach ($constStr['languages'] as $key1 => $value1) {
$html .= '
<label><input type="radio" name="language" value="'.$key1.'" '.($key1==$constStr['language']?'checked':'').' onclick="changelanguage(\''.$key1.'\')">'.$value1.'</label><br>';
}
$html .= '<br>
<label>admin:<input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"></label><br>
<input type="submit" value="'.getconstStr('Submit').'">
</form>
<script>
function changelanguage(str)
{
document.cookie=\'language=\'+str+\'; path=/\';
location.href = location.href;
}
function adminnotnull(t)
{
if (t.admin.value==\'\') {
alert(\'input admin\');
return false;
}
return true;
}
</script>';
$title = getconstStr('SelectLanguage');
return message($html, $title, 201);
}
$html .= 'refresh_token not exist, <a href="?install0">click to install.</a>';
$title = 'Error';
return message($html, $title, 201);
}
function ConfigWriteable()
{
$t = md5( md5(time()).rand(1000,9999) );
setConfig([ 'tmp' => $t ]);
$tmp = getConfig('tmp');
setConfig([ 'tmp' => '' ]);
if ($tmp == $t) return true;
return false;
}
function RewriteEngineOn()
{
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$tmpurl=$http_type . $_SERVER['SERVER_NAME'] . path_format($_SERVER['base_path'] . '/config.php');
$tmp = curl_request($tmpurl);
if ($tmp['stat']==201) return true; //when install return 201, after installed return 404 or 200;
return false;
}
function getConfig($str)
{
include 'config.php';
//$s = file_get_contents('config.json');
if ($configs!='') {
$envs = json_decode($configs, true);
if (isset($envs[$str])) return $envs[$str];
}
return '';
/*
if (!class_exists('mydbreader')) {
class mydbreader extends SQLite3
{
function __construct()
{
$this->open( __DIR__ .'/.ht.db');
}
}
}
$db = new mydbreader();
if(!$db){
echo $db->lastErrorMsg();
} else {
//echo "Opened database successfully<br>\n";
$id=rand(1,309);
$sql="select * from config where id=".$str.";";
$ret = $db->query($sql);
if(!$ret){
echo $db->lastErrorMsg();
} else {
$row = $ret->fetchArray(SQLITE3_ASSOC);
$value1 = $row['value'];
}
$db->close();
}
return $value1;
*/
}
function array_value_isnot_null($arr)
{
return $arr!=='';
}
function setConfig($arr)
{
include 'config.php';
if ($configs!='') $envs = json_decode($configs, true);
foreach ($arr as $k1 => $v1) {
$envs[$k1] = $v1;
}
$envs = array_filter($envs, 'array_value_isnot_null');
ksort($envs);
//echo '<pre>'. json_encode($envs, JSON_PRETTY_PRINT).'</pre>';
$prestr = '<?php $configs = \'
';
$aftstr = '
\';';
return file_put_contents('config.php', $prestr . json_encode($envs, JSON_PRETTY_PRINT) . $aftstr);
}
function EnvOpt($function_name, $needUpdate = 0)
{
global $constStr;
$constEnv = [
//'admin',
'adminloginpage', 'domain_path', 'guestup_path', 'passfile',
//'private_path',
'public_path', 'sitename', 'language', 'theme'
];
asort($constEnv);
$html = '<title>OneManager '.getconstStr('Setup').'</title>';
/*if ($_POST['updateProgram']==getconstStr('updateProgram')) {
$response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
if (isset($response['Error'])) {
$html = $response['Error']['Code'] . '<br>
' . $response['Error']['Message'] . '<br><br>
function_name:' . $_SERVER['function_name'] . '<br>
Region:' . $_SERVER['Region'] . '<br>
namespace:' . $namespace . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
} else {
$html .= getconstStr('UpdateSuccess') . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = getconstStr('Setup');
}
return message($html, $title);
}*/
if ($_POST['submit1']) {
foreach ($_POST as $k => $v) {
if (in_array($k, $constEnv)) {
//if (!(getConfig($k)==''&&$v==''))
$tmp[$k] = $v;
}
}
if ($tmp['domain_path']!='') {
$tmp1 = explode("|",$tmp['domain_path']);
$tmparr = [];
foreach ($tmp1 as $multidomain_paths){
$pos = strpos($multidomain_paths,":");
if ($pos>0) $tmparr[substr($multidomain_paths, 0, $pos)] = path_format(substr($multidomain_paths, $pos+1));
}
$tmp['domain_path'] = $tmparr;
}
$response = setConfig($tmp);
if (!$response) {
$html = $response . '<br>
<button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button>';
$title = 'Error';
} else {
$html .= '<script>location.href=location.href</script>';
}
}
if ($_GET['preview']) {
$preurl = $_SERVER['PHP_SELF'] . '?preview';
} else {
$preurl = path_format($_SERVER['PHP_SELF'] . '/');
}
$html .= '
<a href="'.$preurl.'">'.getconstStr('Back').'</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/qkqpttgf/OneManager-php">Github</a><br>';
/*if ($needUpdate) {
$html .= '<pre>' . $_SERVER['github_version'] . '</pre>
<form action="" method="post">
<input type="submit" name="updateProgram" value="'.getconstStr('updateProgram').'">
</form>';
} else {
$html .= getconstStr('NotNeedUpdate');
}*/
$html .= '
<form action="" method="post">
<table border=1 width=100%>';
foreach ($constEnv as $key) {
if ($key=='language') {
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%>
<select name="' . $key .'">';
foreach ($constStr['languages'] as $key1 => $value1) {
$html .= '
<option value="'.$key1.'" '.($key1==getConfig($key)?'selected="selected"':'').'>'.$value1.'</option>';
}
$html .= '
</select>
</td>
</tr>';
} elseif ($key=='theme') {
$theme_arr = scandir('theme');
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%>
<select name="' . $key .'">';
foreach ($theme_arr as $v1) {
if ($v1!='.' && $v1!='..') $html .= '
<option value="'.$v1.'" '.($v1==getConfig($key)?'selected="selected"':'').'>'.$v1.'</option>';
}
$html .= '
</select>
</td>
</tr>';
} elseif ($key=='domain_path') {
$tmp = getConfig($key);
$domain_path = '';
foreach ($tmp as $k1 => $v1) {
$domain_path .= $k1 . ':' . $v1 . '|';
}
$domain_path = substr($domain_path, 0, -1);
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%><input type="text" name="' . $key .'" value="' . $domain_path . '" placeholder="' . getconstStr('EnvironmentsDescription')[$key] . '" style="width:100%"></td>
</tr>';
} else $html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%><input type="text" name="' . $key .'" value="' . getConfig($key) . '" placeholder="' . getconstStr('EnvironmentsDescription')[$key] . '" style="width:100%"></td>
</tr>';
}
$html .= '</table>
<input type="submit" name="submit1" value="'.getconstStr('Setup').'">
</form>';
return message($html, getconstStr('Setup'));
}
此差异已折叠。
<?php <?php
include 'vendor/autoload.php';
include 'conststr.php'; include 'conststr.php';
include 'function/common.php';
echo '<pre>' . json_encode($_SERVER, JSON_PRETTY_PRINT) . '</pre>'; //echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
if (!isset($_SERVER['REDIRECT_URL'])) $_SERVER['REDIRECT_URL'] = '/index.php'; if ($_SERVER['USER']==='qcloud') {
if ($_SERVER['REDIRECT_URL']=='') $_SERVER['REDIRECT_URL']='/'; include 'function/scf.php';
$path = $_SERVER['REDIRECT_URL']; } elseif ($_SERVER['HEROKU_APP_DIR']==='/app') {
include 'function/heroku.php';
$path = getpath();
//echo 'path:'. $path;
$_GET = getGET();
//echo '<pre>'. json_encode($_GET, JSON_PRETTY_PRINT).'</pre>';
$re = main($path);
$sendHeaders = array();
foreach ($re['headers'] as $headerName => $headerVal) {
header($headerName . ': ' . $headerVal, true);
}
http_response_code($re['statusCode']);
echo $re['body'];
} else {
include 'function/normal.php';
$path = getpath();
//echo 'path:'. $path;
$_GET = getGET();
//echo '<pre>'. json_encode($_GET, JSON_PRETTY_PRINT).'</pre>';
$getstr = substr(urldecode($_SERVER['REQUEST_URI']), strlen(urldecode($_SERVER['REDIRECT_URL']))); $re = main($path);
while (substr($getstr,0,1)=='/' || substr($getstr,0,1)=='?') $getstr = substr($getstr,1); $sendHeaders = array();
$getstrarr = explode("&",$getstr); foreach ($re['headers'] as $headerName => $headerVal) {
foreach ($getstrarr as $getvalues) if ($getvalues!='') { header($headerName . ': ' . $headerVal, true);
$pos = strpos($getvalues,"=");
//echo $pos;
if ($pos>0) {
$getarry[urldecode(substr($getvalues,0,$pos))] = urldecode(substr($getvalues,$pos+1));
} else $getarry[urldecode($getvalues)] = true;
} }
if (isset($getarry)) { http_response_code($re['statusCode']);
$_GET = $getarry; echo $re['body'];
} else $_GET = ''; }
echo '<pre>' . json_encode($_GET, JSON_PRETTY_PRINT) . '</pre>'; function main_handler($event, $context)
{
$event = json_decode(json_encode($event), true);
$context = json_decode(json_encode($context), true);
printInput($event, $context);
unset($_POST);
unset($_GET);
unset($_COOKIE);
unset($_SERVER);
GetGlobalVariable($event);
echo '<pre>'. json_encode($_COOKIE, JSON_PRETTY_PRINT).'</pre>';
config_oauth();
$path = GetPathSetting($event, $context);
return main($path);
}
# Deploy to SCF
https://cloud.tencent.com/product/scf
Install: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/%E6%97%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%BD%E6%95%B0SCF%E6%90%AD%E5%BB%BAOneDrive.mp4?preview
DEMO: https://service-pgxgvop2-1258064400.ap-hongkong.apigateway.myqcloud.com/test/abcdef/
# Deploy to heroku
https://heroku.com
Click the button [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) to Deploy a new app, or create an app then deploy by connect github.
DEMO: https://herooneindex.herokuapp.com/
此差异已折叠。
此差异已折叠。
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit95653bfe69a47d1c8f876456a9c468fd::getLoader();
此差异已折叠。
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'),
'App\\' => array($baseDir . '/app'),
);
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit95653bfe69a47d1c8f876456a9c468fd
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit95653bfe69a47d1c8f876456a9c468fd', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit95653bfe69a47d1c8f876456a9c468fd', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit95653bfe69a47d1c8f876456a9c468fd::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit95653bfe69a47d1c8f876456a9c468fd
{
public static $prefixLengthsPsr4 = array (
'D' =>
array (
'Doctrine\\Common\\Cache\\' => 22,
),
'A' =>
array (
'App\\' => 4,
),
);
public static $prefixDirsPsr4 = array (
'Doctrine\\Common\\Cache\\' =>
array (
0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache',
),
'App\\' =>
array (
0 => __DIR__ . '/../..' . '/app',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit95653bfe69a47d1c8f876456a9c468fd::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit95653bfe69a47d1c8f876456a9c468fd::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}
此差异已折叠。
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\Common\Cache;
/**
* Interface for cache that can be flushed.
*
* Intended to be used for partial clearing of a cache namespace. For a more
* global "flushing", see {@see FlushableCache}.
*
* @link www.doctrine-project.org
* @since 1.4
* @author Adirelle <adirelle@gmail.com>
*/
interface ClearableCache
{
/**
* Deletes all cache entries in the current cache namespace.
*
* @return bool TRUE if the cache entries were successfully deleted, FALSE otherwise.
*/
public function deleteAll();
}
20200118.01
SCF、heroku、普通VPS,三种环境都可以用了。
OneManagerPath=`cd $(dirname $0);pwd -P`
cd ${OneManagerPath}
chmod 666 config.php
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册