Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
00a53a8339 Bump ini from 1.3.5 to 1.3.8
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-05 16:55:00 +00:00
12 changed files with 49 additions and 88 deletions

View File

@@ -172,7 +172,7 @@ class BaseService
public function getCustomFieldClassMap() public function getCustomFieldClassMap()
{ {
$map = []; $map = [];
foreach ($this->customFieldsClassMap as $key => $val) { foreach($this->customFieldsClassMap as $key => $val) {
$map[] = [$key, $val]; $map[] = [$key, $val];
} }
return $map; return $map;

View File

@@ -61,6 +61,7 @@ class DomainAwareInputCleaner
$filterData = json_decode($filters, true); $filterData = json_decode($filters, true);
foreach ($filterData as $name => $value) { foreach ($filterData as $name => $value) {
if (!$this->isValidColumnName($name) || !$this->isValidFilterValue($value)) { if (!$this->isValidColumnName($name) || !$this->isValidFilterValue($value)) {
return ''; return '';
} }

View File

@@ -15,7 +15,7 @@ class ModuleBuilder
public $modules = array(); public $modules = array();
public $user = null; public $user = null;
public function __construct() function __construct()
{ {
$this->user = \Classes\BaseService::getInstance()->getCurrentUser(); $this->user = \Classes\BaseService::getInstance()->getCurrentUser();
} }

View File

@@ -31,8 +31,8 @@ class ModuleTab
$orderBy, $orderBy,
$isActive = false, $isActive = false,
$options = array() $options = array()
) { )
{
$this->modelPath = $modelPath; $this->modelPath = $modelPath;
$this->name = $name; $this->name = $name;
$this->class = $class; $this->class = $class;
@@ -43,14 +43,12 @@ class ModuleTab
$this->isActive = $isActive; $this->isActive = $isActive;
$this->options = array_merge( $this->options = array_merge(
$options, $options, [
[
"setObjectTypeName" => "'{$this->name}'", "setObjectTypeName" => "'{$this->name}'",
"setAccess" => "data.permissions.{$this->name} ? data.permissions.{$this->name} : {}", "setAccess" => "data.permissions.{$this->name} ? data.permissions.{$this->name} : {}",
"setDataPipe" => 'new IceDataPipe(modJsList.tab' . $this->name . ')', "setDataPipe" => 'new IceDataPipe(modJsList.tab' . $this->name . ')',
"setRemoteTable" => true, "setRemoteTable" => true,
] ]);
);
} }
public function getHTML() public function getHTML()
@@ -69,8 +67,8 @@ class ModuleTab
{ {
$active = ($this->isActive)?" active":""; $active = ($this->isActive)?" active":"";
$html = '<div class="tab-pane'.$active.'" id="tabPage'.$this->name.'">'. $html = '<div class="tab-pane'.$active.'" id="tabPage'.$this->name.'">'.
'<div id="'.$this->name.'Table" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>'. '<div id="'.$this->name.'Table" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>'.
'<div id="'.$this->name.'Form"></div>'. '<div id="'.$this->name.'Form"></div>'.
'<div id="'.$this->name.'FilterForm"></div>'. '<div id="'.$this->name.'FilterForm"></div>'.
'</div>'; '</div>';

View File

@@ -7,8 +7,7 @@ use Utils\LogManager;
class SAMLManager class SAMLManager
{ {
public function getSSOEmail($samlData, $relayState) public function getSSOEmail($samlData, $relayState) {
{
// Service Providers Assertion Consumer Service (ACS) URL // Service Providers Assertion Consumer Service (ACS) URL
$acsUrl = CLIENT_BASE_URL.'login.php'; $acsUrl = CLIENT_BASE_URL.'login.php';
$samlResponse = htmlspecialchars($samlData); $samlResponse = htmlspecialchars($samlData);
@@ -28,15 +27,15 @@ class SAMLManager
$statusString = $status->item(0)->getAttribute('Value'); $statusString = $status->item(0)->getAttribute('Value');
$statusArray = explode(':', $statusString); $statusArray = explode(':',$statusString);
if (array_key_exists(7, $statusArray)) { if(array_key_exists(7, $statusArray)){
$status = $statusArray[7]; $status = $statusArray[7];
} }
if ('Success' !== $status) { if ('Success' !== $status) {
$StatusMessage = $xpath->query('/samlp:Response/samlp:Status/samlp:StatusMessage', $doc)->item(0); $StatusMessage = $xpath->query('/samlp:Response/samlp:Status/samlp:StatusMessage', $doc)->item(0);
LogManager::getInstance()->error('SAML login failed: status = '. $status); LogManager::getInstance()->error('SAML login failed: status = '. $status);
if (!empty($StatusMessage)) { if(!empty($StatusMessage)) {
$StatusMessage = $StatusMessage->nodeValue; $StatusMessage = $StatusMessage->nodeValue;
LogManager::getInstance()->error('SAML login failed: status message = '. $StatusMessage); LogManager::getInstance()->error('SAML login failed: status message = '. $StatusMessage);
} }
@@ -52,31 +51,17 @@ class SAMLManager
$certFingerPrint = MoXMLSecurityKey::getRawThumbprint($x509cert); $certFingerPrint = MoXMLSecurityKey::getRawThumbprint($x509cert);
$certFingerPrint = preg_replace('/\s+/', '', $certFingerPrint); $certFingerPrint = preg_replace('/\s+/', '', $certFingerPrint);
$validSignature = false; $validSignature = false;
if (!empty($responseSignatureData)) { if(!empty($responseSignatureData)) {
$validSignature = \Utilities::processResponse( $validSignature = \Utilities::processResponse($acsUrl, $certFingerPrint, $responseSignatureData, $samlResponse, 0, $relayState);
$acsUrl,
$certFingerPrint,
$responseSignatureData,
$samlResponse,
0,
$relayState
);
LogManager::getInstance()->error('SAML: response signature validity :'.$validSignature); LogManager::getInstance()->error('SAML: response signature validity :'.$validSignature);
} }
if (!empty($assertionSignatureData)) { if(!empty($assertionSignatureData)) {
$validSignature = \Utilities::processResponse( $validSignature = \Utilities::processResponse($acsUrl, $certFingerPrint, $assertionSignatureData, $samlResponse, 0, $relayState);
$acsUrl,
$certFingerPrint,
$assertionSignatureData,
$samlResponse,
0,
$relayState
);
LogManager::getInstance()->error('SAML: response signature validity :'.$validSignature); LogManager::getInstance()->error('SAML: response signature validity :'.$validSignature);
} }
if (!$validSignature) { if(!$validSignature) {
LogManager::getInstance()->error('Invalid response or assertion signature'); LogManager::getInstance()->error('Invalid response or assertion signature');
return false; return false;
} }

View File

@@ -28,20 +28,17 @@ class SettingsManager
return self::$me; return self::$me;
} }
public function addEncryptedSetting($name) public function addEncryptedSetting($name) {
{
if (!$this->isEncryptedSetting($name)) { if (!$this->isEncryptedSetting($name)) {
$this->encryptedSettings[] = $name; $this->encryptedSettings[] = $name;
} }
} }
public function isEncryptedSetting($name) public function isEncryptedSetting($name) {
{
return in_array($name, $this->encryptedSettings); return in_array($name, $this->encryptedSettings);
} }
public function getInstanceKey() public function getInstanceKey() {
{
$settings = new Setting(); $settings = new Setting();
$settings->Load("name = ?", array("Instance: Key")); $settings->Load("name = ?", array("Instance: Key"));
if ($settings->name != "Instance: Key") { if ($settings->name != "Instance: Key") {
@@ -50,17 +47,16 @@ class SettingsManager
return $settings->value; return $settings->value;
} }
private function encrypt($value) private function encrypt($value) {
{
$id = BaseService::getInstance()->getInstanceId(); $id = BaseService::getInstance()->getInstanceId();
$key = $this->getInstanceKey(); $key = $this->getInstanceKey();
return AesCtr::encrypt($value, $id.$key, 256); return AesCtr::encrypt($value, $id.$key, 256);
} }
public function encryptSetting($name, $value) public function encryptSetting($name, $value) {
{
// check the existence of prefix and encrypt only if need to avoid double encryption // check the existence of prefix and encrypt only if need to avoid double encryption
if ($this->isEncryptedSetting($name) if (
$this->isEncryptedSetting($name)
&& substr($value, 0, strlen(self::ENCRYPTED_PREFIX)) !== self::ENCRYPTED_PREFIX && substr($value, 0, strlen(self::ENCRYPTED_PREFIX)) !== self::ENCRYPTED_PREFIX
) { ) {
$value = self::ENCRYPTED_PREFIX.$this->encrypt($value); $value = self::ENCRYPTED_PREFIX.$this->encrypt($value);
@@ -69,16 +65,15 @@ class SettingsManager
return $value; return $value;
} }
private function decrypt($value) private function decrypt($value) {
{
$id = BaseService::getInstance()->getInstanceId(); $id = BaseService::getInstance()->getInstanceId();
$key = $this->getInstanceKey(); $key = $this->getInstanceKey();
return AesCtr::decrypt($value, $id.$key, 256); return AesCtr::decrypt($value, $id.$key, 256);
} }
public function decryptSetting($name, $value) public function decryptSetting($name, $value) {
{ if (
if ($this->isEncryptedSetting($name) $this->isEncryptedSetting($name)
&& substr($value, 0, strlen(self::ENCRYPTED_PREFIX)) === self::ENCRYPTED_PREFIX && substr($value, 0, strlen(self::ENCRYPTED_PREFIX)) === self::ENCRYPTED_PREFIX
) { ) {
$value = $this->decrypt(substr($value, strlen(self::ENCRYPTED_PREFIX))); $value = $this->decrypt(substr($value, strlen(self::ENCRYPTED_PREFIX)));
@@ -139,8 +134,7 @@ class SettingsManager
} }
} }
public function getDeprecatedSettings() public function getDeprecatedSettings() {
{
return [ return [
'Attendance: Work Week Start Day', 'Attendance: Work Week Start Day',
'Attendance: Overtime Calculation Class' 'Attendance: Overtime Calculation Class'

View File

@@ -45,8 +45,7 @@ class DocumentTaskCreator implements TaskCreator
return 0; return 0;
} }
$query $query = "select count(id) as c from EmployeeDocuments where employee = ? and valid_until < ? and visible_to = ?";
= "select count(id) as c from EmployeeDocuments where employee = ? and valid_until < ? and visible_to = ?";
$user->DB()->SetFetchMode(ADODB_FETCH_ASSOC); $user->DB()->SetFetchMode(ADODB_FETCH_ASSOC);
// TODO - sending notifications only for Owner documents, this need to be extended later // TODO - sending notifications only for Owner documents, this need to be extended later

View File

@@ -101,7 +101,7 @@ class Setting extends BaseModel
} }
if (strlen($obj->value) > 30) { if (strlen($obj->value) > 30) {
$obj->value = substr($obj->value, 0, 30).'...'; $obj->value = substr($obj->value,0, 30).'...';
} }
return $obj; return $obj;
} }

View File

@@ -17,7 +17,8 @@ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportB
LogManager::getInstance()->info(json_encode($report)); LogManager::getInstance()->info(json_encode($report));
LogManager::getInstance()->info(json_encode($req)); LogManager::getInstance()->info(json_encode($req));
if (empty($req['period']) if (
empty($req['period'])
&& ( && (
empty($req['date_start']) empty($req['date_start'])
|| 'NULL' === $req['date_start'] || 'NULL' === $req['date_start']
@@ -84,13 +85,7 @@ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportB
$company->Load('id = ?', [$employeeObject->department]); $company->Load('id = ?', [$employeeObject->department]);
$reportData = []; $reportData = [];
$reportData[] = [ $reportData[] = ["Date","First Punch-In Time","Last Punch-Out Time","Time in Attendance (Hours)","Time in Time-sheets (Hours)"];
"Date",
"First Punch-In Time",
"Last Punch-Out Time",
"Time in Attendance (Hours)",
"Time in Time-sheets (Hours)",
];
$reportData[] = ["Employee:",$employeeObject->first_name." ".$employeeObject->last_name,"","",""]; $reportData[] = ["Employee:",$employeeObject->first_name." ".$employeeObject->last_name,"","",""];
$reportData[] = ["Department:",$company->title,"","",""]; $reportData[] = ["Department:",$company->title,"","",""];
$reportData[] = ["Total Days:","","","",""]; $reportData[] = ["Total Days:","","","",""];
@@ -99,11 +94,7 @@ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportB
//Iterate date range //Iterate date range
$interval = \DateInterval::createFromDateString('1 day'); $interval = \DateInterval::createFromDateString('1 day');
$period = new \DatePeriod( $period = new \DatePeriod(new \DateTime($req['date_start']), $interval, (new \DateTime($req['date_end']))->modify('+1 day'));
new \DateTime($req['date_start']),
$interval,
(new \DateTime($req['date_end']))->modify('+1 day')
);
$totalHoursOffice = 0; $totalHoursOffice = 0;
$totalHoursTimeSheets = 0; $totalHoursTimeSheets = 0;
@@ -163,8 +154,7 @@ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportB
return $reportData; return $reportData;
} }
private function setRequestDatesBasedOnThePeriod($req) private function setRequestDatesBasedOnThePeriod($req) {
{
if (empty($req['period'])) { if (empty($req['period'])) {
return $req; return $req;
} }
@@ -172,13 +162,13 @@ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportB
if ($req['period'] === 'Current Month') { if ($req['period'] === 'Current Month') {
$req['date_start'] = date('Y-m-01', strtotime('now')); $req['date_start'] = date('Y-m-01', strtotime('now'));
$req['date_end'] = date('Y-m-d', strtotime('now')); $req['date_end'] = date('Y-m-d', strtotime('now'));
} elseif ($req['period'] === 'Last Month') { } else if ($req['period'] === 'Last Month') {
$req['date_start'] = date('Y-m-d', strtotime('first day of last month')); $req['date_start'] = date('Y-m-d', strtotime('first day of last month'));
$req['date_end'] = date('Y-m-d', strtotime('last day of last month')); $req['date_end'] = date('Y-m-d', strtotime('last day of last month'));
} elseif ($req['period'] === 'Last Week') { } else if ($req['period'] === 'Last Week') {
$req['date_start'] = date("Y-m-d", strtotime("-7 days")); $req['date_start'] = date("Y-m-d", strtotime("-7 days"));
$req['date_end'] = date('Y-m-d', strtotime('now')); $req['date_end'] = date('Y-m-d', strtotime('now'));
} elseif ($req['period'] === 'Last 2 Weeks') { } else if ($req['period'] === 'Last 2 Weeks') {
$req['date_start'] = date("Y-m-d", strtotime("-14 days")); $req['date_start'] = date("Y-m-d", strtotime("-14 days"));
$req['date_end'] = date('Y-m-d', strtotime('now')); $req['date_end'] = date('Y-m-d', strtotime('now'));
} }

18
package-lock.json generated
View File

@@ -3824,7 +3824,7 @@
}, },
"doctrine": { "doctrine": {
"version": "1.5.0", "version": "1.5.0",
"resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true, "dev": true,
"requires": { "requires": {
@@ -4759,12 +4759,6 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"ini": {
"version": "1.3.5",
"bundled": true,
"dev": true,
"optional": true
},
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
@@ -6796,9 +6790,9 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
"dev": true "dev": true
}, },
"inline-source-map": { "inline-source-map": {
@@ -6988,7 +6982,7 @@
}, },
"is-accessor-descriptor": { "is-accessor-descriptor": {
"version": "0.1.6", "version": "0.1.6",
"resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
"integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7034,7 +7028,7 @@
}, },
"is-data-descriptor": { "is-data-descriptor": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
"integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
"dev": true, "dev": true,
"requires": { "requires": {