Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into app-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-alain-b authored May 17, 2020
2 parents 830efd8 + 9391e0d commit 89f612d
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 41 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ rainloop-nextcloud is a plugin for Nextcloud to use the excellent Rainloop webma

## Which branch for which version of Nextcloud?

The nc13 branch corresponds to the working version of the plugin for Nextcloud 10 to Nextcloud 13.
The nc14 branch corresponds to a beta version of the plugin for Nextcloud 14. All the changes of nc14 branch were merged into master when it was deemed suitable for production.
The master branch corresponds to the latest stable version of the plugin.
- The master branch corresponds to the latest stable version of the plugin that is suitable for Nextcloud 19 and upwards.
- The 'up-to-nc18' corresponds to the working version of the plugin for Nextcloud 14 to 18.
- The 'nc14' branch corresponds to a beta version of the plugin for Nextcloud 14. All the changes of 'nc14' branch were merged into master when it was deemed suitable for production.
- The 'nc13' branch corresponds to the working version of the plugin for Nextcloud 10 to Nextcloud 13.


Thank you to all contributors to Rainloop for nextcloud:
- Rainloop Team, who initiated it
Expand Down Expand Up @@ -47,6 +49,10 @@ Each user of Rainloop can also change user-specific behaviors in the Rainloop us

Rainloop user settings include management of contacts, of email accounts, of folders, appearance and OpenPGP.

### The specificity of Rainloop user accounts
The plugin passes the login information of the user to the Rainloop app which then creates and manages the user accounts. Accounts in Rainloop are based soley on the authenticated email accounts, and do not take into account the nextcloud user which created them in the first place. If two or more Nextcloud users have the same email account in additional settings, they will in fact share the same 'email account' in Rainloop including any additional email accounts that they may have added subsequently to their main account.
This is to be kept in mind for the use case where multiple users shall have the same email account but may be also tempted to add additionnal acounts to their Rainloop.

## How to auto-connect to Rainloop?

### Auto-connection for all Nextcloud users
Expand All @@ -67,4 +73,4 @@ You can activate Rainloop logging here: `/path/to/nextcloud/data/rainloop-storag
[logs]
enable = On
```
And then logs are then available in `/path/to/nextcloud/data/rainloop-storage/_data_/_default_/logs/`
Logs are then available in `/path/to/nextcloud/data/rainloop-storage/_data_/_default_/logs/`
2 changes: 1 addition & 1 deletion rainloop/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.1.4
22 changes: 22 additions & 0 deletions rainloop/admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/**
* Nextcloud - RainLoop mail plugin
*
* @author RainLoop Team, Nextgen-Networks (@nextgen-networks), Tab Fitts (@tabp0le), Pierre-Alain Bandinelli (@pierre-alain-b)
*
* Based initially on https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
*/

