Software /
code /
prosody
Comparison
plugins/mod_authz_internal.lua @ 12977:74b9e05af71e
plugins: Prefix module imports with prosody namespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Mar 2023 13:15:28 +0100 |
parent | 12925:6cb339423928 |
child | 13170:082c7d856e61 |
comparison
equal
deleted
inserted
replaced
12976:a187600ec7d6 | 12977:74b9e05af71e |
---|---|
1 local array = require "util.array"; | 1 local array = require "prosody.util.array"; |
2 local it = require "util.iterators"; | 2 local it = require "prosody.util.iterators"; |
3 local set = require "util.set"; | 3 local set = require "prosody.util.set"; |
4 local jid_split, jid_bare, jid_host = import("util.jid", "split", "bare", "host"); | 4 local jid_split, jid_bare, jid_host = import("prosody.util.jid", "split", "bare", "host"); |
5 local normalize = require "util.jid".prep; | 5 local normalize = require "prosody.util.jid".prep; |
6 local roles = require "util.roles"; | 6 local roles = require "prosody.util.roles"; |
7 | 7 |
8 local config_global_admin_jids = module:context("*"):get_option_set("admins", {}) / normalize; | 8 local config_global_admin_jids = module:context("*"):get_option_set("admins", {}) / normalize; |
9 local config_admin_jids = module:get_option_inherited_set("admins", {}) / normalize; | 9 local config_admin_jids = module:get_option_inherited_set("admins", {}) / normalize; |
10 local host = module.host; | 10 local host = module.host; |
11 local host_suffix = host:gsub("^[^%.]+%.", ""); | 11 local host_suffix = host:gsub("^[^%.]+%.", ""); |
319 print("EE: Please supply a valid host to migrate to the new role storage"); | 319 print("EE: Please supply a valid host to migrate to the new role storage"); |
320 return 1; | 320 return 1; |
321 end | 321 end |
322 | 322 |
323 -- Initialize storage layer | 323 -- Initialize storage layer |
324 require "core.storagemanager".initialize_host(migrate_host); | 324 require "prosody.core.storagemanager".initialize_host(migrate_host); |
325 | 325 |
326 print("II: Migrating roles..."); | 326 print("II: Migrating roles..."); |
327 local migrated, failed, skipped = do_migration(migrate_host); | 327 local migrated, failed, skipped = do_migration(migrate_host); |
328 print(("II: %d migrated, %d failed, %d skipped"):format(migrated, failed, skipped)); | 328 print(("II: %d migrated, %d failed, %d skipped"):format(migrated, failed, skipped)); |
329 return (failed + skipped == 0) and 0 or 1; | 329 return (failed + skipped == 0) and 0 or 1; |