Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydwivedics authored Sep 4, 2018
1 parent beb79a7 commit 62e1243
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 0 deletions.
19 changes: 19 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
************************************************************************
*
* Nextcloud - RainLoop Webmail package
*
* @author RainLoop Team & Pierre-Alain Bandinelli
*
*
************************************************************************

REQUIREMENTS:
- nextCloud version 10 to 13


INSTALL & CONFIGURATION:
Start within Nextcloud, and click on the "+ Apps" button in the upper-left corner dropdown menu:
Then, enable the Rainloop plugin that is in the "Social & communication" section.
After a quick wait, Rainloop is installed. Even if it is really attractive, it is too soon to click on the newly appeared "Email" icon in the apps list. You should configure Rainloop before using it (which makes some sense, doesn'it): go to Nextcloud admin panel (upper-right corner dropdown menu) and go to "Additionnal settings". There click on the "Go to RainLoop Webmail admin panel".
In the Rainloop admin prompt, the default login is "admin" and the default password is "12345". No need to advise you to change it once in the admin panel!
This is it, you are now free to configure Rainloop as you wish. One important point is the Domains section when you will set up the IMAP/SMTP parameters that shall be associated with the email adresses of your users.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.1.0
19 changes: 19 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* Nextcloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2016 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();
50 changes: 50 additions & 0 deletions app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

OCP\User::checkLoggedIn();

// code copied from nextcloud /lib/private/legacy/response.php
// fixes object-src: 'none' which blocks chrome from preview pdf
$policy = 'default-src \'self\'; '
. 'script-src \'self\' \'unsafe-eval\' \'nonce-'.\OC::$server->getContentSecurityPolicyNonceManager()->getNonce().'\'; '
. 'style-src \'self\' \'unsafe-inline\'; '
. 'frame-src *; '
. 'img-src * data: blob:; '
. 'font-src \'self\' data:; '
. 'media-src *; '
. 'connect-src *; '
. 'object-src \'self\'; '
. 'base-uri \'self\'; ';
header('Content-Security-Policy:' . $policy);

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';
}
25 changes: 25 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* nextcloud - RainLoop mail plugin
*
* @author RainLoop Team & PAB
* @copyright 2017 RainLoop Team & PAB
*
*/

OCP\User::checkLoggedIn();
\OC::$server->getNavigationManager()->setActiveEntry('rainloop_index');

// Load the empty file ../css/style.css, that's needed to allow theming of
// the Nextcloud 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();
33 changes: 33 additions & 0 deletions personal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* Nextcloud - RainLoop mail plugin
*
* @author RainLoop Team
* @copyright 2016 RainLoop Team
*
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/

OCP\User::checkLoggedIn();

OCP\Util::addScript('rainloop', 'personal');

if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false))
{
$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();

0 comments on commit 62e1243

Please sign in to comment.