| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function isEmailUnique($get) |
||
| 23 | { |
||
| 24 | //the router needs a parameter with get functions else throsw a wobbly |
||
| 25 | //we pass a get variable and call the /controller/function/get?bla |
||
| 26 | //for better use and security, we must pass "get" as the parameter |
||
| 27 | if(!$this->startsWith(strtolower($get),"get")) |
||
| 28 | { |
||
| 29 | throw new \Exception("invalid call"); |
||
| 30 | } |
||
| 31 | $email = $this->request->getData("email"); |
||
| 32 | $return = !$this->userModel->isEmailUsed($email); |
||
| 33 | echo json_encode($return); |
||
| 34 | |||
| 36 | } |