@@ -213,7 +213,7 @@ public static function createWordlists($hashlistId, $user) {
213213 fclose ($ wordlistFile );
214214
215215 //add file to files list
216- $ file = new File (null , $ wordlistName , Util::filesize ($ wordlistFilename ), $ hashlist ->getIsSecret (), 0 , $ hashlist ->getAccessGroupId (), $ wordCount );
216+ $ file = new File (null , $ wordlistName , Util::filesize ($ wordlistFilename ), $ hashlist ->getIsSecret (), DFileType:: WORDLIST , $ hashlist ->getAccessGroupId (), $ wordCount );
217217 $ file = Factory::getFileFactory ()->save ($ file );
218218 # TODO: returning wordCount and wordlistName are not really required here as the name and the count are already given in the file object
219219 return [$ wordCount , $ wordlistName , $ file ];
@@ -711,6 +711,7 @@ public static function export($hashlistId, $user) {
711711 $ pagingSize = SConfig::getInstance ()->getVal (DConfig::HASHES_PAGE_SIZE );
712712 }
713713 $ separator = SConfig::getInstance ()->getVal (DConfig::FIELD_SEPARATOR );
714+ $ numEntries = 0 ;
714715 for ($ x = 0 ; $ x * $ pagingSize < $ count ; $ x ++) {
715716 $ oF = new OrderFilter ($ orderObject , "ASC LIMIT " . ($ x * $ pagingSize ) . ", $ pagingSize " );
716717 $ entries = $ factory ->filter ([Factory::FILTER => [$ qF1 , $ qF2 ], Factory::ORDER => $ oF ]);
@@ -733,12 +734,13 @@ public static function export($hashlistId, $user) {
733734 break ;
734735 }
735736 }
737+ $ numEntries += sizeof ($ entries );
736738 fputs ($ file , $ buffer );
737739 }
738740 fclose ($ file );
739741 usleep (1000000 );
740742
741- $ file = new File (null , $ tmpname , Util::filesize ($ tmpfile ), $ hashlist ->getIsSecret (), 0 , $ hashlist ->getAccessGroupId (), null );
743+ $ file = new File (null , $ tmpname , Util::filesize ($ tmpfile ), $ hashlist ->getIsSecret (), DFileType:: OTHER , $ hashlist ->getAccessGroupId (), $ numEntries );
742744 $ file = Factory::getFileFactory ()->save ($ file );
743745 return $ file ;
744746 }
@@ -1098,6 +1100,7 @@ public static function leftlist($hashlistId, $user) {
10981100 if (SConfig::getInstance ()->getVal (DConfig::HASHES_PAGE_SIZE ) !== false ) {
10991101 $ pagingSize = SConfig::getInstance ()->getVal (DConfig::HASHES_PAGE_SIZE );
11001102 }
1103+ $ numEntries = 0 ;
11011104 for ($ x = 0 ; $ x * $ pagingSize < $ count ; $ x ++) {
11021105 $ oF = new OrderFilter (Hash::HASH_ID , "ASC LIMIT " . ($ x * $ pagingSize ) . ", $ pagingSize " );
11031106 $ entries = Factory::getHashFactory ()->filter ([Factory::FILTER => [$ qF1 , $ qF2 ], Factory::ORDER => $ oF ]);
@@ -1109,12 +1112,13 @@ public static function leftlist($hashlistId, $user) {
11091112 }
11101113 $ buffer .= "\n" ;
11111114 }
1115+ $ numEntries += sizeof ($ entries );
11121116 fputs ($ file , $ buffer );
11131117 }
11141118 fclose ($ file );
11151119 usleep (1000000 );
11161120
1117- $ file = new File (null , $ tmpname , Util::filesize ($ tmpfile ), $ hashlist ->getIsSecret (), 0 , $ hashlist ->getAccessGroupId (), null );
1121+ $ file = new File (null , $ tmpname , Util::filesize ($ tmpfile ), $ hashlist ->getIsSecret (), DFileType:: OTHER , $ hashlist ->getAccessGroupId (), $ numEntries );
11181122 return Factory::getFileFactory ()->save ($ file );
11191123 }
11201124
0 commit comments