mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
- Added excluded directories to PHPMD and PHPCS rule sets
- Added testing file for Lint
This commit is contained in:
@@ -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,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" />
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user