mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Added dual pass preferences
This commit is contained in:
parent
54f7afb947
commit
4fe20e1152
@ -11,6 +11,11 @@
|
||||
behind load balanced proxys.
|
||||
- Merged patch for eventlog, this will show debugging info and warnings to admins.
|
||||
Thanks j3rry
|
||||
- Created dual pass preferences, this allows admins to force any preference option
|
||||
on users. (eg, templates, themes, max matchs, etc)
|
||||
- Created generic preferneces/preferences.php app, which uses hooks to
|
||||
set user preferences, admins can force preference, or set the defaults
|
||||
for new accounts.
|
||||
|
||||
[0.9.12]
|
||||
- Note: These changelogs will only contain changes in the API (preferences, admin, etc)
|
||||
|
@ -35,7 +35,7 @@
|
||||
/*! @var account_type */
|
||||
var $account_type;
|
||||
/*! @var data */
|
||||
var $data = Array();
|
||||
var $data = array();
|
||||
/*! @var db */
|
||||
var $db;
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
function preferences($account_id = '')
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
$this->db = $phpgw->db;
|
||||
$this->db = $phpgw->db;
|
||||
$this->account_id = get_account_id($account_id);
|
||||
}
|
||||
|
||||
@ -65,19 +65,38 @@
|
||||
*/
|
||||
function read_repository()
|
||||
{
|
||||
$this->db->lock('phpgw_preferences');
|
||||
$this->db->query("SELECT preference_value FROM phpgw_preferences WHERE preference_owner='".$this->account_id."'",__LINE__,__FILE__);
|
||||
$this->db->query("SELECT * FROM phpgw_preferences WHERE "
|
||||
. "preference_owner='" . $this->account_id . "' or "
|
||||
. "preference_owner='-1' order by preference_owner desc",__LINE__,__FILE__);
|
||||
$this->db->next_record();
|
||||
$pref_info = $this->db->f("preference_value");
|
||||
/* echo "Pref_Info = ".$pref_info."<br>\n"; */
|
||||
$this->data = Array();
|
||||
|
||||
$pref_info = $this->db->f('preference_value');
|
||||
$this->data = unserialize($pref_info);
|
||||
$this->db->unlock();
|
||||
|
||||
if ($this->db->next_record())
|
||||
{
|
||||
$global_defaults = unserialize($this->db->f('preference_value'));
|
||||
|
||||
while (is_array($global_defaults) && list($appname,$values) = each($global_defaults))
|
||||
{
|
||||
while (is_array($values) && list($var,$value) = each($values))
|
||||
{
|
||||
$this->data[$appname][$var] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This is to supress warnings during login */
|
||||
if (gettype($this->data) == 'array')
|
||||
if (is_array($this->data))
|
||||
{
|
||||
reset ($this->data);
|
||||
}
|
||||
|
||||
// This is to supress warnings durring login
|
||||
if (is_array($this->data))
|
||||
{
|
||||
reset($this->data);
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user