예제 #1
0
 /**
  * Logs calls
  *
  * @Flow\After("method(PerfectIn\Api\Webservice\WebserviceCall->invoke())")
  * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current joinpoint
  */
 public function logFinishServiceCall(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
 {
     $callIdentifier = $joinPoint->getProxy()->getClass() . '::' . $joinPoint->getProxy()->getMethod();
     if ($joinPoint->hasException()) {
         $this->logger->log($this->logIdentifier . ' - error - ' . $joinPoint->getException()->getMessage() . '(' . $joinPoint->getException()->getCode() . ')', LOG_ERR);
     } else {
         $this->logger->log($this->logIdentifier . ' - response - ' . $this->getLogMessageForVariable($joinPoint->getResult()), LOG_INFO);
     }
 }
 /**
  * Logs calls and result of isPrivilegeTargetGranted()
  *
  * @Flow\After("method(TYPO3\Flow\Security\Authorization\PrivilegeManager->isPrivilegeTargetGranted())")
  * @param JoinPointInterface $joinPoint
  * @return void
  */
 public function logPrivilegeAccessDecisions(JoinPointInterface $joinPoint)
 {
     $decision = $joinPoint->getResult() === true ? 'GRANTED' : 'DENIED';
     $message = sprintf('Decided "%s" on privilege "%s".', $decision, $joinPoint->getMethodArgument('privilegeTargetIdentifier'));
     $this->securityLogger->log($message, \LOG_INFO);
 }
 /**
  * Logs calls of collectGarbage()
  *
  * @Flow\AfterReturning("within(TYPO3\Flow\Session\SessionInterface) && method(.*->collectGarbage())")
  * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current joinpoint
  * @return void
  */
 public function logCollectGarbage(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
 {
     $sessionRemovalCount = $joinPoint->getResult();
     if ($sessionRemovalCount > 0) {
         $this->systemLogger->log(sprintf('%s: Triggered garbage collection and removed %s expired sessions.', $this->getClassName($joinPoint), $sessionRemovalCount), LOG_INFO);
     } elseif ($sessionRemovalCount === 0) {
         $this->systemLogger->log(sprintf('%s: Triggered garbage collection but no sessions needed to be removed.', $this->getClassName($joinPoint)), LOG_INFO);
     } elseif ($sessionRemovalCount === false) {
         $this->systemLogger->log(sprintf('%s: Ommitting garbage collection because another process is already running. Consider lowering the GC propability if these messages appear a lot.', $this->getClassName($joinPoint)), LOG_WARNING);
     }
 }
예제 #4
0
 /**
  *
  * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint
  * @Flow\After("method(TYPO3\Flow\Security\Policy\PolicyService->getPrivilegesForJoinPoint(*))")
  * @return void
  */
 public function collectRoleVotes(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
 {
     $role = $joinPoint->getMethodArgument('role');
     $privileges = $joinPoint->getResult();
     \Debug\Toolbar\Service\DataStorage::add('Security:RoleVotes', array('role' => $role, 'privileges' => $privileges));
 }