Skip to content

Commit 4f6d12c

Browse files
committed
Merged PR 25: Extjs 6 fixes and security upgrades
Related work items: KETSE#41, KETSE#42, KETSE#60, KETSE#63, KETSE#64
2 parents f10893a + 6a65a10 commit 4f6d12c

26 files changed

+1031
-443
lines changed

app/config/monolog.yml

+16-15
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@ monolog:
1111
level: debug
1212
console:
1313
type: console
14-
mail:
15-
type: fingers_crossed
14+
#commenting out email send for now
15+
# mail:
16+
# type: fingers_crossed
1617
# 500 errors are logged at the critical level
17-
action_level: critical
18+
# action_level: critical
1819
# to also log 400 level errors (but not 404's):
1920
# action_level: error
2021
# excluded_404s:
2122
# - ^/
22-
handler: deduplicated
23-
deduplicated:
24-
type: deduplication
25-
handler: swift
26-
swift:
27-
type: swift_mailer
28-
from_email: '[email protected]'
29-
30-
subject: 'An Error Occurred! %%message%%'
31-
level: debug
32-
formatter: monolog.formatter.html
33-
content_type: text/html
23+
# handler: deduplicated
24+
#deduplicated:
25+
# type: deduplication
26+
# handler: swift
27+
#swift:
28+
# type: swift_mailer
29+
# from_email: '[email protected]'
30+
31+
# subject: 'An Error Occurred! %%message%%'
32+
# level: debug
33+
# formatter: monolog.formatter.html
34+
# content_type: text/html

app/config/twig.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Twig configuration
22
twig:
33
debug: "%kernel.debug%"
4-
strict_variables: "%kernel.debug%"
4+
strict_variables: "%kernel.debug%"
5+
cache: false

src/Casebox/CoreBundle/Resources/translations/frontend.en.xlf

+5
Original file line numberDiff line numberDiff line change
@@ -3254,6 +3254,11 @@
32543254
<source>DecreaseHeaderColumnWidth</source>
32553255
<target>Decrease header column width</target>
32563256
</trans-unit>
3257+
<trans-unit id="5010">
3258+
<source>PasswordRequirements</source>
3259+
<target><![CDATA[<b>New password must meet the following requirements: </b><br/>Contain at least one uppercase alphabetical character<br/> Contain at least one lowercase alphabetical character.<br/>Contain at least one numerical character <br/> Contain at least one special character<br/>Be at least 8 characters long.<br/><br/>]]></target>
3260+
</trans-unit>
3261+
32573262
</body>
32583263
</file>
32593264
</xliff>

src/Casebox/CoreBundle/Resources/views/patient/header.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="obj-header" style="text-align:left"><i class="fas fa-user" style="display:none;color:#4672A6"></i><b class=""> {{data.patient_name}} </b> [{{data.patient_id}}] &nbsp;
2-
<div class="dIB fs12 task-status {{statuscss}}">{{data.status}}</div>
1+
<div class="obj-header" style="text-align:left"><i class="fas fa-user" style="display:none;color:#4672A6"></i><b class=""> {{data.patient_name | default('No Name')}} </b> [{{data.patient_id | default('NOID')}}] &nbsp;
2+
<div class="dIB fs12 task-status {{statuscss}}">{{data.status | default('New Referral')}}</div>
33
<!-- here display deceased, resident, non-citizen, beacon score, pregnant -->
44
</br>
55
<!-- <table width="100%" border="0">

src/Casebox/CoreBundle/Service/Auth/CaseboxAuth.php

+26-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,31 @@ public function authenticate($username, $password)
142142
return $user;
143143
}
144144

