예제 #1
0
<?php

/**
 * ownCloud - RainLoop mail plugin
 *
 * @author RainLoop Team
 * @copyright 2015 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-local');
$oTemplate->assign('rainloop-admin-panel-link', OC_RainLoop_Helper::getAppUrl() . '?admin');
$oTemplate->assign('rainloop-autologin', OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false));
return $oTemplate->fetchPage();
예제 #2
0
/**
 * ownCloud - RainLoop mail plugin
 *
 * @author RainLoop Team
 * @copyright 2015 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'];
    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)));
    }
    $sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
} else {
    sleep(1);
    OC_JSON::error(array('Message' => 'Invalid argument(s)', 'Email' => $sEmail));
    return false;
}
sleep(1);
OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail));
return true;
 * @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', ''));
$sPath = trim(OCP\Config::getAppValue('rainloop', 'rainloop-path', ''));
$bAutologin = OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false);
if ('' === $sUrl || '' === $sPath) {
    $oTemplate = new OCP\Template('rainloop', 'index-empty', 'user');
} else {
    include_once OC_App::getAppPath('rainloop') . '/lib/RainLoopHelper.php';
    OC_Config::setValue('xframe_restriction', false);
    $sUser = OCP\User::getUser();
    if ($bAutologin) {
        $sEmail = $sUser;
        $sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-autologin-password', '');
    } else {
        $sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
        $sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
    }
    $sDecodedPassword = OC_RainLoop_Helper::decodePassword($sEncodedPassword, md5($sEmail));
    $sSsoHash = OC_RainLoop_Helper::getSsoHash($sPath, $sEmail, $sDecodedPassword);
    $sUrl = OC_RainLoop_Helper::normalizeUrl($sUrl);
    $sResultUrl = empty($sSsoHash) ? $sUrl . '?sso' : $sUrl . '?sso&hash=' . $sSsoHash;
    $oTemplate = new OCP\Template('rainloop', 'index', 'user');
    $oTemplate->assign('rainloop-url', $sResultUrl);
}
$oTemplate->printpage();
예제 #4
0
<?php

if (@file_exists(__DIR__ . '/app/index.php')) {
    include_once OC_App::getAppPath('rainloop') . '/lib/RainLoopHelper.php';
    OC_RainLoop_Helper::regRainLoopDataFunction();
    if (isset($_GET['OwnCloudAuth'])) {
        $sEmail = '';
        $sEncodedPassword = '';
        $sUser = OCP\User::getUser();
        if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false)) {
            $sEmail = $sUser;
            $sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-autologin-password', '');
        } else {
            $sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
            $sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
        }
        $sDecodedPassword = OC_RainLoop_Helper::decodePassword($sEncodedPassword, md5($sEmail));
        $_ENV['___rainloop_owncloud_email'] = $sEmail;
        $_ENV['___rainloop_owncloud_password'] = $sDecodedPassword;
    }
    include __DIR__ . '/app/index.php';
}
예제 #5
0
<?php

/**
 * ownCloud - RainLoop mail plugin
 *
 * @author RainLoop Team
 * @copyright 2015 RainLoop Team
 *
 * https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
 */
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('rainloop');
OCP\App::setActiveNavigationEntry('rainloop_index');
// Load the empty file ../css/style.css, that's needed to allow theming of
// the ownCloud header and navigation if rainloop is the active app.
OCP\Util::addStyle('rainloop', 'style');
include_once OC_App::getAppPath('rainloop') . '/lib/RainLoopHelper.php';
$sUrl = OC_RainLoop_Helper::normalizeUrl(OC_RainLoop_Helper::getAppUrl());
$oTemplate = new OCP\Template('rainloop', 'index', 'user');
$oTemplate->assign('rainloop-iframe-url', OC_RainLoop_Helper::normalizeUrl($sUrl) . '?OwnCloudAuth');
$oTemplate->printpage();