2013-09-27 20:30:59 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 17:49:16 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
2020-03-31 11:49:10 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2016-07-21 17:49:16 +03:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Juan Pablo Villafáñez <jvillafanez@solidgear.es>
|
2016-05-26 20:56:05 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2016-07-21 19:13:36 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
|
|
|
* @author Roger Szabo <roger.szabo@web.de>
|
2016-03-01 19:25:15 +03:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
2013-09-27 20:30:59 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @license AGPL-3.0
|
2013-09-27 20:30:59 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* 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.
|
2013-09-27 20:30:59 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2013-09-27 20:30:59 +04:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-03-26 13:44:34 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
2013-09-27 20:30:59 +04:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2013-09-27 20:30:59 +04:00
|
|
|
*
|
|
|
|
*/
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2013-09-27 20:30:59 +04:00
|
|
|
// Check user and app status
|
2018-03-22 15:19:29 +03:00
|
|
|
\OC_JSON::checkAdminUser();
|
|
|
|
\OC_JSON::checkAppEnabled('user_ldap');
|
|
|
|
\OC_JSON::callCheck();
|
2013-09-27 20:30:59 +04:00
|
|
|
|
2014-08-31 12:05:59 +04:00
|
|
|
$l = \OC::$server->getL10N('user_ldap');
|
2013-09-27 20:30:59 +04:00
|
|
|
|
|
|
|
if(!isset($_POST['action'])) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $l->t('No action specified')]);
|
2013-09-27 20:30:59 +04:00
|
|
|
}
|
2015-02-13 15:33:20 +03:00
|
|
|
$action = (string)$_POST['action'];
|
2013-09-27 20:30:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
if(!isset($_POST['ldap_serverconfig_chooser'])) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $l->t('No configuration specified')]);
|
2013-09-27 20:30:59 +04:00
|
|
|
}
|
2015-02-13 15:33:20 +03:00
|
|
|
$prefix = (string)$_POST['ldap_serverconfig_chooser'];
|
2013-09-27 20:30:59 +04:00
|
|
|
|
2016-05-12 17:21:28 +03:00
|
|
|
$ldapWrapper = new \OCA\User_LDAP\LDAP();
|
2016-05-12 17:37:49 +03:00
|
|
|
$configuration = new \OCA\User_LDAP\Configuration($prefix);
|
2014-06-25 19:36:19 +04:00
|
|
|
|
2016-10-25 10:19:24 +03:00
|
|
|
$con = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix, null);
|
2014-06-25 19:36:19 +04:00
|
|
|
$con->setConfiguration($configuration->getConfiguration());
|
|
|
|
$con->ldapConfigurationActive = true;
|
|
|
|
$con->setIgnoreValidation(true);
|
|
|
|
|
2016-05-12 12:25:50 +03:00
|
|
|
$userManager = new \OCA\User_LDAP\User\Manager(
|
2014-06-25 19:36:19 +04:00
|
|
|
\OC::$server->getConfig(),
|
2016-05-12 17:31:35 +03:00
|
|
|
new \OCA\User_LDAP\FilesystemHelper(),
|
2016-05-12 17:16:06 +03:00
|
|
|
new \OCA\User_LDAP\LogWrapper(),
|
2014-06-25 19:36:19 +04:00
|
|
|
\OC::$server->getAvatarManager(),
|
2015-01-07 02:52:18 +03:00
|
|
|
new \OCP\Image(),
|
2016-01-19 17:48:38 +03:00
|
|
|
\OC::$server->getDatabaseConnection(),
|
2017-03-31 10:16:22 +03:00
|
|
|
\OC::$server->getUserManager(),
|
|
|
|
\OC::$server->getNotificationManager());
|
2014-06-25 19:36:19 +04:00
|
|
|
|
2017-11-08 03:51:14 +03:00
|
|
|
$access = new \OCA\User_LDAP\Access(
|
|
|
|
$con,
|
|
|
|
$ldapWrapper,
|
|
|
|
$userManager,
|
|
|
|
new \OCA\User_LDAP\Helper(\OC::$server->getConfig()),
|
2018-04-23 16:58:50 +03:00
|
|
|
\OC::$server->getConfig(),
|
|
|
|
\OC::$server->getUserManager()
|
2017-11-08 03:51:14 +03:00
|
|
|
);
|
2014-06-25 19:36:19 +04:00
|
|
|
|
2016-05-12 17:08:46 +03:00
|
|
|
$wizard = new \OCA\User_LDAP\Wizard($configuration, $ldapWrapper, $access);
|
2013-09-27 20:30:59 +04:00
|
|
|
|
|
|
|
switch($action) {
|
|
|
|
case 'guessPortAndTLS':
|
2013-09-30 01:53:14 +04:00
|
|
|
case 'guessBaseDN':
|
2014-06-25 21:38:54 +04:00
|
|
|
case 'detectEmailAttribute':
|
2014-10-24 20:26:48 +04:00
|
|
|
case 'detectUserDisplayNameAttribute':
|
2013-10-10 03:21:05 +04:00
|
|
|
case 'determineGroupMemberAssoc':
|
2013-10-10 00:00:36 +04:00
|
|
|
case 'determineUserObjectClasses':
|
|
|
|
case 'determineGroupObjectClasses':
|
|
|
|
case 'determineGroupsForUsers':
|
|
|
|
case 'determineGroupsForGroups':
|
2013-10-09 01:47:57 +04:00
|
|
|
case 'determineAttributes':
|
2013-10-08 20:27:36 +04:00
|
|
|
case 'getUserListFilter':
|
2013-10-09 01:47:57 +04:00
|
|
|
case 'getUserLoginFilter':
|
2013-10-10 00:00:36 +04:00
|
|
|
case 'getGroupFilter':
|
2013-10-08 20:27:36 +04:00
|
|
|
case 'countUsers':
|
2013-10-10 00:00:36 +04:00
|
|
|
case 'countGroups':
|
LDAP Wizard Overhaul
wizard refactor
reimplement save spinners and cursor
implement Port detector
introduced detector queue, added base dn detector
disable input fields when detectors are running
introduce spinners for fields that are being updated by detector
cache jq element objects
consolidate processing of detector results in generic / abstract base class
display notification if a detector discovered a problem
don't run base dn detector if a base is configured
reset detector queue on configuration switch
implement functionality check and update of status indicator
document ConfigModel
jsdoc for controller and main view
more documentation
implement the user filter tab view
so far the multiselects get initialized (not filled yet) and the mode can be switched.
mode is also restored.
reintroduce filter switch confirmation in admin XP mode
new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting.
multiselect trigger save actions now on close only
show spinners automatically, when a detector is running
20k limit for object classes preselection test
adjust wordings, fix grammar
add group (for users tab) detector
also includes wording fixes
error presentation moved from detectors to view, where it belongs
add info label to users page
missing wording changes
show effective LDAP filter in Assisted Mode
add user filter detector
implement count button for users and limit all count actions to 1001 for performance reasons
make port field a bit bigger. not perfect though.
do not detect port automatically
implement login filter tab view
only load features in assisted mode and don't enable assisted fields while in raw mode
add tooltips on login filter checkbox options for better understanding
permanently show filter on login tab
and also compile login filter in assisted mode
test/verify button on login attributes tab, with backend changes.
only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode
underline toggle filter links to stress that they are clickable
unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete
add object class and group detector for groups as well as filter composer
show ldap filter permanently on groups tab
introduce input element that can deal better with many groups, will be used with > 40
fix disabling complex group chooser while detection is running
hide complex group chooser on config switch
fix few more issues with complex chooser
make complex group chooser available on Users tab as well
detect base dn improvements/changes:
- do not look for Base DN automatically, offer a button instead
- fix for alternative way to detect a base dn (if agent dn is not given)
- do not trigger filter composers on config switch
Changes with configuration chooser controls
- "New" was removed out of the configuration list
- and split into buttons "add" and "copy"
- delete button is also now an icon
add test button for Base DN
reimplement advanced tab. The save button is gone.
reimplement expert tab
remove unused methods
implement mail attribute detector
implement user display name attribute detection
implement member group association detector
replace text input with textarea for raw filter input
finish functionality check
auto-enable good configurations, as it was before
cleanup
move save confirmation handling to base class, reduces code duplication
enable tabs only if no running save processes are left.
move onConfigLoaded to base class, avoids code duplication
simplify, save LOCs
Test Configuration button to be dealt with in main view as it is a cross-tab element
require detectorQueue in constructor
cleanup
put bootstrap into a function and thus make it testable
get rid of old stuff
2015-03-03 13:56:03 +03:00
|
|
|
case 'countInBaseDN':
|
2013-09-27 20:30:59 +04:00
|
|
|
try {
|
|
|
|
$result = $wizard->$action();
|
|
|
|
if($result !== false) {
|
2018-03-22 15:19:29 +03:00
|
|
|
\OC_JSON::success($result->getResultArray());
|
2013-09-27 20:30:59 +04:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
} catch (\Exception $e) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $e->getMessage(), 'code' => $e->getCode()]);
|
2013-09-27 20:30:59 +04:00
|
|
|
exit;
|
|
|
|
}
|
2018-03-22 15:20:03 +03:00
|
|
|
\OC_JSON::error();
|
2013-09-27 20:30:59 +04:00
|
|
|
exit;
|
|
|
|
break;
|
|
|
|
|
LDAP Wizard Overhaul
wizard refactor
reimplement save spinners and cursor
implement Port detector
introduced detector queue, added base dn detector
disable input fields when detectors are running
introduce spinners for fields that are being updated by detector
cache jq element objects
consolidate processing of detector results in generic / abstract base class
display notification if a detector discovered a problem
don't run base dn detector if a base is configured
reset detector queue on configuration switch
implement functionality check and update of status indicator
document ConfigModel
jsdoc for controller and main view
more documentation
implement the user filter tab view
so far the multiselects get initialized (not filled yet) and the mode can be switched.
mode is also restored.
reintroduce filter switch confirmation in admin XP mode
new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting.
multiselect trigger save actions now on close only
show spinners automatically, when a detector is running
20k limit for object classes preselection test
adjust wordings, fix grammar
add group (for users tab) detector
also includes wording fixes
error presentation moved from detectors to view, where it belongs
add info label to users page
missing wording changes
show effective LDAP filter in Assisted Mode
add user filter detector
implement count button for users and limit all count actions to 1001 for performance reasons
make port field a bit bigger. not perfect though.
do not detect port automatically
implement login filter tab view
only load features in assisted mode and don't enable assisted fields while in raw mode
add tooltips on login filter checkbox options for better understanding
permanently show filter on login tab
and also compile login filter in assisted mode
test/verify button on login attributes tab, with backend changes.
only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode
underline toggle filter links to stress that they are clickable
unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete
add object class and group detector for groups as well as filter composer
show ldap filter permanently on groups tab
introduce input element that can deal better with many groups, will be used with > 40
fix disabling complex group chooser while detection is running
hide complex group chooser on config switch
fix few more issues with complex chooser
make complex group chooser available on Users tab as well
detect base dn improvements/changes:
- do not look for Base DN automatically, offer a button instead
- fix for alternative way to detect a base dn (if agent dn is not given)
- do not trigger filter composers on config switch
Changes with configuration chooser controls
- "New" was removed out of the configuration list
- and split into buttons "add" and "copy"
- delete button is also now an icon
add test button for Base DN
reimplement advanced tab. The save button is gone.
reimplement expert tab
remove unused methods
implement mail attribute detector
implement user display name attribute detection
implement member group association detector
replace text input with textarea for raw filter input
finish functionality check
auto-enable good configurations, as it was before
cleanup
move save confirmation handling to base class, reduces code duplication
enable tabs only if no running save processes are left.
move onConfigLoaded to base class, avoids code duplication
simplify, save LOCs
Test Configuration button to be dealt with in main view as it is a cross-tab element
require detectorQueue in constructor
cleanup
put bootstrap into a function and thus make it testable
get rid of old stuff
2015-03-03 13:56:03 +03:00
|
|
|
case 'testLoginName': {
|
|
|
|
try {
|
|
|
|
$loginName = $_POST['ldap_test_loginname'];
|
|
|
|
$result = $wizard->$action($loginName);
|
|
|
|
if($result !== false) {
|
2018-03-22 15:19:29 +03:00
|
|
|
\OC_JSON::success($result->getResultArray());
|
LDAP Wizard Overhaul
wizard refactor
reimplement save spinners and cursor
implement Port detector
introduced detector queue, added base dn detector
disable input fields when detectors are running
introduce spinners for fields that are being updated by detector
cache jq element objects
consolidate processing of detector results in generic / abstract base class
display notification if a detector discovered a problem
don't run base dn detector if a base is configured
reset detector queue on configuration switch
implement functionality check and update of status indicator
document ConfigModel
jsdoc for controller and main view
more documentation
implement the user filter tab view
so far the multiselects get initialized (not filled yet) and the mode can be switched.
mode is also restored.
reintroduce filter switch confirmation in admin XP mode
new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting.
multiselect trigger save actions now on close only
show spinners automatically, when a detector is running
20k limit for object classes preselection test
adjust wordings, fix grammar
add group (for users tab) detector
also includes wording fixes
error presentation moved from detectors to view, where it belongs
add info label to users page
missing wording changes
show effective LDAP filter in Assisted Mode
add user filter detector
implement count button for users and limit all count actions to 1001 for performance reasons
make port field a bit bigger. not perfect though.
do not detect port automatically
implement login filter tab view
only load features in assisted mode and don't enable assisted fields while in raw mode
add tooltips on login filter checkbox options for better understanding
permanently show filter on login tab
and also compile login filter in assisted mode
test/verify button on login attributes tab, with backend changes.
only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode
underline toggle filter links to stress that they are clickable
unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete
add object class and group detector for groups as well as filter composer
show ldap filter permanently on groups tab
introduce input element that can deal better with many groups, will be used with > 40
fix disabling complex group chooser while detection is running
hide complex group chooser on config switch
fix few more issues with complex chooser
make complex group chooser available on Users tab as well
detect base dn improvements/changes:
- do not look for Base DN automatically, offer a button instead
- fix for alternative way to detect a base dn (if agent dn is not given)
- do not trigger filter composers on config switch
Changes with configuration chooser controls
- "New" was removed out of the configuration list
- and split into buttons "add" and "copy"
- delete button is also now an icon
add test button for Base DN
reimplement advanced tab. The save button is gone.
reimplement expert tab
remove unused methods
implement mail attribute detector
implement user display name attribute detection
implement member group association detector
replace text input with textarea for raw filter input
finish functionality check
auto-enable good configurations, as it was before
cleanup
move save confirmation handling to base class, reduces code duplication
enable tabs only if no running save processes are left.
move onConfigLoaded to base class, avoids code duplication
simplify, save LOCs
Test Configuration button to be dealt with in main view as it is a cross-tab element
require detectorQueue in constructor
cleanup
put bootstrap into a function and thus make it testable
get rid of old stuff
2015-03-03 13:56:03 +03:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
} catch (\Exception $e) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $e->getMessage()]);
|
LDAP Wizard Overhaul
wizard refactor
reimplement save spinners and cursor
implement Port detector
introduced detector queue, added base dn detector
disable input fields when detectors are running
introduce spinners for fields that are being updated by detector
cache jq element objects
consolidate processing of detector results in generic / abstract base class
display notification if a detector discovered a problem
don't run base dn detector if a base is configured
reset detector queue on configuration switch
implement functionality check and update of status indicator
document ConfigModel
jsdoc for controller and main view
more documentation
implement the user filter tab view
so far the multiselects get initialized (not filled yet) and the mode can be switched.
mode is also restored.
reintroduce filter switch confirmation in admin XP mode
new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting.
multiselect trigger save actions now on close only
show spinners automatically, when a detector is running
20k limit for object classes preselection test
adjust wordings, fix grammar
add group (for users tab) detector
also includes wording fixes
error presentation moved from detectors to view, where it belongs
add info label to users page
missing wording changes
show effective LDAP filter in Assisted Mode
add user filter detector
implement count button for users and limit all count actions to 1001 for performance reasons
make port field a bit bigger. not perfect though.
do not detect port automatically
implement login filter tab view
only load features in assisted mode and don't enable assisted fields while in raw mode
add tooltips on login filter checkbox options for better understanding
permanently show filter on login tab
and also compile login filter in assisted mode
test/verify button on login attributes tab, with backend changes.
only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode
underline toggle filter links to stress that they are clickable
unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete
add object class and group detector for groups as well as filter composer
show ldap filter permanently on groups tab
introduce input element that can deal better with many groups, will be used with > 40
fix disabling complex group chooser while detection is running
hide complex group chooser on config switch
fix few more issues with complex chooser
make complex group chooser available on Users tab as well
detect base dn improvements/changes:
- do not look for Base DN automatically, offer a button instead
- fix for alternative way to detect a base dn (if agent dn is not given)
- do not trigger filter composers on config switch
Changes with configuration chooser controls
- "New" was removed out of the configuration list
- and split into buttons "add" and "copy"
- delete button is also now an icon
add test button for Base DN
reimplement advanced tab. The save button is gone.
reimplement expert tab
remove unused methods
implement mail attribute detector
implement user display name attribute detection
implement member group association detector
replace text input with textarea for raw filter input
finish functionality check
auto-enable good configurations, as it was before
cleanup
move save confirmation handling to base class, reduces code duplication
enable tabs only if no running save processes are left.
move onConfigLoaded to base class, avoids code duplication
simplify, save LOCs
Test Configuration button to be dealt with in main view as it is a cross-tab element
require detectorQueue in constructor
cleanup
put bootstrap into a function and thus make it testable
get rid of old stuff
2015-03-03 13:56:03 +03:00
|
|
|
exit;
|
|
|
|
}
|
2018-03-22 15:20:03 +03:00
|
|
|
\OC_JSON::error();
|
LDAP Wizard Overhaul
wizard refactor
reimplement save spinners and cursor
implement Port detector
introduced detector queue, added base dn detector
disable input fields when detectors are running
introduce spinners for fields that are being updated by detector
cache jq element objects
consolidate processing of detector results in generic / abstract base class
display notification if a detector discovered a problem
don't run base dn detector if a base is configured
reset detector queue on configuration switch
implement functionality check and update of status indicator
document ConfigModel
jsdoc for controller and main view
more documentation
implement the user filter tab view
so far the multiselects get initialized (not filled yet) and the mode can be switched.
mode is also restored.
reintroduce filter switch confirmation in admin XP mode
new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting.
multiselect trigger save actions now on close only
show spinners automatically, when a detector is running
20k limit for object classes preselection test
adjust wordings, fix grammar
add group (for users tab) detector
also includes wording fixes
error presentation moved from detectors to view, where it belongs
add info label to users page
missing wording changes
show effective LDAP filter in Assisted Mode
add user filter detector
implement count button for users and limit all count actions to 1001 for performance reasons
make port field a bit bigger. not perfect though.
do not detect port automatically
implement login filter tab view
only load features in assisted mode and don't enable assisted fields while in raw mode
add tooltips on login filter checkbox options for better understanding
permanently show filter on login tab
and also compile login filter in assisted mode
test/verify button on login attributes tab, with backend changes.
only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode
underline toggle filter links to stress that they are clickable
unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete
add object class and group detector for groups as well as filter composer
show ldap filter permanently on groups tab
introduce input element that can deal better with many groups, will be used with > 40
fix disabling complex group chooser while detection is running
hide complex group chooser on config switch
fix few more issues with complex chooser
make complex group chooser available on Users tab as well
detect base dn improvements/changes:
- do not look for Base DN automatically, offer a button instead
- fix for alternative way to detect a base dn (if agent dn is not given)
- do not trigger filter composers on config switch
Changes with configuration chooser controls
- "New" was removed out of the configuration list
- and split into buttons "add" and "copy"
- delete button is also now an icon
add test button for Base DN
reimplement advanced tab. The save button is gone.
reimplement expert tab
remove unused methods
implement mail attribute detector
implement user display name attribute detection
implement member group association detector
replace text input with textarea for raw filter input
finish functionality check
auto-enable good configurations, as it was before
cleanup
move save confirmation handling to base class, reduces code duplication
enable tabs only if no running save processes are left.
move onConfigLoaded to base class, avoids code duplication
simplify, save LOCs
Test Configuration button to be dealt with in main view as it is a cross-tab element
require detectorQueue in constructor
cleanup
put bootstrap into a function and thus make it testable
get rid of old stuff
2015-03-03 13:56:03 +03:00
|
|
|
exit;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-09-27 20:30:59 +04:00
|
|
|
case 'save':
|
|
|
|
$key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false;
|
|
|
|
$val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null;
|
|
|
|
if($key === false || is_null($val)) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $l->t('No data specified')]);
|
2013-09-27 20:30:59 +04:00
|
|
|
exit;
|
|
|
|
}
|
2020-03-26 11:30:18 +03:00
|
|
|
$cfg = [$key => $val];
|
|
|
|
$setParameters = [];
|
2013-09-27 20:30:59 +04:00
|
|
|
$configuration->setConfiguration($cfg, $setParameters);
|
|
|
|
if(!in_array($key, $setParameters)) {
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $l->t($key.
|
|
|
|
' Could not set configuration %s', $setParameters[0])]);
|
2013-09-27 20:30:59 +04:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
$configuration->saveConfiguration();
|
2013-11-20 18:56:25 +04:00
|
|
|
//clear the cache on save
|
2016-05-12 17:35:33 +03:00
|
|
|
$connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix);
|
2013-11-20 18:56:25 +04:00
|
|
|
$connection->clearCache();
|
2018-03-22 15:19:29 +03:00
|
|
|
\OC_JSON::success();
|
2013-09-27 20:30:59 +04:00
|
|
|
break;
|
|
|
|
default:
|
2020-03-26 11:30:18 +03:00
|
|
|
\OC_JSON::error(['message' => $l->t('Action does not exist')]);
|
2013-09-27 20:30:59 +04:00
|
|
|
break;
|
|
|
|
}
|