145+
/**
146+
* verify user password
147+
* @param string $username
148+
* @param string $password
149+
* @return bool
150+
*/
151+
public function verifyUserPassword($username, $password)
152+
{
153+
$user = $this->getEm()->getRepository('CaseboxCoreBundle:UsersGroups')->findUserByUsername($username);
154+
155+
if (!$user instanceof UsersGroupsEntity) {
156+
return false;
157+
}
158+
159+
if (strlen($user->getPassword()) <= 32) {
160+
// Old password behavior
161+
$encodedPass = md5('aero'.$password);
162+
} else {
163+
$encoder = $this->getEncoderFactoryInterface()->getEncoder($user);
164+
$encodedPass = $encoder->encodePassword($password, $user->getSalt());
165+
}
166+
167+
return ($encodedPass == $user->getPassword());
168+
}
169+
145170
/**
146171
* @return bool|true
147172
*/
@@ -151,7 +176,7 @@ public function logout()
151176
if (!$user instanceof UsersGroupsEntity) {
152177
return false;
153178
}
154-
//$user->setLastLogout(time());
179+
$user->setLastLogout(time());
155180
$this->getEm()->flush();
156181

157182

src/Casebox/CoreBundle/Service/Objects.php

+4
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,10 @@ public static function getCustomClassByType($type, $objectId = null)
637637
case 'task':
638638
return new Objects\Task($objectId);
639639
break;
640+
641+
case 'patient':
642+
return new Objects\Patient($objectId);
643+
break;
640644

641645
case 'template':
642646
return new Objects\Template($objectId);

src/Casebox/CoreBundle/Service/Objects/Object.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,9 @@ public function getPreviewBlocks()
19791979
$eventParams['result'] = &$rez;
19801980

19811981
$dispatcher->dispatch('generatePreview', new GeneratePreviewEvent($eventParams));
1982-
1982+
1983+
$this->logAction('view'); //Task 60 - Audit all Views
1984+
19831985
return $rez;
19841986
}
19851987

src/Casebox/CoreBundle/Service/Objects/Patient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,9 @@ public function getPreviewBlocks()
805805
//$pb[0] = 'hi';
806806
//derive some data
807807
$data['statuscss'] = $this->getStatusCSSClass();
808-
$data['data']['birthdate'] = str_replace('0:00','',$data['data']['birthdate']);
809808
$data['age'] = date_diff(date_create($data['data']['birthdate']), date_create('today'))->y;
810-
809+
$data['data']['birthdate'] = str_replace('T00:00:00Z','',$data['data']['birthdate']);
810+
$data['data']['patient_name'] = $data['data']['patient_first_name'] . ' ' . $data['data']['patient_last_name'];
811811
$pb[1] = $twig->render('CaseboxCoreBundle:patient:header.html.twig', $data);
812812
$pb[2] = $twig->render('CaseboxCoreBundle:patient:demographics.html.twig', $data);
813813
$pb[3] = $twig->render('CaseboxCoreBundle:patient:guarantor.html.twig', $data);

src/Casebox/CoreBundle/Service/TreeNode/MyCalendar.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ protected function getChildrenTasks()
8282
}
8383

8484
$p['fq'] = $this->fq;
85-
$p['fq'][] = 'task_u_assignee:'.Cache::get('session')->get('user')['id'];
86-
$p['fq'][] = 'task_status:[0 TO 2]';
85+
//$p['fq'][] = 'task_u_assignee:'.Cache::get('session')->get('user')['id'];
86+
//$p['fq'][] = 'task_status:[0 TO 2]';
8787

8888
$s = new \Casebox\CoreBundle\Service\Search();
8989
$rez = $s->query($p);

src/Casebox/CoreBundle/Service/TreeNode/Patients.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ protected function createDefaultFilter()
2525
//}
2626
$this->fq[] = 'template_id:(150)';
2727
$this->fl = 'patient_account_number_s, site_id_s, account_type_s, social_security_number_s,
28-
patient_type_s, medical_record_number_s, admission_date_s, discharge_date_s,
29-
current_balance_s, admitting_diagnosis_s, patient_last_name_s, patient_first_name_s,
30-
patient_initial, birthdate_s, sex_s, phone_s,nid';
28+
patient_type_s, medical_record_number_s, admission_date_dt, discharge_date_dt,
29+
current_balance_f, admitting_diagnosis_s, patient_last_name_s, patient_first_name_s,
30+
patient_initial_s, birthdate_s, sex_s, phone_s,nid,id,template_type,template_id,name,pids,path,
31+
pid,nid,id';
3132
}
3233

3334
public function getChildren(&$pathArray, $requestParams)

0 commit comments

Comments
 (0)