Merge pull request #1197 from Cheridan/Admin

Admin Log Tweaks
This commit is contained in:
Cael Aislinn
2013-08-23 07:20:45 -07:00
6 changed files with 25 additions and 24 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ var/savefile/Banlist
Banlist["temp"] << temp
if (temp)
Banlist["minutes"] << bantimestamp
notes_add(ckey, "Banned - [reason]")
notes_add(ckey, "Banned for [minutes] minutes - [reason]")
return 1
/proc/RemoveBan(foldername)
+2 -2
View File
@@ -22,12 +22,12 @@
F << "<small>[time2text(world.timeofday,"hh:mm")] \ref[src] ([x],[y],[z])</small> || [src] [message]<br>"
//ADMINVERBS
/client/proc/investigate_show( subject in list("hrefs","notes","ntsl","singulo") )
/client/proc/investigate_show( subject in list("hrefs","notes","ntsl","singulo", "wires") )
set name = "Investigate"
set category = "Admin"
if(!holder) return
switch(subject)
if("singulo", "ntsl") //general one-round-only stuff
if("singulo", "ntsl", "wires") //general one-round-only stuff
var/F = investigate_subject2file(subject)
if(!F)
src << "<font color='red'>Error: admin_investigate: [INVESTIGATE_DIR][subject] is an invalid path or cannot be accessed.</font>"
+18 -6
View File
@@ -12,7 +12,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
var/savefile/notesfile = new(NOTESFILE)
if(!notesfile) return "<font color='red'>Error: Cannot access [NOTESFILE]</font>"
if(ckey)
. = "<b>Notes for <a href='?_src_=holder;notes=show'>[ckey]</a>:</b> <a href='?_src_=holder;notes=add;ckey=[ckey]'>\[+\]</a> <a href='?_src_=holder;notes=remove;ckey=[ckey]'>\[-\]</a><br>"
. = "<b>Notes for <a href='?_src_=holder;notes=show'>[ckey]</a>:</b> <a href='?_src_=holder;notes=add;ckey=[ckey]'>\[+\]</a><br>"
notesfile.cd = "/[ckey]"
var/index = 1
while( !notesfile.eof )
@@ -21,7 +21,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
. += "[note] <a href='?_src_=holder;notes=remove;ckey=[ckey];from=[index]'>\[-\]</a><br>"
index++
else
. = "<b>All Notes:</b> <a href='?_src_=holder;notes=add'>\[+\]</a> <a href='?_src_=holder;notes=remove'>\[-\]</a><br>"
. = "<b>All Notes:</b> <a href='?_src_=holder;notes=add'>\[+\]</a><br>"
notesfile.cd = "/"
for(var/dir in notesfile.dir)
. += "<a href='?_src_=holder;notes=show;ckey=[dir]'>[dir]</a><br>"
@@ -31,7 +31,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
//handles adding notes to the end of a ckey's buffer
//originally had seperate entries such as var/by to record who left the note and when
//but the current bansystem is a heap of dung.
/proc/notes_add(var/ckey, var/note)
/proc/notes_add(var/ckey, var/note, var/lognote = 0)
if(!ckey)
ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
if(!ckey) return
@@ -45,11 +45,17 @@ datum/admins/proc/notes_gethtml(var/ckey)
notesfile.cd = "/[ckey]"
notesfile.eof = 1 //move to the end of the buffer
notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
if(lognote)//don't need an admin log for the notes applied automatically during bans.
message_admins("[key_name(usr)] added note '[note]' to [ckey]")
log_admin("[key_name(usr)] added note '[note]' to [ckey]")
return
//handles removing entries from the buffer, or removing the entire directory if no start_index is given
/proc/notes_remove(var/ckey, var/start_index, var/end_index)
var/savefile/notesfile = new(NOTESFILE)
var/admin_msg
if(!notesfile) return
if(!ckey)
@@ -67,17 +73,23 @@ datum/admins/proc/notes_gethtml(var/ckey)
var/temp
notesfile >> temp
if( (start_index <= index) && (index <= end_index) )
admin_msg = temp
continue
noteslist += temp
notesfile.eof = -2 //Move to the start of the buffer and then erase.
for( var/note in noteslist )
notesfile << note
else
notesfile.cd = "/"
if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
message_admins("[key_name(usr)] removed a note '[admin_msg]' from [ckey]")
log_admin("[key_name(usr)] removed a note '[admin_msg]' from [ckey]")
if(noteslist.len == 0)
notesfile.cd = "/"
notesfile.dir.Remove(ckey)
message_admins("[ckey] has no notes and was removed from the notes list.")
return
#undef NOTESFILE
+1 -1
View File
@@ -862,7 +862,7 @@
if("show")
notes_show(ckey)
if("add")
notes_add(ckey,href_list["text"])
notes_add(ckey,href_list["text"], 1)
notes_show(ckey)
if("remove")
notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"]))