|
|
@ -265,7 +265,7 @@ class rcube_user
|
|
|
|
"SELECT * FROM ".$this->db->table_name('identities').
|
|
|
|
"SELECT * FROM ".$this->db->table_name('identities').
|
|
|
|
" WHERE del <> 1 AND user_id = ?".
|
|
|
|
" WHERE del <> 1 AND user_id = ?".
|
|
|
|
($sql_add ? " ".$sql_add : "").
|
|
|
|
($sql_add ? " ".$sql_add : "").
|
|
|
|
" ORDER BY ".$this->db->quoteIdentifier('standard')." DESC, name ASC, identity_id ASC",
|
|
|
|
" ORDER BY ".$this->db->quote_identifier('standard')." DESC, name ASC, identity_id ASC",
|
|
|
|
$this->ID);
|
|
|
|
$this->ID);
|
|
|
|
|
|
|
|
|
|
|
|
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
|
|
|
|
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
|
|
|
@ -300,7 +300,7 @@ class rcube_user
|
|
|
|
$query_cols = $query_params = array();
|
|
|
|
$query_cols = $query_params = array();
|
|
|
|
|
|
|
|
|
|
|
|
foreach ((array)$data as $col => $value) {
|
|
|
|
foreach ((array)$data as $col => $value) {
|
|
|
|
$query_cols[] = $this->db->quoteIdentifier($col) . ' = ?';
|
|
|
|
$query_cols[] = $this->db->quote_identifier($col) . ' = ?';
|
|
|
|
$query_params[] = $value;
|
|
|
|
$query_params[] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$query_params[] = $iid;
|
|
|
|
$query_params[] = $iid;
|
|
|
@ -336,7 +336,7 @@ class rcube_user
|
|
|
|
|
|
|
|
|
|
|
|
$insert_cols = $insert_values = array();
|
|
|
|
$insert_cols = $insert_values = array();
|
|
|
|
foreach ((array)$data as $col => $value) {
|
|
|
|
foreach ((array)$data as $col => $value) {
|
|
|
|
$insert_cols[] = $this->db->quoteIdentifier($col);
|
|
|
|
$insert_cols[] = $this->db->quote_identifier($col);
|
|
|
|
$insert_values[] = $value;
|
|
|
|
$insert_values[] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$insert_cols[] = 'user_id';
|
|
|
|
$insert_cols[] = 'user_id';
|
|
|
@ -401,7 +401,7 @@ class rcube_user
|
|
|
|
if ($this->ID && $iid) {
|
|
|
|
if ($this->ID && $iid) {
|
|
|
|
$this->db->query(
|
|
|
|
$this->db->query(
|
|
|
|
"UPDATE ".$this->db->table_name('identities').
|
|
|
|
"UPDATE ".$this->db->table_name('identities').
|
|
|
|
" SET ".$this->db->quoteIdentifier('standard')." = '0'".
|
|
|
|
" SET ".$this->db->quote_identifier('standard')." = '0'".
|
|
|
|
" WHERE user_id = ?".
|
|
|
|
" WHERE user_id = ?".
|
|
|
|
" AND identity_id <> ?".
|
|
|
|
" AND identity_id <> ?".
|
|
|
|
" AND del <> 1",
|
|
|
|
" AND del <> 1",
|
|
|
@ -641,11 +641,11 @@ class rcube_user
|
|
|
|
$result = array();
|
|
|
|
$result = array();
|
|
|
|
|
|
|
|
|
|
|
|
$sql_result = $this->db->query(
|
|
|
|
$sql_result = $this->db->query(
|
|
|
|
"SELECT search_id AS id, ".$this->db->quoteIdentifier('name')
|
|
|
|
"SELECT search_id AS id, ".$this->db->quote_identifier('name')
|
|
|
|
." FROM ".$this->db->table_name('searches')
|
|
|
|
." FROM ".$this->db->table_name('searches')
|
|
|
|
." WHERE user_id = ?"
|
|
|
|
." WHERE user_id = ?"
|
|
|
|
." AND ".$this->db->quoteIdentifier('type')." = ?"
|
|
|
|
." AND ".$this->db->quote_identifier('type')." = ?"
|
|
|
|
." ORDER BY ".$this->db->quoteIdentifier('name'),
|
|
|
|
." ORDER BY ".$this->db->quote_identifier('name'),
|
|
|
|
(int) $this->ID, (int) $type);
|
|
|
|
(int) $this->ID, (int) $type);
|
|
|
|
|
|
|
|
|
|
|
|
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
|
|
|
|
while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
|
|
|
@ -673,9 +673,9 @@ class rcube_user
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$sql_result = $this->db->query(
|
|
|
|
$sql_result = $this->db->query(
|
|
|
|
"SELECT ".$this->db->quoteIdentifier('name')
|
|
|
|
"SELECT ".$this->db->quote_identifier('name')
|
|
|
|
.", ".$this->db->quoteIdentifier('data')
|
|
|
|
.", ".$this->db->quote_identifier('data')
|
|
|
|
.", ".$this->db->quoteIdentifier('type')
|
|
|
|
.", ".$this->db->quote_identifier('type')
|
|
|
|
." FROM ".$this->db->table_name('searches')
|
|
|
|
." FROM ".$this->db->table_name('searches')
|
|
|
|
." WHERE user_id = ?"
|
|
|
|
." WHERE user_id = ?"
|
|
|
|
." AND search_id = ?",
|
|
|
|
." AND search_id = ?",
|
|
|
@ -730,11 +730,11 @@ class rcube_user
|
|
|
|
|
|
|
|
|
|
|
|
$insert_cols[] = 'user_id';
|
|
|
|
$insert_cols[] = 'user_id';
|
|
|
|
$insert_values[] = (int) $this->ID;
|
|
|
|
$insert_values[] = (int) $this->ID;
|
|
|
|
$insert_cols[] = $this->db->quoteIdentifier('type');
|
|
|
|
$insert_cols[] = $this->db->quote_identifier('type');
|
|
|
|
$insert_values[] = (int) $data['type'];
|
|
|
|
$insert_values[] = (int) $data['type'];
|
|
|
|
$insert_cols[] = $this->db->quoteIdentifier('name');
|
|
|
|
$insert_cols[] = $this->db->quote_identifier('name');
|
|
|
|
$insert_values[] = $data['name'];
|
|
|
|
$insert_values[] = $data['name'];
|
|
|
|
$insert_cols[] = $this->db->quoteIdentifier('data');
|
|
|
|
$insert_cols[] = $this->db->quote_identifier('data');
|
|
|
|
$insert_values[] = serialize($data['data']);
|
|
|
|
$insert_values[] = serialize($data['data']);
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "INSERT INTO ".$this->db->table_name('searches')
|
|
|
|
$sql = "INSERT INTO ".$this->db->table_name('searches')
|
|
|
|