ownCloud Integration App (#144)

+ external sso functionality
This commit is contained in:
RainLoop Team 2014-05-14 03:08:27 +04:00
parent e82108ac85
commit 4a47796781
29 changed files with 724 additions and 195 deletions

View file

@ -10,7 +10,7 @@ module.exports = function (grunt) {
cfg: { cfg: {
devVersion: "0.0.0", devVersion: "0.0.0",
releasesPath: 'build/dist/releases', releasesPath: 'build/dist/releases',
releasesSrcPath: '', releaseSrcPath: '',
releaseFolder: 'rainloop', releaseFolder: 'rainloop',
releaseZipFile: 'rainloop.zip' releaseZipFile: 'rainloop.zip'
}, },
@ -375,6 +375,17 @@ module.exports = function (grunt) {
cwd: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/src/', cwd: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/src/',
src: ['**/*'] src: ['**/*']
}] }]
},
own: {
options: {
archive: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/<%= cfg.releaseZipFile %>',
mode: 'zip'
},
files: [{
expand: true,
cwd: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/owncloud/',
src: ['**/*']
}]
} }
}, },
@ -450,15 +461,42 @@ module.exports = function (grunt) {
packageJsonContent.replace(/"release":\s?"[\d]+",/, '"release": "' + (1 + parseInt(release, 10)) + '",')); packageJsonContent.replace(/"release":\s?"[\d]+",/, '"release": "' + (1 + parseInt(release, 10)) + '",'));
grunt.config.set('cfg.releaseFolder', versionFull); grunt.config.set('cfg.releaseFolder', versionFull);
grunt.config.set('cfg.releasesSrcPath', dist); grunt.config.set('cfg.releaseSrcPath', dist);
grunt.config.set('cfg.releaseZipFile', 'rainloop-' + versionFull + '.zip'); grunt.config.set('cfg.releaseZipFile', 'rainloop-' + versionFull + '.zip');
}); });
grunt.registerTask('rainloop-owncloud', 'RainLoop ownCloud App build task', function () {
var
content = '',
version = grunt.config('pkg.version'),
release = grunt.config('pkg.release'),
releasesPath = grunt.config('cfg.releasesPath'),
devVersion = grunt.config('cfg.devVersion'),
versionFull = version + '.' + release,
dist = releasesPath + '/' + versionFull + '/owncloud/'
;
grunt.file.mkdir(dist);
require('wrench').copyDirSyncRecursive('build/owncloud/rainloop-app',
dist, {'forceDelete': true});
content = grunt.file.read(dist + 'appinfo/info.xml');
grunt.file.write(dist + 'appinfo/info.xml',
content.replace('<version>0.0.0</version>', '<version>' + version + '</version>'));
grunt.config.set('cfg.releaseFolder', versionFull);
grunt.config.set('cfg.releaseSrcPath', dist);
grunt.config.set('cfg.releaseZipFile', 'rainloop-owncloud-app-' + versionFull + '.zip');
});
grunt.registerTask('rainloop-clear', 'RainLoop Webmail clear task', function () { grunt.registerTask('rainloop-clear', 'RainLoop Webmail clear task', function () {
var releasesSrcPath = grunt.config('cfg.releasesSrcPath'); var releaseSrcPath = grunt.config('cfg.releaseSrcPath');
if ('' !== releasesSrcPath) if ('' !== releaseSrcPath)
{ {
require('wrench').rmdirSyncRecursive(releasesSrcPath); require('wrench').rmdirSyncRecursive(releaseSrcPath);
} }
}); });
@ -479,6 +517,7 @@ module.exports = function (grunt) {
grunt.registerTask('default', ['less', 'concat', 'cssmin', 'jshint', 'rlmin']); grunt.registerTask('default', ['less', 'concat', 'cssmin', 'jshint', 'rlmin']);
grunt.registerTask('build', ['default', 'rainloop', 'compress:build', 'md5:build', 'rainloop-clear']); grunt.registerTask('build', ['default', 'rainloop', 'compress:build', 'md5:build', 'rainloop-clear']);
grunt.registerTask('fast', ['less', 'concat']); grunt.registerTask('fast', ['less', 'concat']);
grunt.registerTask('owncloud', ['rainloop-owncloud', 'compress:own', 'md5:build', 'rainloop-clear']);
// aliases // aliases
grunt.registerTask('u', ['uglify']); grunt.registerTask('u', ['uglify']);
@ -486,4 +525,6 @@ module.exports = function (grunt) {
grunt.registerTask('b', ['build']); grunt.registerTask('b', ['build']);
grunt.registerTask('f', ['fast']); grunt.registerTask('f', ['fast']);
grunt.registerTask('w', ['default', 'watch']); grunt.registerTask('w', ['default', 'watch']);
grunt.registerTask('o', ['owncloud']);
grunt.registerTask('own', ['owncloud']);
}; };

