Changeset 40a1860 in github
- Timestamp:
- May 23, 2011 7:03:52 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- c9f4e9b
- Parents:
- 7ad8e2c
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/include/rcube_user.php (modified) (7 diffs)
-
program/steps/mail/show.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r3e48b941 r40a1860 2 2 =========================== 3 3 4 - Store user preferences in session when write-master is not available and session is stored in memcache, write them later 4 5 - Improve performence of folder manager operations 5 6 - Fix default_port option handling in Installer when config.inc.php file exists (#1487925) -
program/include/rcmail.php
r7ad8e2c r40a1860 1126 1126 $this->imap->expunge('INBOX'); 1127 1127 } 1128 1129 // Try to save unsaved user preferences 1130 if (!empty($_SESSION['preferences'])) { 1131 $this->user->save_prefs(unserialize($_SESSION['preferences'])); 1132 } 1128 1133 } 1129 1134 -
program/include/rcube_user.php
r80809d6 r40a1860 30 30 class rcube_user 31 31 { 32 public $ID = null;33 public $data = null;34 public $language = null;32 public $ID; 33 public $data; 34 public $language; 35 35 36 36 /** … … 39 39 * @var rcube_mdb2 40 40 */ 41 private $db = null; 41 private $db; 42 43 /** 44 * rcmail object. 45 * 46 * @var rcmail 47 */ 48 private $rc; 42 49 43 50 … … 50 57 function __construct($id = null, $sql_arr = null) 51 58 { 52 $this->db = rcmail::get_instance()->get_dbh(); 59 $this->rc = rcmail::get_instance(); 60 $this->db = $this->rc->get_dbh(); 53 61 54 62 if ($id && !$sql_arr) { … … 83 91 // if no domain was provided... 84 92 if (empty($domain)) { 85 $rcmail = rcmail::get_instance(); 86 $domain = $rcmail->config->mail_domain($this->data['mail_host']); 93 $domain = $this->rc->config->mail_domain($this->data['mail_host']); 87 94 } 88 95 … … 111 118 $prefs = array('language' => $this->language); 112 119 113 if ($this->ID && $this->data['preferences']) 114 $prefs += (array)unserialize($this->data['preferences']); 120 if ($this->ID) { 121 // Preferences from session (write-master is unavailable) 122 if (!empty($_SESSION['preferences'])) { 123 // Check last write attempt time, try to write again (every 5 minutes) 124 if ($_SESSION['preferences_time'] < time() - 5 * 60) { 125 $this->save_prefs(unserialize($_SESSION['preferences'])); 126 } 127 else { 128 $this->data['preferences'] = $_SESSION['preferences']; 129 } 130 } 131 132 if ($this->data['preferences']) { 133 $prefs += (array)unserialize($this->data['preferences']); 134 } 135 } 115 136 116 137 return $prefs; … … 129 150 return false; 130 151 131 $config = rcmail::get_instance()->config;152 $config = $this->rc->config; 132 153 $old_prefs = (array)$this->get_prefs(); 133 154 … … 155 176 $this->language = $_SESSION['language']; 156 177 178 // Update success 157 179 if ($this->db->affected_rows() !== false) { 158 180 $config->set_user_prefs($a_user_prefs); 159 181 $this->data['preferences'] = $save_prefs; 182 183 if (isset($_SESSION['preferences'])) { 184 $this->rc->session->remove('preferences'); 185 $this->rc->session->remove('preferences_time'); 186 } 160 187 return true; 188 } 189 // Update error, but we are using replication (we have read-only DB connection) 190 // and we are storing session not in the SQL database 191 // we can store preferences in session and try to write later (see get_prefs()) 192 else if ($this->db->is_replicated() && $config->get('session_storage', 'db') != 'db') { 193 $_SESSION['preferences'] = $save_prefs; 194 $_SESSION['preferences_time'] = time(); 195 $config->set_user_prefs($a_user_prefs); 196 $this->data['preferences'] = $save_prefs; 161 197 } 162 198 -
program/steps/mail/show.inc
ra509bb6 r40a1860 65 65 if ($MESSAGE->headers->others['list-post']) 66 66 $OUTPUT->set_env('list_post', true); 67 if ($CONFIG['forward_attachment']) 67 if ($CONFIG['forward_attachment']) 68 68 $OUTPUT->set_env('forward_attachment', true); 69 69
Note: See TracChangeset
for help on using the changeset viewer.
