forked from extern/egroupware
fix for bug [ 1361782 ] missing sql tables: hook code accessing the prefs-table is moved to the prefs class
This commit is contained in:
parent
fb3c622ddf
commit
1549913fd7
@ -423,7 +423,7 @@
|
|||||||
}
|
}
|
||||||
$pref = &$this->$type;
|
$pref = &$this->$type;
|
||||||
|
|
||||||
if ($all = (is_string($var) && $var == ''))
|
if (($all = (is_string($var) && $var == '')))
|
||||||
{
|
{
|
||||||
unset($pref[$app_name]);
|
unset($pref[$app_name]);
|
||||||
unset($this->data[$app_name]);
|
unset($this->data[$app_name]);
|
||||||
@ -459,6 +459,16 @@
|
|||||||
reset ($this->data);
|
reset ($this->data);
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delete all prefs of a given user
|
||||||
|
*
|
||||||
|
* @param int $accountid
|
||||||
|
*/
|
||||||
|
function delete_user($accountid)
|
||||||
|
{
|
||||||
|
$this->delete($this->table,array('preference_owner' => $accountid),__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add complex array data preference to $app_name a particular app
|
* add complex array data preference to $app_name a particular app
|
||||||
@ -804,7 +814,7 @@
|
|||||||
return $this->data['email']['address'];
|
return $this->data['email']['address'];
|
||||||
}
|
}
|
||||||
// if email-address is set in the account, return it
|
// if email-address is set in the account, return it
|
||||||
if ($email = $GLOBALS['egw']->accounts->id2name($account_id,'account_email'))
|
if (($email = $GLOBALS['egw']->accounts->id2name($account_id,'account_email')))
|
||||||
{
|
{
|
||||||
return $email;
|
return $email;
|
||||||
}
|
}
|
||||||
@ -873,9 +883,6 @@
|
|||||||
// at location [email][ex_accounts][X][...pref names] => pref values
|
// at location [email][ex_accounts][X][...pref names] => pref values
|
||||||
// make this look like "prefs[email] so the code below code below will do its job transparently
|
// make this look like "prefs[email] so the code below code below will do its job transparently
|
||||||
|
|
||||||
// store original prefs
|
|
||||||
$orig_prefs = array();
|
|
||||||
$orig_prefs = $prefs;
|
|
||||||
// obtain the desired sub-array of extra account prefs
|
// obtain the desired sub-array of extra account prefs
|
||||||
$sub_prefs = array();
|
$sub_prefs = array();
|
||||||
$sub_prefs['email'] = $prefs['email']['ex_accounts'][$acctnum];
|
$sub_prefs['email'] = $prefs['email']['ex_accounts'][$acctnum];
|
||||||
|
@ -12,13 +12,8 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
// Delete all records for a user
|
// Delete all prefs of a user
|
||||||
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
||||||
{
|
{
|
||||||
$table_locks = Array('phpgw_preferences');
|
$GLOBALS['egw']->preferences->delete_user($GLOBALS['hook_values']['account_id']);
|
||||||
|
|
||||||
$GLOBALS['egw']->db->lock($table_locks);
|
|
||||||
$GLOBALS['egw']->db->query('DELETE FROM phpgw_preferences WHERE preference_owner='.(int)$GLOBALS['hook_values']['account_id'],__LINE__,__FILE__);
|
|
||||||
$GLOBALS['egw']->db->unlock();
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user