-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PasswordProtectedFiles #5067
PasswordProtectedFiles #5067
Changes from 1 commit
56418a3
ccea176
5ae29af
19ba053
093914b
d06f0a5
b609ece
8af142c
121103e
2b4bd2b
45fa2d4
f1da4d8
fb816e4
3c00491
49dc58a
7c83d5f
8faefc1
28de024
43ec5f7
1ec8efc
8218fcb
17852bb
75e5820
af8cc38
f23c03d
b867b90
d789693
0fb1088
c5eac59
65faf44
5de0a28
4d5c59f
e26199a
38d917f
79ae330
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,9 @@ | |
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive | ||
if(!HDD) | ||
return 1 | ||
var/newpassword = sanitize(input(usr, "Enter a password or leave blank to leave unprotected:")) | ||
var/datum/computer_file/data/F = new/datum/computer_file/data() | ||
F.filename = newname | ||
F.filetype = "TXT" | ||
if (newpassword) | ||
F.password = newpassword | ||
HDD.store_file(F) | ||
if(href_list["PRG_deletefile"]) | ||
. = 1 | ||
|
@@ -153,6 +150,23 @@ | |
return 1 | ||
var/datum/computer_file/C = F.clone(0) | ||
HDD.store_file(C) | ||
if(href_list["PRG_encrypt"]) | ||
. = 1 | ||
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check if HDD exists after this, and return if not. See line 135 or 146. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skull's comment is now invalid, check is present |
||
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_openfile"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldnt that be ? |
||
if (!F) | ||
return | ||
dapocalypse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
F.password = sanitize(input(usr, "Enter an encryption key:", "Encrypt File")) | ||
if(href_list["PRG_decrypt"]) | ||
. = 1 | ||
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check if HDD exists after this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skull's comment is now invalid, check is present |
||
var/datum/computer_file/F = HDD.find_file_by_name(href_list["PRG_openfile"]) | ||
if (!F) | ||
return | ||
if (F.can_access_file(usr)) | ||
F.password = "" | ||
else | ||
return | ||
if(.) | ||
SSnanoui.update_uis(NM) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ | |
{{:helper.link('DELETE', null, { "PRG_deletefile" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
{{:helper.link('RENAME', null, { "PRG_rename" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
{{:helper.link('CLONE', null, { "PRG_clone" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
{{:helper.link('ENCRYPT', null, { "PRG_encrypt" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should disable this button if the file is undeletable or if the file is already encrypted |
||
{{:helper.link('DECRYPT', null, { "PRG_decrypt" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should disable this button if the file is undeletable or if the file is already decrypted. |
||
{{if data.usbconnected}} | ||
{{:helper.link('EXPORT', null, { "PRG_copytousb" : value.name }, value.undeletable ? 'disabled' : null)}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove copying to USB drive? Please return this button. |
||
{{/if}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no checks present to see if the file is already encrypted.
That would allow a user to just hit the encrypt button again to set a password of their choosing.
You need to make sure that no password is set before encrypting the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks are now present