Changeset

4909:6ce42aacad42

mod_adhoc_account_management: Add compatibility with 0.12 permission string (thanks mirux)
author Matthew Wild <mwild1@gmail.com>
date Sat, 19 Mar 2022 09:10:25 +0000
parents 4908:44be2c6087f3
children 4910:5dffb85e62c4
files mod_adhoc_account_management/mod_adhoc_account_management.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_adhoc_account_management/mod_adhoc_account_management.lua	Thu Mar 17 20:24:43 2022 +0000
+++ b/mod_adhoc_account_management/mod_adhoc_account_management.lua	Sat Mar 19 09:10:25 2022 +0000
@@ -103,7 +103,9 @@
 
 -- Feature requests? What could fit under account management?
 
+-- COMPAT w/0.11 (uses "user" instead of "any")
+local permission = pcall(require, "core.features") and "any" or "user";
 
 local adhoc_new = module:require "adhoc".new;
-local adhoc_passwd = adhoc_new("Change Password", "passwd", change_password_command_handler, "user");
+local adhoc_passwd = adhoc_new("Change Password", "passwd", change_password_command_handler, permission);
 module:add_item ("adhoc", adhoc_passwd);