| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function findStudent(Request $request, Response $response) |
||
| 22 | { |
||
| 23 | if ($request->isPost()) { |
||
| 24 | |||
| 25 | $keyword = $request->getParam('name'); |
||
| 26 | $filter = '(&(businesscategory=E*)(displayname=*' . $keyword . '*))'; |
||
| 27 | $res = []; |
||
| 28 | |||
| 29 | foreach($this->ldap($filter, ['displayname', 'uid']) as $student) { |
||
| 30 | if ($student['uid'][0] != null) |
||
| 31 | $res += [ $student['uid'][0] => $student['displayname'][0] ]; |
||
| 32 | } |
||
| 33 | |||
| 34 | return $this->json($response, $res); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->view->render($response, 'find-student.twig'); |
||
| 38 | } |
||
| 40 |