2014-06-03 23:59:00 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ownCloud - RainLoop mail plugin
|
|
|
|
*
|
|
|
|
* @author RainLoop Team
|
|
|
|
* @copyright 2014 RainLoop Team
|
|
|
|
*
|
|
|
|
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
|
|
|
|
*/
|
|
|
|
|
|
|
|
OCP\JSON::checkAdminUser();
|
|
|
|
OCP\JSON::checkAppEnabled('rainloop');
|
|
|
|
OCP\JSON::callCheck();
|
|
|
|
|
|
|
|
$sUrl = '';
|
2014-07-26 00:05:20 +08:00
|
|
|
$sPath = '';
|
2014-08-10 04:46:23 +08:00
|
|
|
$bAutologin = false;
|
2014-07-26 00:05:20 +08:00
|
|
|
|
|
|
|
if (isset($_POST['appname'], $_POST['rainloop-url'], $_POST['rainloop-path']) && 'rainloop' === $_POST['appname'])
|
2014-06-03 23:59:00 +08:00
|
|
|
{
|
|
|
|
OCP\Config::setAppValue('rainloop', 'rainloop-url', $_POST['rainloop-url']);
|
2014-07-26 00:05:20 +08:00
|
|
|
OCP\Config::setAppValue('rainloop', 'rainloop-path', $_POST['rainloop-path']);
|
2014-08-10 04:46:23 +08:00
|
|
|
OCP\Config::setAppValue('rainloop', 'rainloop-autologin', $_POST['rainloop-autologin']);
|
2014-06-03 23:59:00 +08:00
|
|
|
|
|
|
|
$sUrl = OCP\Config::getAppValue('rainloop', 'rainloop-url', '');
|
2014-07-26 00:05:20 +08:00
|
|
|
$sPath = OCP\Config::getAppValue('rainloop', 'rainloop-path', '');
|
2014-08-10 04:46:23 +08:00
|
|
|
$bAutologin = OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false);
|
2014-06-03 23:59:00 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-26 00:05:20 +08:00
|
|
|
OC_JSON::error(array('Message' => 'Invalid Argument(s)', 'Url' => $sUrl, 'Path' => $sPath));
|
2014-06-03 23:59:00 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-07-26 00:05:20 +08:00
|
|
|
OCP\JSON::success(array('Message' => 'Saved successfully', 'Url' => $sUrl, 'Path' => $sPath));
|
2014-06-03 23:59:00 +08:00
|
|
|
return true;
|