<commit_before><?php
/**
 * OpenID Admin Authentication Controller
 * 
 * OpenID is used for SSO accross the internet.  Organizations like google and yahoo
 * already provide thier users with an OpenID so if you don't want to maintain
 * your own identity provider or if you are just testing jazzee then this is a good
 * choice.
 * 
 */
namespace Jazzee\AdminAuthentication;
require_once 'OpenID/RelyingParty.php';
require_once 'OpenID/Extension/AX.php';
class OpenID implements \Jazzee\Interfaces\AdminAuthentication{
  const LOGIN_ELEMENT = 'OpenID_Login';
  
  const SESSION_VAR_ID = 'openid_id';
  /**
   * Our authenticated user
   * @var \Jazzee\Entity\User
   */
  private $_user;
  
  /**
   * Config instance
   * @var \Jazzee\Controller 
   */
  private $_controller;
  
  /**
   * Constructor
   * 
   * Require authentication and setup the user if a valid session is detected
   * 
   * @param \Jazzee\Interfaces\AdminController
   */
  public function __construct(\Jazzee\Interfaces\AdminController $controller){
    $this->_controller = $controller;
    if($this->_controller->getStore()->check(self::SESSION_VAR_ID)){
      $this->_user = $this->_controller->getEntityManager()->getRepository('\Jazzee\Entity\User')->findOneBy(array('uniqueName'=>$this->_controller->getStore()->get(self::SESSION_VAR_ID)));<commit_msg>Supresses error messages in OpenID includes and then check for the existance of the OpenID class in the constructore. Fixes #153<commit_after><?php
/**
 * OpenID Admin Authentication Controller
 * 
 * OpenID is used for SSO accross the internet.  Organizations like google and yahoo
 * already provide thier users with an OpenID so if you don't want to maintain
 * your own identity provider or if you are just testing jazzee then this is a good
 * choice.
 * 
 */
namespace Jazzee\AdminAuthentication;
@include_once 'OpenID/RelyingParty.php';
@include_once 'OpenID/Extension/AX.php';
class OpenID implements \Jazzee\Interfaces\AdminAuthentication{
  const LOGIN_ELEMENT = 'OpenID_Login';
  
  const SESSION_VAR_ID = 'openid_id';
  /**
   * Our authenticated user
   * @var \Jazzee\Entity\User
   */
  private $_user;
  
  /**
   * Config instance
   * @var \Jazzee\Controller 
   */
  private $_controller;
  
  /**
   * Constructor
   * 
   * Require authentication and setup the user if a valid session is detected
   * 
   * @param \Jazzee\Interfaces\AdminController
   */
  public function __construct(\Jazzee\Interfaces\AdminController $controller){
    if(!class_exists('OpenID')){
      throw new \Jazzee\Exception("Pear OpenID library is required to use OpenID for authentication.");
    }
    $this->_controller = $controller;
    if($this->_controller->getStore()->check(self::SESSION_VAR_ID)){
      $this->_user = $this->_controller->getEntityManager()->getRepository('\Jazzee\Entity\User')->findOneBy(array('uniqueName'=>$this->_controller->getStore()->get(self::SESSION_VAR_ID)));
{'fraction_non_alphanumeric': 0.11433447098976109, 'fraction_numerical': 0.0010238907849829352, 'mean_word_length': 4.062176165803109, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3388067', 'n_tokens_mistral': 893, 'n_tokens_neox': 853, 'n_words': 236}