Trying different sso type (PHP) for ownCloud package

This commit is contained in:
RainLoop Team 2014-07-25 20:05:20 +04:00
parent 777d014403
commit 1d39879765
12 changed files with 81 additions and 70 deletions

View file

@ -14,20 +14,21 @@ OCP\JSON::checkAppEnabled('rainloop');
OCP\JSON::callCheck();
$sUrl = '';
$sSsoKey = '';
if (isset($_POST['appname'], $_POST['rainloop-url'], $_POST['rainloop-sso-key']) && 'rainloop' === $_POST['appname'])
$sPath = '';
if (isset($_POST['appname'], $_POST['rainloop-url'], $_POST['rainloop-path']) && 'rainloop' === $_POST['appname'])
{
OCP\Config::setAppValue('rainloop', 'rainloop-url', $_POST['rainloop-url']);
OCP\Config::setAppValue('rainloop', 'rainloop-sso-key', $_POST['rainloop-sso-key']);
OCP\Config::setAppValue('rainloop', 'rainloop-path', $_POST['rainloop-path']);
$sUrl = OCP\Config::getAppValue('rainloop', 'rainloop-url', '');
$sSsoKey = OCP\Config::getAppValue('rainloop', 'rainloop-sso-key', '');
$sPath = OCP\Config::getAppValue('rainloop', 'rainloop-path', '');
}
else
{
OC_JSON::error(array('Message' => 'Invalid Argument(s)', 'Url' => $sUrl, 'SsoKey' => $sSsoKey));
OC_JSON::error(array('Message' => 'Invalid Argument(s)', 'Url' => $sUrl, 'Path' => $sPath));
return false;
}
OCP\JSON::success(array('Message' => 'Saved successfully', 'Url' => $sUrl, 'SsoKey' => $sSsoKey));
OCP\JSON::success(array('Message' => 'Saved successfully', 'Url' => $sUrl, 'Path' => $sPath));
return true;