Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit c041c50

Browse files
committed
Merge pull request #1 from RainLoop/master
update fork
2 parents af3d04a + a4904f4 commit c041c50

File tree

1,172 files changed

+99398
-104768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,172 files changed

+99398
-104768
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/.idea
2+
/error.log
23
/nbproject
34
/npm-debug.log
5+
/rainloop.sublime-project
6+
/rainloop.sublime-workspace
47
/rainloop/v/0.0.0/static/css/*.css
58
/rainloop/v/0.0.0/static/js/*.js
69
/rainloop/v/0.0.0/static/js/**/*.js

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
RainLoop Webmail
22
==================
33

4-
## About
4+
[![Join the chat at https://gitter.im/RainLoop/rainloop-webmail](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RainLoop/rainloop-webmail?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

66
Simple, modern & fast web-based email client.
77

@@ -21,4 +21,4 @@ It's not recommended to use in production environment.
2121
**Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)**
2222
http://creativecommons.org/licenses/by-nc-sa/3.0/
2323

24-
Copyright (c) 2014 Rainloop Team
24+
Copyright (c) 2015 Rainloop Team

build/langs.php

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
3+
\define('IS_ADMIN', isset($_GET['admin']) && '1' === (string) $_GET['admin']);
4+
\define('LANGS_PATH', __DIR__.'/../rainloop/v/0.0.0/langs'.(IS_ADMIN ? '/admin' : ''));
5+
6+
function getLangStructure($sLangFile)
7+
{
8+
$sEngLang = \file_get_contents(LANGS_PATH.'/'.$sLangFile);
9+
return $sEngLang ? \parse_ini_string($sEngLang, true) : null;
10+
}
11+
12+
function mergeLangStructure($aFromLang, $aEngLang, &$iCount = 0)
13+
{
14+
$iCount = 0;
15+
foreach ($aEngLang as $sSectionKey => $aSectionValue)
16+
{
17+
foreach (\array_keys($aSectionValue) as $sParamKey)
18+
{
19+
if (isset($aFromLang[$sSectionKey][$sParamKey]))
20+
{
21+
$aEngLang[$sSectionKey][$sParamKey] = $aFromLang[$sSectionKey][$sParamKey];
22+
}
23+
else
24+
{
25+
echo $sSectionKey.'/'.$sParamKey.','."\n";
26+
$iCount++;
27+
}
28+
}
29+
}
30+
31+
return $aEngLang;
32+
}
33+
34+
function saveLangStructure($sLangFile, $aLang)
35+
{
36+
$aResultLines = array();
37+
// $aResultLines[] = '; '.$sLangFile;
38+
39+
foreach ($aLang as $sSectionKey => $aSectionValue)
40+
{
41+
$aResultLines[] = '';
42+
$aResultLines[] = '['.$sSectionKey.']';
43+
44+
foreach ($aSectionValue as $sParamKey => $sParamValue)
45+
{
46+
$aResultLines[] = $sParamKey.' = "'.
47+
\str_replace(array('\\', '"'), array('\\\\', '\\"'), \trim($sParamValue)).'"';
48+
}
49+
}
50+
51+
\file_put_contents(LANGS_PATH.'/'.$sLangFile, implode("\n", $aResultLines));
52+
}
53+
54+
$sNL = "\n";
55+
$aEngLang = \getLangStructure('en.ini');
56+
57+
$aFiles = \glob(LANGS_PATH.'/*.ini');
58+
foreach ($aFiles as $sFile)
59+
{
60+
$iCount = 0;
61+
$sFileName = \basename($sFile);
62+
63+
$aNextLang = \getLangStructure($sFileName);
64+
$aNewLang = \mergeLangStructure($aNextLang, $aEngLang, $iCount);
65+
66+
if (0 === $iCount)
67+
{
68+
echo $sFileName.': ok'.$sNL;
69+
}
70+
else
71+
{
72+
echo $sFileName.': changed ('.$iCount.')'.$sNL;
73+
}
74+
75+
// \saveLangStructure($sFileName, $aNewLang);
76+
}
Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
************************************************************************
2-
*
3-
* ownCloud - RainLoop Webmail mail plugin
4-
*
5-
* @author RainLoop Team
6-
* @copyright 2014 RainLoop Team
7-
*
8-
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
9-
*
10-
************************************************************************
11-
12-
REQUIREMENTS:
13-
- Installed and configured RainLoop Webmail (standalone)
14-
- ownCloud version 6 or higher
15-
- Both apps (RainLoop & ownCloud) running on the same domain
16-
17-
18-
INSTALL:
19-
- Unpack the RainLoop Webmail application package in the apps directory of your OwnCloud instance
20-
21-
22-
CONFIGURATION:
23-
- ownCloud:
24-
1) In the Apps > Enable 'RainLoop' plugin
25-
2) In the Settings > Admin > Enter "RainLoop Webmail URL" and "Absolute (full) path to RainLoop Webmail installation"
26-
3) In the Settings > Personal > Type your mail server email (login) and password
1+
************************************************************************
2+
*
3+
* ownCloud - RainLoop Webmail package
4+
*
5+
* @author RainLoop Team
6+
* @copyright 2015 RainLoop Team
7+
*
8+
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
9+
*
10+
************************************************************************
11+
12+
REQUIREMENTS:
13+
- ownCloud version 6 or higher
14+
15+
16+
INSTALL:
17+
- Unpack the RainLoop Webmail application package in the apps directory of your OwnCloud instance
18+
19+
20+
CONFIGURATION:
21+
- ownCloud:
22+
1) In the Apps > Enable 'RainLoop' plugin
23+
2) In the Settings > Personal > Type your mail server email (login) and password
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
<?php
2-
3-
/**
4-
* ownCloud - RainLoop mail plugin
5-
*
6-
* @author RainLoop Team
7-
* @copyright 2014 RainLoop Team
8-
*
9-
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
10-
*/
11-
12-
OCP\User::checkAdminUser();
13-
14-
OCP\Util::addScript('rainloop', 'admin');
15-
16-
$oTemplate = new OCP\Template('rainloop', 'admin');
17-
$oTemplate->assign('rainloop-url', OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
18-
$oTemplate->assign('rainloop-path', OCP\Config::getAppValue('rainloop', 'rainloop-path', ''));
19-
$oTemplate->assign('rainloop-autologin', OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false));
20-
return $oTemplate->fetchPage();
1+
<?php
2+
3+
/**
4+
* ownCloud - RainLoop mail plugin
5+
*
6+
* @author RainLoop Team
7+
* @copyright 2015 RainLoop Team
8+
*
9+
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
10+
*/
11+
12+
OCP\User::checkAdminUser();
13+
14+
OCP\Util::addScript('rainloop', 'admin');
15+
16+
$oTemplate = new OCP\Template('rainloop', 'admin-local');
17+
$oTemplate->assign('rainloop-admin-panel-link', OC_RainLoop_Helper::getAppUrl().'?admin');
18+
$oTemplate->assign('rainloop-autologin', OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false));
19+
return $oTemplate->fetchPage();

