| @@ 694-709 (lines=16) @@ | ||
| 691 | * |
|
| 692 | * @return boolean |
|
| 693 | */ |
|
| 694 | public static function encryptedFiles() { |
|
| 695 | //check if encryption was enabled in the past |
|
| 696 | $encryptedFiles = false; |
|
| 697 | if (OC_App::isEnabled('files_encryption') === false) { |
|
| 698 | $view = new OC\Files\View('/' . OCP\User::getUser()); |
|
| 699 | $keysPath = '/files_encryption/keys'; |
|
| 700 | if ($view->is_dir($keysPath)) { |
|
| 701 | $dircontent = $view->getDirectoryContent($keysPath); |
|
| 702 | if (!empty($dircontent)) { |
|
| 703 | $encryptedFiles = true; |
|
| 704 | } |
|
| 705 | } |
|
| 706 | } |
|
| 707 | ||
| 708 | return $encryptedFiles; |
|
| 709 | } |
|
| 710 | ||
| 711 | /** |
|
| 712 | * check if a backup from the encryption keys exists |
|
| @@ 716-731 (lines=16) @@ | ||
| 713 | * |
|
| 714 | * @return boolean |
|
| 715 | */ |
|
| 716 | public static function backupKeysExists() { |
|
| 717 | //check if encryption was enabled in the past |
|
| 718 | $backupExists = false; |
|
| 719 | if (OC_App::isEnabled('files_encryption') === false) { |
|
| 720 | $view = new OC\Files\View('/' . OCP\User::getUser()); |
|
| 721 | $backupPath = '/files_encryption/backup.decryptAll'; |
|
| 722 | if ($view->is_dir($backupPath)) { |
|
| 723 | $dircontent = $view->getDirectoryContent($backupPath); |
|
| 724 | if (!empty($dircontent)) { |
|
| 725 | $backupExists = true; |
|
| 726 | } |
|
| 727 | } |
|
| 728 | } |
|
| 729 | ||
| 730 | return $backupExists; |
|
| 731 | } |
|
| 732 | ||
| 733 | /** |
|
| 734 | * Check for correct file permissions of data directory |
|