- Added excluded directories to PHPMD and PHPCS rule sets

- Added testing file for Lint
This commit is contained in:
Paolo
2022-02-10 15:00:00 +01:00
parent c84dcd900b
commit 6066da470e
3 changed files with 96 additions and 1 deletions
+88
View File
@@ -0,0 +1,88 @@
<?php
class Test extends FHC_Controller
/**
*
*/
public function __construct()
{
parent::__construct()
}
/**
* Displays a login page with username and password
*/
public function usernamePassword()
{
$this->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()
{
}
+2 -1
View File
@@ -2,10 +2,11 @@
<ruleset name="FHComplete">
<description>FHComplete's coding standard</description>
<!-- Ignored directories if phpcs is running from command line, already ignored by phpci -->
<!-- Ignored directories if phpcs is running from command line -->
<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>tests</exclude-pattern>
<exclude-pattern>application/controllers/api/v1</exclude-pattern>
<rule ref="PSR2">
<exclude name="PSR1.Classes.ClassDeclaration" />
+6
View File
@@ -9,6 +9,12 @@
Performs the strictly necessary checks before the code can be merged into the main branch and then deployed to production
</description>
<!-- Ignored directories if phpmd is running from command line -->
<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>tests</exclude-pattern>
<exclude-pattern>application/controllers/api/v1</exclude-pattern>
<!-- Import the entire clean code rule set -->
<rule ref="rulesets/cleancode.xml" />
<!-- Import the entire unused code rule set -->