build/owncloud/rainloop-app/ajax/admin.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ownCloud - RainLoop mail plugin
55
*
66
* @author RainLoop Team
7-
* @copyright 2014 RainLoop Team
7+
* @copyright 2015 RainLoop Team
88
*
99
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
1010
*/
@@ -17,22 +17,20 @@
1717
$sPath = '';
1818
$bAutologin = false;
1919

20-
if (isset($_POST['appname'], $_POST['rainloop-url'], $_POST['rainloop-path']) && 'rainloop' === $_POST['appname'])
20+
if (isset($_POST['appname']) && 'rainloop' === $_POST['appname'])
2121
{
22-
OCP\Config::setAppValue('rainloop', 'rainloop-url', $_POST['rainloop-url']);
23-
OCP\Config::setAppValue('rainloop', 'rainloop-path', $_POST['rainloop-path']);
2422
OCP\Config::setAppValue('rainloop', 'rainloop-autologin', isset($_POST['rainloop-autologin']) ?
2523
'1' === $_POST['rainloop-autologin'] : false);
2624

27-
$sUrl = OCP\Config::getAppValue('rainloop', 'rainloop-url', '');
28-
$sPath = OCP\Config::getAppValue('rainloop', 'rainloop-path', '');
2925
$bAutologin = OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false);
3026
}
3127
else
3228
{
33-
OC_JSON::error(array('Message' => 'Invalid Argument(s)', 'Url' => $sUrl, 'Path' => $sPath));
29+
sleep(1);
30+
OC_JSON::error(array('Message' => 'Invalid Argument(s)'));
3431
return false;
3532
}
3633

