summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-04-23 12:34:17 +0200
committerAndreas Gohr <andi@splitbrain.org>2012-04-23 12:34:17 +0200
commit3891d3ec0d32f09040f0c0a13889c01db23783ae (patch)
treee42d344cd92950e3d5ce0e63d8e1949fff93ff55
parentf77b4d4f96b5465f08cb42f7b536842e371d629e (diff)
parent22ef1e32c51ac82df8d6a03e1e95876100e8f6c1 (diff)
downloadrpg-3891d3ec0d32f09040f0c0a13889c01db23783ae.tar.gz
rpg-3891d3ec0d32f09040f0c0a13889c01db23783ae.tar.bz2
Merge branch 'master' into phpunit
* master: added option to disable reverse DNS lookups
-rw-r--r--conf/dokuwiki.php1
-rw-r--r--inc/common.php5
-rw-r--r--lib/plugins/config/lang/en/lang.php3
-rw-r--r--lib/plugins/config/settings/config.metadata.php1
4 files changed, 10 insertions, 0 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index 35f946b10..cbd42115d 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -158,6 +158,7 @@ $conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generat
$conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate.
/* Network Settings */
+$conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups
// Proxy setup - if your Server needs a proxy to access the web set these
$conf['proxy']['host'] = '';
$conf['proxy']['port'] = '';
diff --git a/inc/common.php b/inc/common.php
index 22a315901..6ea536c44 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -676,10 +676,15 @@ function clientismobile(){
/**
* Convert one or more comma separated IPs to hostnames
*
+ * If $conf['dnslookups'] is disabled it simply returns the input string
+ *
* @author Glen Harris <astfgl@iamnota.org>
* @returns a comma separated list of hostnames
*/
function gethostsbyaddrs($ips){
+ global $conf;
+ if(!$conf['dnslookups']) return $ips;
+
$hosts = array();
$ips = explode(',',$ips);
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index d588e02f8..83c843b3a 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -177,6 +177,9 @@ $lang['renderer_xhtml'] = 'Renderer to use for main (xhtml) wiki output';
$lang['renderer__core'] = '%s (dokuwiki core)';
$lang['renderer__plugin'] = '%s (plugin)';
+/* Network Options */
+$lang['dnslookups'] = 'DokuWiki will lookup hostnames for remote IP addresses of users editing pages. If you have a slow or non working DNS server or don\'t want this feature, disable this option';
+
/* Proxy Options */
$lang['proxy____host'] = 'Proxy servername';
$lang['proxy____port'] = 'Proxy port';
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 997495b2e..3607f56c6 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -207,6 +207,7 @@ $meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => ar
$meta['readdircache'] = array('numeric');
$meta['_network'] = array('fieldset');
+$meta['dnslookups'] = array('onoff');
$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
$meta['proxy____port'] = array('numericopt');
$meta['proxy____user'] = array('string');