Skip to content

Commit

Permalink
Merge pull request #390 from bbalet/v1.0.1
Browse files Browse the repository at this point in the history
V1.0.1
  • Loading branch information
bbalet authored May 1, 2023
2 parents 150a28d + 3531881 commit 3fb7eca
Show file tree
Hide file tree
Showing 937 changed files with 1,425 additions and 1,417 deletions.
14 changes: 14 additions & 0 deletions application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = 'log';

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
Expand Down
14 changes: 14 additions & 0 deletions application/config/demo/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = 'log';

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
Expand Down
2 changes: 1 addition & 1 deletion application/config/demo/saml.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* SAML Configuration file (for Onelogin PHP Library)
* Full documentation is available at https://developers.onelogin.com/saml/php
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.5.0
Expand Down
1 change: 0 additions & 1 deletion application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

//_______________________________________________
//Admin : global features
$route['admin/qrcode'] = 'admin/qrCode';
$route['admin/settings'] = 'admin/settings';
$route['admin/diagnostic'] = 'admin/diagnostic';
$route['admin/oauthclients'] = 'admin/oauthClients';
Expand Down
2 changes: 1 addition & 1 deletion application/config/saml-example-onelogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* SAML Configuration file (for Onelogin PHP Library)
* Full documentation is available at https://developers.onelogin.com/saml/php
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.5.0
Expand Down
2 changes: 1 addition & 1 deletion application/config/saml.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* SAML Configuration file (for Onelogin PHP Library)
* Full documentation is available at https://developers.onelogin.com/saml/php
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.5.0
Expand Down
14 changes: 14 additions & 0 deletions application/config/testing/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use

/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = 'log';

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
Expand Down
2 changes: 1 addition & 1 deletion application/config/testing/saml.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* SAML Configuration file (for Onelogin PHP Library)
* Full documentation is available at https://developers.onelogin.com/saml/php
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.5.0
Expand Down
15 changes: 1 addition & 14 deletions application/controllers/Admin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves the administration pages
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.2
Expand Down Expand Up @@ -163,17 +163,4 @@ public function oauthTokensPurge() {
redirect('admin/oauthclients#sessions');
}

