summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/ajax/clearMappings.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-27 11:35:57 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-27 11:35:57 -0400
commit16925672e885071afab1fe158dc206ab8ed93baf (patch)
tree143f64c88d7d47cb0f5a3a7641228a7cae24821b /apps/user_ldap/ajax/clearMappings.php
parent0953b68556152187ed305323b64b186cc21c2ade (diff)
parent0c621ff6a93fe1b34c77257d83fd344489f59bab (diff)
downloadnextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.tar.gz
nextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.zip
Merge branch 'master' into googledrive
Diffstat (limited to 'apps/user_ldap/ajax/clearMappings.php')
-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