#OCP\User::checkAdminUser();
if (!OC_User::isAdminUser(OC_User::getUser())) {
return;
}

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', \OC::$server->getConfig()->getAppValue('rainloop', 'rainloop-autologin', false));
$oTemplate->assign('rainloop-autologin-with-email', \OC::$server->getConfig()->getAppValue('rainloop', 'rainloop-autologin-with-email', false));
return $oTemplate->fetchPage();
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public static function DecodeHeaderValue($sEncodedValue, $sIncomingCharset = '',
{
$iPos = \strpos($aTempArr[1], '?', 2);
$aTempArr[0] = \substr($aTempArr[1], 2, $iPos - 2);
$sEncType = \strtoupper($aTempArr[1]{$iPos + 1});
$sEncType = \strtoupper($aTempArr[1][$iPos + 1]);
switch ($sEncType)
{
case 'Q':
Expand Down Expand Up @@ -1986,13 +1986,13 @@ public static function Utf7ModifiedToUtf8($sStr)

for ($iIndex = 0; $iLen > 0; $iIndex++, $iLen--)
{
$sChar = $sStr{$iIndex};
$sChar = $sStr[$iIndex];
if ($sChar == '&')
{
$iIndex++;
$iLen--;

$sChar = isset($sStr{$iIndex}) ? $sStr{$iIndex} : null;
$sChar = isset($sStr[$iIndex]) ? $sStr[$iIndex] : null;
if ($sChar === null)
{
break;
Expand All @@ -2008,7 +2008,7 @@ public static function Utf7ModifiedToUtf8($sStr)
$iK = 10;
for (; $iLen > 0; $iIndex++, $iLen--)
{
$sChar = $sStr{$iIndex};
$sChar = $sStr[$iIndex];

$iB = $aArray[\ord($sChar)];
if ((\ord($sChar) & 0x80) || $iB == -1)
Expand Down Expand Up @@ -2052,7 +2052,7 @@ public static function Utf7ModifiedToUtf8($sStr)

if (($iCh || $iK < 6) ||
(!$iLen || $sChar != '-') ||
($iLen > 2 && '&' === $sStr{$iIndex+1} && '-' !== $sStr{$iIndex+2}))
($iLen > 2 && '&' === $sStr[$iIndex+1] && '-' !== $sStr[$iIndex+2]))
{
return $bError;
}
Expand Down Expand Up @@ -2090,7 +2090,7 @@ public static function Utf8ToUtf7Modified($sStr)

while ($sLen)
{
$iC = \ord($sStr{$iIndex});
$iC = \ord($sStr[$iIndex]);
if ($iC < 0x80)
{
$iCh = $iC;
Expand Down Expand Up @@ -2140,7 +2140,7 @@ public static function Utf8ToUtf7Modified($sStr)

for ($iJ = 0; $iJ < $iN; $iJ++)
{
$iO = \ord($sStr{$iIndex+$iJ});
$iO = \ord($sStr[$iIndex+$iJ]);
if (($iO & 0xc0) != 0x80)
{
return $bError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public static function Parse($sEmailAddress)

while ($iCurrentIndex < \strlen($sEmailAddress))
{
switch ($sEmailAddress{$iCurrentIndex})
switch ($sEmailAddress[$iCurrentIndex])
{
// case '\'':
case '"':
// $sQuoteChar = $sEmailAddress{$iCurrentIndex};
// $sQuoteChar = $sEmailAddress[$iCurrentIndex];
if ((!$bInName) && (!$bInAddress) && (!$bInComment))
{
$bInName = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ private function parseEmailAddresses($sRawEmails)

while ($iCurrentPos < $sWorkingRecipientsLen)
{
switch ($sWorkingRecipients{$iCurrentPos})
switch ($sWorkingRecipients[$iCurrentPos])
{
case '\'':
case '"':
if (!$bIsInQuotes)
{
$sChQuote = $sWorkingRecipients{$iCurrentPos};
$sChQuote = $sWorkingRecipients[$iCurrentPos];
$bIsInQuotes = true;
}
else if ($sChQuote == $sWorkingRecipients{$iCurrentPos})
else if ($sChQuote == $sWorkingRecipients[$iCurrentPos])
{
$bIsInQuotes = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ public static function Parse($sEmailAddress)

while ($iCurrentIndex < \strlen($sEmailAddress))
{
switch ($sEmailAddress{$iCurrentIndex})
switch ($sEmailAddress[$iCurrentIndex])
{
// case '\'':
case '"':
// $sQuoteChar = $sEmailAddress{$iCurrentIndex};
// $sQuoteChar = $sEmailAddress[$iCurrentIndex];
if ((!$bInName) && (!$bInAddress) && (!$bInComment))
{
$bInName = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,7 @@ private function _decode($encoded)

if ($delim_pos > self::_byteLength($this->_punycode_prefix)) {
for ($k = self::_byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) {
$decoded[] = ord($encoded{$k});
$decoded[] = ord($encoded[$k]);
}
} else {
$decoded = array();
Expand All @@ -2704,7 +2704,7 @@ private function _decode($encoded)

for ($enco_idx = ($delim_pos)? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
$digit = $this->_decodeDigit($encoded{$enco_idx++});
$digit = $this->_decodeDigit($encoded[$enco_idx++]);
$idx += $digit * $w;

$t = ($k <= $bias) ?
Expand Down Expand Up @@ -3116,7 +3116,7 @@ private function _utf8_to_ucs4($input)
$mode = 'next';
$test = 'none';
for ($k = 0; $k < $inp_len; ++$k) {
$v = ord($input{$k}); // Extract byte from input string
$v = ord($input[$k]); // Extract byte from input string

if ($v < 128) { // We found an ASCII char - put into stirng as is
$output[$out_len] = $v;
Expand Down Expand Up @@ -3283,7 +3283,7 @@ private function _ucs4_string_to_ucs4($input)
$out_len++;
$output[$out_len] = 0;
}
$output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
$output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
}
return $output;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ public function AppData($bAdmin, $bMobile = false, $bMobileDevice = false, $sAut

/*
required by Index.html and rl.js:
NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBackground PluginsLink AuthAccountHash
NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground PluginsLink AuthAccountHash
*/

$aResult = array(
Expand Down Expand Up @@ -9260,7 +9260,7 @@ public function GetThemes($bMobile = false, $bIncludeMobile = true)
{
while (($sFile = \readdir($rDirH)) !== false)
{
if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
if ('.' !== $sFile[0] && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
{
if ('Default' === $sFile)
{
Expand Down Expand Up @@ -9288,7 +9288,7 @@ public function GetThemes($bMobile = false, $bIncludeMobile = true)
{
while (($sFile = \readdir($rDirH)) !== false)
{
if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
if ('.' !== $sFile[0] && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
{
$sList[] = $sFile.'@custom';
}
Expand Down Expand Up @@ -9341,7 +9341,7 @@ public function GetLanguages($bAdmin = false)
{
while (($sFile = \readdir($rDirH)) !== false)
{
if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4))
if ('.' !== $sFile[0] && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4))
{
$sLang = \substr($sFile, 0, -4);
if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ protected function compileProp($prop, $block, $out) {
if ($suffix !== null &&
$subProp[0] == "assign" &&
is_string($subProp[1]) &&
$subProp[1]{0} != $this->vPrefix)
$subProp[1][0] != $this->vPrefix)
{
$subProp[2] = array(
'list', ' ',
Expand Down Expand Up @@ -1626,7 +1626,7 @@ protected function injectVariables($args) {
$this->pushEnv();
$parser = new lessc_parser($this, __METHOD__);
foreach ($args as $name => $strValue) {
if ($name{0} != '@') $name = '@'.$name;
if ($name[0] != '@') $name = '@'.$name;
$parser->count = 0;
$parser->buffer = (string)$strValue;
if (!$parser->propertyValue($value)) {
Expand Down Expand Up @@ -2284,7 +2284,7 @@ protected function parseChunk() {
$hidden = true;
if (!isset($block->args)) {
foreach ($block->tags as $tag) {
if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) {
if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) {
$hidden = false;
break;
}
Expand Down Expand Up @@ -2338,7 +2338,7 @@ protected function isDirective($dirname, $directives) {
protected function fixTags($tags) {
// move @ tags out of variable namespace
foreach ($tags as &$tag) {
if ($tag{0} == $this->lessc->vPrefix)
if ($tag[0] == $this->lessc->vPrefix)
$tag[0] = $this->lessc->mPrefix;
}
return $tags;
Expand Down Expand Up @@ -3068,7 +3068,7 @@ protected function keyword(&$word) {
protected function end() {
if ($this->literal(';')) {
return true;
} elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') {
} elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') {
// if there is end of file or a closing block next then we don't need a ;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion rainloop/app/rainloop/v/1.14.0/static/js/min/admin.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions rainloop/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<name>RainLoop</name>
<summary>RainLoop Webmail</summary>
<description>Simple, modern and fast web-based email client. After enabling in Nextcloud, go to Nextcloud admin panel, "Additionnal settings" and you will see a "Rainloop webmail" section. There, click on the link to go to the Rainloop admin panel. The default user/password is admin/12345. This version is based on Rainloop 1.14.0 (2020-01).</description>
<version>6.1.0</version>
<version>6.1.4</version>
<licence>agpl</licence>
<author>RainLoop Team, Nextgen-Networks, Tab Fitts, Pierre-Alain Bandinelli</author>
<namespace>RainLoop</namespace>
<author>RainLoop Team, Nextgen-Networks, Tab Fitts, Nathan Kinkade, Pierre-Alain Bandinelli</author>
<namespace>RainLoop</namespace>
<documentation>
<user>https://github.com/pierre-alain-b/rainloop-nextcloud/blob/master/README.md</user>
<website>https://www.rainloop.net/</website>
Expand All @@ -19,10 +19,10 @@
<bugs>https://github.com/pierre-alain-b/rainloop-nextcloud/issues</bugs>
<screenshot>https://raw.githubusercontent.com/pierre-alain-b/rainloop-nextcloud/master/screenshots/2016.10.20-screenshot.jpg</screenshot>
<dependencies>
<php min-version="5.4" />
<php min-version="5.4" />
<owncloud min-version="6" max-version="9.2" />
<nextcloud min-version="10" max-version="19" />
</dependencies>
<nextcloud min-version="19" max-version="19" />
</dependencies>
<settings>
<admin>OCA\RainLoop\Settings\AdminSettings</admin>
</settings>
Expand Down
2 changes: 1 addition & 1 deletion rainloop/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
'verb' => 'POST'
]
]
];
];
2 changes: 1 addition & 1 deletion rainloop/appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.1.4

0 comments on commit 89f612d

Please sign in to comment.