public static function is_anonymous_user($user) {
        if (preg_match('/^anon\d*$/', $user->username)) {
            $match = preg_match('/^anonfirstname\d*$/', $user->firstname);
            $match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
            // Check .com for backwards compatibility.
            $emailmatch = preg_match('/^anon\d*@doesntexist\.com$/', $user->email) ||
                preg_match('/^anon\d*@doesntexist\.invalid$/', $user->email);
            if ($match && $emailmatch) {
                return true;
            }
        }
        return false;
    }
public static function is_anonymous_user($user) {
        if (preg_match('/^anon\d*$/', $user->username)) {
            $match = preg_match('/^anonfirstname\d*$/', $user->firstname);
            $match = $match && preg_match('/^anonlastname\d*$/', $user->lastname);
            // Check .com for backwards compatibility.
            $emailmatch = preg_match('/^anon\d*@doesntexist\.com$/', $user->email) ||
                preg_match('/^anon\d*@doesntexist\.invalid$/', $user->email);
            if ($match && $emailmatch) {
                return true;
            }
        }
        return false;
    }
public static function is_anonymous_user ( $ user ) { if ( preg_match ( '/^anon\d*$/' , $ user -> username ) ) { $ match = preg_match ( '/^anonfirstname\d*$/' , $ user -> firstname ) ; $ match = $ match && preg_match ( '/^anonlastname\d*$/' , $ user -> lastname ) ; // Check .com for backwards compatibility. $ emailmatch = preg_match ( '/^anon\d*@doesntexist\.com$/' , $ user -> email ) || preg_match ( '/^anon\d*@doesntexist\.invalid$/' , $ user -> email ) ; if ( $ match && $ emailmatch ) { return true ; } } return false ; }
Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname
and email address.
@param stdClass $user the user record to test
@return bool true if this is an 'anonymous' user
Determine if the given user is an anonymous user based on their username firstname lastname and email address .