Beispiel #1
0
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Beispiel #2
0
 public function keydeleteAction()
 {
     $auth = Zend_Auth::getInstance();
     $router = Zend_Controller_Front::getInstance()->getRouter();
     $store = OAuthStore::instance();
     if (!$auth->hasIdentity()) {
         Zend_Controller_Front::getInstance()->registerPlugin(new Ml_Plugins_LoginRedirect());
     }
     $request = $this->getRequest();
     $params = $request->getParams();
     $consumer = $store->getConsumer($params['api_key'], $auth->getIdentity());
     $form = Ml_Model_Api::deleteForm($consumer);
     if ($request->isPost() && $form->isValid($request->getPost())) {
         $store->deleteConsumer($params['api_key'], $auth->getIdentity());
         $this->_redirect($router->assemble(array(), "apikeys") . "?api_key_deleted=" . $params['api_key'], array("exit"));
     }
     $this->view->form = $form;
     $this->view->consumerData = $consumer;
 }