Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ docker/persist/*
vendor/*
attachments/*
temp/*
uploads/*
# Ignore Mac DS_Store files
.DS_Store
/vendor/
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ deploy:
file:
- $TRAVIS_BUILD_DIR/opencats-$TRAVIS_TAG-full.tar.gz
- $TRAVIS_BUILD_DIR/opencats-$TRAVIS_TAG-full.zip
skip_cleanup: true
on:
repo: opencats/OpenCATS
tags: true
skip_cleanup: true
2 changes: 1 addition & 1 deletion constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


/* Copyright information at bottom of pages. */
define('COPYRIGHT_HTML', '© 2007-2023 OpenCATS.');
define('COPYRIGHT_HTML', '');

/* HTTP response codes. */
define('HTTP_OK', 200);
Expand Down
18 changes: 9 additions & 9 deletions lib/CommonErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$errorTitle = 'Invalid Information';
$internalErrorTitle = 'Bad Input';
$errorMessage = 'Some of the information you provided doesn\'t follow the correct format and '
. 'CATS can\'t interpret what it is. Please <a href="javascript:back()">go back</a> and '
. 'CATS can\'t interpret what it is. Please <a href="javascript:history.back()">go back</a> and '
. 'complete each field paying close attention to any instructions provided. '
. '<p><b>' . $customMessage . '</b>';
break;
Expand Down Expand Up @@ -127,7 +127,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
. 'traffic or older web browsers. The latest version of the <a href="http://www.getfirefox.com"> '
. 'Mozilla Firefox&copy;</a> browser '
. 'is recommended.<br /><br />The problem may be resolved by using the '
. '<a href="javascript:back()">back button</a> on your browser and trying again.';
. '<a href="javascript:history.back()">back button</a> on your browser and trying again.';
break;
case COMMONERROR_BADINDEX:
$errorTitle = 'Bad Server Information';
Expand All @@ -142,7 +142,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
. 'may have been provided to you.'
. '<br /><br />'
. '<b>It\'s ok!</b> CATS can\'t complete whatever action you requested; but chances are, '
. 'if you click the <a href="javascript:back()">back button</a> and <b>refresh</b> the page '
. 'if you click the <a href="javascript:history.back()">back button</a> and <b>refresh</b> the page '
. 'and try again it will work just fine.';
break;

Expand All @@ -151,7 +151,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$internalErrorTitle = 'Permission Denied';
$errorMessage = 'You don\'t have access to the action you\'re attempting to perform. If you '
. 'feel you should have access, contact your site administrator. '
. 'You can click the <a href="javascript:back()">back</a> button on your browser to return '
. 'You can click the <a href="javascript:history.back()">back button</a> on your browser to return '
. 'to where you came from.';
break;

Expand All @@ -172,7 +172,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$internalErrorTitle = 'Required Fields Missing';
$errorMessage = 'One or more of the input fields on the page you came from were required and '
. 'were left with blank or incorrect values. The action you\'re trying to perform cannot '
. 'be completed without those fields. Please use the <a href="javascript:back()">back button</a> '
. 'be completed without those fields. Please use the <a href="javascript:history.back()">back button</a> '
. 'on your browser to return to where you came from.'
. '<br /><br />';

Expand All @@ -191,7 +191,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$internalErrorTitle = 'Missing wild card string';
$errorMessage = 'One or more of the input fields on the page you came from were required and '
. 'were left with blank or incorrect values. The action you\'re trying to perform cannot '
. 'be completed without those fields. Please use the <a href="javascript:back()">back button</a> '
. 'be completed without those fields. Please use the <a href="javascript:history.back()">back button</a> '
. 'on your browser to return to where you came from.'
. '<br /><br />';

Expand All @@ -208,7 +208,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
case COMMONERROR_NOPASSWORDMATCH:
$errorTitle = 'Passwords do not Match';
$internalErrorTitle = 'Passwords do not match';
$errorMessage = 'The passwords you entered do not match. Please use the <a href="javascript:back()">'
$errorMessage = 'The passwords you entered do not match. Please use the <a href="javascript:history.back()">'
. 'back button</a> on your browser to return from where you came and enter the correct password '
. 'in all required fields.';
break;
Expand All @@ -217,7 +217,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$errorTitle = 'File Does Not Exist';
$internalErrorTitle = 'File Does Not Exist';
$errorMessage = 'The file you are requesting for does not exist. Please use the '
. '<a href="javascript:back()">back button</a> on your browser to return to where '
. '<a href="javascript:history.back()">back button</a> on your browser to return to where '
. 'you came from.<br /><br />';