/**
* Output a QRCode containing the URL of the Jorani instance and the e-mail of the connected user
* @author Benjamin BALET <[email protected]>
*/
public function qrCode() {
require_once(APPPATH . 'third_party/QRCode.php');
$this->load->model('users_model');
$user = $this->users_model->getUsers($this->user_id);
$qr = new QRCodeGenerator\QRCode();
$qr = $qr->getMinimumQRCode(base_url() . '#' . $user['login'] .
'#' . $user['email'], QR_ERROR_CORRECT_LEVEL_L);
echo $qr->printHTML();
}
}
2 changes: 1 addition & 1 deletion application/controllers/Api.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller is the entry point for the REST API
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* docuementation of PHP OAuth2 server:
* http://bshaffer.github.io/oauth2-server-php-docs/cookbook/
*
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.6.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Calendar.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller displays the calendars of the leave requests
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
12 changes: 9 additions & 3 deletions application/controllers/Connection.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller manages the connection to the application
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down Expand Up @@ -193,8 +193,14 @@ public function logout() {
*/
public function language() {
$this->load->helper('form');
$this->session->set_userdata('language_code', $this->input->get_post('language', true));
$this->session->set_userdata('language', $this->polyglot->code2language($this->input->get_post('language', true)));

//Prevent transversal path attack and the selection of an unavailable language
$languages = explode(",", $this->config->item('languages'));
$language = $this->input->get_post('language', true);
if (in_array($language, $languages)) {
$this->session->set_userdata('language_code', $language);
$this->session->set_userdata('language', $this->polyglot->code2language($language));
}
if ($this->input->post('last_page') == FALSE) {
$this->redirectToLastPage();
} else {
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Contracts.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller allows to manage the contracts
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Entitleddays.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves the ajax endpoints that manages entitled days
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Extra.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller contains the actions allowing an employee to list and manage its overtime requests
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Hr.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves all the actions performed by human resources department
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
11 changes: 5 additions & 6 deletions application/controllers/Ics.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves all the ICS (webcal, ical) feeds exposed by Jorani.
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.0
Expand Down Expand Up @@ -93,13 +93,12 @@ private function getTimezoneAndLanguageOfUser($userId) {
public function dayoffs($userId, $contract) {
//Get timezone and language of the user
$this->getTimezoneAndLanguageOfUser($userId);
$vcalendar = new VObject\Component\VCalendar();

//Load the list of day off associated to the contract
$this->load->model('dayoffs_model');
$result = $this->dayoffs_model->getDaysOffForContract($contract);
if (empty($result)) {
echo "";
} else {
$vcalendar = new VObject\Component\VCalendar();
if (!empty($result)) {
foreach ($result as $event) {
$startdate = new \DateTime($event->date, new \DateTimeZone($this->timezone));
$enddate = new \DateTime($event->date, new \DateTimeZone($this->timezone));
Expand Down Expand Up @@ -129,8 +128,8 @@ public function dayoffs($userId, $contract) {
'DTEND' => $enddate
));
}
echo $vcalendar->serialize();
}
echo $vcalendar->serialize();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/Leaves.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller contains the actions allowing an employee to list and manage its leave requests
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down Expand Up @@ -830,7 +830,7 @@ public function validate() {
$enddate = preg_replace("([^0-9-])", "", $enddate);
$startdatetype = $this->input->post('startdatetype', TRUE); //Mandatory field checked by frontend
$enddatetype = $this->input->post('enddatetype', TRUE); //Mandatory field checked by frontend
$leave_id = $this->input->post('leave_id', TRUE);
$leave_id = intval($this->input->post('leave_id', TRUE));
$leaveValidator = new stdClass;
$deductDayOff = FALSE;
if (isset($id) && isset($type)) {
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/Leavetypes.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller allows to manage the list of leave types
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down Expand Up @@ -88,7 +88,7 @@ public function edit($id) {
$this->types_model->updateTypes($id,
$this->input->post('name'),
$this->input->post('deduct_days_off'),
$this->input->post('acronym'));
mb_substr($this->input->post('acronym'), 0, 10));
$this->session->set_flashdata('msg', lang('leavetypes_popup_update_flash_msg'));
redirect('leavetypes');
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Organization.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller contains the actions allowing to manage and display the organization tree
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.2.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Overtime.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller contains the actions allowing a manager to list and manage overtime requests
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Pages.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller loads the static and custom pages of the application
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.4.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Positions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves all the actions performed on postions
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Reports.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves the list of custom reports and the system reports.
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.2.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Requests.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller allows a manager to list and manage leave requests submitted to him
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This controller is the entry point for the REST API used by mobile and HTML5
* Clients. They use CORS requests. Each call to end points uses BasicAuth
* except the preflight exchange. So it should be used with a TLS connection
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/RestAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This controller is the entry point for the REST API used by mobile and HTML5
* Clients. They use CORS requests. Each call to end points uses BasicAuth
* except the preflight exchange. So it should be used with a TLS connection
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/RestLeaves.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This controller is the entry point for the REST API used by mobile and HTML5
* Clients. They use CORS requests. Each call to end points uses BasicAuth
* except the preflight exchange. So it should be used with a TLS connection
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/RestRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This controller is the entry point for the REST API used by mobile and HTML5
* Clients. They use CORS requests. Each call to end points uses BasicAuth
* except the preflight exchange. So it should be used with a TLS connection
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/RestUsers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* This controller serves the user management REST API
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @copyright Copyright (c) 2014-2023 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.6.6
Expand Down
Loading

0 comments on commit 3fb7eca

Please sign in to comment.