Skip to content

Commit

Permalink
Item14184: remove /o from regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 9, 2016
1 parent b05a0b7 commit 30c6146
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 32 deletions.
14 changes: 7 additions & 7 deletions .gitignore
@@ -1,8 +1,8 @@
*.swp
NewUserPlugin.md5
NewUserPlugin.sha1
NewUserPlugin.tgz
NewUserPlugin.txt
NewUserPlugin.zip
NewUserPlugin_installer
NewUserPlugin_installer.pl
/NewUserPlugin.md5
/NewUserPlugin.sha1
/NewUserPlugin.tgz
/NewUserPlugin.txt
/NewUserPlugin.zip
/NewUserPlugin_installer
/NewUserPlugin_installer.pl
18 changes: 17 additions & 1 deletion data/System/NewLdapUserTemplate.txt
@@ -1,6 +1,22 @@
%META:TOPICINFO{author="ProjectContributor" comment="save topic" date="1326992609" format="1.1" reprev="2" version="2"}%
%META:TOPICINFO{author="BaseUserMapping_333" comment="save topic" date="1447692369" format="1.1" reprev="2" version="7"}%
%META:TOPICPARENT{name="WikiUsers"}%


%META:FORM{name="%25SYSTEMWEB%25.UserForm"}%
%META:FIELD{name="FirstName" attributes="" title="<nop>FirstName" value=""}%
%META:FIELD{name="LastName" attributes="" title="<nop>LastName" value=""}%
%META:FIELD{name="OrganisationName" attributes="" title="<nop>OrganisationName" value=""}%
%META:FIELD{name="OrganisationURL" attributes="" title="<nop>OrganisationURL" value=""}%
%META:FIELD{name="Profession" attributes="" title="Profession" value=""}%
%META:FIELD{name="Country" attributes="" title="[[System.CountryList][Country]]" value=""}%
%META:FIELD{name="State" attributes="" title="State" value=""}%
%META:FIELD{name="Address" attributes="" title="Address" value=""}%
%META:FIELD{name="Location" attributes="" title="Location" value=""}%
%META:FIELD{name="Telephone" attributes="" title="Telephone" value=""}%
%META:FIELD{name="VoIP" attributes="" title="<nop>VoIP" value=""}%
%META:FIELD{name="InstantMessagingIM" attributes="" title="<nop>InstantMessaging (IM)" value=""}%
%META:FIELD{name="Email" attributes="" title="Email" value=""}%
%META:FIELD{name="HomePage" attributes="" title="<nop>HomePage" value=""}%
%META:FIELD{name="Comment" attributes="" title="Comment" value=""}%
%META:PREFERENCE{name="TOPICTITLE" title="TOPICTITLE" type="Local" value="%25EXPAND%7b%22$percntLDAP%7b\%22sAMAccountName=$percntUSERNAME$percnt\%22 format=\%22$dollardisplayName\%22%7d$percnt%22%7d%25"}%
%META:PREFERENCE{name="VIEW_TEMPLATE" title="VIEW_TEMPLATE" type="Local" value="System.LdapUserView"}%
34 changes: 18 additions & 16 deletions data/System/NewUserPlugin.txt
@@ -1,6 +1,9 @@
%META:TOPICINFO{author="ProjectContributor" date="1419453466" format="1.1" version="1"}%
---+!! NewUserPlugin
%FORMFIELD{"Description"}%

%TOC%

---++ Description
This plugin is of use in those cases where users are registered and authenticated externally,
for example using LDAP.
Expand Down Expand Up @@ -43,20 +46,11 @@ Example:
---++ Installation Instructions
%$INSTALL_INSTRUCTIONS%

---++ Plugin Info
This work is partly funded by
* [[http://www.hennerich.de][T+T Hennerich <nop>GmbH]]
* [[http://www.trivadis.com][Trivadis AG]]
---++ Dependencies
%$DEPENDENCIES%

<!--
* Set SHORTDESCRIPTION = Create a user topic if it does not exist yet
-->
| Plugin Author: | Michael Daum |
| Copyright &copy;: | 2006-2014, Michael Daum http://michaeldaumconsulting.com |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
---++ Change History
| 09 Sep 2016 | remove /o flag from regular expressions |
| 04 Apr 2014 | flag rest handlers that don't require authentication |
| 27 Feb 2013 | disabled debug flag by default |
| 29 Nov 2012 | added service to bulk attach photos to user topics |
Expand All @@ -78,6 +72,14 @@ This work is partly funded by
| 23 Oct 2007 | work around infinite loop in combination with <nop>ActionTrackerPlugin |
| 17 Sep 2007 | replace usernames in formtemplates as well as in the topic text |
| 18 Dec 2006 | initial release |
| Dependencies: | None |
| Plugin Home: | Foswiki:Extensions/%TOPIC% |
| Support: | Foswiki:Support/%TOPIC% |

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="2006-2016, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/%TOPIC%"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%TOPIC%"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%
15 changes: 8 additions & 7 deletions lib/Foswiki/Plugins/NewUserPlugin.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2006-2014 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2006-2016 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -24,8 +24,8 @@ use Foswiki::Func ();
use Foswiki::Plugins ();
use Error qw(:try);

our $VERSION = '2.42';
our $RELEASE = '2.42';
our $VERSION = '2.43';
our $RELEASE = '09 Sep 2016';
our $SHORTDESCRIPTION = 'Create a user topic if it does not exist yet';
our $NO_PREFS_IN_TOPIC = 1;
our $done;
Expand Down Expand Up @@ -135,10 +135,11 @@ sub expandVariables {
my $found = 0;
my $mixedAlphaNum = $Foswiki::regex{'mixedAlphaNum'};

$found = 1 if $text =~ s/\$perce?nt/\%/go;
$found = 1 if $text =~ s/\$nop//go;
$found = 1 if $text =~ s/\$n([^$mixedAlphaNum]|$)/\n$1/go;
$found = 1 if $text =~ s/\$dollar/\$/go;
$found = 1 if $text =~ s/\$perce?nt/\%/g;
$found = 1 if $text =~ s/\$nop//g;
$found = 1 if $text =~ s/\$n([^$mixedAlphaNum]|$)/\n$1/g;
$found = 1 if $text =~ s/\$dollar/\$/g;
$found = 1 if $text =~ s/\\"/"/g;

$text = Foswiki::Func::expandCommonVariables($text, $topic, $web) if $found;

Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/NewUserPlugin/build.pl
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
BEGIN {
unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} );
}
Expand Down

0 comments on commit 30c6146

Please sign in to comment.