2013-09-05 01:52:27 +00:00
|
|
|
<?php
|
|
|
|
namespace Open;
|
|
|
|
|
|
|
|
class Server extends \Zend_Controller_Plugin_Abstract
|
|
|
|
{
|
|
|
|
public $db;
|
|
|
|
public $auth = NULL;
|
|
|
|
public $user;
|
|
|
|
private $config;
|
|
|
|
|
|
|
|
public function __construct($db = NULL,$auth = NULL){
|
|
|
|
$this->config = \Zend_Registry::get('config');
|
|
|
|
if(empty($db))
|
|
|
|
{
|
|
|
|
$this->db = \Zend_Registry::get('db');
|
|
|
|
}else{
|
|
|
|
$this->db = $db;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(empty($auth))
|
|
|
|
{
|
|
|
|
$this->auth = \Zend_Auth::getInstance();
|
|
|
|
if($this->auth->hasIdentity())
|
|
|
|
{
|
|
|
|
$this->user = $this->auth->getIdentity();
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$this->auth = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-21 03:54:26 +00:00
|
|
|
public function getCode()
|
2013-09-05 01:52:27 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|