Skip to content

Commit

Permalink
Merge pull request #283 from fyndiq/fix-login
Browse files Browse the repository at this point in the history
Fix login
  • Loading branch information
Håkan Nylén committed Oct 23, 2015
2 parents 1ac42f9 + 8be5045 commit a7f15c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/backoffice/FmController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handleRequest()
$action = $this->fmConfig->isSetUp() ? $action : 'settings';
$action = $action != 'authenticate' ? $this->serviceIsOperational($action) : $action;

switch($action) {
switch ($action) {
case 'api_unavailable':
return $this->apiUnavailable();
case 'authenticate':
Expand Down Expand Up @@ -113,7 +113,7 @@ private function authenticate()
} catch (Exception $e) {
$this->fmConfig->delete('username');
$this->fmConfig->delete('api_token');
return $this->fmOutput->showModuleError($e->getMessage());
return $this->fmOutput->render('authenticate', $this->data, $e->getMessage());
}
}
return $this->fmOutput->render('authenticate', $this->data);
Expand Down
6 changes: 4 additions & 2 deletions src/backoffice/FmOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct($fmPrestashop, $module, $smarty)
$this->smarty = $smarty;
}

public function render($name, $args = array())
public function render($name, $args = array(), $error = false)
{
$modulePath = $this->fmPrestashop->getModulePath();
// Templates path, relative to admin
Expand All @@ -34,7 +34,9 @@ public function render($name, $args = array())
)
));
$this->smarty->registerPlugin('function', 'fi18n', array('FmOutput', 'fi18n'));

if ($error != false) {
return $this->module->displayError($error) . $this->module->display($this->module->name, 'backoffice/frontend/templates/' . $name . '.tpl');
}
return $this->module->display($this->module->name, 'backoffice/frontend/templates/' . $name . '.tpl');
}

Expand Down

0 comments on commit a7f15c7

Please sign in to comment.