diff --git a/lib/Controller/Schedule.php b/lib/Controller/Schedule.php index 182e32a29d..aa9bef7fdb 100644 --- a/lib/Controller/Schedule.php +++ b/lib/Controller/Schedule.php @@ -890,6 +890,7 @@ function editForm($eventId) 'commands' => $this->commandFactory->query(), 'dayParts' => $this->dayPartFactory->allWithSystem(), 'displayGroups' => $schedule->displayGroups, + 'campaign' => ($schedule->campaignId != '') ? $this->campaignFactory->getById($schedule->campaignId) : null, 'displayGroupIds' => array_map(function($element) { return $element->displayGroupId; }, $schedule->displayGroups), diff --git a/lib/Middleware/SAMLAuthentication.php b/lib/Middleware/SAMLAuthentication.php index 680ae1cedd..5c542dd216 100644 --- a/lib/Middleware/SAMLAuthentication.php +++ b/lib/Middleware/SAMLAuthentication.php @@ -23,6 +23,10 @@ namespace Xibo\Middleware; +use OneLogin\Saml2\Auth; +use OneLogin\Saml2\Error; +use OneLogin\Saml2\Settings; +use OneLogin\Saml2\Utils; use Slim\Middleware; use Xibo\Entity\User; use Xibo\Exception\AccessDeniedException; @@ -55,7 +59,7 @@ public function samlLogout() isset($this->app->configService->samlSettings['workflow']['slo']) && $this->app->configService->samlSettings['workflow']['slo'] == true) { // Initiate SAML SLO - $auth = new \OneLogin_Saml2_Auth($this->app->configService->samlSettings); + $auth = new Auth($this->app->configService->samlSettings); $auth->logout(); } else { $this->app->redirect($this->app->urlFor('logout')); @@ -80,7 +84,7 @@ public function call() $app->logoutRoute = 'saml.logout'; $app->get('/saml/metadata', function () { - $settings = new \OneLogin_Saml2_Settings($this->app->configService->samlSettings, true); + $settings = new Settings($this->app->configService->samlSettings, true); $metadata = $settings->getSPMetadata(); $errors = $settings->validateMetadata($metadata); if (empty($errors)) { @@ -90,14 +94,14 @@ public function call() } else { throw new \Xibo\Exception\ConfigurationException( 'Invalid SP metadata: '.implode(', ', $errors), - \OneLogin_Saml2_Error::METADATA_SP_INVALID + Error::METADATA_SP_INVALID ); } }); $app->get('/saml/login', function () { // Initiate SAML SSO - $auth = new \OneLogin_Saml2_Auth($this->app->configService->samlSettings); + $auth = new Auth($this->app->configService->samlSettings); $auth->login(); }); @@ -110,7 +114,7 @@ public function call() $app = $this->getApplication(); // Log some interesting things - $app->getLog()->debug('Arrived at the ACS route with own URL: ' . \OneLogin_Saml2_Utils::getSelfRoutedURLNoQuery()); + $app->getLog()->debug('Arrived at the ACS route with own URL: ' . Utils::getSelfRoutedURLNoQuery()); // Inject the POST parameters required by the SAML toolkit $_POST = $this->app->request->post(); @@ -118,13 +122,13 @@ public function call() // Pull out the SAML settings $samlSettings = $this->app->configService->samlSettings; - $auth = new \OneLogin_Saml2_Auth($samlSettings); + $auth = new Auth($samlSettings); $auth->processResponse(); $errors = $auth->getErrors(); if (!empty($errors)) { - throw new \OneLogin_Saml2_Error( + throw new Error( 'SAML SSO failed: '.implode(', ', $errors) . '. Last Reason: ' . $auth->getLastErrorReason() ); } else { @@ -315,7 +319,7 @@ public function call() // Inject the GET parameters required by the SAML toolkit $_GET = $this->app->request->get(); - $auth = new \OneLogin_Saml2_Auth($this->app->configService->samlSettings); + $auth = new Auth($this->app->configService->samlSettings); $auth->processSLO(false, null, false, function() use ($app) { // Grab a login controller /** @var \Xibo\Controller\Login $loginController */ @@ -347,7 +351,7 @@ public function call() } else { // Initiate SAML SSO - $auth = new \OneLogin_Saml2_Auth($this->app->configService->samlSettings); + $auth = new Auth($this->app->configService->samlSettings); $auth->login(); } }; diff --git a/views/schedule-form-add.twig b/views/schedule-form-add.twig index 20c70192fd..7d0ce85785 100644 --- a/views/schedule-form-add.twig +++ b/views/schedule-form-add.twig @@ -90,7 +90,7 @@ {% set title %}{% trans "Layout / Campaign" %}{% endset %} {% set helpText %}{% trans "Please select a Layout or Campaign for this Event to show" %}{% endset %} - {{ forms.dropdown("campaignId", "single", title, "", null, "id", "value", helpText, "layout-control", "", "", "", attributes, optionGroups) }} + {{ forms.dropdown("campaignId", "single", title, "", null, "id", "value", helpText, "layout-control", "", "", "", attributes) }}