summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/ajax
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-05-08 17:47:07 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-05-08 17:47:07 +0200
commit796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43 (patch)
treef9e38fe32856ba1d86680fb1c9153c7e63b1d682 /apps/user_ldap/ajax
parent3f1717d3d54fd82090abe6518da56c88678e24a2 (diff)
downloadnextcloud-server-796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43.tar.gz
nextcloud-server-796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43.zip
LDAP: Implement clear mappings functionality
Diffstat (limited to 'apps/user_ldap/ajax')
-rw-r--r--apps/user_ldap/ajax/clearMappings.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php
new file mode 100644
index 00000000000..5dab39839b6
--- /dev/null
+++ b/apps/user_ldap/ajax/clearMappings.php
@@ -0,0 +1,35 @@
+<?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();
+
+$subject = $_POST['ldap_clear_mapping'];
+if(\OCA\user_ldap\lib\Helper::clearMapping($subject)) {
+ OCP\JSON::success();
+} else {
+ $l=OC_L10N::get('user_ldap');
+ OCP\JSON::error(array('message' => $l->t('Failed to clear the mappings.')));
+} \ No newline at end of file