View file

@ -0,0 +1,29 @@
************************************************************************
*
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*
************************************************************************
INSTALL:
- Unpack the RainLoop Webmail application package in the apps directory of your OwnCloud instance
CONFIGURATION:
RainLoop:
1) Open ../_default_/configs/application.ini
2) Find:
[labs]
allow_external_sso = On
external_sso_key = "super-secret-key"
ownCloud:
1) In the Apps > Enable 'RainLoop' plugin
2) In the Settings > Admin > Enter "RainLoop Webmail URL" and "SSO key"
3) In the Settings > Personal > Type your mail server email and password

View file

@ -0,0 +1,19 @@
<?php
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
OCP\User::checkAdminUser();
OCP\Util::addScript('rainloop', 'admin');
$oTemplate = new OCP\Template('rainloop', 'admin');
$oTemplate->assign('rainloop-url', OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
$oTemplate->assign('rainloop-sso-key', OCP\Config::getAppValue('rainloop', 'rainloop-sso-key', ''));
return $oTemplate->fetchPage();

View file

@ -0,0 +1,33 @@
<?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 = '';
$sSsoKey = '';
if (isset($_POST['appname'], $_POST['rainloop-url'], $_POST['rainloop-sso-key']) && 'rainloop' === $_POST['appname'])
{
OCP\Config::setAppValue('rainloop', 'rainloop-url', $_POST['rainloop-url']);
OCP\Config::setAppValue('rainloop', 'rainloop-sso-key', $_POST['rainloop-sso-key']);
$sUrl = OCP\Config::getAppValue('rainloop', 'rainloop-url', '');
$sSsoKey = OCP\Config::getAppValue('rainloop', 'rainloop-sso-key', '');
}
else
{
OC_JSON::error(array('Message' => 'Invalid Argument(s)', 'Url' => $sUrl, 'SsoKey' => $sSsoKey));
return false;
}
OCP\JSON::success(array('Message' => 'Saved successfully', 'Url' => $sUrl, 'SsoKey' => $sSsoKey));
return true;

View file

@ -0,0 +1,45 @@
<?php
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('rainloop');
OCP\JSON::callCheck();
$sEmail = '';
$sLogin = '';
if (isset($_POST['appname'], $_POST['rainloop-password'], $_POST['rainloop-email']) && 'rainloop' === $_POST['appname'])
{
$sUser = OCP\User::getUser();
$sPostEmail = $_POST['rainloop-email'];
$sPostLogin = isset($_POST['rainloop-login']) ? $_POST['rainloop-login'] : '';
OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-email', $sPostEmail);
$sPass = $_POST['rainloop-password'];
if ('******' !== $sPass && '' !== $sPass)
{
include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php';
OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-password',
OC_RainLoop_Helper::encodePassword($sPass, md5($sPostEmail.$sPostLogin)));
}
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
$sLogin = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', '');
}
else
{
OC_JSON::error(array('Message' => 'Invalid argument(s)', 'Email' => $sEmail, 'Login' => $sLogin));
return false;
}
OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail, 'Login' => $sLogin));
return true;

View file

@ -0,0 +1,23 @@
<?php
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/owncloud
*/
OCP\App::registerAdmin('rainloop', 'admin');
OCP\App::registerPersonal('rainloop', 'personal');
OCP\Util::addScript('rainloop', 'rainloop');
OCP\App::addNavigationEntry(array(
'id' => 'rainloop_index',
'order' => 10,
'href' => OCP\Util::linkTo('rainloop', 'index.php'),
'icon' => OCP\Util::imagePath('rainloop', 'mail.png'),
'name' => 'RainLoop'
));

