Swap authorization and directory cleaning in update_catalogs.php. Add loggin in update_catalogs.php