Changeset 534 for trunk/lib/App.inc.php
- Timestamp:
- Jul 27, 2015 7:56:08 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r532 r534 416 416 $_SESSION['_app'][$this->_ns] = array( 417 417 'messages' => array(), 418 'boomerang' => array('url' ),418 'boomerang' => array('url' => array()), 419 419 ); 420 420 } … … 539 539 540 540 if (!$this->running) { 541 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);541 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 542 542 return false; 543 543 } 544 544 545 545 if (!$this->getParam('enable_session')) { 546 $this->logMsg(sprintf('Canceled method call %s, session not enabled.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);546 $this->logMsg(sprintf('Canceled %s, session not enabled.', â ), LOG_NOTICE, __FILE__, __LINE__); 547 547 return false; 548 548 } … … 609 609 { 610 610 if (!$this->running) { 611 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);611 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 612 612 return false; 613 613 } … … 625 625 { 626 626 if (!$this->running) { 627 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);627 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 628 628 return false; 629 629 } … … 647 647 648 648 if (!$this->running) { 649 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);649 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 650 650 return false; 651 651 } … … 968 968 { 969 969 if (!$this->running) { 970 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);970 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 971 971 return false; 972 972 } … … 1095 1095 { 1096 1096 if (!$this->running) { 1097 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1097 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1098 1098 return false; 1099 1099 } … … 1203 1203 * 1204 1204 * @access public 1205 * @param string $user_submitted_csrf_token The user-submitted token to compare with the session token. 1205 1206 * @param string $csrf_token The token to compare with the session token. 1206 1207 * @return bool True if the tokens match, false otherwise. … … 1213 1214 1214 1215 if (!$this->getParam('csrf_token_enabled')) { 1215 $this->logMsg(sprintf('%s method called, but csrf_token_enabled=false', __FUNCTION__), LOG_ERR, __FILE__, __LINE__);1216 $this->logMsg(sprintf('%s called, but csrf_token_enabled=false', __METHOD__), LOG_ERR, __FILE__, __LINE__); 1216 1217 return true; 1217 1218 } … … 1238 1239 * 1239 1240 * @access public 1240 * @param string $user_submitted_csrf_token The user-submitted token to compare with the session token.1241 1241 * @param string $message Optional message to display to the user (otherwise default message will display). Set to an empty string to display no message. 1242 1242 * @param int $type The type of message: MSG_NOTICE, … … 1274 1274 { 1275 1275 if (!$this->running) { 1276 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1276 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1277 1277 return false; 1278 1278 } … … 1327 1327 { 1328 1328 if (!$this->running) { 1329 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1329 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1330 1330 return false; 1331 1331 } … … 1369 1369 { 1370 1370 if (!$this->running) { 1371 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1371 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1372 1372 return false; 1373 1373 } … … 1377 1377 if ('' != $url && is_string($url)) { 1378 1378 // Delete any boomerang request keys in the query string (along with any trailing delimiters after the deletion). 1379 $url = preg_replace(array('/([&?])boomerang= \w+[&?]?/', '/[&?]$/'), array('$1', ''), $url);1379 $url = preg_replace(array('/([&?])boomerang=[^&?]+[&?]?/', '/[&?]$/'), array('$1', ''), $url); 1380 1380 1381 1381 if (isset($_SESSION['_app'][$this->_ns]['boomerang']['url']) && is_array($_SESSION['_app'][$this->_ns]['boomerang']['url']) && !empty($_SESSION['_app'][$this->_ns]['boomerang']['url'])) { 1382 // If the URL currently exists in the boomerang array, delete. 1383 while ($existing_key = array_search($url, $_SESSION['_app'][$this->_ns]['boomerang']['url'])) { 1384 unset($_SESSION['_app'][$this->_ns]['boomerang']['url'][$existing_key]); 1382 // If the ID=>URL pair currently exists in the boomerang array, delete. 1383 foreach (array_keys($_SESSION['_app'][$this->_ns]['boomerang']['url'], $url) as $existing_key) { 1384 if ($existing_key == $id) { 1385 $this->logMsg(sprintf('Found and deleting existing ID=>URL pair: %s=>%s', $id, $url), LOG_DEBUG, __FILE__, __LINE__); 1386 unset($_SESSION['_app'][$this->_ns]['boomerang']['url'][$existing_key]); 1387 } 1385 1388 } 1386 1389 } … … 1407 1410 { 1408 1411 if (!$this->running) { 1409 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1412 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1410 1413 return false; 1411 1414 } … … 1432 1435 { 1433 1436 if (!$this->running) { 1434 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1437 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1435 1438 return false; 1436 1439 } … … 1454 1457 { 1455 1458 if (!$this->running) { 1456 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);1459 $this->logMsg(sprintf('Canceled %s, application not running.', __METHOD__), LOG_NOTICE, __FILE__, __LINE__); 1457 1460 return false; 1458 1461 } … … 1490 1493 // Last boomerang direction was less than 2 seconds ago. 1491 1494 $this->logMsg(sprintf('validBoomerangURL(%s) not valid, boomerang_time too short: %s seconds', $id, time() - $boomerang_time), LOG_DEBUG, __FILE__, __LINE__); 1495 return false; 1496 } 1497 if ($boomerang_time < (time() - 72000)) { 1498 // Last boomerang direction was more than 20 minutes ago. 1499 $this->logMsg(sprintf('validBoomerangURL(%s) not valid, boomerang_time too long: %s seconds', $id, time() - $boomerang_time), LOG_DEBUG, __FILE__, __LINE__); 1492 1500 return false; 1493 1501 }
Note: See TracChangeset
for help on using the changeset viewer.