View file

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<info>
<id>rainloop</id>
<name>RainLoop</name>
<description>RainLoop Webmail</description>
<version>0.0.0</version>
<licence>CC BY-NC-SA 3.0</licence>
<author>RainLoop Team</author>
<require>6.0</require>
</info>

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,41 @@
<?php
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('rainloop');
OCP\App::setActiveNavigationEntry('rainloop_index');
$sUrl = trim(OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
$sSsoKey = trim(OCP\Config::getAppValue('rainloop', 'rainloop-sso-key', ''));
if ('' === $sUrl || '' === $sSsoKey)
{
$oTemplate = new OCP\Template('rainloop', 'index-empty', 'user');
}
else
{
$sUser = OCP\User::getUser();
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
$sLogin = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', '');
$sPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php';
$sPassword = OC_RainLoop_Helper::decodePassword($sPassword, md5($sEmail.$sLogin));
$sSsoHash = OC_RainLoop_Helper::getSsoHash($sUrl, $sSsoKey, $sEmail, $sPassword, $sLogin);
$sResultUrl = empty($sSsoHash) ? $sUrl : $sUrl.'?sso&hash='.$sSsoHash;
$oTemplate = new OCP\Template('rainloop', 'index', 'user');
$oTemplate->assign('rainloop-url', $sResultUrl);
}
$oTemplate->printpage();

View file

@ -0,0 +1,13 @@
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
$(function() {
RainLoopFormHelper('#mail-rainloop-admin-form', 'admin.php');
});

View file

@ -0,0 +1,13 @@
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
$(function() {
RainLoopFormHelper('#mail-rainloop-personal-form', 'personal.php');
});

View file

@ -0,0 +1,76 @@
function RainLoopFormHelper(sID, sAjaxFile, fCallback)
{
try
{
var
oForm = $(sID),
oSubmit = $('#rainloop-save-button', oForm),
sSubmitValue = oSubmit.val(),
oDesc = oForm.find('.rainloop-result-desc')
;
oSubmit.click(function (oEvent) {
var oDefAjax = null;
oEvent.preventDefault();
oForm
.addClass('rainloop-ajax')
.removeClass('rainloop-error')
.removeClass('rainloop-success')
;
oDesc.text('');
oSubmit.val('...');
oDefAjax = $.ajax({
'type': 'POST',
'async': true,
'url': OC.filePath('rainloop', 'ajax', sAjaxFile),
'data': oForm.serialize(),
'dataType': 'json',
'global': true
});
oDefAjax.always(function (oData) {
var bResult = false;
oForm.removeClass('rainloop-ajax');
oSubmit.val(sSubmitValue);
if (oData)
{
bResult = 'success' === oData['status'];
if (oData['Message'])
{
oDesc.text(oData['Message']);
}
}
if (bResult)
{
oForm.addClass('rainloop-success');
}
else
{
oForm.addClass('rainloop-error');
if ('' === oDesc.text())
{
oDesc.text('Error');
}
}
if (fCallback)
{
fCallback(bResult, oData);
}
});
return false;
});
}
catch(e) {}
}

View file

@ -0,0 +1,62 @@
<?php
class OC_RainLoop_Helper
{
public static function getSsoHash($sUrl, $sSsoKey, $sEmail, $sPassword, $sLogin = '')
{
if (!function_exists('curl_init'))
{
return '';
}
$oCurl = curl_init();
curl_setopt_array($oCurl, array(
CURLOPT_URL => $sUrl.'?ExternalSso',
CURLOPT_HEADER => false,
CURLOPT_FAILONERROR => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_USERAGENT => 'RainLoop SSO User Agent (ownCloud)',
CURLOPT_POSTFIELDS => http_build_query(array(
'SsoKey' => $sSsoKey,
'Email' => $sEmail,
'Password' => $sPassword,
'Login' => $sLogin
), '', '&'),
CURLOPT_TIMEOUT => 5
));
$mResult = curl_exec($oCurl);
if (is_resource($oCurl))
{
curl_close($oCurl);
}
return is_string($mResult) ? $mResult : '';
}
public static function encodePassword($sPassword, $sSalt)
{
if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') &&
defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND'))
{
return @trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), $sPassword,
MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
}
return @trim(base64_encode($sPassword));
}
public static function decodePassword($sPassword, $sSalt)
{
if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') &&
defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND'))
{
return @mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)),
MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));
}
return @base64_decode(trim($sPassword));
}
}

