<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$registerStudentForm->fillDataFromArray($_POST);
$errors = $this->validations->validRegisterStudentForm($registerStudentForm);
if (!$errors->hasErrors()) {
$student = $registerStudentForm->getStudent();
$student->setPassword($registerStudentForm->getPassword());
$this->studentGateway->addStudent($student);
$this->registrationHelper->redirect($_GET['go']);
}
}
PD9waHAKICAgICAgICBpZiAoJF9TRVJWRVJbJ1JFUVVFU1RfTUVUSE9EJ10gPT0gJ1BPU1QnKSB7CiAgICAgICAgICAgICRyZWdpc3RlclN0dWRlbnRGb3JtLT5maWxsRGF0YUZyb21BcnJheSgkX1BPU1QpOwoKICAgICAgICAgICAgJGVycm9ycyA9ICR0aGlzLT52YWxpZGF0aW9ucy0+dmFsaWRSZWdpc3RlclN0dWRlbnRGb3JtKCRyZWdpc3RlclN0dWRlbnRGb3JtKTsKCiAgICAgICAgICAgIGlmICghJGVycm9ycy0+aGFzRXJyb3JzKCkpIHsKICAgICAgICAgICAgICAgICRzdHVkZW50ID0gJHJlZ2lzdGVyU3R1ZGVudEZvcm0tPmdldFN0dWRlbnQoKTsKCiAgICAgICAgICAgICAgICAkc3R1ZGVudC0+c2V0UGFzc3dvcmQoJHJlZ2lzdGVyU3R1ZGVudEZvcm0tPmdldFBhc3N3b3JkKCkpOwoKICAgICAgICAgICAgICAgICR0aGlzLT5zdHVkZW50R2F0ZXdheS0+YWRkU3R1ZGVudCgkc3R1ZGVudCk7CgogICAgICAgICAgICAgICAgJHRoaXMtPnJlZ2lzdHJhdGlvbkhlbHBlci0+cmVkaXJlY3QoJF9HRVRbJ2dvJ10pOwogICAgICAgICAgICB9CiAgICAgICAgfQoK