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

Feature suggestion : Allowing editong of any field for admins. #329

Open
chtiland opened this issue Aug 1, 2022 · 3 comments
Open

Feature suggestion : Allowing editong of any field for admins. #329

chtiland opened this issue Aug 1, 2022 · 3 comments

Comments

@chtiland
Copy link

chtiland commented Aug 1, 2022

Hi,

Allows admin or moderator to edit all fields of any comment would be useful (eg. if someone post its full name and didn't realized that it was published).

I tried to modify a comment by editing json file, but discussion disappears when doing so (checksum control somewhere ???, I don't have time to find why this happen, plugin feature or something else ?)

I don't know why this plugin became more and more restrictive for admins (few years ago it begun with the disappearance of IP, and no option to enable or not this feature, and that was really useful to create some IP filters).

Thanks

@Klap-in
Copy link
Member

Klap-in commented Sep 23, 2022

With quick look back in the history, I do not see were the ip-addresses were visible. Sure you do not confuse another plugin?

I removed ip-adresses now completely in #333, because it was implemented messy and it mixes with the user-id field.

The data format used for storing the comments is serialized PHP array. The best is to use php functions to open, unserialize, modify the user, serialize and store again.

//some code suggestion based on save() in action.php (NOT TESTED).
$pageid = '....';
// get discussion meta file name
$file = metaFN($pageid, '.comments');
$data = unserialize(io_readFile($file, false));

$cid = '...comment id....';

$data['comments'][$cid]['user']['name'] = ...
$data['comments'][$cid]['user']['mail'] = ...
//etc...

$date = time();
$data['comments'][$cid]['date']['modified'] = $date;
$type = 'ec'; // edit comment

// save the comment metadata file
io_saveFile($file, serialize($data));
//$this->addLogEntry($date, $pageid, $type, '', $cid);

So you recommend still storing regardless privacy considerations.

  • Were should it be accessible? How do you like to use it? Could you help explaining to make it specific?

At the moment the ip-adresses are still stored temporary in the comment-changelog, which hold a number of recent changes. But that changelog is not accessible via the interface so far i know.

@chtiland
Copy link
Author

Hello @Klap-in

I don't confused with another plugin, because that the one I choose on my first installation and never used another one (nor external one).
I think IP was displayed in admin section of discussion, but it was available in 2013 (some old hidden posts I kept) 😄

I care about privacy, but I decided to valid each post in discussions, less spams.
But sometimes, some posts or replies (injuries...) in discussions needs more than just deleting them and that's where IP of author is required (block IP or pursuits).

In fact, it would be nice to have IP only for admin, but, for privacy reason, best way would to keep this IP for "hidden" post and when clicking on "Show", IP can be removed (not more required).

Of course, if this feature is implemented, I would add a specific message to prevent and explain how, when and why their IP will be temporarily stored.

Thanks for tip to modify json, I didn't even think about php serialization... I probably was too tired 😋

About the comment-changelog, where this file is stored ? I found none in my meta folders, only json comments.

Thanks,
Fabrice

@Klap-in
Copy link
Member

Klap-in commented Sep 26, 2022

Changelog with number of changes (number of changes kept is set with the recent Configuration setting) is stored in $conf['metadir'].'/_comments.changes'

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

No branches or pull requests

2 participants