37-
OCP\JSON::success(array('Message' => 'Saved successfully', 'Url' => $sUrl, 'Path' => $sPath));
34+
sleep(1);
35+
OCP\JSON::success(array('Message' => 'Saved successfully'));
3836
return true;

build/owncloud/rainloop-app/ajax/personal.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ownCloud - RainLoop mail plugin
55
*
66
* @author RainLoop Team
7-
* @copyright 2014 RainLoop Team
7+
* @copyright 2015 RainLoop Team
88
*
99
* https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud
1010
*/
@@ -37,9 +37,11 @@
3737
}
3838
else
3939
{
40+
sleep(1);
4041
OC_JSON::error(array('Message' => 'Invalid argument(s)', 'Email' => $sEmail));
4142
return false;
4243
}
4344

45+
sleep(1);
4446
OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail));
4547
return true;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
if (@file_exists(__DIR__.'/app/index.php'))
4+
{
5+
include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php';
6+
7+
OC_RainLoop_Helper::regRainLoopDataFunction();
8+
9+
if (isset($_GET['OwnCloudAuth']))
10+
{
11+
$sEmail = '';
12+
$sEncodedPassword = '';
13+
14+
$sUser = OCP\User::getUser();
15+
16+
if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false))
17+
{
18+
$sEmail = $sUser;
19+
$sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-autologin-password', '');
20+
}
21+
else
22+
{
23+
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
24+
$sEncodedPassword = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
25+
}
26+
27+
$sDecodedPassword = OC_RainLoop_Helper::decodePassword($sEncodedPassword, md5($sEmail));
28+
29+
$_ENV['___rainloop_owncloud_email'] = $sEmail;
30+
$_ENV['___rainloop_owncloud_password'] = $sDecodedPassword;
31+
}
32+
33+
include __DIR__.'/app/index.php';
34+
}

build/owncloud/rainloop-app/appinfo/app.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ownCloud - RainLoop mail plugin
55
*
66
* @author RainLoop Team
7-
* @copyright 2014 RainLoop Team
7+
* @copyright 2015 RainLoop Team
88
*
99
* https://github.com/RainLoop/owncloud
1010
*/
@@ -17,22 +17,18 @@
1717
if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false))
1818
{
1919
OCP\Util::connectHook('OC_User', 'post_login', 'OC_RainLoop_Helper', 'login');
20-
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
2120
OCP\Util::connectHook('OC_User', 'post_setPassword', 'OC_RainLoop_Helper', 'changePassword');
2221
}
2322

24-
$sUrl = trim(OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
25-
$sPath = trim(OCP\Config::getAppValue('rainloop', 'rainloop-path', ''));
23+
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
24+
25+
OCP\Util::addScript('rainloop', 'rainloop');
26+
27+
OCP\App::addNavigationEntry(array(
28+
'id' => 'rainloop_index',
29+
'order' => 10,
30+
'href' => OCP\Util::linkToRoute('rainloop_index'),
31+
'icon' => OCP\Util::imagePath('rainloop', 'mail.png'),
32+
'name' => 'Email'
33+
));
2634

27-
if (('' !== $sUrl && '' !== $sPath) || OC_User::isAdminUser(OC_User::getUser()))
28-
{
29-
OCP\Util::addScript('rainloop', 'rainloop');
30-
31-
OCP\App::addNavigationEntry(array(
32-
'id' => 'rainloop_index',
33-
'order' => 10,
34-
'href' => OCP\Util::linkTo('rainloop', 'index.php'),
35-
'icon' => OCP\Util::imagePath('rainloop', 'mail.png'),
36-
'name' => 'Email'
37-
));
38-
}

build/owncloud/rainloop-app/appinfo/info.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
<info>
33
<id>rainloop</id>
44
<name>RainLoop</name>
5-
<description>RainLoop Webmail</description>
5+
<description>Simple, modern and fast web-based email client.</description>
66
<version>0.0</version>
77
<licence>CC BY-NC-SA 3.0</licence>
88
<author>RainLoop Team</author>
99
<require>6.0</require>
10+
<dependencies>
11+
<php min-version="5.3"/>
12+
</dependencies>
1013
</info>

0 commit comments

Comments
 (0)