2012-03-02 20:32:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2011, Frank Karlitschek <karlitschek@kde.org>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2012-04-17 17:31:29 +00:00
|
|
|
|
2012-05-01 20:59:38 +00:00
|
|
|
OCP\User::checkAdminUser();
|
2012-03-02 20:32:17 +00: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 17:54:04 +00:00
|
|
|
array_push($sites, array(strip_tags($_POST['site_name'][$i]), strip_tags($_POST['site_url'][$i])));
|
2012-03-02 20:32:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sizeof($sites) == 0)
|
|
|
|
OC_Appconfig::deleteKey('external', 'sites');
|
|
|
|
else
|
2012-05-02 12:11:29 +00:00
|
|
|
OCP\Config::setAppValue('external', 'sites', json_encode($sites));
|
2012-03-02 20:32:17 +00:00
|
|
|
|
|
|
|
echo 'true';
|
|
|
|
?>
|