Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
55 | public function callbackSubmit() |
||
56 | { |
||
57 | // Get values from the submitted form |
||
58 | $acronym = $this->form->value("acronym"); |
||
59 | $password = $this->form->value("password"); |
||
60 | $passwordAgain = $this->form->value("password-again"); |
||
61 | |||
62 | // Check password matches |
||
63 | if ($password !== $passwordAgain) { |
||
64 | $this->form->rememberValues(); |
||
65 | $this->form->addOutput("Password did not match."); |
||
66 | return false; |
||
67 | } |
||
68 | |||
69 | $user = new User(); |
||
70 | $user->setDb($this->di->get("dbqb")); |
||
71 | $user->acronym = $acronym; |
||
72 | $user->setPassword($password); |
||
73 | $user->save(); |
||
74 | |||
75 | $this->form->addOutput("User was created."); |
||
76 | return true; |
||
77 | } |
||
79 |