tigercat requested changes.

This commit is contained in:
Dedhia
2018-10-07 06:50:50 -07:00
parent 0d1ee8c64f
commit 7ccb5b3ded
3 changed files with 12 additions and 12 deletions

View File

@@ -40,12 +40,11 @@ var/global/file_uid = 0
temp.password = password
return temp
/datum/computer_file/proc/can_access_file(var/mob/user, input_password = "")
/datum/computer_file/proc/can_access_file(mob/user, input_password = "")
if(!password)
return TRUE
else if(!input_password)
if(!input_password)
input_password = sanitize(input(user, "Please enter a password to access file '[filename]':"))
if(input_password == password)
return TRUE
else
return FALSE
return FALSE

View File

@@ -86,12 +86,9 @@
if("PRG_openfile")
. = 1
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_openfile"])
if(!F)
return
if(F.can_access_file(usr))
open_file = href_list["PRG_openfile"]
else
if(!F.can_access_file(usr))
return
open_file = href_list["PRG_openfile"]
if("PRG_newtextfile")
. = 1
var/newname = stripped_input(usr, "Enter file name or leave blank to cancel:", "File rename", max_length=50)
@@ -215,7 +212,11 @@
return 1
if(F.password)
return
F.password = sanitize(input(usr, "Enter an encryption key:", "Encrypt File"))
var/new_password = sanitize(input(usr, "Enter an encryption key:", "Encrypt File"))
if(!new_password)
to_chat(usr, "<span class='warning'>File not encrypted.</span>")
return
F.password=new_password
if("PRG_decrypt")
. = 1
if(!HDD)