set a theme for a user in Moodle
<p>Within a Moodle, I've set up, I receive new users via a single sign on, these users should get a specific theme set for them. This theme is not the default theme, other users can sign up for the site (they are not coming in via the SSO) and should not get this theme, so I can't set it as the default theme.</p>

<p>How can I set a theme as the prefered or default theme for a user when he logs in via the SSO?</p>

<p>I would think that this setting is stored in the database but I can't find it there.
I found a column <strong>theme</strong> in the <strong>user</strong> table but setting the theme there does nothing.
I've also looked in the table <strong>user_preferences</strong> but didn't find any record about the theme after I changed it for a specific user.</p>

<p>Does anybody know where in the database this is stored or how I can set a default theme for a specific user?</p>

<p>UPDATE:<br>
Users can change their own theme.<br>
I store the themename in the column in the database (clean, NOT theme_clean).</p>