File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 99exit ;
1010require __DIR__ .'/../../main/inc/global.inc.php ' ;
1111
12+ // Filter to only manage those users based on their user_id :
13+ //$filteredUsers = [11,12,13]; // set the list of user_id
14+
1215// set the extra field variable to use
1316$ extraFieldVariable = 'dni ' ;
1417
3841 $ mostRecentRegistrationDate = 0 ;
3942 foreach ($ users as $ u ) {
4043 $ uid = (int )$ u ['user_id ' ];
44+ if (isset ($ filteredUsers ) && !in_array ($ uid , $ filteredUsers ) {
45+ continue ;
46+ }
4147 $ userInfo = api_get_user_info ($ uid );
4248 if ($ userInfo ['registration_date ' ] > $ mostRecentRegistrationDate ) {
4349 $ mostRecentRegistrationDate = $ userInfo ['registration_date ' ];
4652 }
4753 foreach ($ users as $ u ) {
4854 $ uid = (int )$ u ['user_id ' ];
55+ if (isset ($ filteredUsers ) && !in_array ($ uid , $ filteredUsers ) {
56+ continue ;
57+ }
4958 if ($ uid === $ userIdToUnifyOn ) { continue ; }
50-
51- echo ' Unifying user ' . $ uid . ' on user ' . $ userIdToUnifyOn . PHP_EOL ;
59+ $ now = date ( ' Y-m-d H:i:s ' );
60+ echo $ now . ' Unifying user ' . $ uid . ' on user ' . $ userIdToUnifyOn . PHP_EOL ;
5261 MySpace::duUpdateAllUserRefsList ($ uid , $ userIdToUnifyOn );
5362 MySpace::duDisableOrDeleteUser ($ uid , $ unifyMode );
63+ $ now = date ('Y-m-d H:i:s ' );
64+ echo $ now . ' User unified ' . PHP_EOL ;
5465 }
5566 }
5667 }
You can’t perform that action at this time.
0 commit comments