File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change 113
113
continue ;
114
114
}
115
115
116
+ $ urlUsersIdList = [];
116
117
$ CSVUsers = Import::csvToArray ($ filename , ', ' );
117
118
118
119
if (!$ CSVUsers ) {
225
226
}
226
227
}
227
228
}
228
-
229
- try {
230
- $ entityManager ->flush ();
231
- } catch (OptimisticLockException $ e ) {
232
- echo "Error processing user ' {$ username }': " . $ e ->getMessage () . "\n" ;
233
- error_log ("Error processing user ' {$ username }': " . $ e ->getMessage ());
234
- echo "Trace: " . $ e ->getTraceAsString () . "\n" ;
235
- continue ;
236
- }
237
-
238
- if ($ debug ) {
239
- echo 'Sent to DB ' . $ username . " with user id = " . $ user ->getId () . "\n" ;
240
- }
241
- UrlManager::add_user_to_url ($ user ->getId (), $ accessUrlId );
242
229
}
243
230
231
+ $ urlUsersIdList [] = $ user ->getId ();
244
232
$ allCSVUsers [$ username ] = $ user ;
245
233
246
234
} catch (Exception $ e ) {
250
238
continue ;
251
239
}
252
240
}
241
+ try {
242
+ $ entityManager ->flush ();
243
+ } catch (OptimisticLockException $ e ) {
244
+ echo "Error processing users for URL ' {$ accessUrlId }': " . $ e ->getMessage () . "\n" ;
245
+ error_log ("Error processing users for URL ' {$ accessUrlId }': " . $ e ->getMessage ());
246
+ echo "Trace: " . $ e ->getTraceAsString () . "\n" ;
247
+ continue ;
248
+ }
249
+ if ($ debug ) {
250
+ echo 'Sent users ' . print_r ($ urlUsersIdList ,1 ) . ' to DB for URL ' . $ accessUrlId . "\n" ;
251
+ }
252
+ $ accessUrlList = [];
253
+ $ accessUrlList [] = $ accessUrlId ;
254
+ UrlManager::add_users_to_urls ($ urlUsersIdList , $ accessUrlList );
255
+
253
256
}
254
257
255
258
// Disable or delete user accounts not found in any CSV file depending on $deleteUsersNotFoundInCSV
You can’t perform that action at this time.
0 commit comments