[dev] locked prefs and overrides

Brook Davis brook at linuxbox.com
Wed Jan 9 19:49:38 UTC 2008


Hi all,

I'm working on some code for IMP and I ran into an interesting issue, 
which I thought maybe someone could shed some light on.  The issue is as 
follows:

I've got a checkbox preference that I set as a user in the preferences 
area.  I set this to unchecked/0 as my user and log out, close my 
browser.  Then, I edited the prefs.php file and set the value to '1' and 
changed it from unlocked to locked.  When I log back in and dump the 
values returned by $prefs->getValue('my_pref') and 
$prefs->isLocked('my_pref'), I get 0 and 1, respectively.  The $prefs 
object is reporting both unchecked and locked status.

Here's my question:

Is this the correct behavior ?  I would have expected the 'admin-set' 
value to override the one set by the user.  Or is it the administrator's 
responsibility to clear previously set values from the preference 
storage backend when changing a preference from unlocked to locked 
state?  Or am I missing some other explanation for this ?

I know this is mostly an administrative question and could be thought to 
belong on that list, but since it may inform my code, I hope it isn't 
too off-topic.

Any help / suggestions appreciated,

Brook


More information about the dev mailing list