Splitting this work from T326736: Create preference for viewing IP addresses used by temporary accounts. Tried something like this during the course of the ticket:
if ( $this->userOptionsLookup->getOption( $user, 'checkuser-temporary-account' ) ) { // Users with the 'checkuser' right who haven't set a preference should have the option checked by default $shouldCheckTmpAcctPref = in_array( 'checkuser', $user->getGroups() ) && is_null( $this->userOptionsLookup->getOption( $user, 'checkuser-temporary-account-enable' ) ); $preferences['checkuser-temporary-account-enable'] = [ 'type' => 'toggle', 'label-message' => 'checkuser-tempaccount-enable-preference', 'section' => 'personal/checkuser-tempaccount', 'default' => $shouldCheckTmpAcctPref, ]; }
From what I can tell, this doesn't actually change the preference at all. It checks it by default when the page loads but doesn't actually save the preference. Also, should we be doing this? Is there some kind of need to log enabling this sort of like we did for IP Info? cc @Tchanders