diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2013-01-31 19:28:25 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2013-01-31 19:28:25 +0100 |
commit | 3d5c7ca2456849b7227cf24bed2bc0be4db1a555 (patch) | |
tree | 95ca38a92c8d84d49063e3f852467feae770be96 /apps/user_ldap/ajax/getNewServerConfigPrefix.php | |
parent | ad044eb88861ebf2cefedc993634a85bb4697cd2 (diff) | |
parent | 5bf7791b4212c6dba2ce7289841c71f8177cfa3f (diff) | |
download | nextcloud-server-3d5c7ca2456849b7227cf24bed2bc0be4db1a555.tar.gz nextcloud-server-3d5c7ca2456849b7227cf24bed2bc0be4db1a555.zip |
Merge branch 'master' into navigation
Diffstat (limited to 'apps/user_ldap/ajax/getNewServerConfigPrefix.php')
-rw-r--r-- | apps/user_ldap/ajax/getNewServerConfigPrefix.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php new file mode 100644 index 00000000000..17e78f87072 --- /dev/null +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -0,0 +1,34 @@ +<?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(); + +$serverConnections = \OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(); +sort($serverConnections); +$lk = array_pop($serverConnections); +$ln = intval(str_replace('s', '', $lk)); +$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); +OCP\JSON::success(array('configPrefix' => $nk));
\ No newline at end of file |