mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-26 17:31:58 +00:00
tigercat requested changes.
This commit is contained in:
@@ -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
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user