mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-26 09:03:48 +08:00
2dd9b076fe
+ Small other fixes
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?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', ''));
|
|
$sPath = trim(OCP\Config::getAppValue('rainloop', 'rainloop-path', ''));
|
|
$bAutologin = OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false);
|
|
|
|
if ($bAutologin || '' === $sUrl || '' === $sPath)
|
|
{
|
|
$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', '');
|
|
$sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
|
|
|
|
$oTemplate->assign('rainloop-email', $sEmail);
|
|
$oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******');
|
|
}
|
|
|
|
return $oTemplate->fetchPage();
|