<?php

class Pampa_Auth_Cms extends Zend_Auth {

  /**
   * Singleton instance
   * @var Pampa_Auth_Cms
   */
  protected static $_instance = null;

  protected function __construct() {

  }

  /**
   * Returns an instance of Frk_Auth_Site
   * Singleton pattern implementation
   * @return Pampa_Auth_Cms Provides a fluent interface
   */
  public static function getInstance() {
    $instance = self::$_instance;
    $namespace = "PampaCmsAuth";

    if (null === $instance || $instance->getStorage()->getNamespace() != $namespace) {
      self::$_instance = Zend_Auth::getInstance();
      self::$_instance->setStorage(new Zend_Auth_Storage_Session($namespace));
    }

    return self::$_instance;
  }

}