3838class MfaVerified implements ICheck, IFileCheck {
3939 use TFileCheck;
4040
41- /** @var array */
42- /** @psalm-suppress PropertyNotSetInConstructor */
43- /** @psalm-suppress MissingPropertyType */
44- protected $ fileIds ;
45-
4641 /** @var IL10N */
4742 protected $ l ;
4843
@@ -66,9 +61,9 @@ public function __construct(IL10N $l, ISession $session) {
6661 public function executeCheck ($ operator , $ value ): bool {
6762 $ mfaVerified = $ this ->session ->get ('user_saml.samlUserData ' )["mfa_verified " ][0 ];
6863 if (strtolower ($ value ) == 'true ' ) {
69- return $ mfaVerified == '1 ' ; //Mfa verified must not have access
64+ return $ mfaVerified == '1 ' ; // checking whether the current user is MFA-verified
7065 } else {
71- return $ mfaVerified != '1 ' ;
66+ return $ mfaVerified != '1 ' ; // checking whether the current user is not MFA-verified
7267 }
7368 }
7469
@@ -87,54 +82,6 @@ public function validateCheck($operator, $value): void {
8782 }
8883 }
8984
90- /**
91- * Get the file ids of the given path and its parents
92- * @param ICache $cache
93- * @param string $path
94- * @param bool $isExternalStorage
95- * @return int[]
96- */
97- protected function getFileIds (ICache $ cache , $ path , $ isExternalStorage ) {
98- /** @psalm-suppress InvalidArgument */
99- if ($ this ->storage ->instanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class)) {
100- // Special implementation for groupfolder since all groupfolders share the same storage
101- // id so add the group folder id in the cache key too.
102- $ groupFolderStorage = $ this ->storage ;
103- if ($ this ->storage instanceof Wrapper) {
104- $ groupFolderStorage = $ this ->storage ->getInstanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class);
105- }
106- if ($ groupFolderStorage === null ) {
107- throw new \LogicException ('Should not happen: Storage is instance of GroupFolderStorage but no group folder storage found while unwrapping. ' );
108- }
109- /**
110- * @psalm-suppress UndefinedDocblockClass
111- * @psalm-suppress UndefinedInterfaceMethod
112- */
113- $ cacheId = $ cache ->getNumericStorageId () . '/ ' . $ groupFolderStorage ->getFolderId ();
114- } else {
115- $ cacheId = $ cache ->getNumericStorageId ();
116- }
117- if (isset ($ this ->fileIds [$ cacheId ][$ path ])) {
118- return $ this ->fileIds [$ cacheId ][$ path ];
119- }
120-
121- $ parentIds = [];
122- if ($ path !== $ this ->dirname ($ path )) {
123- $ parentIds = $ this ->getFileIds ($ cache , $ this ->dirname ($ path ), $ isExternalStorage );
124- } elseif (!$ isExternalStorage ) {
125- return [];
126- }
127-
128- $ fileId = $ cache ->getId ($ path );
129- if ($ fileId !== -1 ) {
130- $ parentIds [] = $ fileId ;
131- }
132-
133- $ this ->fileIds [$ cacheId ][$ path ] = $ parentIds ;
134-
135- return $ parentIds ;
136- }
137-
13885 /**
13986 * @param string $path
14087 * @return string
0 commit comments