diff --git a/admin/package-lock.json b/admin/package-lock.json index d6b1450b..c103efab 100644 --- a/admin/package-lock.json +++ b/admin/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "packages": { "": { - "name": "admin", "version": "0.0.0", "dependencies": { + "@element-plus/icons-vue": "^0.2.6", "axios": "^0.21.1", "element-plus": "^1.3.0-beta.5", "vue": "^3.0.5", diff --git a/admin/package.json b/admin/package.json index 82f62959..6a571817 100644 --- a/admin/package.json +++ b/admin/package.json @@ -7,6 +7,7 @@ "serve": "vite preview --mode preview" }, "dependencies": { + "@element-plus/icons-vue": "^0.2.6", "axios": "^0.21.1", "element-plus": "^1.3.0-beta.5", "vue": "^3.0.5", diff --git a/admin/src/App.vue b/admin/src/App.vue index b11e5504..6463911c 100644 --- a/admin/src/App.vue +++ b/admin/src/App.vue @@ -17,15 +17,15 @@ :default-active='state.currentPath' > Dashboard - + User User list - - + + System @@ -44,7 +44,7 @@ Setting - + @@ -186,14 +186,14 @@ body { .el-menu { border-right: none!important; } -.el-submenu { +.el-sub-menu { border-top: 1px solid hsla(0, 0%, 100%, .05); border-bottom: 1px solid rgba(0, 0, 0, .2); } -.el-submenu:first-child { +.el-sub-menu:first-child { border-top: none; } -.el-submenu [class^="el-icon-"] { +.el-sub-menu [class^="el-icon-"] { vertical-align: -1px!important; } a { diff --git a/admin/src/main.js b/admin/src/main.js index 4e823dbf..f18e4912 100644 --- a/admin/src/main.js +++ b/admin/src/main.js @@ -4,4 +4,10 @@ import ElementPlus from 'element-plus' import router from './router/index' import 'element-plus/theme-chalk/index.css' import './styles/common.scss' -createApp(App).use(ElementPlus).use(router).mount('#app') +import * as ElIcons from '@element-plus/icons-vue' + +const app = createApp(App) +for (const name in ElIcons) { + app.component(name, ElIcons[name]) +} +app.use(ElementPlus).use(router).mount('#app') diff --git a/admin/src/views/exam/index.vue b/admin/src/views/exam/index.vue index 1d19fc4e..dd71ae7a 100644 --- a/admin/src/views/exam/index.vue +++ b/admin/src/views/exam/index.vue @@ -6,7 +6,7 @@ - Add + Add diff --git a/admin/src/views/medal/index.vue b/admin/src/views/medal/index.vue index 71d2cd3e..fd1b9eea 100644 --- a/admin/src/views/medal/index.vue +++ b/admin/src/views/medal/index.vue @@ -6,7 +6,7 @@ - Add + Add @@ -33,11 +33,19 @@ + > + + + + + > + + + + Edit diff --git a/admin/src/views/user/detail.vue b/admin/src/views/user/detail.vue index 9651ec1d..1d1802a7 100644 --- a/admin/src/views/user/detail.vue +++ b/admin/src/views/user/detail.vue @@ -19,10 +19,10 @@ - Mod comment - Reset password - Assign exam - Grant medal + Mod comment + Reset password + Assign exam + Grant medal @@ -179,6 +179,9 @@ prop="image_large" label="Image" > + + + - - Add + + + + + + Add + findOrFail((int)$torrent, ['id', 'pos_state']); - } - } - } diff --git a/composer.json b/composer.json index 81e6a659..cc79d594 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ] }, "require": { - "php": "^7.3|^8.0", + "php": "^8.0", "ext-gd": "*", "ext-json": "*", "ext-mbstring": "*", @@ -35,7 +35,7 @@ "geoip2/geoip2": "~2.0", "guzzlehttp/guzzle": "~6.0", "hashids/hashids": "^4.1", - "imdbphp/imdbphp": "^6.4", + "imdbphp/imdbphp": "^7.0", "laravel-lang/lang": "~7.0", "laravel/framework": "^8.12", "laravel/sanctum": "^2.10", diff --git a/composer.lock b/composer.lock index e172cda6..a089ec84 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "536588e03f43a227f60cd6666dbb4e3f", + "content-hash": "4893668aed1fe063d932fc9d9e5ea4d5", "packages": [ { "name": "asm89/stack-cors", @@ -1740,22 +1740,30 @@ }, { "name": "imdbphp/imdbphp", - "version": "v6.5.1", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/tboothman/imdbphp.git", - "reference": "4a88ceeabadf1c7b4924dd321fb89bc642b58bee" + "reference": "8bd3b62344add278959c297a56f0cffd2796e12f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tboothman/imdbphp/zipball/4a88ceeabadf1c7b4924dd321fb89bc642b58bee", - "reference": "4a88ceeabadf1c7b4924dd321fb89bc642b58bee", - "shasum": "" + "url": "https://api.github.com/repos/tboothman/imdbphp/zipball/8bd3b62344add278959c297a56f0cffd2796e12f", + "reference": "8bd3b62344add278959c297a56f0cffd2796e12f", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-curl": "*", "ext-dom": "*", "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", "php": ">=5.6", "psr/log": "~1.0", "psr/simple-cache": "^1.0" @@ -1779,9 +1787,9 @@ "description": "Library for retrieving film and tv information from IMDb", "support": { "issues": "https://github.com/tboothman/imdbphp/issues", - "source": "https://github.com/tboothman/imdbphp/tree/v6.5.1" + "source": "https://github.com/tboothman/imdbphp/tree/v7.2.0" }, - "time": "2021-05-30T00:19:11+00:00" + "time": "2021-07-15T12:15:21+00:00" }, { "name": "laravel-lang/lang", @@ -9439,5 +9447,5 @@ "ext-bcmath": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/include/functions.php b/include/functions.php index 7ec48fc5..475ec560 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1421,7 +1421,11 @@ function sent_mail($to,$fromname,$fromemail,$subject,$body,$type = "confirmation $setting = get_setting('smtp'); // Create the Transport - $transport = (new Swift_SmtpTransport($setting['smtpaddress'], $setting['smtpport'], $setting['smtpport'] == 465 ? 'ssl' : null)) + $encryption = null; + if (isset($setting['encryption']) && in_array($setting['encryption'], ['ssl', 'tls'])) { + $encryption = $setting['encryption']; + } + $transport = (new Swift_SmtpTransport($setting['smtpaddress'], $setting['smtpport'], $encryption)) ->setUsername($setting['accountname']) ->setPassword($setting['accountpassword']) ; diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php index 75e1fc18..3324f85e 100644 --- a/lang/chs/lang_settings.php +++ b/lang/chs/lang_settings.php @@ -557,6 +557,7 @@ $lang_settings = array 'text_setting_for_external_type' => "外部类型设定", 'row_outgoing_mail_address' => "SMTP地址", 'row_outgoing_mail_port' => "SMTP端口", + 'row_outgoing_mail_encryption' => "SMTP加密方式", 'text_outgoing_mail_address_note' => "提示: smtp.yourisp.com", 'text_outgoing_mail_port_note' => "提示: 25", 'row_smtp_account_name' => "用户名", diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php index a9ed926d..9227525b 100644 --- a/lang/cht/lang_settings.php +++ b/lang/cht/lang_settings.php @@ -557,6 +557,7 @@ $lang_settings = array 'text_setting_for_external_type' => "外部類別設定", 'row_outgoing_mail_address' => "SMTP位址", 'row_outgoing_mail_port' => "SMTP通訊埠", + 'row_outgoing_mail_encryption' => "SMTP加密方式", 'text_outgoing_mail_address_note' => "輔助說明: smtp.yourisp.com", 'text_outgoing_mail_port_note' => "輔助說明: 25", 'row_smtp_account_name' => "用戶名", diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php index 263b2def..bf01d603 100644 --- a/lang/en/lang_settings.php +++ b/lang/en/lang_settings.php @@ -556,6 +556,7 @@ $lang_settings = array 'text_setting_for_external_type' => "Settings for External type", 'row_outgoing_mail_address' => "Outgoing mail (SMTP) address", 'row_outgoing_mail_port' => "Outgoing mail (SMTP) port", + 'row_outgoing_mail_encryption' => "Outgoing mail (SMTP) encryption", 'text_outgoing_mail_address_note' => "hint: smtp.yourisp.com", 'text_outgoing_mail_port_note' => "hint: 25", 'row_smtp_account_name' => "Account Name", diff --git a/public/download.php b/public/download.php index 51248797..26af1b94 100644 --- a/public/download.php +++ b/public/download.php @@ -104,15 +104,19 @@ $trackerReportAuthKey = $torrentRep->getTrackerReportAuthKey($id, $CURUSER['id'] $dict = \Rhilip\Bencode\Bencode::load($fn); $dict['announce'] = $ssl_torrent . $base_announce_url . "?authkey=$trackerReportAuthKey"; -if (count($announce_urls) > 1) { - foreach ($announce_urls as $announce_url) { - /** d['announce-list'] = [[ tracker1, tracker2, tracker3 ]] */ - $dict['announce-list'][0][] = $ssl_torrent . $announce_url . "?authkey=$trackerReportAuthKey"; - - /** d['announce-list'] = [ [tracker1], [backup1], [backup2] ] */ - //$dict['announce-list'][] = [$ssl_torrent . $announce_url . "?passkey=" . $CURUSER['passkey']]; - } -} +/** + * does not support multi-tracker + * + * @see https://github.com/xiaomlove/nexusphp/issues/26 + */ +//if (count($announce_urls) > 1) { +// foreach ($announce_urls as $announce_url) { +// /** d['announce-list'] = [[ tracker1, tracker2, tracker3 ]] */ +// $dict['announce-list'][0][] = $ssl_torrent . $announce_url . "?authkey=$trackerReportAuthKey"; +// /** d['announce-list'] = [ [tracker1], [backup1], [backup2] ] */ +// //$dict['announce-list'][] = [$ssl_torrent . $announce_url . "?passkey=" . $CURUSER['passkey']]; +// } +//} //$dict = bdec_file($fn, $max_torrent_size); //$dict['value']['announce']['value'] = $ssl_torrent . $base_announce_url . "?passkey=$CURUSER[passkey]"; diff --git a/public/mybonus.php b/public/mybonus.php index 23c227bc..042c065b 100644 --- a/public/mybonus.php +++ b/public/mybonus.php @@ -112,14 +112,17 @@ function bonusarray($option = 0){ $results[] = $bonus; //Buy medal - $medals = \App\Models\Medal::query()->get(); + $medals = \App\Models\Medal::query()->where('get_type', \App\Models\Medal::GET_TYPE_EXCHANGE)->get(); foreach ($medals as $medal) { $results[] = [ 'points' => $medal->price, 'art' => 'buy_medal', 'menge' => 0, 'name' => $medal->name, - 'description' => sprintf('%s', $medal->description, $medal->id), + 'description' => sprintf( + '%s', + $medal->description, $medal->image_large, $medal->id + ), 'medal_id' => $medal->id, ]; } diff --git a/public/settings.php b/public/settings.php index dfc75e93..01ebd657 100644 --- a/public/settings.php +++ b/public/settings.php @@ -166,7 +166,7 @@ elseif ($action == 'savesettings_smtp') // save smtp if (isset($smtptype) && $smtptype == 'advanced') { $validConfig = array_merge($validConfig, array('smtp_host','smtp_port','smtp_from')); } elseif ($smtptype == 'external') { - $validConfig = array_merge($validConfig, array('smtpaddress','smtpport','accountname','accountpassword')); + $validConfig = array_merge($validConfig, array('smtpaddress','smtpport', 'encryption', 'accountname','accountpassword')); } GetVar($validConfig); @@ -306,6 +306,10 @@ elseif ($action == 'smtpsettings') // stmp settings print("".$lang_settings['text_setting_for_external_type'].""); tr($lang_settings['row_outgoing_mail_address'], " ".$lang_settings['text_outgoing_mail_address_note'], 1); tr($lang_settings['row_outgoing_mail_port'], " ".$lang_settings['text_outgoing_mail_port_note'], 1); + $encryptionRadio = 'none'; + $encryptionRadio .= 'tls'; + $encryptionRadio .= 'ssl'; + tr($lang_settings['row_outgoing_mail_encryption'], $encryptionRadio, 1); tr($lang_settings['row_smtp_account_name'], " ".$lang_settings['text_smtp_account_name_note'], 1); tr($lang_settings['row_smtp_account_password'], " ".$lang_settings['text_smtp_account_password_note'], 1); print("");