View file

@ -0,0 +1,39 @@
<?php
/**
* ownCloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2014 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('rainloop');
OCP\Util::addScript('rainloop', 'personal');
$sUrl = trim(OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
$sSsoKey = trim(OCP\Config::getAppValue('rainloop', 'rainloop-sso-key', ''));
if ('' === $sUrl || '' === $sSsoKey)
{
$oTemplate = new OCP\Template('rainloop', 'empty');
}
else
{
$sUser = OCP\User::getUser();
$oTemplate = new OCP\Template('rainloop', 'personal');
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
$oTemplate->assign('rainloop-email', $sEmail);
$oTemplate->assign('rainloop-login', OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', ''));
$sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
$oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******');
}
return $oTemplate->fetchPage();

View file

@ -0,0 +1,23 @@
<form id="mail-rainloop-admin-form" action="#" method="post">
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="hidden" name="appname" value="rainloop">
<fieldset class="personalblock">
<h2><?php p($l->t('RainLoop Webmail')); ?></h2>
<br />
<p>
<?php p($l->t('RainLoop Webmail URL')); ?>:
<br />
<input type="text" style="width:300px;" id="rainloop-url" name="rainloop-url" value="<?php echo $_['rainloop-url']; ?>" placeholder="https://" />
<br />
<br />
<?php p($l->t('SSO key')); ?>:
<br />
<input type="text" style="width:300px;" id="rainloop-url" name="rainloop-sso-key" value="<?php echo $_['rainloop-sso-key']; ?>" />
<br />
<br />
<input type="button" id="rainloop-save-button" name="rainloop-save-button" value="<?php p($l->t('Save')); ?>" />
&nbsp;&nbsp;<span class="rainloop-result-desc"></span>
</p>
</fieldset>
</form>

View file

@ -0,0 +1 @@
<!-- empty -->

View file

@ -0,0 +1 @@
EMPTY

View file

@ -0,0 +1,3 @@
<div style="box-sizing: border-box; width: 100%; height: 100%; padding: 0 0 5px 5px; background-color: #383c43;">
<iframe src="<?php echo $_['rainloop-url']; ?>" style="width: 100%; height: 100%;" tabindex="-1" frameBorder="0"></iframe>
</div>

View file

@ -0,0 +1,18 @@
<form id="mail-rainloop-personal-form" action="#" method="post">
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="hidden" name="appname" value="rainloop">
<fieldset class="personalblock">
<h2><?php p($l->t('RainLoop Webmail')); ?></h2>
<p>
<input type="text" id="rainloop-email" name="rainloop-email"
value="<?php echo $_['rainloop-email']; ?>" placeholder="<?php p($l->t('Email')); ?>" />
<input type="password" id="rainloop-password" name="rainloop-password"
value="<?php echo $_['rainloop-password']; ?>" placeholder="<?php p($l->t('Password')); ?>" />
<input type="button" id="rainloop-save-button" name="rainloop-save-button" value="<?php p($l->t('Save')); ?>" />
&nbsp;&nbsp;<span class="rainloop-result-desc"></span>
</p>
</fieldset>
</form>

View file

@ -63,17 +63,19 @@ class Api
* @param string $sEmail * @param string $sEmail
* @param string $sPassword * @param string $sPassword
* @param string $sLogin = '' * @param string $sLogin = ''
* @param bool $bUseTimeout = true
* *
* @return string * @return string
*/ */
public static function GetUserSsoHash($sEmail, $sPassword, $sLogin = '') public static function GetUserSsoHash($sEmail, $sPassword, $sLogin = '', $bUseTimeout = true)
{ {
$sSsoHash = \sha1(\rand(10000, 99999).$sEmail.$sPassword.$sLogin.\microtime(true)); $sSsoHash = \sha1(\rand(10000, 99999).$sEmail.$sPassword.$sLogin.\microtime(true));
return self::Actions()->Cacher()->Set(self::Actions()->BuildSsoCacherKey($sSsoHash), \RainLoop\Utils::EncodeKeyValues(array( return self::Actions()->Cacher()->Set(self::Actions()->BuildSsoCacherKey($sSsoHash), \RainLoop\Utils::EncodeKeyValues(array(
'Email' => $sEmail, 'Email' => $sEmail,
'Password' => $sPassword, 'Password' => $sPassword,
'Login' => $sLogin 'Login' => $sLogin,
'Time' => $bUseTimeout ? \time() : 0
))) ? $sSsoHash : ''; ))) ? $sSsoHash : '';
} }

