User prefs access to apache user

User prefs folder is now owned by apache_karoshi.
Moodle realm settings

Moodle module now correctly sets the realm settings.