From f34931d75b4ce9f047bee681a2a4813ef1919c90 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Sun, 14 Aug 2016 06:06:08 -0700 Subject: [PATCH] Admins with +debug get profile access Why haven't I done this much sooner? I can finally stop maintaining that damned config. Make sure I'm on when this is merged, I'll need to desync the profile config to avoid byond fighting with the other server when modifying the file. --- code/modules/admin/admin_ranks.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index 8adf647f56b..9673701d8b6 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -161,6 +161,9 @@ var/list/admin_ranks = list() //list of all admin_rank datums C.holder = null admins.Cut() load_admin_ranks() + //Clear profile access + for(var/A in world.GetConfig("admin")) + world.SetConfig("APP/admin", A, null) var/list/rank_names = list() for(var/datum/admin_rank/R in admin_ranks) @@ -189,6 +192,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/datum/admins/D = new(rank_names[rank], ckey) //create the admin datum and store it for later use if(!D) continue //will occur if an invalid rank is provided + if(D.rank.rights & R_DEBUG) //grant profile access + world.SetConfig("APP/admin", ckey, "role=admin") D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum else establish_db_connection() @@ -214,6 +219,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/datum/admins/D = new(rank_names[rank], ckey) //create the admin datum and store it for later use if(!D) continue //will occur if an invalid rank is provided + if(D.rank.rights & R_DEBUG) //grant profile access + world.SetConfig("APP/admin", ckey, "role=admin") D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum #ifdef TESTING @@ -369,4 +376,4 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/sql_admin_rank = sanitizeSQL(newrank) var/DBQuery/query_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'") - query_update.Execute() \ No newline at end of file + query_update.Execute()