diff --git a/admin/editaccount.php b/admin/editaccount.php index a6a69a70ad..daacb6af62 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -95,10 +95,7 @@ // The following sets any default preferences needed for new applications.. // This is smart enough to know if previous preferences were selected, use them. if (count($new_apps)) { - $phpgw->db->query("select account_id from accounts where account_lid='$new_loginid'",__LINE__,__FILE__); - $phpgw->db->next_record(); - - $pref = new preferences($phpgw->db->f("account_id")); + $pref = new preferences($n_loginid); $docommit = False; for ($j=0;$jquery("delete from preferences where preference_owner='" . $this->account_id . "'",__LINE__,__FILE__); - $db->query("insert into preferences (preference_owner,preference_value) values ('" - . $this->account_id . "','" . serialize($this->preferences) . "')",__LINE__,__FILE__); + $db->query("insert into preferences (preference_owner,preference_value) values (" + . $this->account_id . ",'" . serialize($this->preferences) . "')",__LINE__,__FILE__); if ($phpgw_info["user"]["account_id"] == $this->account_id) { - $phpgw_info["user"]["preferences"] = $this->preferences; + $phpgw->preferences->preferences = $this->get_preferences(); $phpgw->accounts->sync(__LINE__,__FILE__); } }