33 lines
710 B
PHP
33 lines
710 B
PHP
<?php
|
|
|
|
/*define('UTYPE_HOST' , 'H');
|
|
define('UTYPE_ADMIN' , 'A');
|
|
define('UTYPE_GUEST' , 'G');
|
|
define('UTYPE_PROGRAM_MANAGER' , 'P');*/
|
|
|
|
class Application_Service_UserService
|
|
{
|
|
private $currentUser;
|
|
|
|
public function __construct()
|
|
{
|
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
|
if (!is_null($userInfo->id)) {
|
|
$this->currentUser = CcSubjsQuery::create()->findPK($userInfo->id);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*
|
|
* Returns a CcSubjs object
|
|
*/
|
|
public function getCurrentUser()
|
|
{
|
|
if (is_null($this->currentUser)) {
|
|
throw new Exception();
|
|
}
|
|
|
|
return $this->currentUser;
|
|
}
|
|
|
|
} |