summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/ajax/getConfiguration.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-01-23 23:41:35 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-01-23 23:41:35 +0100
commit06c284f6cc6256b22f645d2d35f966c0bc98f4df (patch)
treea3c5236e77ac8dc13dd6ce76ce1ec1e3d0ea1ca9 /apps/user_ldap/ajax/getConfiguration.php
parent83d9e1e2f083b176e3bff9d3851211b3bc9cb560 (diff)
downloadnextcloud-server-06c284f6cc6256b22f645d2d35f966c0bc98f4df.tar.gz
nextcloud-server-06c284f6cc6256b22f645d2d35f966c0bc98f4df.zip
LDAP settings: read configuration when another server config is chosen
Diffstat (limited to 'apps/user_ldap/ajax/getConfiguration.php')
-rw-r--r--apps/user_ldap/ajax/getConfiguration.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/user_ldap/ajax/getConfiguration.php b/apps/user_ldap/ajax/getConfiguration.php
new file mode 100644
index 00000000000..dfae68d2dc9
--- /dev/null
+++ b/apps/user_ldap/ajax/getConfiguration.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * ownCloud - user_ldap
+ *
+ * @author Arthur Schiwon
+ * @copyright 2013 Arthur Schiwon blizzz@owncloud.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Check user and app status
+OCP\JSON::checkAdminUser();
+OCP\JSON::checkAppEnabled('user_ldap');
+OCP\JSON::callCheck();
+
+$prefix = $_POST['ldap_serverconfig_chooser'];
+$connection = new \OCA\user_ldap\lib\Connection($prefix);
+OCP\JSON::success(array('configuration' => $connection->getConfiguration())); \ No newline at end of file