View file

@ -245,6 +245,8 @@ Enables caching in the system'),
'custom_login_link' => array(''), 'custom_login_link' => array(''),
'custom_logout_link' => array(''), 'custom_logout_link' => array(''),
'allow_external_login' => array(false), 'allow_external_login' => array(false),
'allow_external_sso' => array(false),
'external_sso_key' => array(''),
'fast_cache_memcache_host' => array('127.0.0.1'), 'fast_cache_memcache_host' => array('127.0.0.1'),
'fast_cache_memcache_port' => array(11211), 'fast_cache_memcache_port' => array(11211),
'fast_cache_memcache_expire' => array(43200), 'fast_cache_memcache_expire' => array(43200),

View file

@ -749,7 +749,8 @@ class ServiceActions
$mData = \RainLoop\Utils::DecodeKeyValues($sSsoSubData); $mData = \RainLoop\Utils::DecodeKeyValues($sSsoSubData);
$this->Cacher()->Delete($sSsoKey); $this->Cacher()->Delete($sSsoKey);
if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'])) if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'], $mData['Time']) &&
(0 === $mData['Time'] || \time() - 10 < $mData['Time']))
{ {
$sEmail = \trim($mData['Email']); $sEmail = \trim($mData['Email']);
$sPassword = $mData['Password']; $sPassword = $mData['Password'];
@ -815,8 +816,8 @@ class ServiceActions
if ($this->oActions->Config()->Get('labs', 'allow_external_login', false)) if ($this->oActions->Config()->Get('labs', 'allow_external_login', false))
{ {
$sEmail = trim($this->oHttp->GetRequest('Email', '')); $sEmail = \trim($this->oHttp->GetRequest('Email', ''));
$sLogin = trim($this->oHttp->GetRequest('Login', '')); $sLogin = \trim($this->oHttp->GetRequest('Login', ''));
$sPassword = $this->oHttp->GetRequest('Password', ''); $sPassword = $this->oHttp->GetRequest('Password', '');
try try
@ -867,6 +868,40 @@ class ServiceActions
return ''; return '';
} }
/**
* @return string
*/
public function ServiceExternalSso()
{
$sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', '');
if ($this->oActions->Config()->Get('labs', 'allow_external_sso', false) &&
!empty($sKey) && $sKey === \trim($this->oHttp->GetRequest('SsoKey', '')))
{
$sEmail = \trim($this->oHttp->GetRequest('Email', ''));
$sLogin = \trim($this->oHttp->GetRequest('Login', ''));
$sPassword = $this->oHttp->GetRequest('Password', '');
\RainLoop\Api::Handle();
$sResult = \RainLoop\Api::GetUserSsoHash($sEmail, $sPassword, $sLogin);
switch (\strtolower($this->oHttp->GetRequest('Output', 'Plain')))
{
case 'plain':
@\header('Content-Type: text/plain');
return $sResult;
case 'json':
@\header('Content-Type: application/json; charset=utf-8');
return \MailSo\Base\Utils::Php2js(array(
'Action' => 'ExternalSso',
'Result' => $sResult
));
}
}
return '';
}
/** /**
* @return string * @return string
*/ */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long