if (! empty($customMessage)) {
Expand All @@ -229,7 +229,7 @@ public static function fatal($code, $active, $customMessage = '', $modal = false
$errorTitle = 'An Error Has Occurred';
$internalErrorTitle = 'Undefined';
$errorMessage = 'An error has occurred and the operation you were attempting to perform cannot be '
. 'completed. Please use the <a href="javascript:back();">back</a> button on your web browser '
. 'completed. Please use the <a href="javascript:history.back();">back button</a> on your web browser '
. 'to return from where you came. The administrators have been notified, so you may wish to '
. 'try again later.';
break;
Expand Down
20 changes: 10 additions & 10 deletions lib/FileUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@

/* Use a whitelist instead of a blacklist to prevent possible bypasses */
/*
* if (!preg_match("/(?i)\.(pdf|docx?|rtf|odt?g?|txt|wpd|jpe?g|png|csv|xlsx?|ppt|msg|heic|tiff?|html?|bmp|wps|xps)$/i", $fileExtension))
* if (!preg_match("/(?i)\.(pdf|docx?|rtf|odt?g?|txt|wpd|jpe?g|png|csv|xlsx?|ppt|msg|heic|tiff?|html?|bmp|wps|xps)$/i", $fileExtension))
*/
$GoodFileExtensions = ['bak', 'bmp', 'csv', 'doc', 'docx', 'heic', 'html', 'jpeg', 'jpg', 'msg', 'odg', 'odt', 'pages', 'pdf', 'png', 'ppt', 'pptx', 'rtf', 'tiff', 'txt', 'wpd', 'wps', 'xls', 'xlsx', 'xps'];

Check warning on line 179 in lib/FileUtility.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

lib/FileUtility.php#L179

Avoid unused local variables such as '$GoodFileExtensions'.
// if (! in_array($fileExtension, $GoodFileExtensions)) {
// $filename .= ".txt";
// }
/*
* if (in_array($fileExtension, $GLOBALS['badFileExtensions'])) {
* $filename .= '.txt';
* }
*/
$GoodFileExtensions = ['bak', 'bmp', 'csv', 'doc', 'docx', 'heic', 'html', 'jpeg', 'jpg', 'msg', 'odg', 'odt', 'pages', 'pdf', 'png', 'ppt', 'pptx', 'rtf', 'tiff', 'wpd', 'wps', 'xls', 'xlsx', 'xps'];
// if (! in_array($fileExtension, $GoodFileExtensions)) {
// $filename .= ".txt";
// }
/* if (in_array($fileExtension, $GLOBALS['badFileExtensions']))
* {
* $filename .= '.txt';
}
*/
return $filename;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/StringUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,22 +493,22 @@ public static function makeInitialName(
}

if ($lastCommaFirst) {
$firstInitial = $firstName[0] . '.';
$firstInitial = mb_substr($firstName, 0, 1) . '.';

if (strlen((string) $lastName) > $maxLength) {
return ucwords(
substr((string) $lastName, 0, $maxLength) . ', ' . $firstInitial
mb_substr($lastName, 0, $maxLength) . ', ' . $firstInitial
);
}

return ucwords($lastName . ', ' . $firstInitial);
}

$lastInitial = $lastName[0] . '.';
$lastInitial = mb_substr($lastName, 0, 1) . '.';

if (strlen((string) $firstName) > $maxLength) {
return ucwords(
substr((string) $firstName, 0, $maxLength) . ' ' . $lastInitial
mb_substr($firstName, 0, $maxLength) . ' ' . $lastInitial
);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/attachments/AttachmentsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct()
{
parent::__construct();

$this->_authenticationRequired = false;
$this->_authenticationRequired = true;
$this->_moduleDirectory = 'attachments';
$this->_moduleName = 'attachments';
$this->_moduleTabText = '';
Expand Down
4 changes: 2 additions & 2 deletions modules/candidates/Edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<label id="firstNameLabel" for="firstName">First Name:</label>
</td>
<td class="tdData">
<input type="text" class="inputbox" id="firstName" name="firstName" value="<?php $this->_($this->data['firstName']); ?>" style="width: 150px;" />
<input type="text" class="inputbox" id="firstName" name="firstName" value="<?php $this->_($this->data['firstName']); ?>" style="width: 150px;" />&nbsp;*
</td>
</tr>

Expand All @@ -55,7 +55,7 @@
<label id="lastNameLabel" for="lastName">Last Name:</label>
</td>
<td class="tdData">
<input type="text" class="inputbox" id="lastName" name="lastName" value="<?php $this->_($this->data['lastName']); ?>" style="width: 150px;" />
<input type="text" class="inputbox" id="lastName" name="lastName" value="<?php $this->_($this->data['lastName']); ?>" style="width: 150px;" />&nbsp;*
</td>
</tr>

Expand Down
21 changes: 21 additions & 0 deletions modules/candidates/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

errorMessage += checkFirstName();
errorMessage += checkLastName();
errorMessage += checkOwner();

Check warning on line 33 in modules/candidates/validator.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/candidates/validator.js#L33

'checkOwner' was used before it was defined.

if (errorMessage != '')
{
Expand Down Expand Up @@ -173,6 +174,26 @@
return errorMessage;
}

function checkOwner()
{
var errorMessage = '';

fieldValue = document.getElementById('owner').selectedIndex;

Check notice on line 181 in modules/candidates/validator.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/candidates/validator.js#L181

Strings must use doublequote.
fieldLabel = document.getElementById('ownerLabel');

Check notice on line 182 in modules/candidates/validator.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/candidates/validator.js#L182

Strings must use doublequote.
if (fieldValue == '')
{
errorMessage = " - You must select an owner.\n";

fieldLabel.style.color = '#ff0000';
}
else
{
fieldLabel.style.color = '#000';
}

return errorMessage;
}

function checkSearchFullName()
{
var errorMessage = '';
Expand Down
2 changes: 1 addition & 1 deletion modules/import/ImportUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ public function massImport($step = 1)
'errorMessage',
'You didn\'t upload any files or there was a '
. 'problem working with any files you uploaded. Please use the '
. '<a href="javascript:back()"><strong>Back</strong></a> button on your web browser '
. '<a href="javascript:history.back()"><strong>Back</strong></a> button on your web browser '
. 'and select one or more files to import.'
);

Expand Down
2 changes: 1 addition & 1 deletion modules/joborders/Add.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div id="CompanyResults" class="ajaxSearchResults"></div>

<?php if ($this->defaultCompanyID !== false): ?>
<input type="radio" name="typeCompany" id="defaultCompany" onchange="if(document.getElementById('companyName').disabled == false && document.getElementById('companyID').value > 0) {oldCompanyID = document.getElementById('companyID').value; } else if(document.getElementById('companyName').disabled == false) { oldCompanyID = 0; } document.getElementById('companyName').disabled = true; document.getElementById('companyID').value = '<?php echo($this->defaultCompanyID); ?>'; ">&nbsp;Internal Posting<br />
<input type="radio" name="typeCompany" id="defaultCompany" onchange="if(document.getElementById('companyName').disabled == false && document.getElementById('companyID').value > 0) {oldCompanyID = document.getElementById('companyID').value; } else if(document.getElementById('companyName').disabled == false) { oldCompanyID = 0; } document.getElementById('companyName').disabled = true; document.getElementById('companyID').value = '<?php echo($this->defaultCompanyID); ?>'; ">&nbsp;<?php echo($this->defaultCompanyRS['name']); ?><br />
<?php endif; ?>

<script type="text/javascript">oldCompanyID = -1; watchCompanyIDChangeJO('<?php echo($this->sessionCookie); ?>');</script>
Expand Down
2 changes: 1 addition & 1 deletion modules/joborders/Edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</td>
<td class="tdData">
<?php if ($this->defaultCompanyID !== false): ?>
<input type="radio" name="typeCompany" <?php if ($this->defaultCompanyID == $this->data['companyID']) echo(' checked'); ?> id="defaultCompany" onchange="if(document.getElementById('companyName').disabled == false && document.getElementById('companyID').value > 0) {oldCompanyID = document.getElementById('companyID').value; } else if(document.getElementById('companyName').disabled == false) { oldCompanyID = 0; } document.getElementById('companyName').disabled = true; document.getElementById('companyID').value = '<?php echo($this->defaultCompanyID); ?>'; ">&nbsp;Internal Posting
<input type="radio" name="typeCompany" <?php if ($this->defaultCompanyID == $this->data['companyID']) echo(' checked'); ?> id="defaultCompany" onchange="if(document.getElementById('companyName').disabled == false && document.getElementById('companyID').value > 0) {oldCompanyID = document.getElementById('companyID').value; } else if(document.getElementById('companyName').disabled == false) { oldCompanyID = 0; } document.getElementById('companyName').disabled = true; document.getElementById('companyID').value = '<?php echo($this->defaultCompanyID); ?>'; ">&nbsp;<?php echo($this->defaultCompanyRS['name']); ?>
<?php endif; ?>
<script type="text/javascript">oldCompanyID = -1; watchCompanyIDChangeJO('<?php echo($this->sessionCookie); ?>');</script>
</td>
Expand Down