From 6f8f3f5213cb58c7b0c1a918d36c68e4b9b5402d Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sat, 22 Oct 2005 12:55:04 +0000 Subject: [PATCH 1/1] never commited git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@132 839d8a87-29fc-0310-9880-83ba4fa771e5 --- install.d/wiki/e-protect.php | 134 ++++++++++++++++++++++++++++++++++++++++ install.d/wiki/empty/empty.tmpl | 4 +- plugins/pmwiki.platalAuth.php | 24 +++---- 3 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 install.d/wiki/e-protect.php diff --git a/install.d/wiki/e-protect.php b/install.d/wiki/e-protect.php new file mode 100644 index 0000000..2bae8fb --- /dev/null +++ b/install.d/wiki/e-protect.php @@ -0,0 +1,134 @@ + mailto:...]] + Jan 7 2005 - * Moved decoding script to Header, due to problem, when SideBar and Main Text + contains addresses to decode (Klonk) + + Nov 17 2004 - * Calling the decoding function as Custom Markup for PmWiki2 + (by Klonk) * made decoding of [[hidden-email:...]] working + BONUS: [[hidden-email:... |DisplayedText]] works also now + * added class='urllink' to decoded output for same CSS formating + as for other links in PmWiki2 + * inserted own function call in array $EditFunctions before 'ReplaceOnSave' + + May 11, 2004 - Working Beta. Still a few improvements to be made, but + the script is ready for public testing. Please feel + free to email me your comments/suggestions. Thanks! + May 8, 2004 - Alpha release. Not released to public. + + * Configuration * + There aren't (yet) any configuration variables for this script. */ + +//---------------------------------------------------------------------- + +## [[hidden-email:target]] +Markup('hidden-email',' hidden-email:target]] +Markup('-hidden-email','$email\");" . "\n//-->\n"; + else + $html .= "" . $AlternateText . ""; + $html .= "\n\n"; + return Keep($html); +} + +//---------------------------------------------------------------------- +function eProtectEncode ($pagename,&$page,&$new) { +//---------------------------------------------------------------------- + global $KeepToken, $KPV, $UrlExcludeChars; + if (!@$_POST['post']) return; // only Encode, when posting + $text = $new['text']; + $text = preg_replace_callback("/\\[\\=(.*?)\\=\\]/s", create_function('$str', 'return Keep($str[0]);'), $text); // extract the [= .. =] and temporarily store in $KPV[] +# $text = preg_replace_callback("/\\[\\[mailto:([^\\s$UrlExcludeChars]*)/", create_function('$m','return "[[hidden-email:".trim(eProtectStrRecode($m[1]));'), $text); + $text = preg_replace_callback("/\\[\\[(.*?)mailto:([^\\s$UrlExcludeChars]*)(.*?)\\]\\]/", create_function('$m','return "[[".$m[1]."hidden-email:".trim(eProtectStrRecode($m[2])).$m[3]."]]";'), $text); + $text = preg_replace("/$KeepToken(\\d+)$KeepToken/e",'$KPV[$1]',$text); // put the [= .. =] back in to the text + $new['text'] = $text; +} + +?> \ No newline at end of file diff --git a/install.d/wiki/empty/empty.tmpl b/install.d/wiki/empty/empty.tmpl index 06c619a..566059c 100644 --- a/install.d/wiki/empty/empty.tmpl +++ b/install.d/wiki/empty/empty.tmpl @@ -1,8 +1,6 @@ - - + - diff --git a/plugins/pmwiki.platalAuth.php b/plugins/pmwiki.platalAuth.php index 1dc2ebc..3d9d94c 100644 --- a/plugins/pmwiki.platalAuth.php +++ b/plugins/pmwiki.platalAuth.php @@ -1,8 +1,14 @@ trig("Erreur : page Wiki inutilisable sur plat/al"); + $page->trig('Erreur : page Wiki inutilisable sur plat/al'); } else { $page->trig("Tu n'as pas le droit d'accéder à ce service"); } @@ -94,10 +100,4 @@ function AuthPlatal($pagename, $level, $authprompt, $since) return 1; } -$Conditions['logged'] = 'logged()'; -$Conditions['identified'] = 'identified()'; -$Conditions['has_perms'] = 'has_perms()'; -$Conditions['public'] = 'true'; -$Conditions['only_public'] = '!identified()'; - ?> -- 2.1.4