Exemplo n.º 1
0
 public function logout()
 {
     self::$arrUsuario = array();
     unset($_SESSION['auth_user']);
     unset($_SESSION['auth_pass']);
     parent::delete('auth_user');
     parent::delete('auth_pass');
     self::$loggedin = false;
 }
Exemplo n.º 2
0
 /**
  * clears the session user
  */
 public function signOut()
 {
     $this->clearCredentials();
     $this->aUser = null;
     $this->setAuthenticated(false);
     $this->getAttributeHolder()->removeNamespace('user_session');
     $this->getAttributeHolder()->removeNamespace('login');
     $this->getAttributeHolder()->removeNamespace('network');
     CookieUtils::removeWidgetIdentityCookie();
     $this->setAttribute('Credcommunities', null);
     $this->setAttribute('TargetAfterLogin', null);
     $this->shutdown();
 }
 protected function _createConsentUrl()
 {
     $baseUrl = htmlentities($_SERVER['PHP_SELF']);
     // Handle query params
     $queryString = '';
     if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
         parse_str($_SERVER['QUERY_STRING'], $query);
         // Sanitise current query parameters
         $utils = new CookieUtils();
         $safeQuery = array();
         foreach ($query as $param => $value) {
             $safeQuery[$utils->xssClean($param)] = $utils->xssClean($value);
         }
         // Add acceptance param
         $safeQuery[$this->_acceptQueryParam] = 1;
     } else {
         $safeQuery = array($this->_acceptQueryParam => 1);
     }
     // Re-build params in to a string
     $queryString = http_build_query($safeQuery);
     if (!empty($queryString)) {
         $baseUrl .= '?' . $queryString;
     }
     return $baseUrl;
 }
<?php

/**
 * Handles action taken after consent has been given to use cookies.
 * 
 * @author Rhys Elsworth <*****@*****.**>
 * @version 2012-05-17
 */
require_once CCH_CLASSES . '/CookieUtils.php';
require_once CCH_CLASSES . '/CookieConfig.php';
require_once CCH_CLASSES . '/CookieConsentHandler.php';
$utils = new CookieUtils();
$config = new CookieConfig();
if (isset($_REQUEST[$config->get_accept_param]) && $_REQUEST[$config->get_accept_param]) {
    // Get an instance of the consent handler
    $c = new CookieConsentHandler();
    // If consent has not yet been established, set the consent cookie now
    if (!$c->checkConsent()) {
        $c->setConsentCookie();
        // Reload the current URL so that the browser sends the new cookie back to the server
        header("Location: " . $utils->getCurrentUrl());
        exit;
        // Ensure no more output follows
    }
}