| | |
| | | if (!isset($old_prefs[$key]) && ($value == $config->get($key))) |
| | | unset($save_prefs[$key]); |
| | | } |
| | | |
| | | |
| | | $save_prefs = serialize($save_prefs); |
| | | |
| | | $this->db->query( |
| | | "UPDATE ".get_table_name('users')." |
| | | SET preferences=?, |
| | | language=? |
| | | WHERE user_id=?", |
| | | serialize($save_prefs), |
| | | $save_prefs, |
| | | $_SESSION['language'], |
| | | $this->ID); |
| | | |
| | | $this->language = $_SESSION['language']; |
| | | if ($this->db->affected_rows()) { |
| | | $config->set_user_prefs($a_user_prefs); |
| | | $this->data['preferences'] = $save_prefs; |
| | | return true; |
| | | } |
| | | |
| | |
| | | $query_params[] = $this->ID; |
| | | |
| | | $sql = "UPDATE ".get_table_name('identities')." |
| | | SET ".join(', ', $query_cols)." |
| | | SET changed=".$this->db->now().", ".join(', ', $query_cols)." |
| | | WHERE identity_id=? |
| | | AND user_id=? |
| | | AND del<>1"; |
| | |
| | | $insert_values[] = $this->ID; |
| | | |
| | | $sql = "INSERT INTO ".get_table_name('identities')." |
| | | (".join(', ', $insert_cols).") |
| | | VALUES (".join(', ', array_pad(array(), sizeof($insert_values), '?')).")"; |
| | | (changed, ".join(', ', $insert_cols).") |
| | | VALUES (".$this->db->now().", ".join(', ', array_pad(array(), sizeof($insert_values), '?')).")"; |
| | | |
| | | call_user_func_array(array($this->db, 'query'), |
| | | array_merge(array($sql), $insert_values)); |
| | |
| | | if (!$this->ID) |
| | | return false; |
| | | |
| | | $sql_result = $this->db->query("SELECT count(*) AS ident_count FROM " . |
| | | get_table_name('identities') . |
| | | " WHERE user_id = ? AND del <> 1", |
| | | $sql_result = $this->db->query( |
| | | "SELECT count(*) AS ident_count FROM ".get_table_name('identities')." |
| | | WHERE user_id = ? AND del <> 1", |
| | | $this->ID); |
| | | |
| | | $sql_arr = $this->db->fetch_assoc($sql_result); |
| | |
| | | |
| | | $this->db->query( |
| | | "UPDATE ".get_table_name('identities')." |
| | | SET del=1 |
| | | SET del=1, changed=".$this->db->now()." |
| | | WHERE user_id=? |
| | | AND identity_id=?", |
| | | $this->ID, |