mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 11:42:30 +00:00
Locking a db now requests a password/key if none is set
This commit is contained in:
@@ -856,10 +856,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
|
|||||||
break;
|
break;
|
||||||
case MPActionDatabaseSettings:
|
case MPActionDatabaseSettings:
|
||||||
case MPActionEditPassword:
|
case MPActionEditPassword:
|
||||||
valid &= !self.encrypted;
|
|
||||||
break;
|
|
||||||
case MPActionLock:
|
case MPActionLock:
|
||||||
valid &= self.compositeKey.hasPasswordOrKeyFile;
|
valid &= !self.encrypted;
|
||||||
break;
|
break;
|
||||||
case MPActionShowEntryHistory:
|
case MPActionShowEntryHistory:
|
||||||
valid &= (nil != targetEntry);
|
valid &= (nil != targetEntry);
|
||||||
|
|||||||
@@ -343,8 +343,13 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
|||||||
|
|
||||||
- (IBAction)lock:(id)sender {
|
- (IBAction)lock:(id)sender {
|
||||||
MPDocument *document = [self document];
|
MPDocument *document = [self document];
|
||||||
if(!document.compositeKey.hasPasswordOrKeyFile) {
|
if(!document.compositeKey) {
|
||||||
return; // Document needs a password/keyfile to be lockable
|
[self editPasswordWithCompetionHandler:^(NSInteger result) {
|
||||||
|
if(result == NSModalResponseOK) {
|
||||||
|
[self lock:sender];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if(document.encrypted) {
|
if(document.encrypted) {
|
||||||
return; // Document already locked
|
return; // Document already locked
|
||||||
|
|||||||
Reference in New Issue
Block a user