summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/updatenotification/admin.php26
-rw-r--r--apps/updatenotification/appinfo/info.xml6
-rw-r--r--apps/updatenotification/lib/Controller/AdminController.php28
-rw-r--r--apps/user_ldap/appinfo/info.xml4
-rw-r--r--apps/user_ldap/lib/Settings/Admin.php40
-rw-r--r--apps/user_ldap/templates/settings.php29
6 files changed, 61 insertions, 72 deletions
diff --git a/apps/updatenotification/admin.php b/apps/updatenotification/admin.php
deleted file mode 100644
index 81c7a8fb557..00000000000
--- a/apps/updatenotification/admin.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Lukas Reschke <lukas@statuscode.ch>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-$app = new \OCA\UpdateNotification\AppInfo\Application();
-/** @var OCA\UpdateNotification\Controller\AdminController $controller */
-$controller = $app->getContainer()->query('AdminController');
-return $controller->displayPanel()->render();
diff --git a/apps/updatenotification/appinfo/info.xml b/apps/updatenotification/appinfo/info.xml
index 4070e90f221..2fe400a3587 100644
--- a/apps/updatenotification/appinfo/info.xml
+++ b/apps/updatenotification/appinfo/info.xml
@@ -5,7 +5,7 @@
<description>Displays update notifications for ownCloud and provides the SSO for the updater.</description>
<licence>AGPL</licence>
<author>Lukas Reschke</author>
- <version>1.1.0</version>
+ <version>1.1.1</version>
<namespace>UpdateNotification</namespace>
<default_enable/>
<dependencies>
@@ -15,4 +15,8 @@
<background-jobs>
<job>OCA\UpdateNotification\Notification\BackgroundJob</job>
</background-jobs>
+
+ <settings>
+ <admin>OCA\UpdateNotification\Controller\AdminController</admin>
+ </settings>
</info>
diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php
index ada04bdd68c..5f137120435 100644
--- a/apps/updatenotification/lib/Controller/AdminController.php
+++ b/apps/updatenotification/lib/Controller/AdminController.php
@@ -34,8 +34,9 @@ use OCP\IDateTimeFormatter;
use OCP\IL10N;
use OCP\IRequest;
use OCP\Security\ISecureRandom;
+use OCP\Settings\IAdmin;
-class AdminController extends Controller {
+class AdminController extends Controller implements IAdmin {
/** @var IJobList */
private $jobList;
/** @var ISecureRandom */
@@ -144,4 +145,29 @@ class AdminController extends Controller {
return new DataResponse($newToken);
}
+
+ /**
+ * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
+ */
+ public function getForm() {
+ return $this->displayPanel();
+ }
+
+ /**
+ * @return string the section ID, e.g. 'sharing'
+ */
+ public function getSection() {
+ return 'server';
+ }
+
+ /**
+ * @return int whether the form should be rather on the top or bottom of
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
+ *
+ * E.g.: 70
+ */
+ public function getPriority() {
+ return 5;
+ }
}
diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml
index dac4f62879d..b16824925c0 100644
--- a/apps/user_ldap/appinfo/info.xml
+++ b/apps/user_ldap/appinfo/info.xml
@@ -29,7 +29,7 @@ A user logs into ownCloud with their LDAP or AD credentials, and is granted acce
</background-jobs>
<settings>
- <admin>\OCA\User_LDAP\Settings\Admin</admin>
- <admin-section>\OCA\User_LDAP\Settings\Section</admin-section>
+ <admin>OCA\User_LDAP\Settings\Admin</admin>
+ <admin-section>OCA\User_LDAP\Settings\Section</admin-section>
</settings>
</info>
diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php
index 11e2627dedd..f155f1cec8d 100644
--- a/apps/user_ldap/lib/Settings/Admin.php
+++ b/apps/user_ldap/lib/Settings/Admin.php
@@ -23,9 +23,9 @@
namespace OCA\User_LDAP\Settings;
-
use OCA\User_LDAP\Configuration;
use OCA\User_LDAP\Helper;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IL10N;
use OCP\Settings\IAdmin;
use OCP\Template;
@@ -40,53 +40,31 @@ class Admin implements IAdmin {
}
/**
- * @return Template all parameters are supposed to be assigned
+ * @return TemplateResponse
*/
- public function render() {
- $settings = new Template('user_ldap', 'settings');
-
+ public function getForm() {
$helper = new Helper();
$prefixes = $helper->getServerConfigurationPrefixes();
$hosts = $helper->getServerConfigurationHosts();
- $wizardHtml = '';
- $toc = [];
-
$wControls = new Template('user_ldap', 'part.wizardcontrols');
$wControls = $wControls->fetchPage();
$sControls = new Template('user_ldap', 'part.settingcontrols');
$sControls = $sControls->fetchPage();
- $wizTabs = [
- ['tpl' => 'part.wizard-server', 'cap' => $this->l->t('Server')],
- ['tpl' => 'part.wizard-userfilter', 'cap' => $this->l->t('Users')],
- ['tpl' => 'part.wizard-loginfilter', 'cap' => $this->l->t('Login Attributes')],
- ['tpl' => 'part.wizard-groupfilter', 'cap' => $this->l->t('Groups')],
- ];
- $wizTabsCount = count($wizTabs);
- for($i = 0; $i < $wizTabsCount; $i++) {
- $tab = new Template('user_ldap', $wizTabs[$i]['tpl']);
- if($i === 0) {
- $tab->assign('serverConfigurationPrefixes', $prefixes);
- $tab->assign('serverConfigurationHosts', $hosts);
- }
- $tab->assign('wizardControls', $wControls);
- $wizardHtml .= $tab->fetchPage();
- $toc['#ldapWizard'.($i+1)] = $wizTabs[$i]['cap'];
- }
-
- $settings->assign('tabs', $wizardHtml);
- $settings->assign('toc', $toc);
- $settings->assign('settingControls', $sControls);
+ $parameters['serverConfigurationPrefixes'] = $prefixes;
+ $parameters['serverConfigurationHosts'] = $hosts;
+ $parameters['settingControls'] = $sControls;
+ $parameters['wizardControls'] = $wControls;
// assign default values
$config = new Configuration('', false);
$defaults = $config->getDefaults();
foreach($defaults as $key => $default) {
- $settings->assign($key.'_default', $default);
+ $parameters[$key.'_default'] = $default;
}
- return $settings;
+ return new TemplateResponse('user_ldap', 'settings', $parameters);
}
/**
diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php
index a1511071af4..eb4c7b99127 100644
--- a/apps/user_ldap/templates/settings.php
+++ b/apps/user_ldap/templates/settings.php
@@ -49,6 +49,9 @@ script('user_ldap', [
style('user_ldap', 'settings');
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+
?>
<form id="ldap" class="section" action="#" method="post">
@@ -56,20 +59,24 @@ style('user_ldap', 'settings');
<div id="ldapSettings">
<ul>
- <?php foreach($_['toc'] as $id => $title) { ?>
- <li id="<?php p($id); ?>"><a href="<?php p($id); ?>"><?php p($title); ?></a></li>
- <?php } ?>
+ <li id="#ldapWizard1"><a href="#ldapWizard1"><?php p($l->t('Server'));?></a></li>
+ <li id="#ldapWizard2"><a href="#ldapWizard2"><?php p($l->t('Users'));?></a></li>
+ <li id="#ldapWizard3"><a href="#ldapWizard3"><?php p($l->t('Login Attributes'));?></a></li>
+ <li id="#ldapWizard4"><a href="#ldapWizard4"><?php p($l->t('Groups'));?></a></li>
<li class="ldapSettingsTabs"><a href="#ldapSettings-2"><?php p($l->t('Expert'));?></a></li>
<li class="ldapSettingsTabs"><a href="#ldapSettings-1"><?php p($l->t('Advanced'));?></a></li>
</ul>
- <?php if(OCP\App::isEnabled('user_webdavauth')) {
- print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them.').'</p>');
- }
- if(!function_exists('ldap_connect')) {
- print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
- }
- ?>
- <?php print_unescaped($_['tabs']); ?>
+ <?php if(OCP\App::isEnabled('user_webdavauth')) {
+ print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them.').'</p>');
+ }
+ if(!function_exists('ldap_connect')) {
+ print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
+ }
+ ?>
+ <?php require_once(__DIR__ . '/part.wizard-server.php'); ?>
+ <?php require_once(__DIR__ . '/part.wizard-userfilter.php'); ?>
+ <?php require_once(__DIR__ . '/part.wizard-loginfilter.php'); ?>
+ <?php require_once(__DIR__ . '/part.wizard-groupfilter.php'); ?>
<fieldset id="ldapSettings-1">
<div id="ldapAdvancedAccordion">
<h3><?php p($l->t('Connection Settings'));?></h3>