public function successAction()
 {
     $trans = new Application_Transactions();
     $ns = new Zend_Session_Namespace('signup');
     $acct = new Model_Accounts();
     $acct->createUser($ns->email, $ns->password);
     $acct->email = $ns->email;
     echo $acct->email;
     $site = new Model_Sites();
     $site->createSite($ns->sitename, $ns->siteurl);
     $trans->registerModelForCreateOrUpdate($acct);
     $trans->registerModelForCreateOrUpdate($site);
     $trans->commitAll();
     var_dump($acct->email);
     $trans->clearAll();
     $serversTable = Doctrine::getTable('Model_Servers');
     $record = $serversTable->findBy('id', 1);
     $server = $record[0];
     $userLogin = substr($acct->email, 0, strpos($acct->email, "@"));
     var_dump($userLogin);
     $result = $server->addUser($userLogin, $acct->password, $acct->email);
     var_dump($result);
     $authToken = $server->getTokenAuth($userLogin, $acct->password);
     $acct->api = $authToken;
     $acct->server = 1;
     $piwik = $server->addSite($site->name, $site->url, $acct->api);
     $site->account = $acct->id;
     $site->server = 1;
     $site->piwik = $piwik;
     $trans->registerModelForCreateOrUpdate($acct);
     $trans->registerModelForCreateOrUpdate($site);
     $trans->commitAll();
     $trans->clearAll();
     $ns->unlock;
     Zend_Session::namespaceUnset('signup');
 }