From 7f73e4459e836ee4dbf8caee89ca2b7a47340101 Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Wed, 9 Apr 2014 12:15:18 -0700 Subject: [PATCH] Missing VGWS API calls. --- code/modules/admin/admin.dm | 6 ++++-- code/modules/admin/vg-web.dm | 14 +++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index b33a9e876e5..66c5cd6e5cd 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -234,7 +234,8 @@ var/global/floorIsLava = 0 return checkSessionKey() var/cid = input("Type computer ID", "CID", 0) - usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&cid=[cid]") + usr << link(getVGPanel("rapsheet",admin=1,query=list("cid"=cid))) + //usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&cid=[cid]") return /datum/admins/proc/checkCKEY() @@ -249,7 +250,8 @@ var/global/floorIsLava = 0 return checkSessionKey() var/ckey = lowertext(input("Type player ckey", "ckey", null) as text | null) - usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]") + usr << link(getVGPanel("rapsheet",admin=1,query=list("ckey"=ckey))) + //usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]") return /datum/admins/proc/PlayerNotesPage(page) diff --git a/code/modules/admin/vg-web.dm b/code/modules/admin/vg-web.dm index 9afad3a7be6..ce5652f63a8 100644 --- a/code/modules/admin/vg-web.dm +++ b/code/modules/admin/vg-web.dm @@ -1,12 +1,20 @@ #ifdef __OPENBYOND +// The idea is to eventually be able to call +//user << VGPanel(...) +// instead of +//user << link(GetVGPanel(...)) +// But OpenBYOND isn't ready yet. #define VGPanel(...) link(getVGPanel(__VA_ARGS__)) #endif + +// Usage: +// user << link(getVGPanel("route"[, admin=1][, query=list("get_var"="value")])) +// Turns into: +// [config.vgws_base_url]/index.php/route?get_var=value +// s is automatically added when admin=1. /datum/admins/proc/getVGPanel(var/route,var/list/query=list(),var/admin=0) checkSessionKey() var/url="[config.vgws_base_url]/index.php/[route]" - - //usr << link("[config.vgws_base_url]/index.php/rapsheet/?s=[sessKey]&ckey=[ckey]") - if(admin) query["s"]=sessKey url += buildurlquery(query)