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\User::checkLoggedIn();
|
|
|
|
OCP\App::checkAppEnabled('rainloop');
|
|
|
|
|
|
|
|
OCP\Util::addScript('rainloop', 'personal');
|
|
|
|
|
|
|
|
$sUrl = trim(OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
|
2014-07-26 00:05:20 +08:00
|
|
|
$sPath = trim(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
|
|
|
|
2014-08-10 04:46:23 +08:00
|
|
|
if ('on' === $bAutologin || '' === $sUrl || '' === $sPath)
|
2014-06-03 23:59:00 +08:00
|
|
|
{
|
|
|
|
$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', '');
|
2014-07-26 00:05:20 +08:00
|
|
|
$sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
|
2014-06-03 23:59:00 +08:00
|
|
|
|
|
|
|
$oTemplate->assign('rainloop-email', $sEmail);
|
|
|
|
$oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $oTemplate->fetchPage();
|