Merge branch 'master' of github.com:Baystation12/Baystation12 into feature

This commit is contained in:
cib
2013-03-02 01:11:24 +01:00
6 changed files with 26 additions and 8 deletions

View File

@@ -112,7 +112,7 @@ var/global/obj/machinery/account_database/centcomm_account_db
dat += "Confirm identity: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"
if(access_level > 0)
dat += "<a href='?src=\ref[src];toggle_activated=1'>Toggle remote access to this database (warning!)</a>"
dat += "<a href='?src=\ref[src];toggle_activated=1'>[activated ? "Disable" : "Enable"] remote access</a><br>"
dat += "You may not edit accounts at this terminal, only create and view them.<br>"
if(creating_new_account)
dat += "<br>"

View File

@@ -43,7 +43,7 @@ log transactions
if(stat & NOPOWER)
return
if(linked_db && linked_db.stat & NOPOWER)
if(linked_db && ( (linked_db.stat & NOPOWER) || !linked_db.activated ) )
linked_db = null
authenticated_account = null
src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"")
@@ -68,7 +68,7 @@ log transactions
/obj/machinery/atm/proc/reconnect_database()
for(var/obj/machinery/account_database/DB in world)
if(DB.z == src.z && !DB.stat & NOPOWER)
if( DB.z == src.z && !(DB.stat & NOPOWER) && DB.activated )
linked_db = DB
break
@@ -259,7 +259,7 @@ log transactions
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
else
usr << "\red \icon[src] incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining."
usr << "\red \icon[src] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining."
previous_account_number = tried_account_num
playsound(src, 'buzz-sigh.ogg', 50, 1)
else
@@ -279,6 +279,8 @@ log transactions
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
usr << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'"
previous_account_number = tried_account_num
if("withdrawal")
var/amount = max(text2num(href_list["funds_amount"]),0)
@@ -342,8 +344,8 @@ log transactions
held_card = I
if("logout")
authenticated_account = null
usr << browse(null,"window=atm")
return
//usr << browse(null,"window=atm")
src.attack_hand(usr)
//create the most effective combination of notes to make up the requested amount
@@ -385,3 +387,14 @@ log transactions
I = P.id
if(I)
authenticated_account = linked_db.attempt_account_access(I.associated_account_number)
if(authenticated_account)
human_user << "\blue \icon[src] Access granted. Welcome user '[authenticated_account.owner_name].'"
//create a transaction log entry
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Remote terminal access"
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)