server/apps/external/ajax/setsites.php

26 lines
644 B
PHP
Raw Normal View History

<?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-05-01 20:59:38 +00:00
OCP\User::checkAdminUser();
$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])));
}
}
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));
echo 'true';
?>