- Timestamp:
- Aug 24, 2017 4:27:34 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Auth_File.inc.php
r563 r611 135 135 public function clear() 136 136 { 137 $app =& App::getInstance(); 138 137 139 $_SESSION['_auth_file'][$this->_ns] = array('authenticated' => false); 140 141 $app->logMsg(sprintf('Cleared %s auth', $this->_ns), LOG_DEBUG, __FILE__, __LINE__); 138 142 } 139 143 -
trunk/lib/Auth_SQL.inc.php
r601 r611 333 333 public function clear() 334 334 { 335 $app =& App::getInstance(); 335 336 $db =& DB::getInstance(); 336 337 … … 363 364 'user_data' => null, 364 365 ); 366 367 $app->logMsg(sprintf('Cleared %s auth', $this->_ns), LOG_DEBUG, __FILE__, __LINE__); 365 368 } 366 369 -
trunk/lib/Cache.inc.php
r558 r611 282 282 public function clear() 283 283 { 284 $app =& App::getInstance(); 285 284 286 $_SESSION['_cache'][$this->_ns] = array(); 287 $app->logMsg(sprintf('Cleared %s cache', $this->_ns), LOG_DEBUG, __FILE__, __LINE__); 285 288 } 286 289 -
trunk/lib/Cart.inc.php
r502 r611 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 28 28 * @author Quinn Comendant <quinn@strangecode.com> 29 29 * @version 1.0 30 * 30 * 31 31 * Example of use: 32 32 --------------------------------------------------------------------- … … 86 86 87 87 $this->_ns = $namespace; 88 88 89 89 // Initialize. 90 90 if (!isset($_SESSION['_cart'][$this->_ns])) { … … 116 116 { 117 117 $app =& App::getInstance(); 118 118 119 119 if (array_key_exists($param, $this->_params)) { 120 120 return $this->_params[$param]; … … 141 141 { 142 142 $app =& App::getInstance(); 143 143 144 144 // Include any previously added items in the total quantity. 145 145 $quantity += isset($_SESSION['_cart'][$this->_ns]['items'][$item_id]) ? $_SESSION['_cart'][$this->_ns]['items'][$item_id]['quantity'] : 0; 146 146 147 147 // Add item with adjusted quantity and merge in additional specs. 148 148 $_SESSION['_cart'][$this->_ns]['items'][$item_id] = array_merge($specs, array( … … 151 151 'extended_price' => $quantity * $price, 152 152 )); 153 153 154 154 $app->logMsg(sprintf('Added %s %s to cart (%s)', $quantity, $item_id, truncate(getDump($specs, true), 128, 'end')), LOG_DEBUG, __FILE__, __LINE__); 155 155 156 156 return $quantity; 157 157 } 158 158 159 159 /* 160 160 * Set the absolute quantity value of a specified item in a cart. 161 161 * 162 162 * @access public 163 * @param 164 * @return 163 * @param 164 * @return 165 165 * @author Quinn Comendant <quinn@strangecode.com> 166 166 * @version 1.0 … … 185 185 } 186 186 } 187 187 188 188 /* 189 189 * Set the absolute price value of a specified item in a cart. 190 190 * 191 191 * @access public 192 * @param 193 * @return 192 * @param 193 * @return 194 194 * @author Quinn Comendant <quinn@strangecode.com> 195 195 * @version 1.0 … … 209 209 } 210 210 } 211 211 212 212 /* 213 213 * Remove an item from the cart. … … 222 222 { 223 223 $app =& App::getInstance(); 224 224 225 225 if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id])) { 226 226 unset($_SESSION['_cart'][$this->_ns]['items'][$item_id]); … … 231 231 } 232 232 } 233 233 234 234 /* 235 235 * Return the value matching key for a specified item. … … 250 250 return false; 251 251 } 252 252 253 253 /* 254 254 * Return an array of the items in cart. … … 264 264 return $_SESSION['_cart'][$this->_ns]['items']; 265 265 } 266 266 267 267 /* 268 268 * Return the sum of the numeric values stored under the specified key for cart items. … … 299 299 break; 300 300 } 301 301 302 302 return $sum; 303 303 } 304 304 305 305 /** 306 * Resets the $_SESSION cart array. This should be executed with the same consideration 306 * Resets the $_SESSION cart array. This should be executed with the same consideration 307 307 * as $auth->clear(), such as when logging out. 308 308 */ 309 309 public function clear() 310 310 { 311 $app =& App::getInstance(); 312 311 313 $_SESSION['_cart'][$this->_ns] = array( 312 314 'items' => array(), 313 315 ); 316 317 $app->logMsg(sprintf('Cleared %s cart', $this->_ns), LOG_DEBUG, __FILE__, __LINE__); 314 318 } 315 319 } -
trunk/lib/Prefs.inc.php
r579 r611 397 397 public function clear($scope='all') 398 398 { 399 $app =& App::getInstance(); 400 399 401 switch ($scope) { 400 402 case 'all' : … … 428 430 break; 429 431 } 432 433 $app->logMsg(sprintf('Cleared %s %s prefs', $scope, $this->_ns), LOG_DEBUG, __FILE__, __LINE__); 430 434 } 431 435 -
trunk/services/logout.php
r468 r611 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 25 25 */ 26 26 27 if (isset($auth) && method_exists($auth, 'get') && true === $app->getParam('enable_db')) { 28 // Delete the current user's record locks. 29 require_once 'codebase/lib/Lock.inc.php'; 30 $lock =& Lock::getInstance($auth); 31 $lock->removeAll($auth->get('user_id')); 27 if (isset($prefs) && method_exists($prefs, 'clear')) { 28 $prefs->clear(); 32 29 } 33 34 // Logout. 35 $auth->clear(); 30 if (isset($tmp_prefs) && method_exists($tmp_prefs, 'clear')) { 31 $tmp_prefs->clear(); 32 } 33 if (isset($cache) && method_exists($cache, 'clear')) { 34 $cache->clear(); 35 } 36 if (isset($cart) && method_exists($cart, 'clear')) { 37 $cart->clear(); 38 } 39 if (isset($auth) && method_exists($auth, 'get')) { 40 if (true === $app->getParam('enable_db')) { 41 // Delete the current user's record locks. 42 require_once 'codebase/lib/Lock.inc.php'; 43 $lock =& Lock::getInstance($auth); 44 $lock->removeAll($auth->get('user_id')); 45 } 46 } 47 if (isset($auth) && method_exists($auth, 'clear')) { 48 $auth->clear(); 49 } 36 50 37 51 $app->raiseMsg(sprintf(_("Your session has been logged-out."), null), MSG_SUCCESS, __FILE__, __LINE__);
Note: See TracChangeset
for help on using the changeset viewer.