diff --git a/.gitignore b/.gitignore index ae69a7e..14058d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ secrets.php proxy/file_cache +debug.log diff --git a/de.systopia.civiproxy/info.xml b/de.systopia.civiproxy/info.xml index 7ebe021..4fac229 100644 --- a/de.systopia.civiproxy/info.xml +++ b/de.systopia.civiproxy/info.xml @@ -2,19 +2,19 @@ civiproxy CiviProxy - FIXME - FIXME + This will enable CiviProxy support for mailings + B. Endres endres@systopia.de - 0.1 + 0.2 alpha 4.4 - This is a new, undeveloped module + This is an addition to SYSTOPIA's CiviProxy security system CRM/Civiproxy diff --git a/de.systopia.civiproxy/settings/civiproxy.setting.php b/de.systopia.civiproxy/settings/civiproxy.setting.php index 3d8470a..c4fa1c6 100644 --- a/de.systopia.civiproxy/settings/civiproxy.setting.php +++ b/de.systopia.civiproxy/settings/civiproxy.setting.php @@ -18,19 +18,6 @@ return array( 'description' => 'Enables or disables the proxy', 'help_text' => 'TODO', ), - 'image_cache_enabled' => array( - 'group_name' => 'CiviProxy Settings', - 'group' => 'de.systopia', - 'name' => 'image_cache_enabled', - 'type' => 'Integer', - 'html_type' => 'Select', - 'default' => 0, - 'add' => '4.3', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => 'Enables or disables image cache', - 'help_text' => 'TODO', - ), 'proxy_url' => array( 'group_name' => 'CiviProxy Settings', 'group' => 'de.systopia', diff --git a/de.systopia.civiproxy/templates/CRM/Admin/Form/Setting/ProxySettings.hlp b/de.systopia.civiproxy/templates/CRM/Admin/Form/Setting/ProxySettings.hlp index 1256a3a..6d3cb49 100644 --- a/de.systopia.civiproxy/templates/CRM/Admin/Form/Setting/ProxySettings.hlp +++ b/de.systopia.civiproxy/templates/CRM/Admin/Form/Setting/ProxySettings.hlp @@ -1,11 +1,12 @@ {htxt id='id-proxy-enabled'} -

{ts}TODO #1{/ts}

-{/htxt} - -{htxt id='id-image-cache-enabled'} -

{ts}TODO #2{/ts}

+

+ {ts}Enable CiviProxy{/ts} + {ts}This will cause all resource URLs (images, URL trackers, mail open tracers, etc.) to point to the proxy.{/ts} +

{/htxt} {htxt id='id-proxy-url'} -

{ts}TODO #3{/ts}

+

+ {ts}Enter your CiviProxy's URL here{/ts} +

{/htxt} diff --git a/proxy/TODO.txt b/proxy/TODO.txt index 4cbe755..1d794b2 100644 --- a/proxy/TODO.txt +++ b/proxy/TODO.txt @@ -1,4 +1,5 @@ TODO 1) sanitize string values (mysql_escape_string?) -2) restrictions for files? +2) better index page +3) error page diff --git a/proxy/config.php b/proxy/config.php index 4284560..2bb0d50 100644 --- a/proxy/config.php +++ b/proxy/config.php @@ -12,8 +12,8 @@ ** URLS ** ****************************************************************/ $target_civicrm = 'https://crmtest.muslimehelfen.org'; -//$proxy_base = 'https://ssl.webpack.de/wp11230065.server-he.de'; -$proxy_base = 'http://localhost:8888/proxy'; +$proxy_base = 'https://ssl.webpack.de/wp11230065.server-he.de'; +//$proxy_base = 'http://localhost:8888/proxy'; /**************************************************************** @@ -29,6 +29,8 @@ $target_open = $target_civicrm . '/sites/all/modules/civicrm/extern/open.php $target_file = $target_civicrm . '/sites/default/files/civicrm/persist/'; $target_mail = $target_civicrm . '/civicrm/mailing/view'; +// CAREFUL: only enable on debug systems. Will log all queries to given PUBLIC file +$debug = NULL; //'debug.log'; /**************************************************************** diff --git a/proxy/proxy.php b/proxy/proxy.php index 4461681..d5b23e4 100644 --- a/proxy/proxy.php +++ b/proxy/proxy.php @@ -123,6 +123,13 @@ function civiproxy_mend_URLs(&$string) { * @return TRUE if allowed, FALSE if not (or quits if $quit is set) */ function civiproxy_security_check($target, $quit=TRUE) { + global $debug; + if (!empty($debug)) { + $file = fopen($debug, 'a'); + fwrite($file, "REQUEST FROM " . $_SERVER['REMOTE_ADDR'] . " ON " . date('Y-m-d H:i:s') . ' -- ' . print_r($_REQUEST,1)); + fclose($file); + } + // TODO: implement return TRUE; }