2012-03-03 00:32:17 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2012-05-26 21:14:24 +04:00
|
|
|
* 2012 Frank Karlitschek frank@owncloud.org
|
2012-03-03 00:32:17 +04:00
|
|
|
* This file is licensed under the Affero General Public License version 3 or later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2012-04-17 21:31:29 +04:00
|
|
|
|
2012-05-02 00:59:38 +04:00
|
|
|
OCP\User::checkAdminUser();
|
2012-07-07 18:02:33 +04:00
|
|
|
OCP\JSON::callCheck();
|
2012-03-03 00:32:17 +04:00
|
|
|
|
|
|
|
$sites = array();
|
|
|
|
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
|
|
|
|
if (!empty($_POST['site_name'][$i]) && !empty($_POST['site_url'][$i])) {
|
2012-06-10 21:52:23 +04:00
|
|
|
array_push($sites, array(strip_tags($_POST['site_name'][$i]), strip_tags($_POST['site_url'][$i])));
|
2012-03-03 00:32:17 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sizeof($sites) == 0)
|
|
|
|
OC_Appconfig::deleteKey('external', 'sites');
|
|
|
|
else
|
2012-05-02 16:11:29 +04:00
|
|
|
OCP\Config::setAppValue('external', 'sites', json_encode($sites));
|
2012-03-03 00:32:17 +04:00
|
|
|
|
|
|
|
echo 'true';
|