Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it is possible to make this plugin compatible with the plugin encryptedpasswords #194

Open
VDI93 opened this issue Aug 21, 2020 · 4 comments

Comments

@VDI93
Copy link

VDI93 commented Aug 21, 2020

Hello,
it is possible to make this plugin compatible with the plugin encryptedpasswords? https://www.dokuwiki.org/plugin:encryptedpasswords

The plugin edittable provide a nice interface for editing table but the button encrypt doesn't respond in combination with edittable und encryptedpasswords

many thanks!

@kalenpw
Copy link

kalenpw commented Sep 24, 2020

Following, I've been workin on this today (and affected by it for a while).

The primary problem I run into is when you store an encrypted password in a table and then edit said table, it strips the <decrypt> tags from around it thus breaking it for future usage.

At first I was trying to just put together a kludge that didn't strip away <decrypt>, but didn't have much luck.

I'm wondering if we'd be better off creating a new handler function in Doku_Handler and adding a pattern for <decrypt>

Something vageuly like this (based off https://www.dokuwiki.org/devel:parser):

// inc/parser/parser.php
$Lexer->addEntryPattern('<decrypt>', 'edit', 'decrypt');
$Lexer->addExitPattern('</decrypt>','decrypt');

// inc/parser/handler.php
function decrypt($match, $state, $pos) {
    return true; // do we need to do additional processing here?
}

Hopefully @splitbrain can give some pointers

@kalenpw
Copy link

kalenpw commented Sep 25, 2020

I've got a working solution, I'm not sure if it is the cleanest or not but here is what you can do.

Edit lib/plugins/edittable/renderer/inverse.php

Roughly line 633 is the plugin function. You need to tweak that to check if it's the encryptedpasswords plugin and if so add the decrypt tags

Here is my complete function

    function plugin($name, $args, $state = '', $match = '') {
        if($name === "encryptedpasswords") {
            $this->doc .= "<decrypt>$match</decrypt>";
        }
        else {
            $this->doc .= $match;
        }
        // This will break for plugins which provide a catch-all render method
        // like the do or pagenavi plugins
#        $plugin =& plugin_load('syntax',$name);
#        if($plugin === null || !$plugin->render($this->getFormat(),$this,$args)) {
#        }
    }

@Floffyko
Copy link

Hm... 3 Month ago I was forced to downgrade th encryptedpasswords to 2013-03-13 version in order to be compatible with Editable. So, kalenpw, my another idea is to compare the current encryptedpasswords version with 2013 one in order to find out what changes are there that make it incompatible.

Like I already said, the current Editable work without problems with encryptedpasswords version 2013.

ssahara referenced this issue in ssahara/dw-plugin-encryptedpasswords Nov 2, 2020
@ssahara
Copy link
Contributor

ssahara commented Nov 2, 2020

@Floffyko, Thank you for sharing your idea. I hope the updated encryptedpasswords plugin 2020-11-02 will solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants