/** * @return Prosecco_Authentication */ public static function getInstance() { if (!self::$_instance instanceof Prosecco_Authentication) { self::$_instance = new Prosecco_Authentication(); } return self::$_instance; }
public function createKeysAction() { if (($username = Prosecco_Authentication::getInstance()->loggedInAs()) != false) { $this->view->userName = $username; // Get UID $userMapper = new Application_Model_UserMapper(); $userdata = $userMapper->findByColumn("uname", $username); $uid = $userdata[0]->getUid(); // Get real name $userdata = new Application_Model_UserData(); $userDataMapper = new Application_Model_UserDataMapper(); $userDataMapper->find($uid, $userdata); if ($userdata !== null) { $this->view->realName = $this->buildRealName($userdata->getForename(), $userdata->getSurname()); } else { $this->view->realName = null; } } else { //TODO require authentication } }