diff options
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r-- | app/ServiceProvider/ActionProvider.php | 4 | ||||
-rw-r--r-- | app/ServiceProvider/ApiProvider.php | 74 | ||||
-rw-r--r-- | app/ServiceProvider/AuthenticationProvider.php | 116 | ||||
-rw-r--r-- | app/ServiceProvider/AvatarProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/ClassProvider.php | 122 | ||||
-rw-r--r-- | app/ServiceProvider/CommandProvider.php | 62 | ||||
-rw-r--r-- | app/ServiceProvider/DatabaseProvider.php | 25 | ||||
-rw-r--r-- | app/ServiceProvider/EventDispatcherProvider.php | 11 | ||||
-rw-r--r-- | app/ServiceProvider/ExternalLinkProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/FilterProvider.php | 28 | ||||
-rw-r--r-- | app/ServiceProvider/GroupProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/HelperProvider.php | 7 | ||||
-rw-r--r-- | app/ServiceProvider/LoggingProvider.php | 35 | ||||
-rw-r--r-- | app/ServiceProvider/MailProvider.php | 34 | ||||
-rw-r--r-- | app/ServiceProvider/NotificationProvider.php | 26 | ||||
-rw-r--r-- | app/ServiceProvider/PluginProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/QueueProvider.php | 27 | ||||
-rw-r--r-- | app/ServiceProvider/RouteProvider.php | 221 | ||||
-rw-r--r-- | app/ServiceProvider/SessionProvider.php | 2 |
19 files changed, 532 insertions, 270 deletions
diff --git a/app/ServiceProvider/ActionProvider.php b/app/ServiceProvider/ActionProvider.php index 3692f190..34202052 100644 --- a/app/ServiceProvider/ActionProvider.php +++ b/app/ServiceProvider/ActionProvider.php @@ -2,6 +2,7 @@ namespace Kanboard\ServiceProvider; +use Kanboard\Action\TaskAssignColorPriority; use Pimple\Container; use Pimple\ServiceProviderInterface; use Kanboard\Core\Action\ActionManager; @@ -35,7 +36,7 @@ use Kanboard\Action\TaskCloseNoActivity; /** * Action Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class ActionProvider implements ServiceProviderInterface @@ -59,6 +60,7 @@ class ActionProvider implements ServiceProviderInterface $container['actionManager']->register(new TaskAssignColorColumn($container)); $container['actionManager']->register(new TaskAssignColorLink($container)); $container['actionManager']->register(new TaskAssignColorUser($container)); + $container['actionManager']->register(new TaskAssignColorPriority($container)); $container['actionManager']->register(new TaskAssignCurrentUser($container)); $container['actionManager']->register(new TaskAssignCurrentUserColumn($container)); $container['actionManager']->register(new TaskAssignSpecificUser($container)); diff --git a/app/ServiceProvider/ApiProvider.php b/app/ServiceProvider/ApiProvider.php new file mode 100644 index 00000000..19d945f6 --- /dev/null +++ b/app/ServiceProvider/ApiProvider.php @@ -0,0 +1,74 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use JsonRPC\Server; +use Kanboard\Api\ActionApi; +use Kanboard\Api\AppApi; +use Kanboard\Api\BoardApi; +use Kanboard\Api\CategoryApi; +use Kanboard\Api\ColumnApi; +use Kanboard\Api\CommentApi; +use Kanboard\Api\FileApi; +use Kanboard\Api\GroupApi; +use Kanboard\Api\GroupMemberApi; +use Kanboard\Api\LinkApi; +use Kanboard\Api\MeApi; +use Kanboard\Api\Middleware\AuthenticationApiMiddleware; +use Kanboard\Api\ProjectApi; +use Kanboard\Api\ProjectPermissionApi; +use Kanboard\Api\SubtaskApi; +use Kanboard\Api\SwimlaneApi; +use Kanboard\Api\TaskApi; +use Kanboard\Api\TaskLinkApi; +use Kanboard\Api\UserApi; +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Class ApiProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ +class ApiProvider implements ServiceProviderInterface +{ + /** + * Registers services on the given container. + * + * @param Container $container + * @return Container + */ + public function register(Container $container) + { + $server = new Server(); + $server->setAuthenticationHeader(API_AUTHENTICATION_HEADER); + $server->getMiddlewareHandler() + ->withMiddleware(new AuthenticationApiMiddleware($container)) + ; + + $server->getProcedureHandler() + ->withObject(new MeApi($container)) + ->withObject(new ActionApi($container)) + ->withObject(new AppApi($container)) + ->withObject(new BoardApi($container)) + ->withObject(new ColumnApi($container)) + ->withObject(new CategoryApi($container)) + ->withObject(new CommentApi($container)) + ->withObject(new FileApi($container)) + ->withObject(new LinkApi($container)) + ->withObject(new ProjectApi($container)) + ->withObject(new ProjectPermissionApi($container)) + ->withObject(new SubtaskApi($container)) + ->withObject(new SwimlaneApi($container)) + ->withObject(new TaskApi($container)) + ->withObject(new TaskLinkApi($container)) + ->withObject(new UserApi($container)) + ->withObject(new GroupApi($container)) + ->withObject(new GroupMemberApi($container)) + ; + + $container['api'] = $server; + return $container; + } +} diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index 776e65d5..2fad8a3a 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -17,7 +17,7 @@ use Kanboard\Auth\ReverseProxyAuth; /** * Authentication Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class AuthenticationProvider implements ServiceProviderInterface @@ -66,39 +66,43 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->setRoleHierarchy(Role::PROJECT_MANAGER, array(Role::PROJECT_MEMBER, Role::PROJECT_VIEWER)); $acl->setRoleHierarchy(Role::PROJECT_MEMBER, array(Role::PROJECT_VIEWER)); - $acl->add('Action', '*', Role::PROJECT_MANAGER); - $acl->add('ActionProject', '*', Role::PROJECT_MANAGER); - $acl->add('ActionCreation', '*', Role::PROJECT_MANAGER); - $acl->add('Analytic', '*', Role::PROJECT_MANAGER); - $acl->add('Board', 'save', Role::PROJECT_MEMBER); - $acl->add('BoardPopover', '*', Role::PROJECT_MEMBER); - $acl->add('Calendar', 'save', Role::PROJECT_MEMBER); - $acl->add('Category', '*', Role::PROJECT_MANAGER); - $acl->add('Column', '*', Role::PROJECT_MANAGER); - $acl->add('Comment', '*', Role::PROJECT_MEMBER); - $acl->add('Customfilter', '*', Role::PROJECT_MEMBER); - $acl->add('Export', '*', Role::PROJECT_MANAGER); - $acl->add('TaskFile', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER); - $acl->add('Gantt', '*', Role::PROJECT_MANAGER); - $acl->add('Project', array('share', 'integrations', 'notifications', 'duplicate', 'disable', 'enable', 'remove'), Role::PROJECT_MANAGER); - $acl->add('ProjectPermission', '*', Role::PROJECT_MANAGER); - $acl->add('ProjectEdit', '*', Role::PROJECT_MANAGER); - $acl->add('ProjectFile', '*', Role::PROJECT_MEMBER); - $acl->add('Projectuser', '*', Role::PROJECT_MANAGER); - $acl->add('Subtask', '*', Role::PROJECT_MEMBER); - $acl->add('SubtaskRestriction', '*', Role::PROJECT_MEMBER); - $acl->add('SubtaskStatus', '*', Role::PROJECT_MEMBER); - $acl->add('Swimlane', '*', Role::PROJECT_MANAGER); - $acl->add('Task', 'remove', Role::PROJECT_MEMBER); - $acl->add('Taskcreation', '*', Role::PROJECT_MEMBER); - $acl->add('Taskduplication', '*', Role::PROJECT_MEMBER); - $acl->add('TaskRecurrence', '*', Role::PROJECT_MEMBER); - $acl->add('TaskImport', '*', Role::PROJECT_MANAGER); - $acl->add('TaskInternalLink', '*', Role::PROJECT_MEMBER); - $acl->add('TaskExternalLink', '*', Role::PROJECT_MEMBER); - $acl->add('Taskmodification', '*', Role::PROJECT_MEMBER); - $acl->add('Taskstatus', '*', Role::PROJECT_MEMBER); - $acl->add('UserHelper', array('mention'), Role::PROJECT_MEMBER); + $acl->add('ActionController', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectActionDuplicationController', '*', Role::PROJECT_MANAGER); + $acl->add('ActionCreationController', '*', Role::PROJECT_MANAGER); + $acl->add('AnalyticController', '*', Role::PROJECT_MANAGER); + $acl->add('BoardAjaxController', 'save', Role::PROJECT_MEMBER); + $acl->add('BoardPopoverController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskPopoverController', '*', Role::PROJECT_MEMBER); + $acl->add('CalendarController', 'save', Role::PROJECT_MEMBER); + $acl->add('CategoryController', '*', Role::PROJECT_MANAGER); + $acl->add('ColumnController', '*', Role::PROJECT_MANAGER); + $acl->add('CommentController', '*', Role::PROJECT_MEMBER); + $acl->add('CustomFilterController', '*', Role::PROJECT_MEMBER); + $acl->add('ExportController', '*', Role::PROJECT_MANAGER); + $acl->add('TaskFileController', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER); + $acl->add('TaskGanttController', '*', Role::PROJECT_MANAGER); + $acl->add('TaskGanttCreationController', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectViewController', array('share', 'updateSharing', 'integrations', 'updateIntegrations', 'notifications', 'updateNotifications', 'duplicate', 'doDuplication'), Role::PROJECT_MANAGER); + $acl->add('ProjectPermissionController', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectEditController', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectFileController', '*', Role::PROJECT_MEMBER); + $acl->add('ProjectUserOverviewController', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectStatusController', '*', Role::PROJECT_MANAGER); + $acl->add('SubtaskController', '*', Role::PROJECT_MEMBER); + $acl->add('SubtaskRestrictionController', '*', Role::PROJECT_MEMBER); + $acl->add('SubtaskStatusController', '*', Role::PROJECT_MEMBER); + $acl->add('SwimlaneController', '*', Role::PROJECT_MANAGER); + $acl->add('TaskSuppressionController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskCreationController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskBulkController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskDuplicationController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskRecurrenceController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskImportController', '*', Role::PROJECT_MANAGER); + $acl->add('TaskInternalLinkController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskExternalLinkController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskModificationController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskStatusController', '*', Role::PROJECT_MEMBER); + $acl->add('UserAjaxController', array('mention'), Role::PROJECT_MEMBER); return $acl; } @@ -117,27 +121,31 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->setRoleHierarchy(Role::APP_MANAGER, array(Role::APP_USER, Role::APP_PUBLIC)); $acl->setRoleHierarchy(Role::APP_USER, array(Role::APP_PUBLIC)); - $acl->add('Auth', array('login', 'check'), Role::APP_PUBLIC); - $acl->add('Captcha', '*', Role::APP_PUBLIC); - $acl->add('PasswordReset', '*', Role::APP_PUBLIC); - $acl->add('Webhook', '*', Role::APP_PUBLIC); - $acl->add('Task', 'readonly', Role::APP_PUBLIC); - $acl->add('Board', 'readonly', Role::APP_PUBLIC); - $acl->add('Ical', '*', Role::APP_PUBLIC); - $acl->add('Feed', '*', Role::APP_PUBLIC); - $acl->add('AvatarFile', 'show', Role::APP_PUBLIC); + $acl->add('AuthController', array('login', 'check'), Role::APP_PUBLIC); + $acl->add('CaptchaController', '*', Role::APP_PUBLIC); + $acl->add('PasswordResetController', '*', Role::APP_PUBLIC); + $acl->add('TaskViewController', 'readonly', Role::APP_PUBLIC); + $acl->add('BoardViewController', 'readonly', Role::APP_PUBLIC); + $acl->add('ICalendarController', '*', Role::APP_PUBLIC); + $acl->add('FeedController', '*', Role::APP_PUBLIC); + $acl->add('AvatarFileController', 'show', Role::APP_PUBLIC); - $acl->add('Config', '*', Role::APP_ADMIN); - $acl->add('Currency', '*', Role::APP_ADMIN); - $acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER); - $acl->add('Group', '*', Role::APP_ADMIN); - $acl->add('Link', '*', Role::APP_ADMIN); - $acl->add('ProjectCreation', 'create', Role::APP_MANAGER); - $acl->add('Projectuser', '*', Role::APP_MANAGER); - $acl->add('Twofactor', 'disable', Role::APP_ADMIN); - $acl->add('UserImport', '*', Role::APP_ADMIN); - $acl->add('User', array('index', 'create', 'save', 'authentication'), Role::APP_ADMIN); - $acl->add('UserStatus', '*', Role::APP_ADMIN); + $acl->add('ConfigController', '*', Role::APP_ADMIN); + $acl->add('PluginController', '*', Role::APP_ADMIN); + $acl->add('CurrencyController', '*', Role::APP_ADMIN); + $acl->add('ProjectGanttController', '*', Role::APP_MANAGER); + $acl->add('GroupListController', '*', Role::APP_ADMIN); + $acl->add('GroupCreationController', '*', Role::APP_ADMIN); + $acl->add('GroupModificationController', '*', Role::APP_ADMIN); + $acl->add('LinkController', '*', Role::APP_ADMIN); + $acl->add('ProjectCreationController', 'create', Role::APP_MANAGER); + $acl->add('ProjectUserOverviewController', '*', Role::APP_MANAGER); + $acl->add('TwoFactorController', 'disable', Role::APP_ADMIN); + $acl->add('UserImportController', '*', Role::APP_ADMIN); + $acl->add('UserCreationController', '*', Role::APP_ADMIN); + $acl->add('UserListController', '*', Role::APP_ADMIN); + $acl->add('UserStatusController', '*', Role::APP_ADMIN); + $acl->add('UserCredentialController', array('changeAuthentication', 'saveAuthentication'), Role::APP_ADMIN); return $acl; } diff --git a/app/ServiceProvider/AvatarProvider.php b/app/ServiceProvider/AvatarProvider.php index aac4fcab..d17985ed 100644 --- a/app/ServiceProvider/AvatarProvider.php +++ b/app/ServiceProvider/AvatarProvider.php @@ -12,7 +12,7 @@ use Kanboard\User\Avatar\LetterAvatarProvider; /** * Avatar Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class AvatarProvider implements ServiceProviderInterface diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index 18c1d578..3e6efb02 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -4,13 +4,18 @@ namespace Kanboard\ServiceProvider; use Pimple\Container; use Pimple\ServiceProviderInterface; -use Kanboard\Core\Mail\Client as EmailClient; use Kanboard\Core\ObjectStorage\FileStorage; use Kanboard\Core\Paginator; use Kanboard\Core\Http\OAuth2; use Kanboard\Core\Tool; use Kanboard\Core\Http\Client as HttpClient; +/** + * Class ClassProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ class ClassProvider implements ServiceProviderInterface { private $classes = array( @@ -22,59 +27,60 @@ class ClassProvider implements ServiceProviderInterface 'AverageTimeSpentColumnAnalytic', ), 'Model' => array( - 'Action', - 'ActionParameter', - 'AvatarFile', - 'Board', - 'Category', - 'Color', - 'Column', - 'Comment', - 'Config', - 'Currency', - 'CustomFilter', - 'Group', - 'GroupMember', - 'LastLogin', - 'Link', - 'Notification', - 'PasswordReset', - 'Project', - 'ProjectFile', - 'ProjectActivity', - 'ProjectDuplication', - 'ProjectDailyColumnStats', - 'ProjectDailyStats', - 'ProjectPermission', - 'ProjectNotification', - 'ProjectMetadata', - 'ProjectGroupRole', - 'ProjectUserRole', - 'RememberMeSession', - 'Subtask', - 'SubtaskTimeTracking', - 'Swimlane', - 'Task', - 'TaskAnalytic', - 'TaskCreation', - 'TaskDuplication', - 'TaskExternalLink', - 'TaskFinder', - 'TaskFile', - 'TaskLink', - 'TaskModification', - 'TaskPermission', - 'TaskPosition', - 'TaskStatus', - 'TaskMetadata', - 'Transition', - 'User', - 'UserLocking', - 'UserMention', - 'UserNotification', - 'UserNotificationFilter', - 'UserUnreadNotification', - 'UserMetadata', + 'ActionModel', + 'ActionParameterModel', + 'AvatarFileModel', + 'BoardModel', + 'CategoryModel', + 'ColorModel', + 'ColumnModel', + 'CommentModel', + 'ConfigModel', + 'CurrencyModel', + 'CustomFilterModel', + 'GroupModel', + 'GroupMemberModel', + 'LanguageModel', + 'LastLoginModel', + 'LinkModel', + 'NotificationModel', + 'PasswordResetModel', + 'ProjectModel', + 'ProjectFileModel', + 'ProjectActivityModel', + 'ProjectDuplicationModel', + 'ProjectDailyColumnStatsModel', + 'ProjectDailyStatsModel', + 'ProjectPermissionModel', + 'ProjectNotificationModel', + 'ProjectMetadataModel', + 'ProjectGroupRoleModel', + 'ProjectUserRoleModel', + 'RememberMeSessionModel', + 'SubtaskModel', + 'SubtaskTimeTrackingModel', + 'SwimlaneModel', + 'TaskModel', + 'TaskAnalyticModel', + 'TaskCreationModel', + 'TaskDuplicationModel', + 'TaskExternalLinkModel', + 'TaskFinderModel', + 'TaskFileModel', + 'TaskLinkModel', + 'TaskModificationModel', + 'TaskPositionModel', + 'TaskStatusModel', + 'TaskMetadataModel', + 'TimezoneModel', + 'TransitionModel', + 'UserModel', + 'UserLockingModel', + 'UserMentionModel', + 'UserNotificationModel', + 'UserNotificationFilterModel', + 'UserUnreadNotificationModel', + 'UserMetadataModel', ), 'Validator' => array( 'ActionValidator', @@ -154,14 +160,6 @@ class ClassProvider implements ServiceProviderInterface return new FileStorage(FILES_DIR); }; - $container['emailClient'] = function ($container) { - $mailer = new EmailClient($container); - $mailer->setTransport('smtp', '\Kanboard\Core\Mail\Transport\Smtp'); - $mailer->setTransport('sendmail', '\Kanboard\Core\Mail\Transport\Sendmail'); - $mailer->setTransport('mail', '\Kanboard\Core\Mail\Transport\Mail'); - return $mailer; - }; - $container['cspRules'] = array( 'default-src' => "'self'", 'style-src' => "'self' 'unsafe-inline'", diff --git a/app/ServiceProvider/CommandProvider.php b/app/ServiceProvider/CommandProvider.php new file mode 100644 index 00000000..55c2712b --- /dev/null +++ b/app/ServiceProvider/CommandProvider.php @@ -0,0 +1,62 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use Kanboard\Console\CronjobCommand; +use Kanboard\Console\LocaleComparatorCommand; +use Kanboard\Console\LocaleSyncCommand; +use Kanboard\Console\PluginInstallCommand; +use Kanboard\Console\PluginUninstallCommand; +use Kanboard\Console\PluginUpgradeCommand; +use Kanboard\Console\ProjectDailyColumnStatsExportCommand; +use Kanboard\Console\ProjectDailyStatsCalculationCommand; +use Kanboard\Console\ResetPasswordCommand; +use Kanboard\Console\ResetTwoFactorCommand; +use Kanboard\Console\SubtaskExportCommand; +use Kanboard\Console\TaskExportCommand; +use Kanboard\Console\TaskOverdueNotificationCommand; +use Kanboard\Console\TaskTriggerCommand; +use Kanboard\Console\TransitionExportCommand; +use Kanboard\Console\WorkerCommand; +use Pimple\Container; +use Pimple\ServiceProviderInterface; +use Symfony\Component\Console\Application; + +/** + * Class CommandProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ +class CommandProvider implements ServiceProviderInterface +{ + /** + * Registers services on the given container. + * + * @param Container $container + * @return Container + */ + public function register(Container $container) + { + $application = new Application('Kanboard', APP_VERSION); + $application->add(new TaskOverdueNotificationCommand($container)); + $application->add(new SubtaskExportCommand($container)); + $application->add(new TaskExportCommand($container)); + $application->add(new ProjectDailyStatsCalculationCommand($container)); + $application->add(new ProjectDailyColumnStatsExportCommand($container)); + $application->add(new TransitionExportCommand($container)); + $application->add(new LocaleSyncCommand($container)); + $application->add(new LocaleComparatorCommand($container)); + $application->add(new TaskTriggerCommand($container)); + $application->add(new CronjobCommand($container)); + $application->add(new WorkerCommand($container)); + $application->add(new ResetPasswordCommand($container)); + $application->add(new ResetTwoFactorCommand($container)); + $application->add(new PluginUpgradeCommand($container)); + $application->add(new PluginInstallCommand($container)); + $application->add(new PluginUninstallCommand($container)); + + $container['cli'] = $application; + return $container; + } +} diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php index d323807d..a3f57457 100644 --- a/app/ServiceProvider/DatabaseProvider.php +++ b/app/ServiceProvider/DatabaseProvider.php @@ -8,13 +8,31 @@ use Pimple\Container; use Pimple\ServiceProviderInterface; use PicoDb\Database; +/** + * Class DatabaseProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ class DatabaseProvider implements ServiceProviderInterface { + /** + * Register provider + * + * @access public + * @param Container $container + * @return Container + */ public function register(Container $container) { $container['db'] = $this->getInstance(); - $container['db']->stopwatch = DEBUG; - $container['db']->logQueries = DEBUG; + + if (DEBUG) { + $container['db']->getStatementHandler() + ->withLogging() + ->withStopWatch() + ; + } return $container; } @@ -83,6 +101,9 @@ class DatabaseProvider implements ServiceProviderInterface 'database' => DB_NAME, 'charset' => 'utf8', 'port' => DB_PORT, + 'ssl_key' => DB_SSL_KEY, + 'ssl_ca' => DB_SSL_CA, + 'ssl_cert' => DB_SSL_CERT, )); } diff --git a/app/ServiceProvider/EventDispatcherProvider.php b/app/ServiceProvider/EventDispatcherProvider.php index 880caa41..57543fe4 100644 --- a/app/ServiceProvider/EventDispatcherProvider.php +++ b/app/ServiceProvider/EventDispatcherProvider.php @@ -2,6 +2,7 @@ namespace Kanboard\ServiceProvider; +use Kanboard\Subscriber\LdapUserPhotoSubscriber; use Pimple\Container; use Pimple\ServiceProviderInterface; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -14,6 +15,12 @@ use Kanboard\Subscriber\SubtaskTimeTrackingSubscriber; use Kanboard\Subscriber\TransitionSubscriber; use Kanboard\Subscriber\RecurringTaskSubscriber; +/** + * Class EventDispatcherProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ class EventDispatcherProvider implements ServiceProviderInterface { public function register(Container $container) @@ -28,6 +35,10 @@ class EventDispatcherProvider implements ServiceProviderInterface $container['dispatcher']->addSubscriber(new TransitionSubscriber($container)); $container['dispatcher']->addSubscriber(new RecurringTaskSubscriber($container)); + if (LDAP_AUTH && LDAP_USER_ATTRIBUTE_PHOTO !== '') { + $container['dispatcher']->addSubscriber(new LdapUserPhotoSubscriber($container)); + } + return $container; } } diff --git a/app/ServiceProvider/ExternalLinkProvider.php b/app/ServiceProvider/ExternalLinkProvider.php index 8b71ec81..2cec768d 100644 --- a/app/ServiceProvider/ExternalLinkProvider.php +++ b/app/ServiceProvider/ExternalLinkProvider.php @@ -12,7 +12,7 @@ use Kanboard\ExternalLink\FileLinkProvider; /** * External Link Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class ExternalLinkProvider implements ServiceProviderInterface diff --git a/app/ServiceProvider/FilterProvider.php b/app/ServiceProvider/FilterProvider.php index f3918d77..cdef9ed8 100644 --- a/app/ServiceProvider/FilterProvider.php +++ b/app/ServiceProvider/FilterProvider.php @@ -27,17 +27,17 @@ use Kanboard\Filter\TaskStatusFilter; use Kanboard\Filter\TaskSubtaskAssigneeFilter; use Kanboard\Filter\TaskSwimlaneFilter; use Kanboard\Filter\TaskTitleFilter; -use Kanboard\Model\Project; -use Kanboard\Model\ProjectGroupRole; -use Kanboard\Model\ProjectUserRole; -use Kanboard\Model\User; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\ProjectGroupRoleModel; +use Kanboard\Model\ProjectUserRoleModel; +use Kanboard\Model\UserModel; use Pimple\Container; use Pimple\ServiceProviderInterface; /** * Filter Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class FilterProvider implements ServiceProviderInterface @@ -61,7 +61,7 @@ class FilterProvider implements ServiceProviderInterface { $container['userQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['db']->table(User::TABLE)); + $builder->withQuery($c['db']->table(UserModel::TABLE)); return $builder; }); @@ -72,26 +72,26 @@ class FilterProvider implements ServiceProviderInterface { $container['projectGroupRoleQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['db']->table(ProjectGroupRole::TABLE)); + $builder->withQuery($c['db']->table(ProjectGroupRoleModel::TABLE)); return $builder; }); $container['projectUserRoleQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['db']->table(ProjectUserRole::TABLE)); + $builder->withQuery($c['db']->table(ProjectUserRoleModel::TABLE)); return $builder; }); $container['projectQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['db']->table(Project::TABLE)); + $builder->withQuery($c['db']->table(ProjectModel::TABLE)); return $builder; }); $container['projectActivityLexer'] = $container->factory(function ($c) { $builder = new LexerBuilder(); $builder - ->withQuery($c['projectActivity']->getQuery()) + ->withQuery($c['projectActivityModel']->getQuery()) ->withFilter(new ProjectActivityTaskTitleFilter(), true) ->withFilter(new ProjectActivityTaskStatusFilter()) ->withFilter(new ProjectActivityProjectNameFilter()) @@ -108,7 +108,7 @@ class FilterProvider implements ServiceProviderInterface $container['projectActivityQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['projectActivity']->getQuery()); + $builder->withQuery($c['projectActivityModel']->getQuery()); return $builder; }); @@ -120,7 +120,7 @@ class FilterProvider implements ServiceProviderInterface { $container['taskQuery'] = $container->factory(function ($c) { $builder = new QueryBuilder(); - $builder->withQuery($c['taskFinder']->getExtendedQuery()); + $builder->withQuery($c['taskFinderModel']->getExtendedQuery()); return $builder; }); @@ -128,13 +128,13 @@ class FilterProvider implements ServiceProviderInterface $builder = new LexerBuilder(); $builder - ->withQuery($c['taskFinder']->getExtendedQuery()) + ->withQuery($c['taskFinderModel']->getExtendedQuery()) ->withFilter(TaskAssigneeFilter::getInstance() ->setCurrentUserId($c['userSession']->getId()) ) ->withFilter(new TaskCategoryFilter()) ->withFilter(TaskColorFilter::getInstance() - ->setColorModel($c['color']) + ->setColorModel($c['colorModel']) ) ->withFilter(new TaskColumnFilter()) ->withFilter(new TaskCommentFilter()) diff --git a/app/ServiceProvider/GroupProvider.php b/app/ServiceProvider/GroupProvider.php index b222b218..08548c73 100644 --- a/app/ServiceProvider/GroupProvider.php +++ b/app/ServiceProvider/GroupProvider.php @@ -11,7 +11,7 @@ use Kanboard\Group\LdapBackendGroupProvider; /** * Group Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class GroupProvider implements ServiceProviderInterface diff --git a/app/ServiceProvider/HelperProvider.php b/app/ServiceProvider/HelperProvider.php index bf3956a2..a909e3cf 100644 --- a/app/ServiceProvider/HelperProvider.php +++ b/app/ServiceProvider/HelperProvider.php @@ -7,6 +7,12 @@ use Kanboard\Core\Template; use Pimple\Container; use Pimple\ServiceProviderInterface; +/** + * Class HelperProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ class HelperProvider implements ServiceProviderInterface { public function register(Container $container) @@ -31,6 +37,7 @@ class HelperProvider implements ServiceProviderInterface $container['helper']->register('avatar', '\Kanboard\Helper\AvatarHelper'); $container['helper']->register('projectHeader', '\Kanboard\Helper\ProjectHeaderHelper'); $container['helper']->register('projectActivity', '\Kanboard\Helper\ProjectActivityHelper'); + $container['helper']->register('mail', '\Kanboard\Helper\MailHelper'); $container['template'] = new Template($container['helper']); diff --git a/app/ServiceProvider/LoggingProvider.php b/app/ServiceProvider/LoggingProvider.php index 68c074f0..cb6d0baa 100644 --- a/app/ServiceProvider/LoggingProvider.php +++ b/app/ServiceProvider/LoggingProvider.php @@ -6,27 +6,48 @@ use Psr\Log\LogLevel; use Pimple\Container; use Pimple\ServiceProviderInterface; use SimpleLogger\Logger; +use SimpleLogger\Stderr; +use SimpleLogger\Stdout; use SimpleLogger\Syslog; use SimpleLogger\File; +/** + * Class LoggingProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ class LoggingProvider implements ServiceProviderInterface { public function register(Container $container) { $logger = new Logger; + $driver = null; - if (ENABLE_SYSLOG) { - $syslog = new Syslog('kanboard'); - $syslog->setLevel(LogLevel::ERROR); - $logger->setLogger($syslog); + switch (LOG_DRIVER) { + case 'syslog': + $driver = new Syslog('kanboard'); + break; + case 'stdout': + $driver = new Stdout(); + break; + case 'stderr': + $driver = new Stderr(); + break; + case 'file': + $driver = new File(LOG_FILE); + break; } - if (DEBUG) { - $logger->setLogger(new File(DEBUG_FILE)); + if ($driver !== null) { + if (! DEBUG) { + $driver->setLevel(LogLevel::INFO); + } + + $logger->setLogger($driver); } $container['logger'] = $logger; - return $container; } } diff --git a/app/ServiceProvider/MailProvider.php b/app/ServiceProvider/MailProvider.php new file mode 100644 index 00000000..685709e3 --- /dev/null +++ b/app/ServiceProvider/MailProvider.php @@ -0,0 +1,34 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use Kanboard\Core\Mail\Client as EmailClient; +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Mail Provider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ +class MailProvider implements ServiceProviderInterface +{ + /** + * Registers services on the given container. + * + * @param Container $container + */ + public function register(Container $container) + { + $container['emailClient'] = function ($container) { + $mailer = new EmailClient($container); + $mailer->setTransport('smtp', '\Kanboard\Core\Mail\Transport\Smtp'); + $mailer->setTransport('sendmail', '\Kanboard\Core\Mail\Transport\Sendmail'); + $mailer->setTransport('mail', '\Kanboard\Core\Mail\Transport\Mail'); + return $mailer; + }; + + return $container; + } +} diff --git a/app/ServiceProvider/NotificationProvider.php b/app/ServiceProvider/NotificationProvider.php index 83daf65d..a0571209 100644 --- a/app/ServiceProvider/NotificationProvider.php +++ b/app/ServiceProvider/NotificationProvider.php @@ -4,15 +4,15 @@ namespace Kanboard\ServiceProvider; use Pimple\Container; use Pimple\ServiceProviderInterface; -use Kanboard\Model\UserNotificationType; -use Kanboard\Model\ProjectNotificationType; -use Kanboard\Notification\Mail as MailNotification; -use Kanboard\Notification\Web as WebNotification; +use Kanboard\Model\UserNotificationTypeModel; +use Kanboard\Model\ProjectNotificationTypeModel; +use Kanboard\Notification\MailNotification as MailNotification; +use Kanboard\Notification\WebNotification as WebNotification; /** * Notification Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class NotificationProvider implements ServiceProviderInterface @@ -26,17 +26,17 @@ class NotificationProvider implements ServiceProviderInterface */ public function register(Container $container) { - $container['userNotificationType'] = function ($container) { - $type = new UserNotificationType($container); - $type->setType(MailNotification::TYPE, t('Email'), '\Kanboard\Notification\Mail'); - $type->setType(WebNotification::TYPE, t('Web'), '\Kanboard\Notification\Web'); + $container['userNotificationTypeModel'] = function ($container) { + $type = new UserNotificationTypeModel($container); + $type->setType(MailNotification::TYPE, t('Email'), '\Kanboard\Notification\MailNotification'); + $type->setType(WebNotification::TYPE, t('Web'), '\Kanboard\Notification\WebNotification'); return $type; }; - $container['projectNotificationType'] = function ($container) { - $type = new ProjectNotificationType($container); - $type->setType('webhook', 'Webhook', '\Kanboard\Notification\Webhook', true); - $type->setType('activity_stream', 'ActivityStream', '\Kanboard\Notification\ActivityStream', true); + $container['projectNotificationTypeModel'] = function ($container) { + $type = new ProjectNotificationTypeModel($container); + $type->setType('webhook', 'Webhook', '\Kanboard\Notification\WebhookNotification', true); + $type->setType('activity_stream', 'ActivityStream', '\Kanboard\Notification\ActivityStreamNotification', true); return $type; }; diff --git a/app/ServiceProvider/PluginProvider.php b/app/ServiceProvider/PluginProvider.php index d2f1666b..4cf57251 100644 --- a/app/ServiceProvider/PluginProvider.php +++ b/app/ServiceProvider/PluginProvider.php @@ -9,7 +9,7 @@ use Kanboard\Core\Plugin\Loader; /** * Plugin Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class PluginProvider implements ServiceProviderInterface diff --git a/app/ServiceProvider/QueueProvider.php b/app/ServiceProvider/QueueProvider.php new file mode 100644 index 00000000..946b436a --- /dev/null +++ b/app/ServiceProvider/QueueProvider.php @@ -0,0 +1,27 @@ +<?php + +namespace Kanboard\ServiceProvider; + +use Kanboard\Core\Queue\QueueManager; +use Pimple\Container; +use Pimple\ServiceProviderInterface; + +/** + * Class QueueProvider + * + * @package Kanboard\ServiceProvider + * @author Frederic Guillot + */ +class QueueProvider implements ServiceProviderInterface +{ + /** + * Registers services on the given container. + * + * @param Container $container + */ + public function register(Container $container) + { + $container['queueManager'] = new QueueManager($container); + return $container; + } +} diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index 30d23a51..3d1391df 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -10,7 +10,7 @@ use Kanboard\Core\Http\Router; /** * Route Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class RouteProvider implements ServiceProviderInterface @@ -31,168 +31,165 @@ class RouteProvider implements ServiceProviderInterface $container['route']->enable(); // Dashboard - $container['route']->addRoute('dashboard', 'app', 'index'); - $container['route']->addRoute('dashboard/:user_id', 'app', 'index'); - $container['route']->addRoute('dashboard/:user_id/projects', 'app', 'projects'); - $container['route']->addRoute('dashboard/:user_id/tasks', 'app', 'tasks'); - $container['route']->addRoute('dashboard/:user_id/subtasks', 'app', 'subtasks'); - $container['route']->addRoute('dashboard/:user_id/calendar', 'app', 'calendar'); - $container['route']->addRoute('dashboard/:user_id/activity', 'app', 'activity'); - $container['route']->addRoute('dashboard/:user_id/notifications', 'app', 'notifications'); + $container['route']->addRoute('dashboard', 'DashboardController', 'show'); + $container['route']->addRoute('dashboard/:user_id', 'DashboardController', 'show'); + $container['route']->addRoute('dashboard/:user_id/projects', 'DashboardController', 'projects'); + $container['route']->addRoute('dashboard/:user_id/tasks', 'DashboardController', 'tasks'); + $container['route']->addRoute('dashboard/:user_id/subtasks', 'DashboardController', 'subtasks'); + $container['route']->addRoute('dashboard/:user_id/calendar', 'DashboardController', 'calendar'); + $container['route']->addRoute('dashboard/:user_id/activity', 'DashboardController', 'activity'); + $container['route']->addRoute('dashboard/:user_id/notifications', 'DashboardController', 'notifications'); // Search routes - $container['route']->addRoute('search', 'search', 'index'); - $container['route']->addRoute('search/activity', 'search', 'activity'); + $container['route']->addRoute('search', 'SearchController', 'index'); + $container['route']->addRoute('search/activity', 'SearchController', 'activity'); // ProjectCreation routes - $container['route']->addRoute('project/create', 'ProjectCreation', 'create'); - $container['route']->addRoute('project/create/private', 'ProjectCreation', 'createPrivate'); + $container['route']->addRoute('project/create', 'ProjectCreationController', 'create'); + $container['route']->addRoute('project/create/private', 'ProjectCreationController', 'createPrivate'); // Project routes - $container['route']->addRoute('projects', 'project', 'index'); - $container['route']->addRoute('project/:project_id', 'project', 'show'); - $container['route']->addRoute('p/:project_id', 'project', 'show'); - $container['route']->addRoute('project/:project_id/customer-filters', 'customfilter', 'index'); - $container['route']->addRoute('project/:project_id/share', 'project', 'share'); - $container['route']->addRoute('project/:project_id/notifications', 'project', 'notifications'); - $container['route']->addRoute('project/:project_id/integrations', 'project', 'integrations'); - $container['route']->addRoute('project/:project_id/duplicate', 'project', 'duplicate'); - $container['route']->addRoute('project/:project_id/remove', 'project', 'remove'); - $container['route']->addRoute('project/:project_id/disable', 'project', 'disable'); - $container['route']->addRoute('project/:project_id/enable', 'project', 'enable'); - $container['route']->addRoute('project/:project_id/permissions', 'ProjectPermission', 'index'); - $container['route']->addRoute('project/:project_id/import', 'taskImport', 'step1'); - $container['route']->addRoute('project/:project_id/activity', 'activity', 'project'); + $container['route']->addRoute('projects', 'ProjectListController', 'show'); + $container['route']->addRoute('project/:project_id', 'ProjectViewController', 'show'); + $container['route']->addRoute('p/:project_id', 'ProjectViewController', 'show'); + $container['route']->addRoute('project/:project_id/customer-filters', 'CustomFilterController', 'index'); + $container['route']->addRoute('project/:project_id/share', 'ProjectViewController', 'share'); + $container['route']->addRoute('project/:project_id/notifications', 'ProjectViewController', 'notifications'); + $container['route']->addRoute('project/:project_id/integrations', 'ProjectViewController', 'integrations'); + $container['route']->addRoute('project/:project_id/duplicate', 'ProjectViewController', 'duplicate'); + $container['route']->addRoute('project/:project_id/permissions', 'ProjectPermissionController', 'index'); + $container['route']->addRoute('project/:project_id/activity', 'ActivityController', 'project'); // Project Overview - $container['route']->addRoute('project/:project_id/overview', 'ProjectOverview', 'show'); + $container['route']->addRoute('project/:project_id/overview', 'ProjectOverviewController', 'show'); // ProjectEdit routes - $container['route']->addRoute('project/:project_id/edit', 'ProjectEdit', 'edit'); - $container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEdit', 'dates'); - $container['route']->addRoute('project/:project_id/edit/description', 'ProjectEdit', 'description'); - $container['route']->addRoute('project/:project_id/edit/priority', 'ProjectEdit', 'priority'); + $container['route']->addRoute('project/:project_id/edit', 'ProjectEditController', 'edit'); + $container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEditController', 'dates'); + $container['route']->addRoute('project/:project_id/edit/description', 'ProjectEditController', 'description'); + $container['route']->addRoute('project/:project_id/edit/priority', 'ProjectEditController', 'priority'); // ProjectUser routes - $container['route']->addRoute('projects/managers/:user_id', 'projectuser', 'managers'); - $container['route']->addRoute('projects/members/:user_id', 'projectuser', 'members'); - $container['route']->addRoute('projects/tasks/:user_id/opens', 'projectuser', 'opens'); - $container['route']->addRoute('projects/tasks/:user_id/closed', 'projectuser', 'closed'); - $container['route']->addRoute('projects/managers', 'projectuser', 'managers'); + $container['route']->addRoute('projects/managers/:user_id', 'ProjectUserOverviewController', 'managers'); + $container['route']->addRoute('projects/members/:user_id', 'ProjectUserOverviewController', 'members'); + $container['route']->addRoute('projects/tasks/:user_id/opens', 'ProjectUserOverviewController', 'opens'); + $container['route']->addRoute('projects/tasks/:user_id/closed', 'ProjectUserOverviewController', 'closed'); + $container['route']->addRoute('projects/managers', 'ProjectUserOverviewController', 'managers'); // Action routes - $container['route']->addRoute('project/:project_id/actions', 'action', 'index'); + $container['route']->addRoute('project/:project_id/actions', 'ActionController', 'index'); // Column routes - $container['route']->addRoute('project/:project_id/columns', 'column', 'index'); + $container['route']->addRoute('project/:project_id/columns', 'ColumnController', 'index'); // Swimlane routes - $container['route']->addRoute('project/:project_id/swimlanes', 'swimlane', 'index'); + $container['route']->addRoute('project/:project_id/swimlanes', 'SwimlaneController', 'index'); // Category routes - $container['route']->addRoute('project/:project_id/categories', 'category', 'index'); + $container['route']->addRoute('project/:project_id/categories', 'CategoryController', 'index'); + + // Import routes + $container['route']->addRoute('project/:project_id/import', 'TaskImportController', 'show'); // Task routes - $container['route']->addRoute('project/:project_id/task/:task_id', 'task', 'show'); - $container['route']->addRoute('t/:task_id', 'task', 'show'); - $container['route']->addRoute('public/task/:task_id/:token', 'task', 'readonly'); + $container['route']->addRoute('project/:project_id/task/:task_id', 'TaskViewController', 'show'); + $container['route']->addRoute('t/:task_id', 'TaskViewController', 'show'); + $container['route']->addRoute('public/task/:task_id/:token', 'TaskViewController', 'readonly'); - $container['route']->addRoute('project/:project_id/task/:task_id/activity', 'activity', 'task'); - $container['route']->addRoute('project/:project_id/task/:task_id/transitions', 'task', 'transitions'); - $container['route']->addRoute('project/:project_id/task/:task_id/analytics', 'task', 'analytics'); - $container['route']->addRoute('project/:project_id/task/:task_id/subtasks', 'subtask', 'show'); - $container['route']->addRoute('project/:project_id/task/:task_id/time-tracking', 'task', 'timetracking'); + $container['route']->addRoute('project/:project_id/task/:task_id/activity', 'ActivityController', 'task'); + $container['route']->addRoute('project/:project_id/task/:task_id/transitions', 'TaskViewController', 'transitions'); + $container['route']->addRoute('project/:project_id/task/:task_id/analytics', 'TaskViewController', 'analytics'); + $container['route']->addRoute('project/:project_id/task/:task_id/time-tracking', 'TaskViewController', 'timetracking'); // Exports - $container['route']->addRoute('export/tasks/:project_id', 'export', 'tasks'); - $container['route']->addRoute('export/subtasks/:project_id', 'export', 'subtasks'); - $container['route']->addRoute('export/transitions/:project_id', 'export', 'transitions'); - $container['route']->addRoute('export/summary/:project_id', 'export', 'summary'); + $container['route']->addRoute('export/tasks/:project_id', 'ExportController', 'tasks'); + $container['route']->addRoute('export/subtasks/:project_id', 'ExportController', 'subtasks'); + $container['route']->addRoute('export/transitions/:project_id', 'ExportController', 'transitions'); + $container['route']->addRoute('export/summary/:project_id', 'ExportController', 'summary'); // Analytics routes - $container['route']->addRoute('analytics/tasks/:project_id', 'analytic', 'tasks'); - $container['route']->addRoute('analytics/users/:project_id', 'analytic', 'users'); - $container['route']->addRoute('analytics/cfd/:project_id', 'analytic', 'cfd'); - $container['route']->addRoute('analytics/burndown/:project_id', 'analytic', 'burndown'); - $container['route']->addRoute('analytics/average-time-column/:project_id', 'analytic', 'averageTimeByColumn'); - $container['route']->addRoute('analytics/lead-cycle-time/:project_id', 'analytic', 'leadAndCycleTime'); - $container['route']->addRoute('analytics/estimated-spent-time/:project_id', 'analytic', 'compareHours'); + $container['route']->addRoute('analytics/tasks/:project_id', 'AnalyticController', 'tasks'); + $container['route']->addRoute('analytics/users/:project_id', 'AnalyticController', 'users'); + $container['route']->addRoute('analytics/cfd/:project_id', 'AnalyticController', 'cfd'); + $container['route']->addRoute('analytics/burndown/:project_id', 'AnalyticController', 'burndown'); + $container['route']->addRoute('analytics/average-time-column/:project_id', 'AnalyticController', 'averageTimeByColumn'); + $container['route']->addRoute('analytics/lead-cycle-time/:project_id', 'AnalyticController', 'leadAndCycleTime'); + $container['route']->addRoute('analytics/estimated-spent-time/:project_id', 'AnalyticController', 'compareHours'); // Board routes - $container['route']->addRoute('board/:project_id', 'board', 'show'); - $container['route']->addRoute('b/:project_id', 'board', 'show'); - $container['route']->addRoute('public/board/:token', 'board', 'readonly'); + $container['route']->addRoute('board/:project_id', 'BoardViewController', 'show'); + $container['route']->addRoute('b/:project_id', 'BoardViewController', 'show'); + $container['route']->addRoute('public/board/:token', 'BoardViewController', 'readonly'); // Calendar routes - $container['route']->addRoute('calendar/:project_id', 'calendar', 'show'); - $container['route']->addRoute('c/:project_id', 'calendar', 'show'); + $container['route']->addRoute('calendar/:project_id', 'CalendarController', 'show'); + $container['route']->addRoute('c/:project_id', 'CalendarController', 'show'); // Listing routes - $container['route']->addRoute('list/:project_id', 'listing', 'show'); - $container['route']->addRoute('l/:project_id', 'listing', 'show'); + $container['route']->addRoute('list/:project_id', 'TaskListController', 'show'); + $container['route']->addRoute('l/:project_id', 'TaskListController', 'show'); // Gantt routes - $container['route']->addRoute('gantt/:project_id', 'gantt', 'project'); - $container['route']->addRoute('gantt/:project_id/sort/:sorting', 'gantt', 'project'); + $container['route']->addRoute('gantt/:project_id', 'TaskGanttController', 'show'); + $container['route']->addRoute('gantt/:project_id/sort/:sorting', 'TaskGanttController', 'show'); // Feed routes - $container['route']->addRoute('feed/project/:token', 'feed', 'project'); - $container['route']->addRoute('feed/user/:token', 'feed', 'user'); + $container['route']->addRoute('feed/project/:token', 'FeedController', 'project'); + $container['route']->addRoute('feed/user/:token', 'FeedController', 'user'); // Ical routes - $container['route']->addRoute('ical/project/:token', 'ical', 'project'); - $container['route']->addRoute('ical/user/:token', 'ical', 'user'); + $container['route']->addRoute('ical/project/:token', 'ICalendarController', 'project'); + $container['route']->addRoute('ical/user/:token', 'ICalendarController', 'user'); // Users - $container['route']->addRoute('users', 'user', 'index'); - $container['route']->addRoute('user/profile/:user_id', 'user', 'profile'); - $container['route']->addRoute('user/show/:user_id', 'user', 'show'); - $container['route']->addRoute('user/show/:user_id/timesheet', 'user', 'timesheet'); - $container['route']->addRoute('user/show/:user_id/last-logins', 'user', 'last'); - $container['route']->addRoute('user/show/:user_id/sessions', 'user', 'sessions'); - $container['route']->addRoute('user/:user_id/edit', 'user', 'edit'); - $container['route']->addRoute('user/:user_id/password', 'user', 'password'); - $container['route']->addRoute('user/:user_id/share', 'user', 'share'); - $container['route']->addRoute('user/:user_id/notifications', 'user', 'notifications'); - $container['route']->addRoute('user/:user_id/accounts', 'user', 'external'); - $container['route']->addRoute('user/:user_id/integrations', 'user', 'integrations'); - $container['route']->addRoute('user/:user_id/authentication', 'user', 'authentication'); - $container['route']->addRoute('user/:user_id/2fa', 'twofactor', 'index'); + $container['route']->addRoute('users', 'UserListController', 'show'); + $container['route']->addRoute('user/profile/:user_id', 'UserViewController', 'profile'); + $container['route']->addRoute('user/show/:user_id', 'UserViewController', 'show'); + $container['route']->addRoute('user/show/:user_id/timesheet', 'UserViewController', 'timesheet'); + $container['route']->addRoute('user/show/:user_id/last-logins', 'UserViewController', 'lastLogin'); + $container['route']->addRoute('user/show/:user_id/sessions', 'UserViewController', 'sessions'); + $container['route']->addRoute('user/:user_id/edit', 'UserModificationController', 'show'); + $container['route']->addRoute('user/:user_id/password', 'UserCredentialController', 'changePassword'); + $container['route']->addRoute('user/:user_id/share', 'UserViewController', 'share'); + $container['route']->addRoute('user/:user_id/notifications', 'UserViewController', 'notifications'); + $container['route']->addRoute('user/:user_id/accounts', 'UserViewController', 'external'); + $container['route']->addRoute('user/:user_id/integrations', 'UserViewController', 'integrations'); + $container['route']->addRoute('user/:user_id/authentication', 'UserCredentialController', 'changeAuthentication'); + $container['route']->addRoute('user/:user_id/2fa', 'TwoFactorController', 'index'); + $container['route']->addRoute('user/:user_id/avatar', 'AvatarFileController', 'show'); // Groups - $container['route']->addRoute('groups', 'group', 'index'); - $container['route']->addRoute('groups/create', 'group', 'create'); - $container['route']->addRoute('group/:group_id/associate', 'group', 'associate'); - $container['route']->addRoute('group/:group_id/dissociate/:user_id', 'group', 'dissociate'); - $container['route']->addRoute('group/:group_id/edit', 'group', 'edit'); - $container['route']->addRoute('group/:group_id/members', 'group', 'users'); - $container['route']->addRoute('group/:group_id/remove', 'group', 'confirm'); + $container['route']->addRoute('groups', 'GroupListController', 'index'); + $container['route']->addRoute('group/:group_id/members', 'GroupListController', 'users'); // Config - $container['route']->addRoute('settings', 'config', 'index'); - $container['route']->addRoute('settings/plugins', 'config', 'plugins'); - $container['route']->addRoute('settings/application', 'config', 'application'); - $container['route']->addRoute('settings/project', 'config', 'project'); - $container['route']->addRoute('settings/project', 'config', 'project'); - $container['route']->addRoute('settings/board', 'config', 'board'); - $container['route']->addRoute('settings/calendar', 'config', 'calendar'); - $container['route']->addRoute('settings/integrations', 'config', 'integrations'); - $container['route']->addRoute('settings/webhook', 'config', 'webhook'); - $container['route']->addRoute('settings/api', 'config', 'api'); - $container['route']->addRoute('settings/links', 'link', 'index'); - $container['route']->addRoute('settings/currencies', 'currency', 'index'); + $container['route']->addRoute('settings', 'ConfigController', 'index'); + $container['route']->addRoute('settings/application', 'ConfigController', 'application'); + $container['route']->addRoute('settings/project', 'ConfigController', 'project'); + $container['route']->addRoute('settings/project', 'ConfigController', 'project'); + $container['route']->addRoute('settings/board', 'ConfigController', 'board'); + $container['route']->addRoute('settings/calendar', 'ConfigController', 'calendar'); + $container['route']->addRoute('settings/integrations', 'ConfigController', 'integrations'); + $container['route']->addRoute('settings/webhook', 'ConfigController', 'webhook'); + $container['route']->addRoute('settings/api', 'ConfigController', 'api'); + $container['route']->addRoute('settings/links', 'LinkController', 'index'); + $container['route']->addRoute('settings/currencies', 'CurrencyController', 'index'); + + // Plugins + $container['route']->addRoute('extensions', 'PluginController', 'show'); + $container['route']->addRoute('extensions/directory', 'PluginController', 'directory'); // Doc - $container['route']->addRoute('documentation/:file', 'doc', 'show'); - $container['route']->addRoute('documentation', 'doc', 'show'); + $container['route']->addRoute('documentation/:file', 'DocumentationController', 'show'); + $container['route']->addRoute('documentation', 'DocumentationController', 'show'); // Auth routes - $container['route']->addRoute('login', 'auth', 'login'); - $container['route']->addRoute('logout', 'auth', 'logout'); + $container['route']->addRoute('login', 'AuthController', 'login'); + $container['route']->addRoute('logout', 'AuthController', 'logout'); // PasswordReset - $container['route']->addRoute('forgot-password', 'PasswordReset', 'create'); - $container['route']->addRoute('forgot-password/change/:token', 'PasswordReset', 'change'); + $container['route']->addRoute('forgot-password', 'PasswordResetController', 'create'); + $container['route']->addRoute('forgot-password/change/:token', 'PasswordResetController', 'change'); } return $container; diff --git a/app/ServiceProvider/SessionProvider.php b/app/ServiceProvider/SessionProvider.php index 0999d531..96dcac2e 100644 --- a/app/ServiceProvider/SessionProvider.php +++ b/app/ServiceProvider/SessionProvider.php @@ -11,7 +11,7 @@ use Kanboard\Core\Session\FlashMessage; /** * Session Provider * - * @package serviceProvider + * @package Kanboard\ServiceProvider * @author Frederic Guillot */ class SessionProvider implements ServiceProviderInterface |