Fix bugs from admin rank updates (#9888)

This commit is contained in:
Erki
2020-09-07 10:28:13 +02:00
committed by GitHub
parent 2caaaa6f5e
commit e1954661a6
3 changed files with 17 additions and 6 deletions
+7 -5
View File
@@ -85,7 +85,7 @@ var/list/forum_groupids_to_ranks = list()
//Split the line at every "-"
var/list/List = text2list(line, "-")
if(!List.len)
if(List.len != 2)
continue
//ckey is before the first "-"
@@ -94,20 +94,22 @@ var/list/forum_groupids_to_ranks = list()
continue
//rank follows the first "-"
var/rank = ""
if(List.len >= 2)
rank = ckeyEx(List[2])
var/rank = trim(List[2])
//load permissions associated with this rank
var/datum/admin_rank/rank_object = admin_ranks[rank]
if (!rank_object)
error("Unrecognized rank in admins.txt: \"[rank]\"")
continue
//create the admin datum and store it for later use
var/datum/admins/D = new /datum/admins(rank, rank_object?.rights || 0, ckey)
//find the client for a ckey if they are connected and associate them with the new admin datum
D.associate(directory[ckey])
log_debug("AdminRanks: Upaded Admins from Legacy System")
log_debug("AdminRanks: Updated Admins from Legacy System")
else
//The current admin system uses SQL
+4 -1
View File
@@ -105,7 +105,10 @@
if(!check_rights(R_SERVER|R_DEV))
return
message_admins("[usr] manually reloaded admins")
if (config.use_forumuser_api)
update_admins_from_api(FALSE)
log_and_message_admins("manually reloaded admins.")
load_admins()
feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!