summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/ajax/wizard.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/ajax/wizard.php')
-rw-r--r--apps/user_ldap/ajax/wizard.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php
index ab521b5bf0e..267b9568a28 100644
--- a/apps/user_ldap/ajax/wizard.php
+++ b/apps/user_ldap/ajax/wizard.php
@@ -72,13 +72,11 @@ switch($action) {
case 'determineGroupsForGroups':
case 'determineAttributes':
case 'getUserListFilter':
- case 'getLoginFilterMode':
case 'getUserLoginFilter':
- case 'getUserFilterMode':
case 'getGroupFilter':
- case 'getGroupFilterMode':
case 'countUsers':
case 'countGroups':
+ case 'countInBaseDN':
try {
$result = $wizard->$action();
if($result !== false) {
@@ -93,6 +91,23 @@ switch($action) {
exit;
break;
+ case 'testLoginName': {
+ try {
+ $loginName = $_POST['ldap_test_loginname'];
+ $result = $wizard->$action($loginName);
+ if($result !== false) {
+ OCP\JSON::success($result->getResultArray());
+ exit;
+ }
+ } catch (\Exception $e) {
+ \OCP\JSON::error(array('message' => $e->getMessage()));
+ exit;
+ }
+ \OCP\JSON::error();
+ exit;
+ break;
+ }
+
case 'save':
$key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false;
$val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null;
@@ -115,6 +130,6 @@ switch($action) {
OCP\JSON::success();
break;
default:
- //TODO: return 4xx error
+ \OCP\JSON::error(array('message' => $l->t('Action does not exist')));
break;
}