From 6a2f02fa47834313745c9370f39e5df232d46128 Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Sat, 7 Nov 2015 14:57:08 -0800 Subject: [PATCH 1/2] Allows Database based jobbans to be lifted via the jobban panel. Jobbans lifted this way take into effect the same round. --- code/__DEFINES/admin.dm | 1 + code/modules/admin/DB ban/functions.dm | 6 ++++++ code/modules/admin/topic.dm | 6 +----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 65017becff3..930da1f2cac 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -17,6 +17,7 @@ #define BANTYPE_APPEARANCE 6 #define BANTYPE_ADMIN_PERMA 7 #define BANTYPE_ADMIN_TEMP 8 +#define BANTYPE_ANY_JOB 9 //used to remove jobbans //Please don't edit these values without speaking to Errorage first ~Carn //Admin Permissions diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index e52011f5ba6..0d60b16ef90 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -170,14 +170,20 @@ if(BANTYPE_ANY_FULLBAN) bantype_str = "ANY" bantype_pass = 1 + if(BANTYPE_ANY_JOB) + bantype_str = "ANYJOB" + bantype_pass = 1 if( !bantype_pass ) return var/bantype_sql if(bantype_str == "ANY") bantype_sql = "(bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now() ) )" + else if(bantype_str == "ANYJOB") + bantype_sql = "(bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now() ) )" else bantype_sql = "bantype = '[bantype_str]'" + var/sql = "SELECT id FROM [format_table_name("ban")] WHERE ckey = '[ckey]' AND [bantype_sql] AND (unbanned is null OR unbanned = false)" if(job) sql += " AND job = '[job]'" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index fdb2ccfac82..dc08a87351b 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -950,10 +950,6 @@ //Unbanning joblist //all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned) if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban. - if(!config.ban_legacy_system) - usr << "Unfortunately, database based unbanning cannot be done through this panel" - DB_ban_panel(M.ckey) - return var/msg for(var/job in joblist) var/reason = jobban_isbanned(M, job) @@ -962,7 +958,7 @@ if("Yes") ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]") log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]") - DB_ban_unban(M.ckey, BANTYPE_JOB_PERMA, job) + DB_ban_unban(M.ckey, BANTYPE_ANY_JOB, job) feedback_inc("ban_job_unban",1) feedback_add_details("ban_job_unban","- [job]") jobban_unban(M, job) From 981dd378f4c9346c94664034164dae3856e69a3c Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Sat, 7 Nov 2015 14:59:18 -0800 Subject: [PATCH 2/2] Removes extra line --- code/modules/admin/DB ban/functions.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 0d60b16ef90..f7cb35a8da3 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -183,7 +183,6 @@ else bantype_sql = "bantype = '[bantype_str]'" - var/sql = "SELECT id FROM [format_table_name("ban")] WHERE ckey = '[ckey]' AND [bantype_sql] AND (unbanned is null OR unbanned = false)" if(job) sql += " AND job = '[job]'"