Changeset 5829 in subversion
- Timestamp:
- Jan 27, 2012 4:56:11 AM (16 months ago)
- Location:
- branches/devel-framework/roundcubemail/program/include
- Files:
-
- 6 edited
-
rcmail.php (modified) (1 diff)
-
rcube_imap.php (modified) (1 diff)
-
rcube_imap_cache.php (modified) (5 diffs)
-
rcube_ldap.php (modified) (3 diffs)
-
rcube_spellchecker.php (modified) (5 diffs)
-
rcube_user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-framework/roundcubemail/program/include/rcmail.php
r5828 r5829 2406 2406 } 2407 2407 2408 2409 /** 2410 * Getter for logged user ID. 2411 * 2412 * @return mixed User identifier 2413 */ 2414 public function get_user_id() 2415 { 2416 if (is_object($this->user)) { 2417 return $this->user->ID; 2418 } 2419 } 2420 2421 2422 /** 2423 * Getter for logged user name. 2424 * 2425 * @return string User name 2426 */ 2427 public function get_user_name() 2428 { 2429 if (is_object($this->user)) { 2430 return $this->user->get_username(); 2431 } 2432 } 2408 2433 } -
branches/devel-framework/roundcubemail/program/include/rcube_imap.php
r5828 r5829 3606 3606 if ($dbh = $rcmail->get_dbh()) { 3607 3607 $this->mcache = new rcube_imap_cache( 3608 $dbh, $this, $rcmail-> user->ID, $this->options['skip_deleted']);3608 $dbh, $this, $rcmail->get_user_id(), $this->options['skip_deleted']); 3609 3609 } 3610 3610 } -
branches/devel-framework/roundcubemail/program/include/rcube_imap_cache.php
r5822 r5829 93 93 $this->db = $db; 94 94 $this->imap = $imap; 95 $this->userid = (int)$userid;95 $this->userid = $userid; 96 96 $this->skip_deleted = $skip_deleted; 97 97 } … … 512 512 "DELETE FROM ".$this->db->table_name('cache_messages') 513 513 ." WHERE user_id = ?" 514 ." AND mailbox = ".$this->db->quote($mailbox)514 ." AND mailbox = ?" 515 515 .($uids !== null ? " AND uid IN (".$this->db->array2list((array)$uids, 'integer').")" : ""), 516 $this->userid );516 $this->userid, $mailbox); 517 517 } 518 518 … … 534 534 $this->db->query( 535 535 "DELETE FROM ".$this->db->table_name('cache_index') 536 ." WHERE user_id = ".intval($this->userid) 537 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : "") 536 ." WHERE user_id = ?" 537 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : ""), 538 $this->userid 538 539 ); 539 540 } … … 542 543 "UPDATE ".$this->db->table_name('cache_index') 543 544 ." SET valid = 0" 544 ." WHERE user_id = ".intval($this->userid) 545 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : "") 545 ." WHERE user_id = ?" 546 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : ""), 547 $this->userid 546 548 ); 547 549 } … … 567 569 $this->db->query( 568 570 "DELETE FROM ".$this->db->table_name('cache_thread') 569 ." WHERE user_id = ".intval($this->userid) 570 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : "") 571 ." WHERE user_id = ?" 572 .(strlen($mailbox) ? " AND mailbox = ".$this->db->quote($mailbox) : ""), 573 $this->userid 571 574 ); 572 575 -
branches/devel-framework/roundcubemail/program/include/rcube_ldap.php
r5828 r5829 64 64 * Object constructor 65 65 * 66 * @param array LDAP connection properties 67 * @param boolean Enables debug mode 68 * @param string Current user mail domain name 69 * @param integer User-ID 66 * @param array $p LDAP connection properties 67 * @param boolean $debug Enables debug mode 68 * @param string $mail_domain Current user mail domain name 70 69 */ 71 function __construct($p, $debug =false, $mail_domain=NULL)70 function __construct($p, $debug = false, $mail_domain = null) 72 71 { 73 72 $this->prop = $p; … … 155 154 private function _connect() 156 155 { 157 global $RCMAIL;156 $RCMAIL = rcmail::get_instance(); 158 157 159 158 if (!function_exists('ldap_connect')) … … 227 226 228 227 // Get the pieces needed for variable replacement. 229 if ($fu = $RCMAIL-> user->get_username())228 if ($fu = $RCMAIL->get_user_name()) 230 229 list($u, $d) = explode('@', $fu); 231 230 else -
branches/devel-framework/roundcubemail/program/include/rcube_spellchecker.php
r5828 r5829 533 533 { 534 534 if (strcasecmp($this->options['dictionary'], 'shared') != 0) { 535 $userid = (int) $this->rc->user->ID;535 $userid = $this->rc->get_user_id(); 536 536 } 537 537 … … 548 548 "UPDATE ".$this->rc->db->table_name('dictionary') 549 549 ." SET data = ?" 550 ." WHERE user_id " . ($plugin['userid'] ? "= ".$ plugin['userid']: "IS NULL")550 ." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") 551 551 ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", 552 552 implode(' ', $plugin['dictionary']), $plugin['language']); … … 556 556 $this->rc->db->query( 557 557 "DELETE FROM " . $this->rc->db->table_name('dictionary') 558 ." WHERE user_id " . ($plugin['userid'] ? "= ".$ plugin['userid']: "IS NULL")558 ." WHERE user_id " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") 559 559 ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", 560 560 $plugin['language']); … … 580 580 581 581 if (strcasecmp($this->options['dictionary'], 'shared') != 0) { 582 $userid = (int) $this->rc->user->ID;582 $userid = $this->rc->get_user_id(); 583 583 } 584 584 … … 590 590 $this->rc->db->query( 591 591 "SELECT data FROM ".$this->rc->db->table_name('dictionary') 592 ." WHERE user_id ". ($plugin['userid'] ? "= ".$ plugin['userid']: "IS NULL")592 ." WHERE user_id ". ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL") 593 593 ." AND " . $this->rc->db->quoteIdentifier('language') . " = ?", 594 594 $plugin['language']); -
branches/devel-framework/roundcubemail/program/include/rcube_user.php
r5828 r5829 125 125 // Check last write attempt time, try to write again (every 5 minutes) 126 126 if ($_SESSION['preferences_time'] < time() - 5 * 60) { 127 $saved_prefs = unserialize($_SESSION['preferences']);127 $saved_prefs = unserialize($_SESSION['preferences']); 128 128 $this->rc->session->remove('preferences'); 129 $this->rc->session->remove('preferences_time');129 $this->rc->session->remove('preferences_time'); 130 130 $this->save_prefs($saved_prefs); 131 131 }
Note: See TracChangeset
for help on using the changeset viewer.
