Commit 9f2e52d2 by Dirk Benkert

fixed #6

parent 09eae9d2
......@@ -47,7 +47,6 @@ class FormController extends ControllerAbstract {
public function forgotpasswordAction() {
$form = new ForgotPasswordForm();
$request = $this->getRequest();
if ($request->isPost()) {
$form->setData($request->getPost());
if ($form->isValid()) {
......@@ -55,12 +54,13 @@ class FormController extends ControllerAbstract {
$service->run($form->getData());
return $this->getResponse()->setContent(Json::encode(array(
'status' => 'success',
'status' => 'success',
)));
} else {
error_log(print_r($request->getPost(), true));
}
}
$viewModel = new ViewModel(array(
'form' => $form,
));
......
......@@ -143,12 +143,17 @@ class IndexController extends ControllerAbstract {
}
$user = $this->getEntityManager()->find('Application\Entity\User', $data['id']);
$userData = $user->getData();
$userData = array(
'isadmin' => ($user->isadmin == false) ? 0 : $user->isadmin,
'caninvite' => ($user->caninvite == false) ? 0 : $user->caninvite,
'cancreatefolders' => ($user->cancreatefolders == false) ? 0 : $user->cancreatefolders,
'canuploadfiles' => ($user->canuploadfiles == false) ? 0 : $user->canuploadfiles,
);
$editMode = true;
$data = array_merge($userData, $data);
$userForm = new UserForm($this->getServiceLocator(), $editMode);
$userForm->setData(array_merge($userData, $data));
$userForm->setData($data);
if ($userForm->isValid()) {
$user->setService($this);
......
......@@ -103,7 +103,7 @@ class NotificationEmail extends AbstractService {
throw new \RuntimeException('no identifier set before calling run on NotificationEmail service.');
}
$this->template = $template = getcwd() . '/mustache/'.$this->getIdentifier().'.mustache';
$this->template = $template = getcwd() . '/mustache/'.strtolower($this->getIdentifier()).'.mustache';
if (!file_exists($this->template)) {
throw new \RuntimeException($this->template . ' not found.');
}
......@@ -122,7 +122,7 @@ class NotificationEmail extends AbstractService {
$mail->setSubject($config['subjects'][$this->getIdentifier()]);
$transport = new Mail\Transport\Sendmail('-f'.$config['sender']['email']);
if (!isset($this->config['testmode'])) {
if (!isset($this->config['testmode']) || $this->config['testmode'] !== true) {
$transport->send($mail);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment