DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:hidingip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:hidingip [2018-06-01 18:11] – a link to Japanese page hokkaidopersonplugin:hidingip [2020-07-14 10:08] (current) – Compatible with hogfather hokkaidoperson
Line 5: Line 5:
 author     : Hokkaidoperson  author     : Hokkaidoperson 
 email      : dosankomali@yahoo.co.jp  email      : dosankomali@yahoo.co.jp 
-type       : Action +type       : Action, Helper 
-lastupdate : 2018-06-01 +lastupdate : 2018-11-05 
-compatible : Greebo, 2018-04-22 +compatible : Greebo, Hogfather 
-tags       : !experimental, ip, annonymous+tags       : ip, anonymous
  
 downloadurl: https://github.com/hokkaidoperson/DokuWiki-HidingIP-Plugin/archive/master.zip downloadurl: https://github.com/hokkaidoperson/DokuWiki-HidingIP-Plugin/archive/master.zip
Line 16: Line 16:
  
 :!: [[ja:plugin:hidingip|このページは日本語でご覧頂けます(This page is also available in Japanese)]]\\  :!: [[ja:plugin:hidingip|このページは日本語でご覧頂けます(This page is also available in Japanese)]]\\ 
-:!: This plugin is still experimental.  Maybe it can't hide IPs completely.\\ 
 :!: I’m not a native English speaker, so this page may contain some mistakes in English sentences. :!: I’m not a native English speaker, so this page may contain some mistakes in English sentences.
  
Line 33: Line 32:
 ===== Installation ===== ===== Installation =====
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
Line 39: Line 38:
 It doesn't need any additional settings.\\ It doesn't need any additional settings.\\
 After you install this plugin, it'll automatically hide IPs in: After you install this plugin, it'll automatically hide IPs in:
-  * Recent Changes +  * Recent Changes (via an event [[devel:event:html_recentform_output|HTML_RECENTFORM_OUTPUT]]) 
-  * Old Revisions +  * Old Revisions (via an event [[devel:event:html_revisionsform_output|HTML_REVISIONSFORM_OUTPUT]]) 
-  * Showing Diffs +  * Showing Diffs (via an event [[devel:event:tpl_content_display|TPL_CONTENT_DISPLAY]]) 
-  * Last Modified +  * Last Modified (via an event [[devel:event:common_user_link|COMMON_USER_LINK]]) 
-  * Page Locking+  * Page Locking (via an event [[devel:event:common_user_link|COMMON_USER_LINK]])
  
 The plugin will rewrite only superficial data, core data won't be overwritten. The plugin will rewrite only superficial data, core data won't be overwritten.
 +
 +When to run this plugin can be specified on the config (see [[#Configuration and Settings]]).
 +
 +==== Helper Plugin Option ====
 +You can use the localization of the alternative text used by this plugin.\\
 +Here is a sample of the code:
 +<code PHP>
 +if (!isset($_SERVER['REMOTE_USER'])) {
 +    if(!plugin_isdisabled('hidingip')) {
 +        $hidingip = plugin_load('helper', 'hidingip');
 +        $user = $hidingip->altText();  // "$hidingip->getLang('notloggedin')" works similarly
 +}
 +</code>
 +
 +A practical sample can be seen in the program of my [[plugin:autotweet2|Autotweet2 plugin]] ([[https://github.com/hokkaidoperson/DokuWiki-AutoTweet2-Plugin/blob/master/action.php#L71|Here]]).
  
 ==== How IPs are Replaced ==== ==== How IPs are Replaced ====
 === In Recent Changes and Old Revisions === === In Recent Changes and Old Revisions ===
-When ''$event->data->_content['(number)']['class']'' has 'user', there is an user name or an IP address in ''$event->data->_content['(the next number)']''.\\+When ''%%$event->data->_content['(number)']['class']%%'' has 'user', there is an user name or an IP address in ''%%$event->data->_content['(the next number)']%%''.\\
 Thus this plugin detects the 'user' texts, and substitutes TRUE for ''$flag'' if found.\\ Thus this plugin detects the 'user' texts, and substitutes TRUE for ''$flag'' if found.\\
 If the ''$flag'' is TRUE, this plugin will check whether or not there is an IP in the texts.  If found, it'll be hidden .\\ If the ''$flag'' is TRUE, this plugin will check whether or not there is an IP in the texts.  If found, it'll be hidden .\\
-But, the first item of the old revision is little different from others, so there is some customizing.+But, the first item of the old revision is different a little from others, so there is some customizing.
  
 === In Showing Diffs === === In Showing Diffs ===
Line 58: Line 72:
  
 === In Last Modified and Page Locking === === In Last Modified and Page Locking ===
-Simply replace the texts that is likely IPs.\\+:!: **UPDATED**\\ 
 +If ''%%$event->data['username']%%'' is likely to be an IP, the plugin will write ''%%$event->data['name']%%''.\\
 :!: You can't use the user name like IPs (that'll be accidentally replaced. e.g.: 3.57.2.13 ).((though I think that the case is rare)) :!: You can't use the user name like IPs (that'll be accidentally replaced. e.g.: 3.57.2.13 ).((though I think that the case is rare))
 +
 +===== Configuration and Settings =====
 +You can change the following setting by using the [[plugin:config|Configuration Manager]].
 +
 +^Option^Description^Value Type^Default Value^
 +|''whenToHide''|When to run the plugin (In the text box, you can specify when to run if you'll use Hidingip Helper plugin in other plugins.)|multiple choice from ''revision'' (Old revisions), ''recent'' (Recent changes), ''diff'' (Showing diffs), and ''userlink'' (COMMON_USER_LINK event (such as page locking and showing "last modified"))|''revision,recent,diff,userlink''|
 +|''rightToSeeIP''|Who can see IP addresses? (see config "[[config:manager]]" and "[[config:superuser]]|pull-down choice from ''sp'' (Superusers) or ''mg'' (Managers (including superusers))|''sp''|
  
 ===== Development ===== ===== Development =====
Line 67: Line 89:
   * **2018-06-01**   * **2018-06-01**
     * Initial release     * Initial release
 +  * **2018-06-02**
 +    * modified text garbling
 +  * **2018-10-24**
 +    * Update with bug fixing (The problem about WARNING level errors, and the problem that the plugin didn't work well if [[config:showuseras|the config Showuseras]] was ''username_link'' or ''email_link'')
 +  * **2018-10-30**
 +    * Adding some options (configs and the helper plugin section)
 +  * **2018-11-05**
 +    * Fixed invalid syntax
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
Line 84: Line 114:
  
 ===== Discussion ===== ===== Discussion =====
- 
- 
- 
  
  
plugin/hidingip.1527869501.txt.gz · Last modified: 2018-06-01 18:11 by hokkaidoperson

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki