diff --git a/application/controllers/system/Test.php b/application/controllers/system/Test.php new file mode 100644 index 000000000..c83e4f6cb --- /dev/null +++ b/application/controllers/system/Test.php @@ -0,0 +1,88 @@ +load->view('system/login/usernamePassword'); + } + + /** + * Called with HTTP POST via ajax to login using the LDAP authentication + */ + public function loginLDAP() + { + $username = $this->input->post('username'); + $password = $this->input->post('password'); + + $this->load->library('AuthLib', array(false)); // without authentication otherwise loooooop! + + $login = $this->authlib->loginLDAP($username, $password); + if (isSuccess($login)) + { + $this->outputJsonSuccess($this->authlib->getLandingPage()); // if login is success then retrieves the desired page + } + else + { + $this->outputJsonError(getCode($login)); // returns the error code + } + } + + /** + * Called with HTTP POST via ajax to login as another user specified by uid + */ + public function loginASByUid() + { + $uid = $this->input->get('uid'); + + // With authentication -> you must be already logged to gain another identity + $this->load->library('AuthLib'); + + $loginAS = $this->authlib->loginASByUID($uid); + $this->outputJson($loginAS); // returns the error code + } + + /** + * Called with HTTP POST via ajax to login as another user specified by person id + */ + public function loginASByPersonId() + { + $person_id = $this->input->get('person_id'); + + // With authentication -> you must be already logged to gain another identity + $this->load->library('AuthLib'); + + $loginAS = $this->authlib->loginASByPersonId($person_id); + if (isSuccess($loginAS)) + { + $this->outputJsonSuccess(true); // obtained! + } + else + { + $this->outputJsonSuccess(getCode($loginAS)); // returns the error code + }; + } + + /** + * To login into the system with email and code as credentials + */ + public function emailCode() + { + } + + /** + * To login into the system using SSO + */ + public function sso() + { +} diff --git a/tests/codesniffer/FHComplete/ruleset.xml b/tests/codesniffer/FHComplete/ruleset.xml index eb78d11bb..c46f15595 100644 --- a/tests/codesniffer/FHComplete/ruleset.xml +++ b/tests/codesniffer/FHComplete/ruleset.xml @@ -2,10 +2,11 @@ FHComplete's coding standard - + \.git vendor tests + application/controllers/api/v1 diff --git a/tests/phpmd/rulesets.xml b/tests/phpmd/rulesets.xml index 18b14401e..56c18d3b0 100644 --- a/tests/phpmd/rulesets.xml +++ b/tests/phpmd/rulesets.xml @@ -9,6 +9,12 @@ Performs the strictly necessary checks before the code can be merged into the main branch and then deployed to production + + \.git + vendor + tests + application/controllers/api/v1 +