From 362a4f084345b496ab6b155db3ec50cad3939d0e Mon Sep 17 00:00:00 2001 From: Szymon Olewniczak Date: Tue, 10 Dec 2013 09:19:46 +0100 Subject: add TEMPLATE_SITETOOLS_DISPLAY and TEMPLATE_USERTOOLS_DISPLAY basing on Starter template --- inc/template.php | 19 +++++++++++++++++++ lib/tpl/dokuwiki/tpl_header.php | 19 ++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/inc/template.php b/inc/template.php index 60e178d1a..fb468d041 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1786,5 +1786,24 @@ function tpl_classes() { return join(' ', $classes); } +/** + * Create event for tools menues + * + * @author Anika Henke + */ +function tpl_toolsevent($toolsname, $items, $view='main') { + $data = array( + 'view' => $view, + 'items' => $items + ); + + $hook = 'TEMPLATE_'.strtoupper($toolsname).'_DISPLAY'; + $evt = new Doku_Event($hook, $data); + if($evt->advise_before()){ + foreach($evt->data['items'] as $k => $html) echo $html; + } + $evt->advise_after(); +} + //Setup VIM: ex: et ts=4 : diff --git a/lib/tpl/dokuwiki/tpl_header.php b/lib/tpl/dokuwiki/tpl_header.php index a2bfd4346..547dd1401 100644 --- a/lib/tpl/dokuwiki/tpl_header.php +++ b/lib/tpl/dokuwiki/tpl_header.php @@ -46,10 +46,13 @@ if (!defined('DOKU_INC')) die(); tpl_userinfo(); /* 'Logged in as ...' */ echo ''; } - tpl_action('admin', 1, 'li'); - tpl_action('profile', 1, 'li'); - tpl_action('register', 1, 'li'); - tpl_action('login', 1, 'li'); + + tpl_toolsevent('usertools', array( + 'admin' => tpl_action('admin', 1, 'li', 1), + 'profile' => tpl_action('profile', 1, 'li', 1), + 'register' => tpl_action('register', 1, 'li', 1), + 'login' => tpl_action('login', 1, 'li', 1), + )); ?> @@ -64,9 +67,11 @@ if (!defined('DOKU_INC')) die(); -- cgit v1.2.3 From 3940c519db432ec22e8c587504d86191631f9bfb Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 8 Jan 2014 11:56:06 +0100 Subject: use nav+ul element for "you are here" As described in the common idioms of the HTML5 spec, mark up navigation as a list inside a `nav` element for better semantics and accessibility. see: * http://www.w3.org/html/wg/drafts/html/master/common-idioms.html#rel-up * http://lists.w3.org/Archives/Public/public-html/2013Nov/thread.html#msg6 * https://dl.dropboxusercontent.com/u/377471/breadcrumb.html for discussion and background. --- inc/template.php | 41 ++++++++++++++++++++++++------------- lib/tpl/dokuwiki/css/mixins.less | 15 +++++++++++++- lib/tpl/dokuwiki/css/structure.less | 15 ++++++++++++++ 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/inc/template.php b/inc/template.php index 3bccb0bd8..1fad18271 100644 --- a/inc/template.php +++ b/inc/template.php @@ -893,12 +893,12 @@ function tpl_breadcrumbs($sep = '•') { * @author Nigel McNie * @author Sean Coates * @author - * @todo May behave strangely in RTL languages + * @author Mark C. Prins * * @param string $sep Separator between entries * @return bool */ -function tpl_youarehere($sep = ' » ') { +function tpl_youarehere($sep = ' → ') { global $conf; global $ID; global $lang; @@ -909,12 +909,15 @@ function tpl_youarehere($sep = ' » ') { $parts = explode(':', $ID); $count = count($parts); - echo ''.$lang['youarehere'].' '; - + echo ''; + return true; + } + $page = $part.$parts[$i]; - if($page == $conf['start']) return true; - echo $sep; - tpl_pagelink($page); + if($page == $conf['start']) { + echo ''; + return true; + } + + echo $sep.'
  • '.noNSorNS($page).'
  • '; return true; } diff --git a/lib/tpl/dokuwiki/css/mixins.less b/lib/tpl/dokuwiki/css/mixins.less index a88767e97..4b15bb600 100644 --- a/lib/tpl/dokuwiki/css/mixins.less +++ b/lib/tpl/dokuwiki/css/mixins.less @@ -7,4 +7,17 @@ background: -o-linear-gradient( @declaration); background: -ms-linear-gradient( @declaration); background: linear-gradient( @declaration); -} \ No newline at end of file +} + +/** + * provides inline list styling. + */ +.inline-list(){ + list-style-type: none; + + & li { + margin: 0; + padding: 0; + display: inline; + } +} diff --git a/lib/tpl/dokuwiki/css/structure.less b/lib/tpl/dokuwiki/css/structure.less index 3ea2f83eb..f7dea3948 100644 --- a/lib/tpl/dokuwiki/css/structure.less +++ b/lib/tpl/dokuwiki/css/structure.less @@ -87,3 +87,18 @@ body { #dokuwiki__footer { clear: both; } + +.dokuwiki .navlist { + display: inline; + padding: 0; + .inline-list; +} + +.bchead { + display: inline; + font-size: inherit; +} + +.curid { + font-weight: bold; +} -- cgit v1.2.3 From ea0c142784dedbbc3e93b84bea865a40ccb6dc94 Mon Sep 17 00:00:00 2001 From: Christoph Dwertmann Date: Thu, 5 Feb 2015 15:37:31 +1100 Subject: Add ob_flush() to sendGIF I'm running this dokuwiki docker container: https://registry.hub.docker.com/u/mprasil/dokuwiki/ It uses lighttpd and fastcgi. For some reason, the ignore_user_abort() feature where the browser should close the connection after the GIF has been received is not working on lighty. The browser keeps loading the page until the indexer run is complete, which leads to extremely slow load times with a larger page index. Adding ob_flush() to sendGIF fixes the issue. --- lib/exe/indexer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 330b8498d..2de178caa 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,6 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; + ob_flush(); flush(); // Browser should drop connection after this // Thinks it's got the whole image -- cgit v1.2.3 From eba389bb2fd1174360c5d255bbf53e1d40ab8712 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 9 Feb 2015 17:03:34 +0100 Subject: avoid messages pushing down page tools. fixes #1011 This moves the message area into content div. The pageid is now aligned by floating instead of absolute positioning. --- lib/tpl/dokuwiki/css/design.less | 16 +++++++++------- lib/tpl/dokuwiki/detail.php | 1 + lib/tpl/dokuwiki/main.php | 1 + lib/tpl/dokuwiki/tpl_header.php | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/tpl/dokuwiki/css/design.less b/lib/tpl/dokuwiki/css/design.less index 66607b5e9..3ded73581 100644 --- a/lib/tpl/dokuwiki/css/design.less +++ b/lib/tpl/dokuwiki/css/design.less @@ -11,7 +11,7 @@ ********************************************************************/ #dokuwiki__header { - padding: 2em 0 1.5em; + padding: 2em 0 0; .headings, .tools { @@ -349,11 +349,11 @@ form.search { ********************************************************************/ .dokuwiki .pageId { - position: absolute; - top: -2.3em; - right: -1em; + float: right; + margin-right: -1em; + margin-bottom: -1px; overflow: hidden; - padding: 1em 1em 0; + padding: 0.5em 1em 0; span { font-size: 0.875em; @@ -370,6 +370,7 @@ form.search { } .dokuwiki div.page { + clear: both; background: @ini_background; color: inherit; border: 1px solid @ini_background_alt; @@ -396,8 +397,9 @@ form.search { } [dir=rtl] .dokuwiki .pageId { - right: auto; - left: -1em; + float: left; + margin-left: -1em; + margin-right: 0; } /* footer diff --git a/lib/tpl/dokuwiki/detail.php b/lib/tpl/dokuwiki/detail.php index d4f9c39d1..b27567987 100644 --- a/lib/tpl/dokuwiki/detail.php +++ b/lib/tpl/dokuwiki/detail.php @@ -36,6 +36,7 @@ header('X-UA-Compatible: IE=edge,chrome=1');
    +
    diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php index 10c0bf91e..165230e8a 100644 --- a/lib/tpl/dokuwiki/main.php +++ b/lib/tpl/dokuwiki/main.php @@ -49,6 +49,7 @@ $showSidebar = $hasSidebar && ($ACT=='show');
    +
    diff --git a/lib/tpl/dokuwiki/tpl_header.php b/lib/tpl/dokuwiki/tpl_header.php index 7d9c88347..ee51cbd01 100644 --- a/lib/tpl/dokuwiki/tpl_header.php +++ b/lib/tpl/dokuwiki/tpl_header.php @@ -85,7 +85,7 @@ if (!defined('DOKU_INC')) die();
    - +
    -- cgit v1.2.3 From 25839a4134376bdcf24d224bea967ee79ec85a40 Mon Sep 17 00:00:00 2001 From: chang-zhao Date: Thu, 12 Feb 2015 15:09:51 +0300 Subject: Update wordblock.conf wordblock.conf too restrictive #1021 - removed fetish, bi...sex & gay...sex --- conf/wordblock.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/conf/wordblock.conf b/conf/wordblock.conf index fc939a4d4..f877f26d7 100644 --- a/conf/wordblock.conf +++ b/conf/wordblock.conf @@ -2,14 +2,11 @@ # patches welcome # https?:\/\/(\S*?)(-side-effects|top|pharm|pill|discount|discount-|deal|price|order|now|best|cheap|cheap-|online|buy|buy-|sale|sell)(\S*?)(cialis|viagra|prazolam|xanax|zanax|soma|vicodin|zenical|xenical|meridia|paxil|prozac|claritin|allegra|lexapro|wellbutrin|zoloft|retin|valium|levitra|phentermine) -gay\s*sex -bi\s*sex incest zoosex gang\s*bang facials ladyboy -fetish \btits\b \brape\b bolea\.com -- cgit v1.2.3 From fb45dc56a0cf91f2a0d7126e846580666a6755b7 Mon Sep 17 00:00:00 2001 From: Tim222 Date: Thu, 12 Feb 2015 13:56:22 +0100 Subject: Update interwiki.conf Support for the URI scheme tel: #643 --- conf/interwiki.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/interwiki.conf b/conf/interwiki.conf index d961912e5..4857e27f3 100644 --- a/conf/interwiki.conf +++ b/conf/interwiki.conf @@ -32,6 +32,6 @@ google.de http://www.google.de/search?q= go http://www.google.com/search?q={URL}&btnI=lucky user :user:{NAME} -# To support VoIP/SIP links +# To support VoIP/SIP/TEL links callto callto://{NAME} - +tel tel:{NAME} -- cgit v1.2.3 From 2a3c155cbaa1367e7dfaa067621e9535cb2ad880 Mon Sep 17 00:00:00 2001 From: Tim222 Date: Thu, 12 Feb 2015 14:15:57 +0100 Subject: Added icon for interwiki.conf Support for the URI scheme tel: #643 --- lib/images/interwiki/tel.gif | Bin 0 -> 177 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/images/interwiki/tel.gif diff --git a/lib/images/interwiki/tel.gif b/lib/images/interwiki/tel.gif new file mode 100644 index 000000000..60158c565 Binary files /dev/null and b/lib/images/interwiki/tel.gif differ -- cgit v1.2.3 From 8b7f89f548e7fdb4a84eb98f638fe5f49529d829 Mon Sep 17 00:00:00 2001 From: chang-zhao Date: Thu, 12 Feb 2015 19:51:22 +0300 Subject: Update wordblock.conf --- conf/wordblock.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/wordblock.conf b/conf/wordblock.conf index f877f26d7..f2ff15942 100644 --- a/conf/wordblock.conf +++ b/conf/wordblock.conf @@ -2,13 +2,12 @@ # patches welcome # https?:\/\/(\S*?)(-side-effects|top|pharm|pill|discount|discount-|deal|price|order|now|best|cheap|cheap-|online|buy|buy-|sale|sell)(\S*?)(cialis|viagra|prazolam|xanax|zanax|soma|vicodin|zenical|xenical|meridia|paxil|prozac|claritin|allegra|lexapro|wellbutrin|zoloft|retin|valium|levitra|phentermine) -incest +https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|\brape\b) zoosex gang\s*bang facials ladyboy \btits\b -\brape\b bolea\.com 52crystal baida\.org -- cgit v1.2.3 From c9f9ddf9a8e1f6113df3844ed45bb1f6d9012f4f Mon Sep 17 00:00:00 2001 From: chang-zhao Date: Fri, 13 Feb 2015 12:56:51 +0300 Subject: Update wordblock.conf moved those keywords to http & added penis --- conf/wordblock.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/wordblock.conf b/conf/wordblock.conf index f2ff15942..3040fa08f 100644 --- a/conf/wordblock.conf +++ b/conf/wordblock.conf @@ -2,7 +2,7 @@ # patches welcome # https?:\/\/(\S*?)(-side-effects|top|pharm|pill|discount|discount-|deal|price|order|now|best|cheap|cheap-|online|buy|buy-|sale|sell)(\S*?)(cialis|viagra|prazolam|xanax|zanax|soma|vicodin|zenical|xenical|meridia|paxil|prozac|claritin|allegra|lexapro|wellbutrin|zoloft|retin|valium|levitra|phentermine) -https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|\brape\b) +https?:\/\/(\S*?)(bi\s*sex|gay\s*sex|fetish|incest|penis|\brape\b) zoosex gang\s*bang facials -- cgit v1.2.3 From c2a2396e45a7ec8a14d573c89719463e765b1074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Iradier?= Date: Fri, 13 Feb 2015 16:01:39 +0100 Subject: translation update --- inc/lang/es/lang.php | 4 +++- lib/plugins/extension/lang/es/lang.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/lang/es/lang.php b/inc/lang/es/lang.php index 8f4cb2977..865110ab9 100644 --- a/inc/lang/es/lang.php +++ b/inc/lang/es/lang.php @@ -37,6 +37,7 @@ * @author Antonio Castilla * @author Jonathan Hernández * @author pokesakura + * @author Álvaro Iradier */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -98,7 +99,7 @@ $lang['badpassconfirm'] = 'Lo siento, la contraseña es errónea'; $lang['minoredit'] = 'Cambios menores'; $lang['draftdate'] = 'Borrador guardado automáticamente:'; $lang['nosecedit'] = 'La página ha cambiado en el lapso, la información de sección estaba anticuada, en su lugar se cargó la página completa.'; -$lang['searchcreatepage'] = "Si no has encontrado lo que buscabas, puedes crear una nueva página con tu consulta utilizando el botón ''Crea esta página''."; +$lang['searchcreatepage'] = 'Si no has encontrado lo que buscabas, puedes crear una nueva página con tu consulta utilizando el botón \'\'Crea esta página\'\'.'; $lang['regmissing'] = 'Lo siento, tienes que completar todos los campos.'; $lang['reguexists'] = 'Lo siento, ya existe un usuario con este nombre.'; $lang['regsuccess'] = 'El usuario ha sido creado y la contraseña se ha enviado por correo.'; @@ -369,3 +370,4 @@ $lang['currentns'] = 'Espacio de nombres actual'; $lang['searchresult'] = 'Resultado de la búsqueda'; $lang['plainhtml'] = 'HTML sencillo'; $lang['wikimarkup'] = 'Etiquetado Wiki'; +$lang['page_nonexist_rev'] = 'La página no existía en %s. Por tanto fue creada en %s.'; diff --git a/lib/plugins/extension/lang/es/lang.php b/lib/plugins/extension/lang/es/lang.php index 63742c3b3..a835cb630 100644 --- a/lib/plugins/extension/lang/es/lang.php +++ b/lib/plugins/extension/lang/es/lang.php @@ -6,6 +6,7 @@ * @author Antonio Bueno * @author Antonio Castilla * @author Jonathan Hernández + * @author Álvaro Iradier */ $lang['menu'] = 'Administrador de Extensiones '; $lang['tab_plugins'] = 'Plugins instalados'; @@ -64,6 +65,7 @@ $lang['status_bundled'] = 'agrupado'; $lang['msg_enabled'] = 'Plugin %s activado'; $lang['msg_disabled'] = 'Plugin %s desactivado'; $lang['msg_delete_success'] = 'Extensión desinstalada'; +$lang['msg_delete_failed'] = 'La desinstalación de la extensión %s ha fallado'; $lang['msg_template_install_success'] = 'Plantilla %s instalada con éxito'; $lang['msg_template_update_success'] = 'Plantilla %s actualizada con éxito'; $lang['msg_plugin_install_success'] = 'Plugin %s instalado con éxito'; @@ -78,6 +80,9 @@ $lang['url_change'] = 'URL actualizada: El Download $lang['error_badurl'] = 'URLs deberían empezar con http o https'; $lang['error_dircreate'] = 'No es posible de crear un directorio temporero para poder recibir el download'; $lang['error_download'] = 'No es posible descargar el documento: %s'; +$lang['error_decompress'] = 'No se pudo descomprimir el fichero descargado. Puede ser a causa de una descarga incorrecta, en cuyo caso puedes intentarlo de nuevo; o puede que el formato de compresión sea desconocido, en cuyo caso necesitarás descargar e instalar manualmente.'; +$lang['noperms'] = 'El directorio de extensiones no tiene permiso de escritura.'; +$lang['notplperms'] = 'El directorio de plantillas no tiene permiso de escritura.'; $lang['git'] = 'Esta extensión fue instalada a través de git, quizás usted no quiera actualizarla aquí mismo.'; $lang['install_url'] = 'Instalar desde URL:'; $lang['install_upload'] = 'Subir Extensión:'; -- cgit v1.2.3 From 001ea14e1ab1f02f7715f2baba75ab563da5236e Mon Sep 17 00:00:00 2001 From: Rainbow Spike Date: Mon, 16 Feb 2015 21:41:15 +1000 Subject: Update template.php Added placeholder in search textarea --- inc/template.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/template.php b/inc/template.php index ec8de44f3..a4ace1a63 100644 --- a/inc/template.php +++ b/inc/template.php @@ -840,6 +840,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) { print ''; print ''; print ''; -- cgit v1.2.3 From d6dc28be40fb3202a3df69458db164e20999ac2b Mon Sep 17 00:00:00 2001 From: ghi Date: Tue, 17 Feb 2015 11:07:57 +0100 Subject: Revert "add TEMPLATE_SITETOOLS_DISPLAY and TEMPLATE_USERTOOLS_DISPLAY basing on Starter template" This reverts commit 362a4f084345b496ab6b155db3ec50cad3939d0e. --- inc/template.php | 19 ------------------- lib/tpl/dokuwiki/tpl_header.php | 19 +++++++------------ 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/inc/template.php b/inc/template.php index fb468d041..60e178d1a 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1786,24 +1786,5 @@ function tpl_classes() { return join(' ', $classes); } -/** - * Create event for tools menues - * - * @author Anika Henke - */ -function tpl_toolsevent($toolsname, $items, $view='main') { - $data = array( - 'view' => $view, - 'items' => $items - ); - - $hook = 'TEMPLATE_'.strtoupper($toolsname).'_DISPLAY'; - $evt = new Doku_Event($hook, $data); - if($evt->advise_before()){ - foreach($evt->data['items'] as $k => $html) echo $html; - } - $evt->advise_after(); -} - //Setup VIM: ex: et ts=4 : diff --git a/lib/tpl/dokuwiki/tpl_header.php b/lib/tpl/dokuwiki/tpl_header.php index 547dd1401..a2bfd4346 100644 --- a/lib/tpl/dokuwiki/tpl_header.php +++ b/lib/tpl/dokuwiki/tpl_header.php @@ -46,13 +46,10 @@ if (!defined('DOKU_INC')) die(); tpl_userinfo(); /* 'Logged in as ...' */ echo ''; } - - tpl_toolsevent('usertools', array( - 'admin' => tpl_action('admin', 1, 'li', 1), - 'profile' => tpl_action('profile', 1, 'li', 1), - 'register' => tpl_action('register', 1, 'li', 1), - 'login' => tpl_action('login', 1, 'li', 1), - )); + tpl_action('admin', 1, 'li'); + tpl_action('profile', 1, 'li'); + tpl_action('register', 1, 'li'); + tpl_action('login', 1, 'li'); ?>
    @@ -67,11 +64,9 @@ if (!defined('DOKU_INC')) die();
      tpl_action('recent', 1, 'li', 1), - 'media' => tpl_action('media', 1, 'li', 1), - 'index' => tpl_action('index', 1, 'li', 1), - )); + tpl_action('recent', 1, 'li'); + tpl_action('media', 1, 'li'); + tpl_action('index', 1, 'li'); ?>
    -- cgit v1.2.3 From 0747f5d729d43516c67c5240a662a68dfb446437 Mon Sep 17 00:00:00 2001 From: ghi Date: Tue, 17 Feb 2015 11:38:10 +0100 Subject: event HTML_SHOWREV_OUTPUT --- inc/html.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/inc/html.php b/inc/html.php index 3a93a6604..c87d0ea87 100644 --- a/inc/html.php +++ b/inc/html.php @@ -232,6 +232,14 @@ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false return $ret; } +/** + * show a revision warning + * + * @author Szymon Olewniczak + */ +function html_showrev($data) { + print p_locale_xhtml($data); +} /** * Show a wiki page @@ -265,7 +273,10 @@ function html_show($txt=null){ echo ''; }else{ - if ($REV||$DATE_AT) print p_locale_xhtml('showrev'); + if ($REV||$DATE_AT){ + $data = 'showrev'; + trigger_event('HTML_SHOWREV_OUTPUT', $data, 'html_showrev'); + } $html = p_wiki_xhtml($ID,$REV,true,$DATE_AT); $html = html_secedit($html,$secedit); if($INFO['prependTOC']) $html = tpl_toc(true).$html; -- cgit v1.2.3 From a500e62c4c074fa156db9a5096adee2133176543 Mon Sep 17 00:00:00 2001 From: SC Yoo Date: Tue, 17 Feb 2015 23:02:15 +0900 Subject: Normalization is required to manage multibyte characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OSX uses Unicode-NFD so normalization is required to manage multibyte characters. ( http://unicode.org/reports/tr15/ ) If don't do that, DokuWiki can't find the file uploaded from OS X with multibyte filename like '도쿠위키.jpg' --- inc/utf8.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/inc/utf8.php b/inc/utf8.php index f86217686..c6a189490 100644 --- a/inc/utf8.php +++ b/inc/utf8.php @@ -356,7 +356,7 @@ if(!function_exists('utf8_strtolower')){ * @return string */ function utf8_strtolower($string){ - if(UTF8_MBSTRING) return mb_strtolower($string,'utf-8'); + if(UTF8_MBSTRING) return normalizer::normalize(mb_strtolower($string,'utf-8')); global $UTF8_UPPER_TO_LOWER; return strtr($string,$UTF8_UPPER_TO_LOWER); @@ -1066,11 +1066,11 @@ if(!UTF8_MBSTRING){ "z"=>"Z","y"=>"Y","x"=>"X","w"=>"W","v"=>"V","u"=>"U","t"=>"T","s"=>"S","r"=>"R","q"=>"Q", "p"=>"P","o"=>"O","n"=>"N","m"=>"M","l"=>"L","k"=>"K","j"=>"J","i"=>"I","h"=>"H","g"=>"G", "f"=>"F","e"=>"E","d"=>"D","c"=>"C","b"=>"B","a"=>"A","ῳ"=>"ῼ","ῥ"=>"Ῥ","ῡ"=>"Ῡ","ῑ"=>"Ῑ", - "ῐ"=>"Ῐ","ῃ"=>"ῌ","ι"=>"Ι","ᾳ"=>"ᾼ","ᾱ"=>"Ᾱ","ᾰ"=>"Ᾰ","ᾧ"=>"ᾯ","ᾦ"=>"ᾮ","ᾥ"=>"ᾭ","ᾤ"=>"ᾬ", + "ῐ"=>"Ῐ","ῃ"=>"ῌ","ι"=>"Ι","ᾳ"=>"ᾼ","ᾱ"=>"Ᾱ","ᾰ"=>"Ᾰ","ᾧ"=>"ᾯ","ᾦ"=>"ᾮ","ᾥ"=>"ᾭ","ᾤ"=>"ᾬ", "ᾣ"=>"ᾫ","ᾢ"=>"ᾪ","ᾡ"=>"ᾩ","ᾗ"=>"ᾟ","ᾖ"=>"ᾞ","ᾕ"=>"ᾝ","ᾔ"=>"ᾜ","ᾓ"=>"ᾛ","ᾒ"=>"ᾚ","ᾑ"=>"ᾙ", - "ᾐ"=>"ᾘ","ᾇ"=>"ᾏ","ᾆ"=>"ᾎ","ᾅ"=>"ᾍ","ᾄ"=>"ᾌ","ᾃ"=>"ᾋ","ᾂ"=>"ᾊ","ᾁ"=>"ᾉ","ᾀ"=>"ᾈ","ώ"=>"Ώ", - "ὼ"=>"Ὼ","ύ"=>"Ύ","ὺ"=>"Ὺ","ό"=>"Ό","ὸ"=>"Ὸ","ί"=>"Ί","ὶ"=>"Ὶ","ή"=>"Ή","ὴ"=>"Ὴ","έ"=>"Έ", - "ὲ"=>"Ὲ","ά"=>"Ά","ὰ"=>"Ὰ","ὧ"=>"Ὧ","ὦ"=>"Ὦ","ὥ"=>"Ὥ","ὤ"=>"Ὤ","ὣ"=>"Ὣ","ὢ"=>"Ὢ","ὡ"=>"Ὡ", + "ᾐ"=>"ᾘ","ᾇ"=>"ᾏ","ᾆ"=>"ᾎ","ᾅ"=>"ᾍ","ᾄ"=>"ᾌ","ᾃ"=>"ᾋ","ᾂ"=>"ᾊ","ᾁ"=>"ᾉ","ᾀ"=>"ᾈ","ώ"=>"Ώ", + "ὼ"=>"Ὼ","ύ"=>"Ύ","ὺ"=>"Ὺ","ό"=>"Ό","ὸ"=>"Ὸ","ί"=>"Ί","ὶ"=>"Ὶ","ή"=>"Ή","ὴ"=>"Ὴ","έ"=>"Έ", + "ὲ"=>"Ὲ","ά"=>"Ά","ὰ"=>"Ὰ","ὧ"=>"Ὧ","ὦ"=>"Ὦ","ὥ"=>"Ὥ","ὤ"=>"Ὤ","ὣ"=>"Ὣ","ὢ"=>"Ὢ","ὡ"=>"Ὡ", "ὗ"=>"Ὗ","ὕ"=>"Ὕ","ὓ"=>"Ὓ","ὑ"=>"Ὑ","ὅ"=>"Ὅ","ὄ"=>"Ὄ","ὃ"=>"Ὃ","ὂ"=>"Ὂ","ὁ"=>"Ὁ","ὀ"=>"Ὀ", "ἷ"=>"Ἷ","ἶ"=>"Ἶ","ἵ"=>"Ἵ","ἴ"=>"Ἴ","ἳ"=>"Ἳ","ἲ"=>"Ἲ","ἱ"=>"Ἱ","ἰ"=>"Ἰ","ἧ"=>"Ἧ","ἦ"=>"Ἦ", "ἥ"=>"Ἥ","ἤ"=>"Ἤ","ἣ"=>"Ἣ","ἢ"=>"Ἢ","ἡ"=>"Ἡ","ἕ"=>"Ἕ","ἔ"=>"Ἔ","ἓ"=>"Ἓ","ἒ"=>"Ἒ","ἑ"=>"Ἑ", @@ -1145,11 +1145,11 @@ if(!UTF8_MBSTRING){ "Z"=>"z","Y"=>"y","X"=>"x","W"=>"w","V"=>"v","U"=>"u","T"=>"t","S"=>"s","R"=>"r","Q"=>"q", "P"=>"p","O"=>"o","N"=>"n","M"=>"m","L"=>"l","K"=>"k","J"=>"j","I"=>"i","H"=>"h","G"=>"g", "F"=>"f","E"=>"e","D"=>"d","C"=>"c","B"=>"b","A"=>"a","ῼ"=>"ῳ","Ῥ"=>"ῥ","Ῡ"=>"ῡ","Ῑ"=>"ῑ", - "Ῐ"=>"ῐ","ῌ"=>"ῃ","Ι"=>"ι","ᾼ"=>"ᾳ","Ᾱ"=>"ᾱ","Ᾰ"=>"ᾰ","ᾯ"=>"ᾧ","ᾮ"=>"ᾦ","ᾭ"=>"ᾥ","ᾬ"=>"ᾤ", + "Ῐ"=>"ῐ","ῌ"=>"ῃ","Ι"=>"ι","ᾼ"=>"ᾳ","Ᾱ"=>"ᾱ","Ᾰ"=>"ᾰ","ᾯ"=>"ᾧ","ᾮ"=>"ᾦ","ᾭ"=>"ᾥ","ᾬ"=>"ᾤ", "ᾫ"=>"ᾣ","ᾪ"=>"ᾢ","ᾩ"=>"ᾡ","ᾟ"=>"ᾗ","ᾞ"=>"ᾖ","ᾝ"=>"ᾕ","ᾜ"=>"ᾔ","ᾛ"=>"ᾓ","ᾚ"=>"ᾒ","ᾙ"=>"ᾑ", - "ᾘ"=>"ᾐ","ᾏ"=>"ᾇ","ᾎ"=>"ᾆ","ᾍ"=>"ᾅ","ᾌ"=>"ᾄ","ᾋ"=>"ᾃ","ᾊ"=>"ᾂ","ᾉ"=>"ᾁ","ᾈ"=>"ᾀ","Ώ"=>"ώ", - "Ὼ"=>"ὼ","Ύ"=>"ύ","Ὺ"=>"ὺ","Ό"=>"ό","Ὸ"=>"ὸ","Ί"=>"ί","Ὶ"=>"ὶ","Ή"=>"ή","Ὴ"=>"ὴ","Έ"=>"έ", - "Ὲ"=>"ὲ","Ά"=>"ά","Ὰ"=>"ὰ","Ὧ"=>"ὧ","Ὦ"=>"ὦ","Ὥ"=>"ὥ","Ὤ"=>"ὤ","Ὣ"=>"ὣ","Ὢ"=>"ὢ","Ὡ"=>"ὡ", + "ᾘ"=>"ᾐ","ᾏ"=>"ᾇ","ᾎ"=>"ᾆ","ᾍ"=>"ᾅ","ᾌ"=>"ᾄ","ᾋ"=>"ᾃ","ᾊ"=>"ᾂ","ᾉ"=>"ᾁ","ᾈ"=>"ᾀ","Ώ"=>"ώ", + "Ὼ"=>"ὼ","Ύ"=>"ύ","Ὺ"=>"ὺ","Ό"=>"ό","Ὸ"=>"ὸ","Ί"=>"ί","Ὶ"=>"ὶ","Ή"=>"ή","Ὴ"=>"ὴ","Έ"=>"έ", + "Ὲ"=>"ὲ","Ά"=>"ά","Ὰ"=>"ὰ","Ὧ"=>"ὧ","Ὦ"=>"ὦ","Ὥ"=>"ὥ","Ὤ"=>"ὤ","Ὣ"=>"ὣ","Ὢ"=>"ὢ","Ὡ"=>"ὡ", "Ὗ"=>"ὗ","Ὕ"=>"ὕ","Ὓ"=>"ὓ","Ὑ"=>"ὑ","Ὅ"=>"ὅ","Ὄ"=>"ὄ","Ὃ"=>"ὃ","Ὂ"=>"ὂ","Ὁ"=>"ὁ","Ὀ"=>"ὀ", "Ἷ"=>"ἷ","Ἶ"=>"ἶ","Ἵ"=>"ἵ","Ἴ"=>"ἴ","Ἳ"=>"ἳ","Ἲ"=>"ἲ","Ἱ"=>"ἱ","Ἰ"=>"ἰ","Ἧ"=>"ἧ","Ἦ"=>"ἦ", "Ἥ"=>"ἥ","Ἤ"=>"ἤ","Ἣ"=>"ἣ","Ἢ"=>"ἢ","Ἡ"=>"ἡ","Ἕ"=>"ἕ","Ἔ"=>"ἔ","Ἓ"=>"ἓ","Ἒ"=>"ἒ","Ἑ"=>"ἑ", @@ -1355,11 +1355,11 @@ global $UTF8_SPECIAL_CHARS2; if(empty($UTF8_SPECIAL_CHARS2)) $UTF8_SPECIAL_CHARS2 = "\x1A".' !"#$%&\'()+,/;<=>?@[\]^`{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•�'. '�—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½�'. - '�¿×÷ˇ˘˙˚˛˜˝̣̀́̃̉΄΅·ϖְֱֲֳִֵֶַָֹֻּֽ־ֿ�'. + '�¿×÷ˇ˘˙˚˛˜˝̣̀́̃̉΄΅·ϖְֱֲֳִֵֶַָֹֻּֽ־ֿ�'. '�ׁׂ׃׳״،؛؟ـًٌٍَُِّْ٪฿‌‍‎‏–—―‗‘’‚“”�'. - '��†‡•…‰′″‹›⁄₧₪₫€№℘™Ωℵ←↑→↓↔↕↵'. + '��†‡•…‰′″‹›⁄₧₪₫€№℘™Ωℵ←↑→↓↔↕↵'. '⇐⇑⇒⇓⇔∀∂∃∅∆∇∈∉∋∏∑−∕∗∙√∝∞∠∧∨�'. - '�∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌐⌠⌡〈〉⑩─�'. + '�∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌐⌠⌡〈〉⑩─�'. '��┌┐└┘├┤┬┴┼═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠'. '╡╢╣╤╥╦╧╨╩╪╫╬▀▄█▌▐░▒▓■▲▼◆◊●�'. '�★☎☛☞♠♣♥♦✁✂✃✄✆✇✈✉✌✍✎✏✐✑✒✓✔✕�'. -- cgit v1.2.3 From c8556525035212e8abf05907e8cfdf290bb6dcd6 Mon Sep 17 00:00:00 2001 From: ghi Date: Wed, 18 Feb 2015 10:47:05 +0100 Subject: passing rev and date_at to the event --- inc/html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/html.php b/inc/html.php index c87d0ea87..4bf784502 100644 --- a/inc/html.php +++ b/inc/html.php @@ -237,8 +237,8 @@ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false * * @author Szymon Olewniczak */ -function html_showrev($data) { - print p_locale_xhtml($data); +function html_showrev() { + print p_locale_xhtml('showrev'); } /** @@ -274,7 +274,7 @@ function html_show($txt=null){ }else{ if ($REV||$DATE_AT){ - $data = 'showrev'; + $data = array('rev' => &$REV, 'date_at' => &$DATE_AT); trigger_event('HTML_SHOWREV_OUTPUT', $data, 'html_showrev'); } $html = p_wiki_xhtml($ID,$REV,true,$DATE_AT); -- cgit v1.2.3 From 5a93f8690b91ddfa9a37a081f72d245833b4aefa Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 19 Feb 2015 20:10:45 +0000 Subject: add missing tabletbody_open|close() to renderer --- inc/parser/renderer.php | 12 ++++++++++++ inc/parser/xhtml.php | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index e1d28267a..35bdd0e3f 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -707,6 +707,18 @@ class Doku_Renderer extends DokuWiki_Plugin { function tablethead_close() { } + /** + * Open a table body + */ + function tabletbody_open() { + } + + /** + * Close a table body + */ + function tabletbody_close() { + } + /** * Open a table row */ diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index c68d206be..d1bf91a02 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -1289,6 +1289,20 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->doc .= DOKU_TAB.''.DOKU_LF; } + /** + * Open a table body + */ + function tabletbody_open() { + $this->doc .= DOKU_TAB.''.DOKU_LF; + } + + /** + * Close a table body + */ + function tabletbody_close() { + $this->doc .= DOKU_TAB.''.DOKU_LF; + } + /** * Open a table row */ @@ -1753,7 +1767,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $out .= ''.NL; return $out; } - + /** * _getLastMediaRevisionAt is a helperfunction to internalmedia() and _media() * which returns an existing media revision less or equal to rev or date_at -- cgit v1.2.3 From 8a8104b258a296c2710caf2911b87403c9ef3d97 Mon Sep 17 00:00:00 2001 From: SC Yoo Date: Fri, 20 Feb 2015 12:14:07 +0900 Subject: Added class-exitsts --- inc/utf8.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/utf8.php b/inc/utf8.php index c6a189490..2b6a0c498 100644 --- a/inc/utf8.php +++ b/inc/utf8.php @@ -356,8 +356,12 @@ if(!function_exists('utf8_strtolower')){ * @return string */ function utf8_strtolower($string){ - if(UTF8_MBSTRING) return normalizer::normalize(mb_strtolower($string,'utf-8')); - + if(UTF8_MBSTRING) { + if (class_exists("Normalizer", $autoload = false)) + return normalizer::normalize(mb_strtolower($string,'utf-8')); + else + return (mb_strtolower($string,'utf-8')); + } global $UTF8_UPPER_TO_LOWER; return strtr($string,$UTF8_UPPER_TO_LOWER); } -- cgit v1.2.3 From 15a61525c6586054213c7f64cc6e686d7dc8eed0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 24 Feb 2015 09:48:55 +0100 Subject: add bottom margin to tables in print. fixes #1052 --- lib/tpl/dokuwiki/css/print.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tpl/dokuwiki/css/print.css b/lib/tpl/dokuwiki/css/print.css index 86e686b69..7197ac1c1 100644 --- a/lib/tpl/dokuwiki/css/print.css +++ b/lib/tpl/dokuwiki/css/print.css @@ -111,6 +111,9 @@ blockquote { } /* tables */ +.dokuwiki div.table { + margin-bottom: 1.4em; +} table { border-collapse: collapse; empty-cells: show; -- cgit v1.2.3 From 30c466355a6686ac20edc1f23d87a3a8c8ec6081 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 24 Feb 2015 09:57:10 +0100 Subject: fixed the margin for the sidebar --- lib/tpl/dokuwiki/css/design.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tpl/dokuwiki/css/design.less b/lib/tpl/dokuwiki/css/design.less index 3ded73581..548ba7228 100644 --- a/lib/tpl/dokuwiki/css/design.less +++ b/lib/tpl/dokuwiki/css/design.less @@ -11,7 +11,7 @@ ********************************************************************/ #dokuwiki__header { - padding: 2em 0 0; + padding: 2em 0 1.5em; .headings, .tools { @@ -352,6 +352,7 @@ form.search { float: right; margin-right: -1em; margin-bottom: -1px; + margin-top: -1.5em; overflow: hidden; padding: 0.5em 1em 0; -- cgit v1.2.3 From 757f6ddab0add1026d4b4afb980fbd244df05f02 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 24 Feb 2015 11:51:36 +0100 Subject: simple fix for pageID clash with sidebar in mobile view Since the pageid is no longer positioned absolute it clashed with the sidebar since #1027. this introduces a very simplisitc fix. --- lib/tpl/dokuwiki/css/mobile.less | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tpl/dokuwiki/css/mobile.less b/lib/tpl/dokuwiki/css/mobile.less index c3e517795..ac7c46456 100644 --- a/lib/tpl/dokuwiki/css/mobile.less +++ b/lib/tpl/dokuwiki/css/mobile.less @@ -23,6 +23,7 @@ #dokuwiki__aside { width: 100%; float: none; + margin-bottom: 1.5em; } #dokuwiki__aside > .pad, -- cgit v1.2.3 From 9cbf80e627322dee19852b953ef242b4e0ad514a Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 24 Feb 2015 19:45:03 +0100 Subject: check permissions in ACL plugin's RPC API component. #1056 Security Fix Severity: Medium Type: Remote Priviledge Escalation Remote: yes Vulnerability Details: This fixes a security hole in the ACL plugins remote API component. The plugin failed to check for superuser permissions before executing ACL addition or deletion. This means everybody with permissions to call the XMLRPC API also had permissions to set up their own ACL rules and thus circumventing any existing rules. Risk Assessment: The XMLRPC API in DokuWiki is marked experimental and off by default. It also implements an additional safeguard by giving access to a configured circle of users and groups only. So only a minor number of DokuWiki installations will be affected at all. For affected installations the risk is high if users with access to the API are not to be trusted. Thus the overall severity of medium. Resolution: Installations applying this commit are safe. A hotfix is about to be released. Meanwhile users are advised to disable the XMLRPC API in the config manager. --- lib/plugins/acl/remote.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/plugins/acl/remote.php b/lib/plugins/acl/remote.php index b10c544ee..42449428f 100644 --- a/lib/plugins/acl/remote.php +++ b/lib/plugins/acl/remote.php @@ -32,9 +32,14 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin { * @param string $scope * @param string $user * @param int $level see also inc/auth.php + * @throws RemoteAccessDeniedException * @return bool */ public function addAcl($scope, $user, $level){ + if(!auth_isadmin()) { + throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114); + } + /** @var admin_plugin_acl $apa */ $apa = plugin_load('admin', 'acl'); return $apa->_acl_add($scope, $user, $level); @@ -45,9 +50,14 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin { * * @param string $scope * @param string $user + * @throws RemoteAccessDeniedException * @return bool */ public function delAcl($scope, $user){ + if(!auth_isadmin()) { + throw new RemoteAccessDeniedException('You are not allowed to access ACLs, superuser permission is required', 114); + } + /** @var admin_plugin_acl $apa */ $apa = plugin_load('admin', 'acl'); return $apa->_acl_del($scope, $user); -- cgit v1.2.3 From 6401de3d8cba9f2c76724a2c2c68c7d3fc97d2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schplurtz=20le=20D=C3=A9boulonn=C3=A9?= Date: Tue, 24 Feb 2015 22:16:02 +0100 Subject: translation update --- inc/lang/fr/lang.php | 2 +- lib/plugins/authldap/lang/fr/settings.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php index 9deff1220..fb3890c9e 100644 --- a/inc/lang/fr/lang.php +++ b/inc/lang/fr/lang.php @@ -228,7 +228,7 @@ $lang['restored'] = 'ancienne révision (%s) restaurée'; $lang['external_edit'] = 'modification externe'; $lang['summary'] = 'Résumé'; $lang['noflash'] = 'L\'extension Adobe Flash est nécessaire pour afficher ce contenu.'; -$lang['download'] = 'Télécharger un extrait'; +$lang['download'] = 'Télécharger cet extrait'; $lang['tools'] = 'Outils'; $lang['user_tools'] = 'Outils pour utilisateurs'; $lang['site_tools'] = 'Outils du site'; diff --git a/lib/plugins/authldap/lang/fr/settings.php b/lib/plugins/authldap/lang/fr/settings.php index dc475071e..aa75105cf 100644 --- a/lib/plugins/authldap/lang/fr/settings.php +++ b/lib/plugins/authldap/lang/fr/settings.php @@ -5,6 +5,7 @@ * * @author Bruno Veilleux * @author schplurtz + * @author Schplurtz le Déboulonné */ $lang['server'] = 'Votre serveur LDAP. Soit le nom d\'hôte (localhost) ou l\'URL complète (ldap://serveur.dom:389)'; $lang['port'] = 'Port du serveur LDAP si l\'URL complète n\'a pas été indiquée ci-dessus'; @@ -26,3 +27,6 @@ $lang['deref_o_0'] = 'LDAP_DEREF_NEVER'; $lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING'; $lang['deref_o_2'] = 'LDAP_DEREF_FINDING'; $lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS'; +$lang['referrals_o_-1'] = 'comportement par défaut'; +$lang['referrals_o_0'] = 'ne pas suivre les références'; +$lang['referrals_o_1'] = 'suivre les références'; -- cgit v1.2.3 From a2e737c4fece56318728021edca1cc40c1d1adb6 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 25 Feb 2015 09:41:15 +0100 Subject: remove additional sidebar bottom margin in phone mode --- lib/tpl/dokuwiki/css/mobile.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tpl/dokuwiki/css/mobile.less b/lib/tpl/dokuwiki/css/mobile.less index ac7c46456..e5e13e221 100644 --- a/lib/tpl/dokuwiki/css/mobile.less +++ b/lib/tpl/dokuwiki/css/mobile.less @@ -159,6 +159,11 @@ body { padding: 0 .5em; } } + +#dokuwiki__aside { + margin-bottom: 0; +} + #dokuwiki__header { padding: .5em 0; } -- cgit v1.2.3 From 6619ddf4b04390e1d1273dd79bd16bfb9eb6cf89 Mon Sep 17 00:00:00 2001 From: Sascha Klopp Date: Tue, 3 Mar 2015 11:09:21 +0100 Subject: Two new authldap config options: 'userkey' denotes the LDAP attribute holding the username, 'modPass' allows to disable password changing by the user. --- lib/plugins/authldap/auth.php | 5 +++-- lib/plugins/authldap/conf/default.php | 4 +++- lib/plugins/authldap/conf/metadata.php | 4 +++- lib/plugins/authldap/lang/de/settings.php | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 50735882f..9d031c049 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -37,7 +37,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { } // Add the capabilities to change the password - $this->cando['modPass'] = true; + $this->cando['modPass'] = $this->getConf('modPass'); } /** @@ -360,8 +360,9 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { $sr = ldap_search($this->con, $this->getConf('usertree'), $all_filter); $entries = ldap_get_entries($this->con, $sr); $users_array = array(); + $userkey = $this->getConf('userkey'); for($i = 0; $i < $entries["count"]; $i++) { - array_push($users_array, $entries[$i]["uid"][0]); + array_push($users_array, $entries[$i][$userkey][0]); } asort($users_array); $result = $users_array; diff --git a/lib/plugins/authldap/conf/default.php b/lib/plugins/authldap/conf/default.php index c2e462c5c..116cb9d3f 100644 --- a/lib/plugins/authldap/conf/default.php +++ b/lib/plugins/authldap/conf/default.php @@ -16,5 +16,7 @@ $conf['bindpw'] = ''; //$conf['mapping']['grps'] unsupported in config manager $conf['userscope'] = 'sub'; $conf['groupscope'] = 'sub'; +$conf['userkey'] = 'uid'; $conf['groupkey'] = 'cn'; -$conf['debug'] = 0; \ No newline at end of file +$conf['debug'] = 0; +$conf['modPass'] = 1; diff --git a/lib/plugins/authldap/conf/metadata.php b/lib/plugins/authldap/conf/metadata.php index 4649ba5bf..a67b11ca6 100644 --- a/lib/plugins/authldap/conf/metadata.php +++ b/lib/plugins/authldap/conf/metadata.php @@ -15,5 +15,7 @@ $meta['bindpw'] = array('password','_caution' => 'danger'); //$meta['mapping']['grps'] unsupported in config manager $meta['userscope'] = array('multichoice','_choices' => array('sub','one','base'),'_caution' => 'danger'); $meta['groupscope'] = array('multichoice','_choices' => array('sub','one','base'),'_caution' => 'danger'); +$meta['userkey'] = array('string','_caution' => 'danger'); $meta['groupkey'] = array('string','_caution' => 'danger'); -$meta['debug'] = array('onoff','_caution' => 'security'); \ No newline at end of file +$meta['debug'] = array('onoff','_caution' => 'security'); +$meta['modPass'] = array('onoff'); diff --git a/lib/plugins/authldap/lang/de/settings.php b/lib/plugins/authldap/lang/de/settings.php index d788da876..ecb407820 100644 --- a/lib/plugins/authldap/lang/de/settings.php +++ b/lib/plugins/authldap/lang/de/settings.php @@ -20,6 +20,7 @@ $lang['binddn'] = 'DN eines optionalen Benutzers, wenn der anonym $lang['bindpw'] = 'Passwort des angegebenen Benutzers.'; $lang['userscope'] = 'Die Suchweite nach Benutzeraccounts.'; $lang['groupscope'] = 'Die Suchweite nach Benutzergruppen.'; +$lang['userkey'] = 'Attribut, das den Benutzernamen enthält; muss konsistent zum userfilter sein.'; $lang['groupkey'] = 'Gruppieren der Benutzeraccounts anhand eines beliebigen Benutzerattributes z. B. Telefonnummer oder Abteilung, anstelle der Standard-Gruppen).'; $lang['debug'] = 'Debug-Informationen beim Auftreten von Fehlern anzeigen?'; $lang['deref_o_0'] = 'LDAP_DEREF_NEVER'; -- cgit v1.2.3 From 138a9500555ab0f27ce3fd67d3ea3ab17f8e9e3b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 3 Mar 2015 17:19:43 +0100 Subject: send JavaScript with correct mimetype While Browsers (IE of course) still fail to accept the correct application/javascript mimetype in the type attribute of the script element, we should serve the scripts with the correct Content-Type header at least. This is especially important as the default configuration of mod_deflate expects application/javascript and will not compress text/javascript. --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exe/js.php b/lib/exe/js.php index 3f9781e34..06d0dda55 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -14,7 +14,7 @@ require_once(DOKU_INC.'inc/init.php'); // Main (don't run when UNIT test) if(!defined('SIMPLE_TEST')){ - header('Content-Type: text/javascript; charset=utf-8'); + header('Content-Type: application/javascript; charset=utf-8'); js_out(); } -- cgit v1.2.3 From 25f80763dd71190679289de2b8d29f28021aedb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 11 Mar 2015 19:49:14 +0100 Subject: Get total number of users in ad, needed for paging --- lib/plugins/authad/auth.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 88b56046c..a0a1143db 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -116,6 +116,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { // other can do's are changed in $this->_loadServerConfig() base on domain setup $this->cando['modName'] = true; $this->cando['modMail'] = true; + $this->cando['getUserCount'] = true; } /** @@ -325,6 +326,26 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { return false; } + /** + * @param array $filter + * @return int + */ + public function getUserCount($filter = array()) { + + $adldap = $this->_adldap(null); + if(!$adldap) { + dbglog("authad/auth.php: _adldap not set."); + return -1; + } + + $result = $adldap->user()->all(); + if (!$result) { + dbglog("authad/auth.php: getting all users failed."); + return -1; + } + return count($result); + } + /** * Bulk retrieval of user data * -- cgit v1.2.3 From 67a31a83dd6c8a3ff9e87da0c2070a2783aec44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 13:09:08 +0100 Subject: Create and use ad search for user, name and email --- lib/plugins/authad/auth.php | 68 ++++++++++++++++++++++++++++++++------- lib/plugins/usermanager/admin.php | 14 ++++++++ 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index a0a1143db..f1f34245e 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -326,19 +326,63 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { return false; } + protected function _constructSearchString($filter){ + if (!$filter){ + return '*'; + } + $result = '*'; + if (isset($filter['name'])) { + $result .= ')(displayname=*' . $filter['name'] . '*'; + unset($filter['name']); + } + if (isset($filter['user'])) { + $result .= ')(samAccountName=*' . $filter['user'] . '*'; + unset($filter['user']); + } + + if (isset($filter['mail'])) { + $result .= ')(mail=*' . $filter['mail'] . '*'; + unset($filter['mail']); + } + dbglog($result); + return $result; + } + /** * @param array $filter * @return int */ public function getUserCount($filter = array()) { + if ($filter == array()) { + $adldap = $this->_adldap(null); + if(!$adldap) { + dbglog("authad/auth.php getUserCount(): _adldap not set."); + return -1; + } + $result = $adldap->user()->all(); + $start = 0; + } else {/* + dbglog('_startcache: ' . $this->_startcache); + $usermanager = plugin_load("admin", "usermanager", false); + if ($this->_startcache < $usermanager->getStart()) { + $start = $usermanager->getStart(); + $this->_startcache = $start; + } else { + $start = $this->_startcache; + } + $pagesize = $usermanager->getPagesize(); + $result = $this->retrieveUsers($start, 3*$pagesize,$filter,false);*/ + $adldap = $this->_adldap(null); + if(!$adldap) { + dbglog("authad/auth.php getUserCount(): _adldap not set."); + return -1; + } + dbglog($filter); + $searchString = $this->_constructSearchString($filter); + $result = $adldap->user()->all(false, $searchString); - $adldap = $this->_adldap(null); - if(!$adldap) { - dbglog("authad/auth.php: _adldap not set."); - return -1; } - $result = $adldap->user()->all(); if (!$result) { dbglog("authad/auth.php: getting all users failed."); return -1; @@ -351,18 +395,20 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * * @author Dominik Eckelmann * - * @param int $start index of first user to be returned - * @param int $limit max number of users to be returned - * @param array $filter array of field/pattern pairs, null for no filter - * @return array userinfo (refer getUserData for internal userinfo details) + * @param int $start index of first user to be returned + * @param int $limit max number of users to be returned + * @param array $filter array of field/pattern pairs, null for no filter + * @param bool $setStart + * @return array userinfo (refer getUserData for internal userinfo details) */ - public function retrieveUsers($start = 0, $limit = 0, $filter = array()) { + public function retrieveUsers($start = 0, $limit = 0, $filter = array(), $setStart = true) { + dbglog("start: " . $start . "; limit: " . $limit); $adldap = $this->_adldap(null); if(!$adldap) return false; if(!$this->users) { //get info for given user - $result = $adldap->user()->all(); + $result = $adldap->user()->all(false, $this->_constructSearchString($filter)); if (!$result) return array(); $this->users = array_fill_keys($result, false); } diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index 86562f1dd..b1f5c4023 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -81,6 +81,20 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { return 2; } + /** + * @return int current start value for pageination + */ + public function getStart() { + return $this->_start; + } + + /** + * @return int number of users per page + */ + public function getPagesize() { + return $this->_pagesize; + } + /** * Handle user request * -- cgit v1.2.3 From c52f6cd2bf68bccfbc665f376f68c93861a99837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 14:50:23 +0100 Subject: When filtering for group implement prefetching --- lib/plugins/authad/auth.php | 82 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index f1f34245e..2710d6a17 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -67,6 +67,10 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { */ protected $_pattern = array(); + protected $_actualstart = 0; + + protected $_grpsusers = array(); + /** * Constructor */ @@ -380,6 +384,16 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { dbglog($filter); $searchString = $this->_constructSearchString($filter); $result = $adldap->user()->all(false, $searchString); + if (isset($filter['grps'])) { + $this->users = array_fill_keys($result, false); + $usermanager = plugin_load("admin", "usermanager", false); + if (!isset($this->_grpsusers[$this->_filterToString($filter)])){ + $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize()); + } elseif (count($this->_grpsusers[$this->_filterToString($filter)]) < getStart() + 3*$usermanager->getPagesize()) { + $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize() - count($this->_grpsusers[$this->_filterToString($filter)])); + } + $result = $this->_grpsusers[$this->_filterToString($filter)]; + } } @@ -390,6 +404,44 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { return count($result); } + protected function _filterToString ($filter) { + $result = ''; + if (isset($filter['user'])) { + $result .= 'user-' . $filter['user']; + } + if (isset($filter['name'])) { + $result .= 'name-' . $filter['name']; + } + if (isset($filter['mail'])) { + $result .= 'mail-' . $filter['mail']; + } + if (isset($filter['grps'])) { + $result .= 'grps-' . $filter['grps']; + } + return $result; + } + + protected function _fillGroupUserArray($filter, $numberOfAdds){ + $this->_grpsusers[$this->_filterToString($filter)]; + $i = 0; + $count = 0; + $this->_constructPattern($filter); + foreach ($this->users as $user => &$info) { + if($i++ < $this->_actualstart) { + continue; + } + if($info === false) { + $info = $this->getUserData($user); + } + if($this->_filter($user, $info)) { + $this->_grpsusers[$this->_filterToString($filter)][$user] = $info; + if(($numberOfAdds > 0) && (++$count >= $numberOfAdds)) break; + } + } + $this->_actualstart = $i; + return $count; + } + /** * Bulk retrieval of user data * @@ -398,10 +450,9 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * @param int $start index of first user to be returned * @param int $limit max number of users to be returned * @param array $filter array of field/pattern pairs, null for no filter - * @param bool $setStart * @return array userinfo (refer getUserData for internal userinfo details) */ - public function retrieveUsers($start = 0, $limit = 0, $filter = array(), $setStart = true) { + public function retrieveUsers($start = 0, $limit = 0, $filter = array()) { dbglog("start: " . $start . "; limit: " . $limit); $adldap = $this->_adldap(null); if(!$adldap) return false; @@ -418,17 +469,32 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $this->_constructPattern($filter); $result = array(); - foreach($this->users as $user => &$info) { - if($i++ < $start) { - continue; + if (!isset($filter['grps'])) { + foreach($this->users as $user => &$info) { + if($i++ < $start) { + continue; + } + if($info === false) { + $info = $this->getUserData($user); + } + if($this->_filter($user, $info)) { + $result[$user] = $info; + if(($limit > 0) && (++$count >= $limit)) break; + } } - if($info === false) { - $info = $this->getUserData($user); + } else { + if (!isset($this->_grpsusers[$this->_filterToString($filter)]) || count($this->_grpsusers[$this->_filterToString($filter)]) < ($start+$limit)) { + $this->_fillGroupUserArray($filter,$start+$limit - count($this->_grpsusers[$this->_filterToString($filter)]) +1); } - if($this->_filter($user, $info)) { + foreach($this->_grpsusers[$this->_filterToString($filter)] as $user => &$info) { + dbglog($this->_grpsusers[$this->_filterToString($filter)]); + if($i++ < $start) { + continue; + } $result[$user] = $info; if(($limit > 0) && (++$count >= $limit)) break; } + } return $result; } -- cgit v1.2.3 From 462e9e37f38d6de9ec19ad1476b64bac3b851fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 15:06:26 +0100 Subject: Disable the ``last`` button when filtering groups Since we cannot effectively filter for groups and have to work with incremental prefetching, the ``last`` button is mostly broken/buggy. Hence it is disabled in this usecase. --- lib/plugins/authad/auth.php | 8 ++++++++ lib/plugins/usermanager/admin.php | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 2710d6a17..4022cd68f 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -387,12 +387,16 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if (isset($filter['grps'])) { $this->users = array_fill_keys($result, false); $usermanager = plugin_load("admin", "usermanager", false); + $usermanager->setLastdisabled(true); if (!isset($this->_grpsusers[$this->_filterToString($filter)])){ $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize()); } elseif (count($this->_grpsusers[$this->_filterToString($filter)]) < getStart() + 3*$usermanager->getPagesize()) { $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize() - count($this->_grpsusers[$this->_filterToString($filter)])); } $result = $this->_grpsusers[$this->_filterToString($filter)]; + } else { + $usermanager = plugin_load("admin", "usermanager", false); + $usermanager->setLastdisabled(false); } } @@ -470,6 +474,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $result = array(); if (!isset($filter['grps'])) { + $usermanager = plugin_load("admin", "usermanager", false); + $usermanager->setLastdisabled(false); foreach($this->users as $user => &$info) { if($i++ < $start) { continue; @@ -483,6 +489,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } } } else { + $usermanager = plugin_load("admin", "usermanager", false); + $usermanager->setLastdisabled(true); if (!isset($this->_grpsusers[$this->_filterToString($filter)]) || count($this->_grpsusers[$this->_filterToString($filter)]) < ($start+$limit)) { $this->_fillGroupUserArray($filter,$start+$limit - count($this->_grpsusers[$this->_filterToString($filter)]) +1); } diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index b1f5c4023..cc4c4ae47 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -31,6 +31,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { protected $_edit_userdata = array(); protected $_disabled = ''; // if disabled set to explanatory string protected $_import_failures = array(); + protected $_lastdisabled = false; // set to true if last user is unknown and last button is hence buggy /** * Constructor @@ -95,6 +96,13 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { return $this->_pagesize; } + /** + * @param boolean $lastdisabled + */ + public function setLastdisabled($lastdisabled) { + $this->_lastdisabled = $lastdisabled; + } + /** * Handle user request * @@ -850,6 +858,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { $buttons['last'] = $buttons['next'] = (($this->_start + $this->_pagesize) >= $this->_user_total) ? $disabled : ''; } + if ($this->_lastdisabled) { + $buttons['last'] = $disabled; + } + return $buttons; } -- cgit v1.2.3 From 6fcf992c3420a8904add8169cfd672407a7c38d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 16:00:26 +0100 Subject: Clean up code, add phpdoc comments, some refactoring, etc. --- lib/plugins/authad/auth.php | 62 ++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 4022cd68f..bcf01ff21 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -330,6 +330,10 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { return false; } + /** + * @param array $filter + * @return string + */ protected function _constructSearchString($filter){ if (!$filter){ return '*'; @@ -348,7 +352,6 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $result .= ')(mail=*' . $filter['mail'] . '*'; unset($filter['mail']); } - dbglog($result); return $result; } @@ -357,31 +360,14 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * @return int */ public function getUserCount($filter = array()) { + $adldap = $this->_adldap(null); + if(!$adldap) { + dbglog("authad/auth.php getUserCount(): _adldap not set."); + return -1; + } if ($filter == array()) { - $adldap = $this->_adldap(null); - if(!$adldap) { - dbglog("authad/auth.php getUserCount(): _adldap not set."); - return -1; - } $result = $adldap->user()->all(); - $start = 0; - } else {/* - dbglog('_startcache: ' . $this->_startcache); - $usermanager = plugin_load("admin", "usermanager", false); - if ($this->_startcache < $usermanager->getStart()) { - $start = $usermanager->getStart(); - $this->_startcache = $start; - } else { - $start = $this->_startcache; - } - $pagesize = $usermanager->getPagesize(); - $result = $this->retrieveUsers($start, 3*$pagesize,$filter,false);*/ - $adldap = $this->_adldap(null); - if(!$adldap) { - dbglog("authad/auth.php getUserCount(): _adldap not set."); - return -1; - } - dbglog($filter); + } else { $searchString = $this->_constructSearchString($filter); $result = $adldap->user()->all(false, $searchString); if (isset($filter['grps'])) { @@ -390,7 +376,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $usermanager->setLastdisabled(true); if (!isset($this->_grpsusers[$this->_filterToString($filter)])){ $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize()); - } elseif (count($this->_grpsusers[$this->_filterToString($filter)]) < getStart() + 3*$usermanager->getPagesize()) { + } elseif (count($this->_grpsusers[$this->_filterToString($filter)]) < $usermanager->getStart() + 3*$usermanager->getPagesize()) { $this->_fillGroupUserArray($filter,$usermanager->getStart() + 3*$usermanager->getPagesize() - count($this->_grpsusers[$this->_filterToString($filter)])); } $result = $this->_grpsusers[$this->_filterToString($filter)]; @@ -402,12 +388,18 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } if (!$result) { - dbglog("authad/auth.php: getting all users failed."); - return -1; + return 0; } return count($result); } + /** + * + * create a unique string for each filter used with a group + * + * @param array $filter + * @return string + */ protected function _filterToString ($filter) { $result = ''; if (isset($filter['user'])) { @@ -425,6 +417,11 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { return $result; } + /** + * @param array $filter + * @param int $numberOfAdds additional number of users requested + * @return int number of Users actually add to Array + */ protected function _fillGroupUserArray($filter, $numberOfAdds){ $this->_grpsusers[$this->_filterToString($filter)]; $i = 0; @@ -457,7 +454,6 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * @return array userinfo (refer getUserData for internal userinfo details) */ public function retrieveUsers($start = 0, $limit = 0, $filter = array()) { - dbglog("start: " . $start . "; limit: " . $limit); $adldap = $this->_adldap(null); if(!$adldap) return false; @@ -470,12 +466,12 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $i = 0; $count = 0; - $this->_constructPattern($filter); $result = array(); if (!isset($filter['grps'])) { $usermanager = plugin_load("admin", "usermanager", false); $usermanager->setLastdisabled(false); + $this->_constructPattern($filter); foreach($this->users as $user => &$info) { if($i++ < $start) { continue; @@ -483,10 +479,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if($info === false) { $info = $this->getUserData($user); } - if($this->_filter($user, $info)) { - $result[$user] = $info; - if(($limit > 0) && (++$count >= $limit)) break; - } + $result[$user] = $info; + if(($limit > 0) && (++$count >= $limit)) break; } } else { $usermanager = plugin_load("admin", "usermanager", false); @@ -494,8 +488,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if (!isset($this->_grpsusers[$this->_filterToString($filter)]) || count($this->_grpsusers[$this->_filterToString($filter)]) < ($start+$limit)) { $this->_fillGroupUserArray($filter,$start+$limit - count($this->_grpsusers[$this->_filterToString($filter)]) +1); } + if (!$this->_grpsusers[$this->_filterToString($filter)]) return false; foreach($this->_grpsusers[$this->_filterToString($filter)] as $user => &$info) { - dbglog($this->_grpsusers[$this->_filterToString($filter)]); if($i++ < $start) { continue; } -- cgit v1.2.3 From 7910cbbbce7fd803f3ee4f458d5426eac51bfd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 16:34:45 +0100 Subject: Explain functions in docstrings --- lib/plugins/authad/auth.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index bcf01ff21..321a60f24 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -331,6 +331,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } /** + * Create a Search-String useable by adLDAPUsers::all($includeDescription = false, $search = "*", $sorted = true) + * * @param array $filter * @return string */ @@ -343,6 +345,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $result .= ')(displayname=*' . $filter['name'] . '*'; unset($filter['name']); } + if (isset($filter['user'])) { $result .= ')(samAccountName=*' . $filter['user'] . '*'; unset($filter['user']); @@ -356,8 +359,10 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } /** - * @param array $filter - * @return int + * Return a count of the number of user which meet $filter criteria + * + * @param array $filter $filter array of field/pattern pairs, empty array for no filter + * @return int number of users */ public function getUserCount($filter = array()) { $adldap = $this->_adldap(null); @@ -418,6 +423,10 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } /** + * Create an array of $numberOfAdds users passing a certain $filter, including belonging + * to a certain group and save them to a object-wide array. If the array + * already exists try to add $numberOfAdds further users to it. + * * @param array $filter * @param int $numberOfAdds additional number of users requested * @return int number of Users actually add to Array -- cgit v1.2.3 From 07aec0297354ce1a2bb273def8173ff0a524f852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Thu, 12 Mar 2015 16:57:13 +0100 Subject: Escape user strings given to adLDAP --- lib/plugins/authad/auth.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 321a60f24..400a5efee 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -3,6 +3,7 @@ if(!defined('DOKU_INC')) die(); require_once(DOKU_PLUGIN.'authad/adLDAP/adLDAP.php'); +require_once(DOKU_PLUGIN.'authad/adLDAP/classes/adLDAPUtils.php'); /** * Active Directory authentication backend for DokuWiki @@ -340,19 +341,20 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if (!$filter){ return '*'; } + $adldapUtils = new adLDAPUtils($this->_adldap(null)); $result = '*'; if (isset($filter['name'])) { - $result .= ')(displayname=*' . $filter['name'] . '*'; + $result .= ')(displayname=*' . $adldapUtils->ldapSlashes($filter['name']) . '*'; unset($filter['name']); } if (isset($filter['user'])) { - $result .= ')(samAccountName=*' . $filter['user'] . '*'; + $result .= ')(samAccountName=*' . $adldapUtils->ldapSlashes($filter['user']) . '*'; unset($filter['user']); } if (isset($filter['mail'])) { - $result .= ')(mail=*' . $filter['mail'] . '*'; + $result .= ')(mail=*' . $adldapUtils->ldapSlashes($filter['mail']) . '*'; unset($filter['mail']); } return $result; -- cgit v1.2.3 From 1014a348a1826737c9df8a9edaed3f756d0058f2 Mon Sep 17 00:00:00 2001 From: Sascha Klopp Date: Fri, 13 Mar 2015 12:01:51 +0100 Subject: Add description for modPass-Option --- lib/plugins/authldap/lang/de/settings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plugins/authldap/lang/de/settings.php b/lib/plugins/authldap/lang/de/settings.php index ecb407820..933189c40 100644 --- a/lib/plugins/authldap/lang/de/settings.php +++ b/lib/plugins/authldap/lang/de/settings.php @@ -22,6 +22,7 @@ $lang['userscope'] = 'Die Suchweite nach Benutzeraccounts.'; $lang['groupscope'] = 'Die Suchweite nach Benutzergruppen.'; $lang['userkey'] = 'Attribut, das den Benutzernamen enthält; muss konsistent zum userfilter sein.'; $lang['groupkey'] = 'Gruppieren der Benutzeraccounts anhand eines beliebigen Benutzerattributes z. B. Telefonnummer oder Abteilung, anstelle der Standard-Gruppen).'; +$lang['modPass'] = 'Darf über Dokuwiki das LDAP-Passwort geändert werden?'; $lang['debug'] = 'Debug-Informationen beim Auftreten von Fehlern anzeigen?'; $lang['deref_o_0'] = 'LDAP_DEREF_NEVER'; $lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING'; -- cgit v1.2.3 From 84f66e9f97ebf4d78ffaaad7a0b44f5c0180bfc9 Mon Sep 17 00:00:00 2001 From: Sascha Klopp Date: Mon, 16 Mar 2015 16:50:38 +0100 Subject: Add english description for new authldap options --- lib/plugins/authldap/lang/en/settings.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/plugins/authldap/lang/en/settings.php b/lib/plugins/authldap/lang/en/settings.php index 951901ccc..a4194b00a 100644 --- a/lib/plugins/authldap/lang/en/settings.php +++ b/lib/plugins/authldap/lang/en/settings.php @@ -13,7 +13,9 @@ $lang['binddn'] = 'DN of an optional bind user if anonymous bind is not suf $lang['bindpw'] = 'Password of above user'; $lang['userscope'] = 'Limit search scope for user search'; $lang['groupscope'] = 'Limit search scope for group search'; +$lang['userkey'] = 'Attribute denoting the username; must be consistent to userfilter.'; $lang['groupkey'] = 'Group membership from any user attribute (instead of standard AD groups) e.g. group from department or telephone number'; +$lang['modPass'] = 'Can the LDAP password be changed via dokuwiki?'; $lang['debug'] = 'Display additional debug information on errors'; -- cgit v1.2.3 From 2f505bf9a889ddaf530fe975967589f6c6993e39 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 16 Mar 2015 22:49:47 +0100 Subject: use correct host in proxy tests --- _test/tests/inc/httpclient_https_proxy.test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_test/tests/inc/httpclient_https_proxy.test.php b/_test/tests/inc/httpclient_https_proxy.test.php index 9402e91af..7a54bb92e 100644 --- a/_test/tests/inc/httpclient_https_proxy.test.php +++ b/_test/tests/inc/httpclient_https_proxy.test.php @@ -2,7 +2,7 @@ require_once dirname(__FILE__).'/httpclient_http_proxy.test.php'; class httpclient_https_proxy_test extends httpclient_http_proxy_test { - protected $url = 'https://www.dokuwiki.org/README'; + protected $url = 'https://test.dokuwiki.org/README'; public function setUp(){ // skip tests when this PHP has no SSL support @@ -27,4 +27,4 @@ class httpclient_https_proxy_test extends httpclient_http_proxy_test { $this->assertFalse($data); $this->assertEquals(-150, $http->status); } -} \ No newline at end of file +} -- cgit v1.2.3 From e13bd5dcd000cc82ed5f1379dac0d674789d3a0c Mon Sep 17 00:00:00 2001 From: Christoph Dwertmann Date: Tue, 17 Mar 2015 18:22:29 +1100 Subject: Speed up indexer on lighttpd by using tpl_flush() --- lib/exe/indexer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 2de178caa..d2a4d45f7 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,8 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; - ob_flush(); - flush(); + tpl_flush(); // Browser should drop connection after this // Thinks it's got the whole image } -- cgit v1.2.3 From abb2621b95a47515d8223fcc52b5d62ca61b3e07 Mon Sep 17 00:00:00 2001 From: Jacob Palm Date: Tue, 17 Mar 2015 15:01:44 +0100 Subject: translation update --- inc/lang/da/denied.txt | 2 +- inc/lang/da/lang.php | 101 +++++++++++----------- lib/plugins/authad/lang/da/lang.php | 8 ++ lib/plugins/authldap/lang/da/settings.php | 5 ++ lib/plugins/authmysql/lang/da/settings.php | 4 + lib/plugins/extension/lang/da/intro_install.txt | 1 + lib/plugins/extension/lang/da/intro_plugins.txt | 1 + lib/plugins/extension/lang/da/intro_templates.txt | 1 + lib/plugins/extension/lang/da/lang.php | 56 ++++++++++++ 9 files changed, 128 insertions(+), 51 deletions(-) create mode 100644 lib/plugins/authad/lang/da/lang.php create mode 100644 lib/plugins/extension/lang/da/intro_install.txt create mode 100644 lib/plugins/extension/lang/da/intro_plugins.txt create mode 100644 lib/plugins/extension/lang/da/intro_templates.txt diff --git a/inc/lang/da/denied.txt b/inc/lang/da/denied.txt index 7bf3b8b9b..217d8937e 100644 --- a/inc/lang/da/denied.txt +++ b/inc/lang/da/denied.txt @@ -1,3 +1,3 @@ -====== Adgang nægtet! ====== +====== Adgang nægtet ====== Du har ikke rettigheder til at fortsætte. diff --git a/inc/lang/da/lang.php b/inc/lang/da/lang.php index 3b353d50c..e7c597f2b 100644 --- a/inc/lang/da/lang.php +++ b/inc/lang/da/lang.php @@ -19,6 +19,7 @@ * @author soer9648 * @author Søren Birk * @author Søren Birk + * @author Jacob Palm */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -58,7 +59,7 @@ $lang['btn_resendpwd'] = 'Vælg ny adgangskode'; $lang['btn_draft'] = 'Redigér kladde'; $lang['btn_recover'] = 'Gendan kladde'; $lang['btn_draftdel'] = 'Slet kladde'; -$lang['btn_revert'] = 'Reetablér'; +$lang['btn_revert'] = 'Gendan'; $lang['btn_register'] = 'Registrér'; $lang['btn_apply'] = 'Anvend'; $lang['btn_media'] = 'Media Manager'; @@ -76,7 +77,7 @@ $lang['fullname'] = 'Fulde navn'; $lang['email'] = 'E-mail'; $lang['profile'] = 'Brugerprofil'; $lang['badlogin'] = 'Brugernavn eller adgangskode var forkert.'; -$lang['badpassconfirm'] = 'Kodeordet var desværre forkert'; +$lang['badpassconfirm'] = 'Adgangkode var desværre forkert'; $lang['minoredit'] = 'Mindre ændringer'; $lang['draftdate'] = 'Kladde automatisk gemt d.'; $lang['nosecedit'] = 'Siden blev ændret i mellemtiden, sektions information var for gammel, hentede hele siden i stedet.'; @@ -88,26 +89,26 @@ $lang['regsuccess2'] = 'Du er nu oprettet som bruger.'; $lang['regmailfail'] = 'Dit adgangskode blev ikke sendt. Kontakt venligst administratoren.'; $lang['regbadmail'] = 'E-mail-adressen er ugyldig. Kontakt venligst administratoren, hvis du mener dette er en fejl.'; $lang['regbadpass'] = 'De to adgangskoder er ikke ens, vær venlig at prøve igen.'; -$lang['regpwmail'] = 'Dit DokuWiki password'; +$lang['regpwmail'] = 'Dit adgangskode til DokuWiki'; $lang['reghere'] = 'Opret en DokuWiki-konto her'; $lang['profna'] = 'Denne wiki understøtter ikke ændring af profiler'; $lang['profnochange'] = 'Ingen ændringer, intet modificeret.'; $lang['profnoempty'] = 'Tomt navn eller e-mail adresse er ikke tilladt.'; $lang['profchanged'] = 'Brugerprofil opdateret korrekt.'; -$lang['profnodelete'] = 'Denne wiki supporterer ikke sletning af brugere'; -$lang['profdeleteuser'] = 'Slet Konto'; +$lang['profnodelete'] = 'Denne wiki understøtter ikke sletning af brugere'; +$lang['profdeleteuser'] = 'Slet konto'; $lang['profdeleted'] = 'Din brugerkonto er blevet slettet fra denne wiki'; $lang['profconfdelete'] = 'Jeg ønsker at slette min konto fra denne wiki.
    Denne handling kan ikke fortrydes.'; -$lang['pwdforget'] = 'Har du glemt dit adgangskode? Få et nyt'; -$lang['resendna'] = 'Denne wiki understøtter ikke udsendelse af nyt adgangskode.'; -$lang['resendpwd'] = 'Vælg ny adgangskode for'; +$lang['pwdforget'] = 'Har du glemt dit adgangskode? Få en ny'; +$lang['resendna'] = 'Denne wiki understøtter ikke udsendelse af ny adgangskode.'; +$lang['resendpwd'] = 'Vælg en ny adgangskode for'; $lang['resendpwdmissing'] = 'Du skal udfylde alle felter.'; $lang['resendpwdnouser'] = 'Vi kan ikke finde denne bruger i vores database.'; $lang['resendpwdbadauth'] = 'Beklager, denne autoriseringskode er ikke gyldig. Kontroller venligst at du benyttede det fulde link til bekræftelse.'; -$lang['resendpwdconfirm'] = 'Et henvisning med bekræftelse er blevet sendt med email.'; -$lang['resendpwdsuccess'] = 'Dit nye adgangskode er blevet sendt med e-mail.'; -$lang['license'] = 'Med mindre andet angivet, vil indhold på denne wiki blive frigjort under følgende licens:'; -$lang['licenseok'] = 'Note: ved at ændre denne side, acceptere du at dit indhold bliver frigivet under følgende licens:'; +$lang['resendpwdconfirm'] = 'En e-mail med et link til bekræftelse er blevet sendt.'; +$lang['resendpwdsuccess'] = 'Din nye adgangskode er blevet sendt med e-mail.'; +$lang['license'] = 'Med mindre andet angivet, vil indhold på denne wiki blive udgivet under følgende licens:'; +$lang['licenseok'] = 'Bemærk - ved at redigere denne side, accepterer du at dit indhold bliver frigivet under følgende licens:'; $lang['searchmedia'] = 'Søg filnavn'; $lang['searchmedia_in'] = 'Søg i %s'; $lang['txt_upload'] = 'Vælg den fil der skal overføres:'; @@ -117,76 +118,76 @@ $lang['maxuploadsize'] = 'Upload max. %s pr. fil.'; $lang['lockedby'] = 'Midlertidig låst af:'; $lang['lockexpire'] = 'Lås udløber kl:.'; $lang['js']['willexpire'] = 'Din lås på dette dokument udløber om et minut.\nTryk på Forhåndsvisning-knappen for at undgå konflikter.'; -$lang['js']['notsavedyet'] = 'Ugemte ændringer vil blive mistet +$lang['js']['notsavedyet'] = 'Ugemte ændringer vil blive mistet. Fortsæt alligevel?'; $lang['js']['searchmedia'] = 'Søg efter filer'; $lang['js']['keepopen'] = 'Hold vindue åbent ved valg'; $lang['js']['hidedetails'] = 'Skjul detaljer'; $lang['js']['mediatitle'] = 'Link indstillinger'; $lang['js']['mediadisplay'] = 'Link type'; -$lang['js']['mediaalign'] = 'Juster'; +$lang['js']['mediaalign'] = 'Justering'; $lang['js']['mediasize'] = 'Billede størrelse'; -$lang['js']['mediatarget'] = 'Link mål'; +$lang['js']['mediatarget'] = 'Link destination'; $lang['js']['mediaclose'] = 'Luk'; $lang['js']['mediainsert'] = 'Indsæt'; $lang['js']['mediadisplayimg'] = 'Vis billedet'; $lang['js']['mediadisplaylnk'] = 'Vis kun linket'; $lang['js']['mediasmall'] = 'Lille version'; -$lang['js']['mediamedium'] = 'Medium version'; +$lang['js']['mediamedium'] = 'Mellem version'; $lang['js']['medialarge'] = 'Stor version'; $lang['js']['mediaoriginal'] = 'Original version'; $lang['js']['medialnk'] = 'Link til detajle side'; $lang['js']['mediadirect'] = 'Direkte link til originalen'; $lang['js']['medianolnk'] = 'Intet link'; -$lang['js']['medianolink'] = 'Link ikke billedet'; +$lang['js']['medianolink'] = 'Link ikke til billedet'; $lang['js']['medialeft'] = 'Juster billedet til venstre'; $lang['js']['mediaright'] = 'Juster billedet til højre'; $lang['js']['mediacenter'] = 'Centreret'; $lang['js']['medianoalign'] = 'Brug ingen justering'; $lang['js']['nosmblinks'] = 'Henvisninger til Windows shares virker kun i Microsoft Internet Explorer. Du kan stadig kopiere og indsætte linket.'; -$lang['js']['linkwiz'] = 'guiden til henvisninger'; -$lang['js']['linkto'] = 'Henvise til:'; +$lang['js']['linkwiz'] = 'Guiden til henvisninger'; +$lang['js']['linkto'] = 'Henvis til:'; $lang['js']['del_confirm'] = 'Slet valgte post(er)?'; -$lang['js']['restore_confirm'] = 'Vil du virkeligt genskabe denne version?'; +$lang['js']['restore_confirm'] = 'Er du sikker på at du vil genskabe denne version?'; $lang['js']['media_diff'] = 'Vis forskelle:'; $lang['js']['media_diff_both'] = 'Side ved Side'; -$lang['js']['media_diff_opacity'] = 'Skin-igennem'; +$lang['js']['media_diff_opacity'] = 'Skin igennem'; $lang['js']['media_diff_portions'] = 'Skub'; $lang['js']['media_select'] = 'Vælg filer...'; -$lang['js']['media_upload_btn'] = 'Upload'; +$lang['js']['media_upload_btn'] = 'Overfør'; $lang['js']['media_done_btn'] = 'Færdig'; -$lang['js']['media_drop'] = 'Drop filer her for at uploade'; +$lang['js']['media_drop'] = 'Træk filer hertil for at overføre'; $lang['js']['media_cancel'] = 'fjern'; $lang['js']['media_overwrt'] = 'Overskriv eksisterende filer'; -$lang['rssfailed'] = 'Der opstod en fejl ved indhentning af: '; +$lang['rssfailed'] = 'Der opstod en fejl ved hentning af dette feed: '; $lang['nothingfound'] = 'Søgningen gav intet resultat.'; $lang['mediaselect'] = 'Vælg mediefil'; -$lang['fileupload'] = 'Overføre mediefil'; -$lang['uploadsucc'] = 'Overførelse var en succes'; -$lang['uploadfail'] = 'Overførelse fejlede. Der er muligvis problemer med rettighederne.'; -$lang['uploadwrong'] = 'Overførelse afvist. Filtypen er ikke tilladt.'; +$lang['fileupload'] = 'Overfør mediefil'; +$lang['uploadsucc'] = 'Overførels blev fuldført'; +$lang['uploadfail'] = 'Overførslen fejlede. Der er muligvis problemer med rettighederne.'; +$lang['uploadwrong'] = 'Overførslen blev afvist. Filtypen er ikke tilladt.'; $lang['uploadexist'] = 'Filen eksisterer allerede.'; -$lang['uploadbadcontent'] = 'Overføret indhold tilsvaret ikke til %s fil-endelsen.'; +$lang['uploadbadcontent'] = 'Det overført indhold svarer ikke til %s fil-endelsen.'; $lang['uploadspam'] = 'Overførelsen blev blokeret af spam sortlisten.'; $lang['uploadxss'] = 'Overførelsen blev blokeret på grund af mulig skadeligt indhold.'; -$lang['uploadsize'] = 'Den overføret fil var for stor (max. %s)'; +$lang['uploadsize'] = 'Den overførte fil var for stor (maksimal størrelse %s)'; $lang['deletesucc'] = 'Filen "%s" er blevet slettet.'; -$lang['deletefail'] = '"%s" kunne ikke slettes - check rettighederne.'; -$lang['mediainuse'] = 'Filen "%s" er ikke slettet - den er stadig i brug.'; +$lang['deletefail'] = '"%s" kunne ikke slettes - kontroller rettighederne.'; +$lang['mediainuse'] = 'Filen "%s" kan ikke slettes - den er stadig i brug.'; $lang['namespaces'] = 'Navnerum'; $lang['mediafiles'] = 'Tilgængelige filer i'; -$lang['accessdenied'] = 'Du har ikke tilladelse til at se denne side'; +$lang['accessdenied'] = 'Du har ikke tilladelse til at se denne side.'; $lang['mediausage'] = 'Brug den følgende syntaks til at henvise til denne fil:'; $lang['mediaview'] = 'Vis oprindelig fil'; $lang['mediaroot'] = 'rod'; $lang['mediaupload'] = 'Overføre en fil til det nuværende navnerum her. For at oprette under-navnerum, tilføj dem til "Overføre som" filnavnet, adskilt af kolontegn.'; -$lang['mediaextchange'] = 'Filudvidelse ændret fra .%s til .%s!'; +$lang['mediaextchange'] = 'Filtype ændret fra .%s til .%s!'; $lang['reference'] = 'Henvisning til'; $lang['ref_inuse'] = 'Filen kan ikke slettes, da den stadig er i brug på følgende sider:'; -$lang['ref_hidden'] = 'Nogle henvisninger er i dokumenter du ikke har læserettigheder til'; +$lang['ref_hidden'] = 'Nogle henvisninger er på sider du ikke har læserettigheder til'; $lang['hits'] = 'Besøg'; -$lang['quickhits'] = 'Tilsvarende dokumentnavne'; +$lang['quickhits'] = 'Tilsvarende sidenavne'; $lang['toc'] = 'Indholdsfortegnelse'; $lang['current'] = 'nuværende'; $lang['yours'] = 'Din version'; @@ -195,7 +196,7 @@ $lang['diff2'] = 'Vis forskelle i forhold til de valgte revision $lang['difflink'] = 'Link til denne sammenlinings vising'; $lang['diff_type'] = 'Vis forskelle:'; $lang['diff_inline'] = 'Indeni'; -$lang['diff_side'] = 'Side ved Side'; +$lang['diff_side'] = 'Side ved side'; $lang['diffprevrev'] = 'Forrige revision'; $lang['diffnextrev'] = 'Næste revision'; $lang['difflastrev'] = 'Sidste revision'; @@ -208,26 +209,26 @@ $lang['lastmod'] = 'Sidst ændret:'; $lang['by'] = 'af'; $lang['deleted'] = 'slettet'; $lang['created'] = 'oprettet'; -$lang['restored'] = 'gammel udgave reetableret (%s)'; +$lang['restored'] = 'gammel udgave gendannet (%s)'; $lang['external_edit'] = 'ekstern redigering'; -$lang['summary'] = 'Redigerings resumé'; -$lang['noflash'] = 'Den Adobe Flash Plugin er nødvendig til at vise denne indehold.'; -$lang['download'] = 'Hente kodestykke'; +$lang['summary'] = 'Resumé af ændrigner'; +$lang['noflash'] = 'Du skal installere Adobe Flash Player for at kunne se dette indhold.'; +$lang['download'] = 'Hent kodestykke'; $lang['tools'] = 'Værktøjer'; $lang['user_tools'] = 'Brugerværktøjer'; $lang['site_tools'] = 'Webstedsværktøjer'; $lang['page_tools'] = 'Sideværktøjer'; $lang['skip_to_content'] = 'hop til indhold'; $lang['sidebar'] = 'Sidebjælke'; -$lang['mail_newpage'] = 'dokument tilføjet:'; -$lang['mail_changed'] = 'dokument ændret:'; -$lang['mail_subscribe_list'] = 'sider ændret i navnerum'; +$lang['mail_newpage'] = 'side tilføjet:'; +$lang['mail_changed'] = 'side ændret:'; +$lang['mail_subscribe_list'] = 'sider ændret i navnerum:'; $lang['mail_new_user'] = 'Ny bruger'; -$lang['mail_upload'] = 'fil overføret:'; +$lang['mail_upload'] = 'fil overført:'; $lang['changes_type'] = 'Vis ændringer af'; $lang['pages_changes'] = 'Sider'; -$lang['media_changes'] = 'Media filer'; -$lang['both_changes'] = 'Både sider og media filer'; +$lang['media_changes'] = 'Mediefiler'; +$lang['both_changes'] = 'Både sider og medie filer'; $lang['qb_bold'] = 'Fed'; $lang['qb_italic'] = 'Kursiv'; $lang['qb_underl'] = 'Understregning'; @@ -239,7 +240,7 @@ $lang['qb_h3'] = 'Niveau 3 overskrift'; $lang['qb_h4'] = 'Niveau 4 overskrift'; $lang['qb_h5'] = 'Niveau 5 overskrift'; $lang['qb_h'] = 'Overskrift'; -$lang['qb_hs'] = 'Vælg overskriften'; +$lang['qb_hs'] = 'Vælg overskrift'; $lang['qb_hplus'] = 'Højere overskriftsniveau'; $lang['qb_hminus'] = 'Lavere overskriftsniveau'; $lang['qb_hequal'] = 'Samme overskriftsniveau'; @@ -247,7 +248,7 @@ $lang['qb_link'] = 'Intern henvisning'; $lang['qb_extlink'] = 'Ekstern henvisning'; $lang['qb_hr'] = 'Vandret linje'; $lang['qb_ol'] = 'Nummereret liste'; -$lang['qb_ul'] = 'Unummereret liste'; +$lang['qb_ul'] = 'Punktopstilling'; $lang['qb_media'] = 'Tilføj billeder og andre filer'; $lang['qb_sig'] = 'Indsæt signatur'; $lang['qb_smileys'] = 'Smileys'; @@ -255,7 +256,7 @@ $lang['qb_chars'] = 'Specialtegn'; $lang['upperns'] = 'Gå til overordnet navnerum'; $lang['admin_register'] = 'Tilføj ny bruger'; $lang['metaedit'] = 'Rediger metadata'; -$lang['metasaveerr'] = 'Skrivning af metadata fejlede'; +$lang['metasaveerr'] = 'Fejl under skrivning af metadata'; $lang['metasaveok'] = 'Metadata gemt'; $lang['img_title'] = 'Titel:'; $lang['img_caption'] = 'Billedtekst:'; diff --git a/lib/plugins/authad/lang/da/lang.php b/lib/plugins/authad/lang/da/lang.php new file mode 100644 index 000000000..8fc7db775 --- /dev/null +++ b/lib/plugins/authad/lang/da/lang.php @@ -0,0 +1,8 @@ + + */ +$lang['domain'] = 'Logondomæne'; diff --git a/lib/plugins/authldap/lang/da/settings.php b/lib/plugins/authldap/lang/da/settings.php index b736504a5..a9fce3a8c 100644 --- a/lib/plugins/authldap/lang/da/settings.php +++ b/lib/plugins/authldap/lang/da/settings.php @@ -5,11 +5,16 @@ * * @author Jens Hyllegaard * @author soer9648 + * @author Jacob Palm */ $lang['server'] = 'Din LDAP server. Enten værtsnavn (localhost) eller fuld kvalificeret URL (ldap://server.tld:389)'; $lang['port'] = 'LDAP server port, hvis der ikke er angivet en komplet URL ovenfor.'; $lang['usertree'] = 'Hvor findes brugerkonti. F.eks. ou=Personer, dc=server, dc=tld'; $lang['grouptree'] = 'Hvor findes brugergrupper. F.eks. ou=Grupper, dc=server, dc=tld'; +$lang['userfilter'] = 'LDAP filter der benyttes til at søge efter brugerkonti. F.eks. (&(uid=%{user})(objectClass=posixAccount))'; +$lang['groupfilter'] = 'LDAP filter tder benyttes til at søge efter grupper. F.eks. (&(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))'; +$lang['version'] = 'Protokol version der skal benyttes. Det er muligvis nødvendigt at sætte denne til 3'; $lang['starttls'] = 'Benyt TLS forbindelser?'; $lang['bindpw'] = 'Kodeord til ovenstående bruger'; +$lang['modPass'] = 'Kan LDAP adgangskoden skiftes via DokuWiki?'; $lang['debug'] = 'Vis yderligere debug output ved fejl'; diff --git a/lib/plugins/authmysql/lang/da/settings.php b/lib/plugins/authmysql/lang/da/settings.php index ed21201fb..5fd66dbad 100644 --- a/lib/plugins/authmysql/lang/da/settings.php +++ b/lib/plugins/authmysql/lang/da/settings.php @@ -5,6 +5,7 @@ * * @author Jens Hyllegaard * @author soer9648 + * @author Jacob Palm */ $lang['server'] = 'Din MySQL server'; $lang['user'] = 'MySQL brugernavn'; @@ -12,8 +13,11 @@ $lang['password'] = 'Kodeord til ovenstående bruger'; $lang['database'] = 'Database der skal benyttes'; $lang['charset'] = 'Tegnsæt benyttet i database'; $lang['debug'] = 'Vis yderligere debug output'; +$lang['forwardClearPass'] = 'Videregiv bruger adgangskoder i klar tekst til nedenstående SQL statement, i stedet for at benytte passcrypt'; +$lang['TablesToLock'] = 'Kommasepareret liste over tabeller der skal låses under skrivning'; $lang['checkPass'] = 'SQL-sætning til at kontrollere kodeord'; $lang['getUserInfo'] = 'SQL-sætning til at hente brugerinformation'; +$lang['getGroups'] = 'SQL statement til at bestemme en brugers medlemskab af grupper'; $lang['getUsers'] = 'SQL-sætning til at liste alle brugere'; $lang['addUser'] = 'SQL-sætning til at tilføje en ny bruger'; $lang['addGroup'] = 'SQL-sætning til at tilføje en ny gruppe'; diff --git a/lib/plugins/extension/lang/da/intro_install.txt b/lib/plugins/extension/lang/da/intro_install.txt new file mode 100644 index 000000000..e5657f218 --- /dev/null +++ b/lib/plugins/extension/lang/da/intro_install.txt @@ -0,0 +1 @@ +Her kan du installerer plugins eller templates manuelt, ved enten at uploade dem eller angive en direkte URL til download. \ No newline at end of file diff --git a/lib/plugins/extension/lang/da/intro_plugins.txt b/lib/plugins/extension/lang/da/intro_plugins.txt new file mode 100644 index 000000000..5d9deaf1e --- /dev/null +++ b/lib/plugins/extension/lang/da/intro_plugins.txt @@ -0,0 +1 @@ +Dette er de plugins du aktuelt har installeret i din DokuWiki. Du kan aktivere, deaktiver eller fjerne plugins fra denne side. Opdateringer til plugins vises også her - husk at læse dokumentationen til et plugin inden du opdaterer det. \ No newline at end of file diff --git a/lib/plugins/extension/lang/da/intro_templates.txt b/lib/plugins/extension/lang/da/intro_templates.txt new file mode 100644 index 000000000..1914500b1 --- /dev/null +++ b/lib/plugins/extension/lang/da/intro_templates.txt @@ -0,0 +1 @@ +Dette er de templates du aktuelt har installeret i din DokuWiki. Du kan vælge det template du vil benytte under [[?do=admin&page=config|Opsætningsstyring]]. \ No newline at end of file diff --git a/lib/plugins/extension/lang/da/lang.php b/lib/plugins/extension/lang/da/lang.php index c341bc5f9..17cb3b57c 100644 --- a/lib/plugins/extension/lang/da/lang.php +++ b/lib/plugins/extension/lang/da/lang.php @@ -4,7 +4,62 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * * @author Søren Birk + * @author Jacob Palm */ +$lang['tab_plugins'] = 'Installerede plugins'; +$lang['tab_templates'] = 'Installerede templates'; +$lang['tab_search'] = 'Søg og installer'; +$lang['tab_install'] = 'Manuel installation'; +$lang['notimplemented'] = 'Denne funktion er ikke implementeret endnu'; +$lang['unknownauthor'] = 'Ukendt udgiver'; +$lang['unknownversion'] = 'Ukendt version'; +$lang['btn_info'] = 'Vis mere information'; +$lang['btn_update'] = 'Opdater'; +$lang['btn_uninstall'] = 'Afinstaller'; +$lang['btn_enable'] = 'Aktiver'; +$lang['btn_disable'] = 'Deaktiver'; +$lang['btn_install'] = 'Installer'; +$lang['btn_reinstall'] = 'Geninstaller'; +$lang['js']['reallydel'] = 'Er du sikker på at du vil afinstallere denne udvidelse?'; +$lang['search_for'] = 'Søg efter udvidelse:'; +$lang['search'] = 'Søg'; +$lang['extensionby'] = '%s af %s'; +$lang['screenshot'] = 'Skærmbillede af %s'; +$lang['popularity'] = 'Popularitet: %s%%'; +$lang['homepage_link'] = 'Dokumenter'; +$lang['bugs_features'] = 'Fejl'; +$lang['tags'] = 'Tags:'; +$lang['author_hint'] = 'Søg efter udvidelse af denne udgiver'; +$lang['installed'] = 'Installeret:'; +$lang['downloadurl'] = 'Download URL:'; +$lang['unknown'] = 'ukendt'; +$lang['installed_version'] = 'Installeret version:'; +$lang['install_date'] = 'Din sidste opdatering:'; +$lang['available_version'] = 'Tilgængelig version:'; +$lang['compatible'] = 'Kompatibel med:'; +$lang['depends'] = 'Afhængig af:'; +$lang['similar'] = 'Ligner:'; +$lang['donate'] = 'Synes du om denne?'; +$lang['donate_action'] = 'Køb en kop kaffe til udvikleren!'; +$lang['repo_retry'] = 'Førsøg igen'; +$lang['status'] = 'Status:'; +$lang['status_installed'] = 'installeret'; +$lang['status_not_installed'] = 'ikke installeret'; +$lang['status_protected'] = 'beskyttet'; +$lang['status_enabled'] = 'aktiveret'; +$lang['status_disabled'] = 'deaktiveret'; +$lang['status_unmodifiable'] = 'låst for ændringer'; +$lang['status_plugin'] = 'plugin'; +$lang['status_template'] = 'template'; +$lang['msg_enabled'] = 'Plugin %s aktiveret'; +$lang['msg_disabled'] = 'Plugin %s deaktiveret'; +$lang['msg_delete_success'] = 'Udvidelse %s afinstalleret'; +$lang['msg_delete_failed'] = 'Kunne ikke afinstallere udvidelsen %s'; +$lang['msg_template_install_success'] = 'Template %s blev installeret'; +$lang['msg_template_update_success'] = 'Template %s blev opdateret'; +$lang['msg_plugin_install_success'] = 'Plugin %s blev installeret'; +$lang['msg_plugin_update_success'] = 'Plugin %s blev opdateret'; +$lang['msg_upload_failed'] = 'Kunne ikke uploade filen'; $lang['update_available'] = 'Opdatering: Ny version %s er tilgængelig.'; $lang['wrong_folder'] = 'Plugin ikke installeret korrekt: Omdøb plugin-mappe "%s" til "%s".'; $lang['url_change'] = 'URL ændret: Download-URL er blevet ændret siden sidste download. Kontrollér om den nye URL er valid, inden udvidelsen opdateres.
    Ny: %s
    Gammel: %s'; @@ -22,3 +77,4 @@ $lang['auth'] = 'Auth-plugin er ikke aktiveret i konfiguratione $lang['install_url'] = 'Installér fra URL:'; $lang['install_upload'] = 'Upload Udvidelse:'; $lang['repo_error'] = 'Plugin-arkivet kunne ikke kontaktes. Kontrollér at din server kan kontakte www.dokuwiki.org kontrollér dine proxy-indstillinger.'; +$lang['nossl'] = 'Din PHP lader til at mangle understøttelse for SSL. Mange DokuWiki udvidelser vil ikke kunne downloades.'; -- cgit v1.2.3 From 09513545a4776e31b5fb113bd8741df1df878816 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Mar 2015 11:19:04 +0100 Subject: give better error message in HTTPClient for failed crypto setup --- _test/tests/inc/httpclient_http_proxy.test.php | 2 +- inc/HTTPClient.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_test/tests/inc/httpclient_http_proxy.test.php b/_test/tests/inc/httpclient_http_proxy.test.php index c44dc7ed7..79b8f8e5e 100644 --- a/_test/tests/inc/httpclient_http_proxy.test.php +++ b/_test/tests/inc/httpclient_http_proxy.test.php @@ -15,7 +15,7 @@ class httpclient_http_proxy_test extends DokuWikiTest { $http->proxy_port = 8080; $data = $http->get($this->url); - $this->assertFalse($data === false, 'HTTP response '.$http->error); + $this->assertFalse($data === false, 'HTTP response: '.$http->error.' ['.$this->url.']'); $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content'); } } \ No newline at end of file diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 76d973c38..24b3a8d78 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -604,6 +604,8 @@ class HTTPClient { $requesturl = $requestinfo['path']; return true; } + + throw new HTTPClientException('Failed to set up crypto for secure proxy connection', -151); } throw new HTTPClientException('Failed to establish secure proxy connection', -150); -- cgit v1.2.3 From 8e455cddd749f1ea627e47e5ff5b910b7443d561 Mon Sep 17 00:00:00 2001 From: itsho Date: Wed, 18 Mar 2015 15:05:49 +0100 Subject: translation update --- inc/lang/he/lang.php | 26 ++++++++++++++++++++++++-- inc/lang/he/resetpwd.txt | 3 +++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 inc/lang/he/resetpwd.txt diff --git a/inc/lang/he/lang.php b/inc/lang/he/lang.php index 5e2ecbdff..1b8710df9 100644 --- a/inc/lang/he/lang.php +++ b/inc/lang/he/lang.php @@ -13,6 +13,7 @@ * @author alex * @author matt carroll * @author tomer + * @author itsho */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'rtl'; @@ -57,6 +58,8 @@ $lang['btn_register'] = 'הרשמה'; $lang['btn_apply'] = 'ליישם'; $lang['btn_media'] = 'מנהל המדיה'; $lang['btn_deleteuser'] = 'להסיר את החשבון שלי'; +$lang['btn_img_backto'] = 'חזרה אל %s'; +$lang['btn_mediaManager'] = 'צפה במנהל מדיה'; $lang['loggedinas'] = 'נכנסת בשם:'; $lang['user'] = 'שם משתמש'; $lang['pass'] = 'ססמה'; @@ -188,6 +191,11 @@ $lang['difflink'] = 'קישור לתצוגה השוואה זו'; $lang['diff_type'] = 'הצגת הבדלים:'; $lang['diff_inline'] = 'באותה השורה'; $lang['diff_side'] = 'זה לצד זה'; +$lang['diffprevrev'] = 'הגירסה הקודמת'; +$lang['diffnextrev'] = 'הגירסה הבאה'; +$lang['difflastrev'] = 'הגירסה האחרונה'; +$lang['diffbothprevrev'] = 'גירסה קודמת בשני הצדדים'; +$lang['diffbothnextrev'] = 'הגירסה הבאה בשני הצדדים'; $lang['line'] = 'שורה'; $lang['breadcrumb'] = 'ביקורים אחרונים:'; $lang['youarehere'] = 'זהו מיקומך:'; @@ -244,7 +252,6 @@ $lang['admin_register'] = 'הוספת משתמש חדש'; $lang['metaedit'] = 'עריכת נתוני העל'; $lang['metasaveerr'] = 'אירע כשל בשמירת נתוני העל'; $lang['metasaveok'] = 'נתוני העל נשמרו'; -$lang['btn_img_backto'] = 'חזרה אל %s'; $lang['img_title'] = 'שם:'; $lang['img_caption'] = 'כותרת:'; $lang['img_date'] = 'תאריך:'; @@ -257,7 +264,6 @@ $lang['img_camera'] = 'מצלמה:'; $lang['img_keywords'] = 'מילות מפתח:'; $lang['img_width'] = 'רוחב:'; $lang['img_height'] = 'גובה:'; -$lang['btn_mediaManager'] = 'צפה במנהל מדיה'; $lang['subscr_subscribe_success'] = '%s נוסף לרשימת המינויים לדף %s'; $lang['subscr_subscribe_error'] = 'אירעה שגיאה בהוספת %s לרשימת המינויים לדף %s'; $lang['subscr_subscribe_noaddress'] = 'אין כתובת המשויכת עם הכניסה שלך, נא ניתן להוסיף אותך לרשימת המינויים'; @@ -287,6 +293,7 @@ $lang['i_modified'] = 'משיקולי אבטחה סקריפט זה י Dokuwiki installation instructions'; $lang['i_funcna'] = 'פונקציית ה-PHP‏ %s אינה זמינה. יתכן כי מארח האתר חסם אותה מסיבה כלשהי?'; $lang['i_phpver'] = 'גרסת PHP שלך %s נמוכה מ %s הצורך. אתה צריך לשדרג PHP שלך להתקין.'; +$lang['i_mbfuncoverload'] = 'יש לבטל את mbstring.func_overload בphp.ini בכדי להריץ את DokuWiki'; $lang['i_permfail'] = '%s אינה ניתנת לכתיבה על ידי DokuWiki. עליך לשנות הרשאות תיקייה זו!'; $lang['i_confexists'] = '%s כבר קיים'; $lang['i_writeerr'] = 'אין אפשרות ליצור את %s. נא לבדוק את הרשאות הקובץ/תיקייה וליצור את הקובץ ידנית.'; @@ -326,3 +333,18 @@ $lang['media_sort_date'] = 'תאריך'; $lang['media_namespaces'] = 'בחר מרחב שמות'; $lang['media_files'] = 'קבצים ב s%'; $lang['media_upload'] = 'להעלות s%'; +$lang['media_search'] = 'חיפוש ב%s'; +$lang['media_view'] = '%s'; +$lang['media_viewold'] = '%s ב %s'; +$lang['media_edit'] = 'ערוך %s'; +$lang['media_history'] = 'היסטוריה של %s'; +$lang['media_meta_edited'] = 'metadata נערך'; +$lang['media_perm_read'] = 'מצטערים, אין לך הרשאות לקרוא קבצים.'; +$lang['media_perm_upload'] = 'מצטערים, אין לך הרשאות להעלות קבצים.'; +$lang['media_update'] = 'העלה גירסה חדשה'; +$lang['media_restore'] = 'שחזר גירסה זו'; +$lang['currentns'] = 'שם מרחב נוכחי'; +$lang['searchresult'] = 'תוצאות חיפוש'; +$lang['plainhtml'] = 'HTML פשוט'; +$lang['page_nonexist_rev'] = 'העמוד לא קיים ב%s. העמוד נוצר במקום זאת ב%s.'; +$lang['unable_to_parse_date'] = 'לא ניתן לפענח פרמטר "%s".'; diff --git a/inc/lang/he/resetpwd.txt b/inc/lang/he/resetpwd.txt new file mode 100644 index 000000000..bd7b5ace4 --- /dev/null +++ b/inc/lang/he/resetpwd.txt @@ -0,0 +1,3 @@ +====== קבע סיסמה חדשה ====== + +אנא הכנס סיסמה חדשה לחשבון שלך בויקי זה. \ No newline at end of file -- cgit v1.2.3 From d387bf5e958e9d25a7192d1f5e5280ac0eb82da7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Mar 2015 20:27:10 +0100 Subject: correct error checking for bz2 file reading The code reading .bz2 compressed files did not correctly check for possible read errors. In case of a corrupted file this could have led to an infinite loop. Thanks to Filippo Cavallarin from www.segment.technology for dicovering this bug. --- _test/tests/inc/io_readfile.test.php | 53 ++++++++++++++++++++++++++++ _test/tests/inc/io_readfile/corrupt.txt.bz2 | 1 + _test/tests/inc/io_readfile/corrupt.txt.gz | Bin 0 -> 31 bytes _test/tests/inc/io_readfile/test.txt.bz2 | Bin 0 -> 49 bytes _test/tests/inc/io_readfile/test.txt.gz | Bin 0 -> 31 bytes inc/io.php | 16 ++++++--- 6 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 _test/tests/inc/io_readfile.test.php create mode 100644 _test/tests/inc/io_readfile/corrupt.txt.bz2 create mode 100644 _test/tests/inc/io_readfile/corrupt.txt.gz create mode 100644 _test/tests/inc/io_readfile/test.txt.bz2 create mode 100644 _test/tests/inc/io_readfile/test.txt.gz diff --git a/_test/tests/inc/io_readfile.test.php b/_test/tests/inc/io_readfile.test.php new file mode 100644 index 000000000..e3e90cd8d --- /dev/null +++ b/_test/tests/inc/io_readfile.test.php @@ -0,0 +1,53 @@ +markTestSkipped('skipping all zlib tests. Need zlib extension'); + } + } + + /* + * dependency for tests needing zlib extension to pass + */ + public function test_ext_bz2() { + if (!extension_loaded('bz2')) { + $this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension'); + } + } + + function test_plain(){ + // since git converts line endings, we can't check in this test file but have to create it ourselves + $plain = TMP_DIR.'/test.txt'; + file_put_contents($plain, "The\015\012Test\015\012"); + + $this->assertEquals("The\012Test\012", io_readFile($plain)); + $this->assertEquals("The\015\012Test\015\012", io_readFile($plain, false)); + $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt')); + } + + /** + * @depends test_ext_zlib + */ + function test_gzfiles(){ + $this->assertEquals("The\012Test\012", io_readFile(__DIR__.'/io_readfile/test.txt.gz')); + $this->assertEquals("The\015\012Test\015\012", io_readFile(__DIR__.'/io_readfile/test.txt.gz', false)); + $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt.gz')); + $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/corrupt.txt.gz')); + } + + /** + * @depends test_ext_bz2 + */ + function test_bzfiles(){ + $this->assertEquals("The\012Test\012", io_readFile(__DIR__.'/io_readfile/test.txt.bz2')); + $this->assertEquals("The\015\012Test\015\012", io_readFile(__DIR__.'/io_readfile/test.txt.bz2', false)); + $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/nope.txt.bz2')); + $this->assertEquals(false, io_readFile(__DIR__.'/io_readfile/corrupt.txt.bz2')); + } + +} \ No newline at end of file diff --git a/_test/tests/inc/io_readfile/corrupt.txt.bz2 b/_test/tests/inc/io_readfile/corrupt.txt.bz2 new file mode 100644 index 000000000..97f742919 --- /dev/null +++ b/_test/tests/inc/io_readfile/corrupt.txt.bz2 @@ -0,0 +1 @@ +BZh91AY&SYXHd \ No newline at end of file diff --git a/_test/tests/inc/io_readfile/corrupt.txt.gz b/_test/tests/inc/io_readfile/corrupt.txt.gz new file mode 100644 index 000000000..f7f5d3397 Binary files /dev/null and b/_test/tests/inc/io_readfile/corrupt.txt.gz differ diff --git a/_test/tests/inc/io_readfile/test.txt.bz2 b/_test/tests/inc/io_readfile/test.txt.bz2 new file mode 100644 index 000000000..3d4e1b226 Binary files /dev/null and b/_test/tests/inc/io_readfile/test.txt.bz2 differ diff --git a/_test/tests/inc/io_readfile/test.txt.gz b/_test/tests/inc/io_readfile/test.txt.gz new file mode 100644 index 000000000..8ac8f7d40 Binary files /dev/null and b/_test/tests/inc/io_readfile/test.txt.gz differ diff --git a/inc/io.php b/inc/io.php index 3ed227162..0636a4b62 100644 --- a/inc/io.php +++ b/inc/io.php @@ -101,7 +101,7 @@ function _io_readWikiPage_action($data) { * * @param string $file filename * @param bool $clean - * @return string + * @return string|bool the file contents or false on error */ function io_readFile($file,$clean=true){ $ret = ''; @@ -114,7 +114,7 @@ function io_readFile($file,$clean=true){ $ret = file_get_contents($file); } } - if($clean){ + if($ret !== false && $clean){ return cleanText($ret); }else{ return $ret; @@ -124,22 +124,28 @@ function io_readFile($file,$clean=true){ * Returns the content of a .bz2 compressed file as string * * @author marcel senf + * @author Andreas Gohr * * @param string $file filename - * @return string content + * @return string|bool content or false on error */ function bzfile($file){ $bz = bzopen($file,"r"); + if($bz === false) return false; + $str = ''; while (!feof($bz)){ //8192 seems to be the maximum buffersize? - $str = $str . bzread($bz,8192); + $buffer = bzread($bz,8192); + if(($buffer === false) || (bzerrno($bz) !== 0)) { + return false; + } + $str = $str . $buffer; } bzclose($bz); return $str; } - /** * Used to write out a DokuWiki page to file, and send IO_WIKIPAGE_WRITE events. * -- cgit v1.2.3 From 6abea1c0be56a2cb5575c8921c3e6661ed565697 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Mar 2015 21:55:59 +0100 Subject: fixed HTTPS proxy tests, our tests now run on httpbin.org This also reverses the order of crypto protocols tried again. Using TLS first again. related to #915 --- _test/tests/inc/httpclient_http_proxy.test.php | 2 +- _test/tests/inc/httpclient_https_proxy.test.php | 2 +- inc/HTTPClient.php | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/_test/tests/inc/httpclient_http_proxy.test.php b/_test/tests/inc/httpclient_http_proxy.test.php index 79b8f8e5e..dae801dbd 100644 --- a/_test/tests/inc/httpclient_http_proxy.test.php +++ b/_test/tests/inc/httpclient_http_proxy.test.php @@ -3,7 +3,7 @@ require_once (__DIR__ . '/httpclient_mock.php'); class httpclient_http_proxy_test extends DokuWikiTest { - protected $url = 'http://test.dokuwiki.org/README'; + protected $url = 'http://httpbin.org/user-agent'; /** * @group internet diff --git a/_test/tests/inc/httpclient_https_proxy.test.php b/_test/tests/inc/httpclient_https_proxy.test.php index 7a54bb92e..cf5b9a8b9 100644 --- a/_test/tests/inc/httpclient_https_proxy.test.php +++ b/_test/tests/inc/httpclient_https_proxy.test.php @@ -2,7 +2,7 @@ require_once dirname(__FILE__).'/httpclient_http_proxy.test.php'; class httpclient_https_proxy_test extends httpclient_http_proxy_test { - protected $url = 'https://test.dokuwiki.org/README'; + protected $url = 'https://httpbin.org/user-agent'; public function setUp(){ // skip tests when this PHP has no SSL support diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 24b3a8d78..092216c57 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -592,20 +592,22 @@ class HTTPClient { // set correct peer name for verification (enabled since PHP 5.6) stream_context_set_option($socket, 'ssl', 'peer_name', $requestinfo['host']); - // Because of older PHP versions having trouble with TLS (enable_crypto returns true, but - // the conection still borks) we try SSLv3 first - if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) { + // because SSLv3 is mostly broken, we try TLS connections here first. + // according to https://github.com/splitbrain/dokuwiki/commit/c05ef534 we had problems with certain + // setups with this solution before, but we have no usable test for that and TLS should be the more + // common crypto by now + if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { $requesturl = $requestinfo['path']; return true; } - // If the proxy does not support SSLv3 we try TLS - if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + // if the above failed, this will most probably not work either, but we can try + if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) { $requesturl = $requestinfo['path']; return true; } - throw new HTTPClientException('Failed to set up crypto for secure proxy connection', -151); + throw new HTTPClientException('Failed to set up crypto for secure connection to '.$requestinfo['host'], -151); } throw new HTTPClientException('Failed to establish secure proxy connection', -150); -- cgit v1.2.3 From f23f95941a400702f525923973f3612df6da82cb Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Mar 2015 22:16:34 +0100 Subject: SECURITY escape user properties in user manager #1081 The user properties (login, real name, etc) where not properly escaped in the user manager's edit form. This allowed a XSS attack on the superuser by registered users. Thanks to Filippo Cavallarin from www.segment.technology for discovering this bug. --- lib/plugins/usermanager/admin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index cc4c4ae47..9cb9b0c40 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -222,9 +222,9 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { */ $groups = join(', ',$grps); ptln(" "); - ptln(" "); + ptln(" "); if ($editable) { - ptln(" 1, + ptln(" 1, 'do' => 'admin', 'page' => 'usermanager', 'sectok' => getSecurityToken())). @@ -356,7 +356,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { // save current $user, we need this to access details if the name is changed if ($user) - ptln(" ",$indent); + ptln(" ",$indent); $this->_htmlFilterSettings($indent+10); @@ -401,6 +401,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { $fieldtype = 'text'; $autocomp = ''; } + $value = hsc($value); echo ""; echo ""; -- cgit v1.2.3 From 8599a179b08d4cdcf1c8895bacde82aad9df101f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Mar 2015 22:43:45 +0100 Subject: corrupted the gz test file more it seems that different zlib versions behave different with corrupted files. Some return false, some return whatever they still can read from the file. the file now should no longer be readable by any version. --- _test/tests/inc/io_readfile/corrupt.txt.gz | Bin 31 -> 31 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/_test/tests/inc/io_readfile/corrupt.txt.gz b/_test/tests/inc/io_readfile/corrupt.txt.gz index f7f5d3397..9d7666f47 100644 Binary files a/_test/tests/inc/io_readfile/corrupt.txt.gz and b/_test/tests/inc/io_readfile/corrupt.txt.gz differ -- cgit v1.2.3