diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index e68425111f5..3bd20bbcbde 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -291,7 +291,10 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/author = query.item[2]
var/title = query.item[3]
var/category = query.item[4]
- dat += "
| [author] | [title] | [category] | \[Order\] |
"
+ dat += "| [author] | [title] | [category] | \[Order\]"
+ if(check_rights(R_ADMIN)) // This isn't the only check, since you can just href-spoof press this button. Just to tidy things up.
+ dat += "\[Del\]"
+ dat += " |
"
dat += ""
dat += "
(Return to main menu)
"
@@ -451,6 +454,18 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
B.item_state = B.icon_state
src.visible_message("[src]'s printer hums as it produces a completely bound book. How did it do that?")
break
+
+ if(href_list["delid"])
+ if(!check_rights(R_ADMIN))
+ return
+ var/sqlid = sanitizeSQL(href_list["delid"])
+ establish_old_db_connection()
+ if(!dbcon_old.IsConnected())
+ alert("Connection to Archive has been severed. Aborting.")
+ else
+ var/DBQuery/query = dbcon_old.NewQuery("DELETE FROM library WHERE id=[sqlid]")
+ query.Execute()
+
if(href_list["orderbyid"])
var/orderid = input("Enter your order:") as num|null
if(orderid)