diff --git a/apps/middleware/AuthByCookiesMiddleware.php b/apps/middleware/AuthByCookiesMiddleware.php index 29ef66b..0c1b092 100644 --- a/apps/middleware/AuthByCookiesMiddleware.php +++ b/apps/middleware/AuthByCookiesMiddleware.php @@ -57,12 +57,12 @@ public function handle($callable, \Closure $next) * if this config key is not exist , the default class 1 will be used to compare. * * Example of `Route - Controller - Config Key` Map: - * /admin -> AdminController::actionIndex -> authority.route_admin_index - * /admin/service -> AdminController::actionService -> authority.route_admin_service + * /admin -> AdminController::actionIndex -> route.admin_index + * /admin/service -> AdminController::actionService -> route.admin_service */ $route = strtolower(str_replace(['apps\\controllers\\', 'Controller'], ['', ''], $controllerName)) . "_" . strtolower(str_replace('action', '', $action)); - $required_class = app()->config->get('authority.route_' . $route, false) ?: 1; + $required_class = app()->config->get('route.' . $route, false) ?: 1; if (app()->user->getClass(true) < $required_class) { return app()->response->setStatusCode(403); } diff --git a/apps/public/static/css/main.css b/apps/public/static/css/main.css index 72c18b9..e742b68 100644 --- a/apps/public/static/css/main.css +++ b/apps/public/static/css/main.css @@ -22,6 +22,8 @@ body{background-color:#f6f6f6} .nowrap {white-space: nowrap;} +.required:after{position: static} + /*-----------------------------------------------------------------------------------*/ /* 2. Layout of Header, Navigation & Menus /*-----------------------------------------------------------------------------------*/ @@ -86,6 +88,8 @@ body{background-color:#f6f6f6} /* Common */ .torrent-title-block{margin-bottom: 15px} .torrent-title{} +.name-left{width:95%;} +#torrents_table td[data-item] {vertical-align: middle;} /* '/torrent/upload' */ #torrent_upload_table > tbody > tr > td:first-child{vertical-align:middle;text-align:right} diff --git a/apps/views/auth/register.php b/apps/views/auth/register.php index 123c016..fe590a8 100644 --- a/apps/views/auth/register.php +++ b/apps/views/auth/register.php @@ -90,6 +90,7 @@ onpaste="return false;" data-match="#password" > +
diff --git a/apps/views/index.php b/apps/views/index.php index 82f3b17..2cf33c1 100644 --- a/apps/views/index.php +++ b/apps/views/index.php @@ -8,8 +8,6 @@ * @var League\Plates\Template\Template $this * @var array $news */ - -$can_manage_news = app()->user->isPrivilege('manage_news'); ?> layout('layout/base') ?> @@ -18,6 +16,7 @@ start('container') ?>
+ user->isPrivilege('manage_news'); ?>
Recent News - [All] [New]' : '' ?>
diff --git a/apps/views/torrent/upload.php b/apps/views/torrent/upload.php index 52215b5..837bdb1 100644 --- a/apps/views/torrent/upload.php +++ b/apps/views/torrent/upload.php @@ -22,7 +22,7 @@ - + - + - +
@@ -35,7 +35,7 @@ You should obey our upload rules. **LINK**
diff --git a/migration/ridpt.sql b/migration/ridpt.sql index 091367b..a3fd32e 100644 --- a/migration/ridpt.sql +++ b/migration/ridpt.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Jun 07, 2019 at 11:15 AM +-- Generation Time: Jun 15, 2019 at 07:53 PM -- Server version: 8.0.16 -- PHP Version: 7.3.6 @@ -196,7 +196,7 @@ CREATE TABLE IF NOT EXISTS `invite` ( `invite_type` enum('temporarily','permanent') NOT NULL DEFAULT 'temporarily', `create_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `expire_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `used` tinyint(1) NOT NULL DEFAULT '0', + `used` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 - wait to use ; 1 - used ; -1 - expired; -2 - recycled', PRIMARY KEY (`id`), UNIQUE KEY `hash` (`hash`), UNIQUE KEY `username` (`username`), @@ -364,8 +364,6 @@ INSERT INTO `site_config` (`name`, `value`) VALUES ('authority.manage_news', '80'), ('authority.pass_invite_interval_check', '60'), ('authority.pass_tracker_upspeed_check', '60'), -('authority.route_admin_index', '60'), -('authority.route_admin_service', '90'), ('authority.see_anonymous_uploader', '40'), ('authority.see_banned_torrent', '40'), ('authority.see_extend_debug_log', '90'), @@ -427,6 +425,8 @@ INSERT INTO `site_config` (`name`, `value`) VALUES ('register.user_default_status', 'pending'), ('register.user_default_uploaded', '0'), ('register.user_default_uploadpos', '1'), +('route.admin_index', '60'), +('route.admin_service', '90'), ('security.max_login_attempts', '10'), ('torrent.max_file_size', '3145728'), ('torrent.max_nfo_size', '65535'),