started version 0.2, added logging
This commit is contained in:
parent
5af6e1df18
commit
1c6690351e
|
|
@ -1,2 +1,3 @@
|
|||
secrets.php
|
||||
proxy/file_cache
|
||||
debug.log
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
<extension key="de.systopia.civiproxy" type="module">
|
||||
<file>civiproxy</file>
|
||||
<name>CiviProxy</name>
|
||||
<description>FIXME</description>
|
||||
<license>FIXME</license>
|
||||
<description>This will enable CiviProxy support for mailings</description>
|
||||
<license></license>
|
||||
<maintainer>
|
||||
<author>B. Endres</author>
|
||||
<email>endres@systopia.de</email>
|
||||
</maintainer>
|
||||
<releaseDate></releaseDate>
|
||||
<version>0.1</version>
|
||||
<version>0.2</version>
|
||||
<develStage>alpha</develStage>
|
||||
<compatibility>
|
||||
<ver>4.4</ver>
|
||||
</compatibility>
|
||||
<comments>This is a new, undeveloped module</comments>
|
||||
<comments>This is an addition to SYSTOPIA's CiviProxy security system</comments>
|
||||
<civix>
|
||||
<namespace>CRM/Civiproxy</namespace>
|
||||
</civix>
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
{htxt id='id-proxy-enabled'}
|
||||
<p>{ts}TODO #1{/ts}</p>
|
||||
{/htxt}
|
||||
|
||||
{htxt id='id-image-cache-enabled'}
|
||||
<p>{ts}TODO #2{/ts}</p>
|
||||
<p>
|
||||
{ts}Enable CiviProxy{/ts}
|
||||
{ts}This will cause all resource URLs (images, URL trackers, mail open tracers, etc.) to point to the proxy.{/ts}
|
||||
</p>
|
||||
{/htxt}
|
||||
|
||||
{htxt id='id-proxy-url'}
|
||||
<p>{ts}TODO #3{/ts}</p>
|
||||
<p>
|
||||
{ts}Enter your CiviProxy's URL here{/ts}
|
||||
</p>
|
||||
{/htxt}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
TODO
|
||||
|
||||
1) sanitize string values (mysql_escape_string?)
|
||||
2) restrictions for files?
|
||||
2) better index page
|
||||
3) error page
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
||||
/****************************************************************
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue