summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rainloop-fwd.php107
1 files changed, 107 insertions, 0 deletions
diff --git a/rainloop-fwd.php b/rainloop-fwd.php
new file mode 100644
index 0000000..d742f44
--- /dev/null
+++ b/rainloop-fwd.php
@@ -0,0 +1,107 @@
+<?php
+# index.php
+ define('APP_VERSION', '1.12.1');
+ define('APP_VERSION_TYPE', 'community');
+ define('APP_INDEX_ROOT_FILE', __FILE__);
+ define('APP_INDEX_ROOT_PATH', str_replace('\\', '/', rtrim(dirname(__FILE__), '\\/').'/'));
+
+# rainloop/v/1.12.1/include.php
+ define('APP_VERSION_ROOT_PATH', APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/');
+ date_default_timezone_set('UTC');
+ define('APP_DEFAULT_PRIVATE_DATA_NAME', '_default_');
+ define('APP_DATA_FOLDER_PATH_UNIX', str_replace('\\', '/', APP_DATA_FOLDER_PATH));
+
+ $sPrivateDataFolderInternalName='...';
+ $sSalt = @file_get_contents(APP_DATA_FOLDER_PATH.'SALT.php');
+ $sData = file_exists(APP_DATA_FOLDER_PATH.'DATA.php') ? @file_get_contents(APP_DATA_FOLDER_PATH.'DATA.php') : '';
+ $sInstalled = @file_get_contents(APP_DATA_FOLDER_PATH.'INSTALLED');
+
+ define('APP_SALT', md5($sSalt.APP_PRIVATE_DATA_NAME.$sSalt));
+ define('APP_PRIVATE_DATA', APP_DATA_FOLDER_PATH.'_data_'.($sData ? md5($sData) : '').'/'.APP_PRIVATE_DATA_NAME.'/');
+ define('APP_PLUGINS_PATH', APP_PRIVATE_DATA.'plugins/');
+ unset($sSalt, $sData, $sInstalled, $sPrivateDataFolderInternalName);
+
+# rainloop/v/1.12.1/app/handle.php
+ #\define('RAINLOOP_APP_PATH', \rtrim(\realpath(__DIR__), '\\/').'/');
+ # include mis a plat donc chemin modifie
+ \define('RAINLOOP_APP_PATH', APP_VERSION_ROOT_PATH.'app/');
+ \define('RAINLOOP_APP_LIBRARIES_PATH', RAINLOOP_APP_PATH.'libraries/');
+ \define('RAINLOOP_MB_SUPPORTED', \function_exists('mb_strtoupper'));
+
+ \define('RAINLOOP_INCLUDE_AS_API_DEF', isset($_ENV['RAINLOOP_INCLUDE_AS_API']) && $_ENV['RAINLOOP_INCLUDE_AS_API']);
+ \define('RL_BACKWARD_CAPABILITY', true);
+ include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/Common/BackwardCapability/Account.php';
+
+
+ function rainLoopSplAutoloadNamespaces()
+ {
+ return RAINLOOP_INCLUDE_AS_API_DEF ? array('RainLoop', 'Predis') :
+ array('RainLoop', 'Facebook', 'PHPThumb', 'Predis', 'SabreForRainLoop', 'Imagine', 'Detection');
+ }
+
+ function rainLoopSplAutoloadRegisterFunction($sClassName)
+ {
+ if ($sClassName && '\\' === $sClassName[0])
+ {
+ $sClassName = \substr($sClassName, 1);
+ }
+
+ foreach (rainLoopSplAutoloadNamespaces() as $sNamespaceName)
+ {
+ if (0 === \strpos($sClassName, $sNamespaceName.'\\'))
+ {
+ $sPrefix = '';
+ if ('Detection' === $sNamespaceName)
+ {
+ $sPrefix = 'Mobile_Detect/namespaced/';
+ }
+
+ if ('SabreForRainLoop' === $sNamespaceName && !RAINLOOP_MB_SUPPORTED && !defined('RL_MB_FIXED'))
+ {
+ \define('RL_MB_FIXED', true);
+ include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/Common/MbStringFix.php';
+ }
+
+ error_log("include ".RAINLOOP_APP_LIBRARIES_PATH.$sPrefix.\strtr($sClassName, '\\', '/').'.php');
+ return include RAINLOOP_APP_LIBRARIES_PATH.$sPrefix.\strtr($sClassName, '\\', '/').'.php';
+ }
+ }
+
+ error_log("$sClassName not found");
+ return false;
+ }
+
+ \spl_autoload_register('rainLoopSplAutoloadRegisterFunction', false);
+ include APP_VERSION_ROOT_PATH.'app/libraries/MailSo/MailSo.php';
+ \define('APP_API_STARTED', true);
+
+# me and rainloop/v/1.12.1/app/libraries/RainLoop/Providers/Filters/SieveStorage.php
+include_once('SieveStorageNoPriv.php');
+class SieveDump extends RainLoop\Providers\Filters\SieveStorageNoPriv
+{
+ public function Dump($aFilters) {
+ $sUserFilter = $this->collectionToFileString($aFilters);
+ return $sUserFilter;
+ }
+}
+
+# rainloop/v/1.12.1/app/libraries/RainLoop/Api.php
+$oActions = \RainLoop\Actions::NewInstance();
+# me
+$oSieveDump = new SieveDump($oActions->Plugins(), $oActions->Config());
+
+# rainloop/v/1.12.1/app/libraries/RainLoop/Providers/Filters/Classes/Filter.php
+$oFilter = new RainLoop\Providers\Filters\Classes\Filter();
+
+# me
+$sMailFwdTo = filter_var($_GET['to'], FILTER_SANITIZE_EMAIL);
+$oFilter->FromJSON(array(
+ 'ID' => '1',
+ 'Name' => 'Renvoi',
+ 'ActionType' => \RainLoop\Providers\Filters\Enumerations\ActionType::FORWARD,
+ 'ActionValue' => $sMailFwdTo,
+ 'Keep' => 0,
+));
+
+header('Content-Type: text/plain');
+echo $oSieveDump->Dump(array($oFilter));