Missing href token adds

This commit is contained in:
Novacat
2022-12-15 20:43:47 +00:00
committed by CHOMPStation2
parent 02092ee913
commit 1e7cbec2e3
66 changed files with 2368 additions and 461 deletions
+25
View File
@@ -51,6 +51,7 @@ var/global/datum/book_manager/book_mgr = new()
tgui_alert_async(usr, "Connection to Archive has been severed. Aborting.")
return
else
<<<<<<< HEAD
var/DBQuery/query = dbcon.NewQuery("DELETE FROM library WHERE id=[isbn]")
if(!query.Execute())
to_chat(usr,query.ErrorMsg())
@@ -58,6 +59,30 @@ var/global/datum/book_manager/book_mgr = new()
else
book_mgr.remove(isbn)
log_admin("[usr.key] has deleted the book [isbn]")
=======
dat += {"<A href='?our_comp=\ref[our_comp];[HrefToken()];orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>
<table>
<tr><td><A href='?our_comp=\ref[our_comp];[HrefToken()];sort=author>AUTHOR</A></td><td><A href='?our_comp=\ref[our_comp];[HrefToken()];sort=title>TITLE</A></td><td><A href='?our_comp=\ref[our_comp];[HrefToken()];sort=category>CATEGORY</A></td><td></td></tr>"}
var/DBQuery/query = dbcon_old.NewQuery("SELECT id, author, title, category FROM library ORDER BY [sortby]")
query.Execute()
var/show_admin_options = check_rights(R_ADMIN, show_msg = FALSE)
while(query.NextRow())
var/id = query.item[1]
var/author = query.item[2]
var/title = query.item[3]
var/category = query.item[4]
dat += "<tr><td>[author]</td><td>[title]</td><td>[category]</td><td>"
if(show_admin_options) // This isn't the only check, since you can just href-spoof press this button. Just to tidy things up.
dat += "<A href='?our_comp=\ref[our_comp];[HrefToken()];delid=[id]'>\[Del\]</A>"
dat += "</td></tr>"
dat += "</table>"
usr << browse(dat, "window=library")
onclose(usr, "library")
//VOREStation Edit End
>>>>>>> fe91b1a43b... Merge pull request #14206 from ItsSelis/selis-href-adds
// delete a book
/datum/book_manager/proc/remove(var/id)