Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.
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
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '40 15 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
36 changes: 36 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

# - name: Run test suite
# run: composer run-script test
53 changes: 26 additions & 27 deletions _INSTALL/default.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- PHP Version: 5.3.6-13ubuntu3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
SET time_zone = "+05:30";

--
-- Database: `default`
Expand Down Expand Up @@ -36,14 +36,13 @@ CREATE TABLE IF NOT EXISTS `cm` (
`address2` varchar(200) NOT NULL DEFAULT '',
`city` varchar(100) NOT NULL DEFAULT '',
`state` varchar(100) NOT NULL DEFAULT '',
`zip` varchar(10) NOT NULL DEFAULT '',
`pin` varchar(10) NOT NULL DEFAULT '',
`phone` text NOT NULL,
`email` text NOT NULL,
`ssn` varchar(15) NOT NULL DEFAULT '',
`aadhar` varchar(15) NOT NULL DEFAULT '',
`dob` varchar(15) NOT NULL DEFAULT '',
`age` varchar(10) NOT NULL DEFAULT '',
`gender` varchar(10) NOT NULL DEFAULT '',
`race` varchar(10) NOT NULL DEFAULT '',
`income` int(50) DEFAULT NULL,
`per` varchar(15) NOT NULL,
`judge` varchar(200) NOT NULL DEFAULT '',
Expand Down Expand Up @@ -136,10 +135,12 @@ CREATE TABLE IF NOT EXISTS `cm_case_types` (
--

INSERT INTO `cm_case_types` (`id`, `type`, `case_type_code`) VALUES
(1, 'Criminal', 'CRM'),
(2, 'Adoption', 'ADO'),
(3, 'SSI', 'SSI'),
(4, 'Divorce', 'DIV');
(1, 'Goods and Services Tax', 'GST'),
(2, 'Income Tax', 'IT'),
(3, 'Value Added Tax', 'VAT'),
(4, 'Old GST', 'GSTO');
(5, 'Others', 'ORS');


-- --------------------------------------------------------

Expand Down Expand Up @@ -197,34 +198,33 @@ INSERT INTO `cm_columns` (`id`, `db_name`, `display_name`, `include_in_case_tabl
(7, 'organization', 'Organization', 'true', 'text', '', 'false', 1, 7),
(8, 'date_open', 'Date Open', 'true', 'date', '', 'true', 1, 8),
(9, 'date_close', 'Date Close', 'true', 'date', '', 'true', 1, 41),
(10, 'case_type', 'Case Type', 'true', 'select', 'a:5:{s:4:"MISD";s:22:"Criminal - Misdemeanor";s:3:"ADO";s:8:"Adoption";s:4:"CHSP";s:13:"Child Support";s:3:"FEL";s:17:"Criminal - Felony";s:3:"DIV";s:7:"Divorce";}', 'true', 1, 10),
(10, 'case_type', 'Case Type', 'true', 'select', 'a:7:{s:4:"MISD";s:22:"Criminal - Misdemeanor";s:3:"ADO";s:8:"Adoption";s:4:"CHSP";s:13:"Child Support";s:3:"FEL";s:17:"Criminal - Felony";s:3:"DIV";s:7:"Divorce";s:3:"GST";s:7:"Goods and Services Tax";s:3:"IT";s:7:"Income Tax";}', 'true', 1, 10),
(44, 'assigned_users', 'Assigned Users', 'true', 'text', '', 'false', 0, 41),
(41, 'adverse_parties', 'Adverse Party', 'true', 'multi-text', '', 'false', 1, 33),
(11, 'clinic_type', 'Clinic Type', 'true', 'select', 'a:8:{s:3:"MSD";s:18:"Misdemeanor Clinic";s:3:"CMJ";s:17:"Community Justice";s:3:"CRM";s:8:"Criminal";s:3:"FAM";s:6:"Family";s:3:"IMM";s:11:"Immigration";s:3:"LTT";s:25:"Litigation and Technology";s:3:"TST";s:11:"Test Clinic";s:3:"WJS";s:17:"Workplace Justice";}', 'false', 0, 11),
(12, 'address1', 'Address 1', 'false', 'text', '', 'false', 0, 12),
(13, 'address2', 'Address 2', 'false', 'text', '', 'false', 0, 13),
(14, 'city', 'City', 'false', 'text', '', 'false', 0, 14),
(15, 'state', 'State', 'false', 'select', 'a:51:{s:2:"AL";s:7:"Alabama";s:2:"AK";s:6:"Alaska";s:2:"AZ";s:7:"Arizona";s:2:"AR";s:8:"Arkansas";s:2:"CA";s:10:"California";s:2:"CO";s:8:"Colorado";s:2:"CT";s:11:"Connecticut";s:2:"DE";s:8:"Delaware";s:2:"DC";s:20:"District Of Columbia";s:2:"FL";s:7:"Florida";s:2:"GA";s:7:"Georgia";s:2:"HI";s:6:"Hawaii";s:2:"ID";s:5:"Idaho";s:2:"IL";s:8:"Illinois";s:2:"IN";s:7:"Indiana";s:2:"IA";s:4:"Iowa";s:2:"KS";s:6:"Kansas";s:2:"KY";s:8:"Kentucky";s:2:"LA";s:9:"Louisiana";s:2:"ME";s:5:"Maine";s:2:"MD";s:8:"Maryland";s:2:"MA";s:13:"Massachusetts";s:2:"MI";s:8:"Michigan";s:2:"MN";s:9:"Minnesota";s:2:"MS";s:11:"Mississippi";s:2:"MO";s:8:"Missouri";s:2:"MT";s:7:"Montana";s:2:"NE";s:8:"Nebraska";s:2:"NV";s:6:"Nevada";s:2:"NH";s:13:"New Hampshire";s:2:"NJ";s:10:"New Jersey";s:2:"NM";s:10:"New Mexico";s:2:"NY";s:8:"New York";s:2:"NC";s:14:"North Carolina";s:2:"ND";s:12:"North Dakota";s:2:"OH";s:4:"Ohio";s:2:"OK";s:8:"Oklahoma";s:2:"OR";s:6:"Oregon";s:2:"PA";s:12:"Pennsylvania";s:2:"RI";s:12:"Rhode Island";s:2:"SC";s:14:"South Carolina";s:2:"SD";s:12:"South Dakota";s:2:"TN";s:9:"Tennessee";s:2:"TX";s:5:"Texas";s:2:"UT";s:4:"Utah";s:2:"VT";s:7:"Vermont";s:2:"VA";s:8:"Virginia";s:2:"WA";s:10:"Washington";s:2:"WV";s:13:"West Virginia";s:2:"WI";s:9:"Wisconsin";s:2:"WY";s:7:"Wyoming";}', 'false', 0, 15),
(16, 'zip', 'Zip', 'false', 'text', '', 'false', 0, 16),
(15, 'state', 'State', 'false', 'select', 'a:6:{s:2:"JK";s:7:"Jammu and Kashmir";s:2:"LA";s:6:"Ladakh";s:2:"DE";s:6:"Delhi";s:2:"HA";s:6:"Haryana";s:2:"PB";s:6:"Punjab";s:2:"MP";s:6:"Madhya Pradesh";}', 'false', 0, 15),
(16, 'Pin_Code', 'Pin', 'false', 'text', '', 'false', 0, 16),
(17, 'phone', 'Phone', 'true', 'dual', 'a:5:{s:4:"home";s:4:"Home";s:4:"work";s:4:"Work";s:6:"mobile";s:6:"Mobile";s:3:"fax";s:3:"Fax";s:5:"other";s:5:"Other";}', 'false', 1, 17),
(19, 'email', 'Email', 'true', 'dual', 'a:3:{s:4:"Home";s:4:"Home";s:4:"Work";s:4:"Work";s:5:"Other";s:5:"Other";}', 'false', 1, 19),
(20, 'ssn', 'SSN', 'true', 'text', '', 'false', 0, 20),
(20, 'Aadhar_no', 'Aadhar', 'true', 'text', '', 'false', 0, 20),
(21, 'dob', 'DOB', 'true', 'text', '', 'false', 0, 21),
(22, 'age', 'Age', 'true', 'text', '', 'false', 0, 22),
(23, 'gender', 'Gender', 'true', 'select', 'a:2:{s:1:"M";s:4:"Male";s:1:"F";s:6:"Female";}', 'false', 0, 23),
(24, 'race', 'Race', 'true', 'select', 'a:5:{s:2:"AA";s:16:"African-American";s:1:"W";s:5:"White";s:1:"H";s:8:"Hispanic";s:1:"A";s:5:"Asian";s:1:"O";s:5:"Other";}', 'false', 0, 24),
(25, 'income', 'Income', 'false', 'text', '', 'false', 0, 25),
(26, 'per', 'Per', 'false', 'select', 'a:4:{s:3:"day";s:3:"Day";s:4:"week";s:4:"Week";s:5:"month";s:5:"Month";s:4:"year";s:4:"Year";}', 'false', 0, 26),
(27, 'judge', 'Judge', 'false', 'text', '', 'false', 0, 27),
(28, 'pl_or_def', 'Plaintiff/Defendant', 'false', 'select', 'a:3:{s:9:"plaintiff";s:9:"Plaintiff";s:9:"defendant";s:9:"Defendant";s:5:"other";s:5:"Other";}', 'false', 0, 28),
(29, 'court', 'Court', 'true', 'select', 'a:2:{i:0;s:38:"Federal Court for the Eastern District";i:1;s:14:"Superior Court";}', 'false', 0, 29),
(29, 'court', 'Court', 'true', 'select', 'a:3:{i:0;s:38:"District Court";i:2;s:14:"High Court";;i:3;s:15:"Supreme Court";}', 'false', 0, 29),
(30, 'section', 'Section', 'false', 'text', '', 'false', 0, 30),
(31, 'ct_case_no', 'Court Case Number', 'false', 'text', '', 'false', 0, 31),
(32, 'case_name', 'Case Name', 'false', 'text', '', 'false', 0, 32),
(33, 'notes', 'Notes', 'false', 'textarea', '', 'false', 0, 33),
(36, 'dispo', 'Disposition', 'true', 'select', 'a:5:{i:0;s:11:"Advice Only";i:1;s:16:"Judgment Granted";i:2;s:6:"Guilty";i:3;s:10:"Not Guilty";i:4;s:15:"Client Withdrew";}', 'true', 0, 42),
(36, 'dispo', 'Disposition', 'true', 'select', 'a:5:{i:0;s:11:"Advice Only";i:1;s:16:"Judgment Granted";i:2;s:6:"Set Aside";i:3;s:10:"Client Withdrew";}', 'true', 0, 42),
(38, 'close_notes', 'Closing Notes', 'false', 'textarea', '', 'false', 0, 44),
(39, 'referral', 'Referred By', 'true', 'select', 'a:3:{i:1;s:15:"Social Services";i:2;s:3:"LSC";i:3;s:16:"Legal Aid Bureau";}', 'false', 0, 39),
(39, 'referral', 'Referred By', 'true', 'select', 'a:3:{i:1;s:15:"Colleagues";i:2;s:3:"Clients";i:3;s:16:"Department";}', 'false', 0, 39),
(40, 'opened_by', 'Opened By', 'true', 'text', '', 'true', 1, 40);

-- --------------------------------------------------------
Expand All @@ -242,7 +242,7 @@ CREATE TABLE IF NOT EXISTS `cm_contacts` (
`address` text NOT NULL,
`city` varchar(100) NOT NULL DEFAULT '',
`state` char(2) NOT NULL DEFAULT '',
`zip` varchar(10) NOT NULL DEFAULT '',
`pin` varchar(10) NOT NULL DEFAULT '',
`phone` text NOT NULL,
`email` text NOT NULL,
`url` text NOT NULL,
Expand Down Expand Up @@ -292,8 +292,9 @@ CREATE TABLE IF NOT EXISTS `cm_courts` (
--

INSERT INTO `cm_courts` (`id`, `court`) VALUES
(1, 'Federal Court for the Eastern District'),
(2, 'Superior Court ');
(1, 'Distrct Court '),
(2, 'High Court '),
(3, 'Supreme Court ');

-- --------------------------------------------------------

Expand All @@ -314,9 +315,8 @@ CREATE TABLE IF NOT EXISTS `cm_dispos` (
INSERT INTO `cm_dispos` (`id`, `dispo`) VALUES
(1, 'Advice Only'),
(2, 'Judgment Granted'),
(3, 'Guilty'),
(4, 'Not Guilty'),
(5, 'Client Withdrew');
(3, 'Client Withdrew'),
(4, 'Set Aside');

-- --------------------------------------------------------

Expand Down Expand Up @@ -432,8 +432,8 @@ CREATE TABLE IF NOT EXISTS `cm_groups` (
INSERT INTO `cm_groups` (`id`, `group_name`, `group_title`, `group_description`, `allowed_tabs`, `add_cases`, `delete_cases`, `edit_cases`, `close_cases`, `view_all_cases`, `assign_cases`, `view_users`, `add_users`, `delete_users`, `edit_users`, `activate_users`, `add_case_notes`, `edit_case_notes`, `delete_case_notes`, `documents_upload`, `documents_modify`, `add_events`, `edit_events`, `delete_events`, `add_contacts`, `edit_contacts`, `delete_contacts`, `post_in_board`, `view_board`, `edit_posts`, `reads_journals`, `writes_journals`, `change_permissions`, `can_configure`, `supervises`, `is_supervised`) VALUES
(1, 'super', 'Super User', 'The super user can access all ClinicCases functions and add, edit, and delete all data. Most importantly, only the super user can change permissions for all users.\r\nSuper User access should be restricted to a limited number of users.', 'a:8:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:5:"Group";i:3;s:5:"Users";i:4;s:8:"Journals";i:5;s:5:"Board";i:6;s:9:"Utilities";i:7;s:8:"Messages";}', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0),
(2, 'admin', 'Administrator', 'The administrator can access all ClinicCases functions and view,edit, and delete all data. By default, the administrator is the only user who can add new files or authorize new users.\r\n\r\nThe administrator cannot change group permissions.', 'a:6:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:5:"Users";i:3;s:5:"Board";i:4;s:9:"Utilities";i:5;s:8:"Messages";}', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0),
(3, 'student', 'Student', 'Students can only access the cases to which they have been assigned by a professor.', 'a:6:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:8:"Journals";i:3;s:5:"Board";i:4;s:9:"Utilities";i:5;s:8:"Messages";}', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1),
(4, 'prof', 'Professor', 'Professors supervise students. By default, they can assign students to cases and view, edit, and delete all data in cases to which they are assigned.', 'a:7:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:5:"Group";i:3;s:8:"Journals";i:4;s:5:"Board";i:5;s:9:"Utilities";i:6;s:8:"Messages";}', 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0);
(3, 'Staff', 'Staff', 'Staff members can only access the cases to which they have been assigned by a professor.', 'a:6:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:8:"Journals";i:3;s:5:"Board";i:4;s:9:"Utilities";i:5;s:8:"Messages";}', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1),
(4, 'prof', 'Professor', 'Professors supervise Staff members. By default, they can assign students to cases and view, edit, and delete all data in cases to which they are assigned.', 'a:7:{i:0;s:4:"Home";i:1;s:5:"Cases";i:2;s:5:"Group";i:3;s:8:"Journals";i:4;s:5:"Board";i:5;s:9:"Utilities";i:6;s:8:"Messages";}', 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0);

-- --------------------------------------------------------

Expand Down Expand Up @@ -514,9 +514,8 @@ CREATE TABLE IF NOT EXISTS `cm_referral` (
--

INSERT INTO `cm_referral` (`id`, `referral`) VALUES
(1, 'Social Services'),
(2, 'LSC'),
(3, 'Legal Aid Bureau');
(1, 'Department'),
(2, 'Clients');

-- --------------------------------------------------------

Expand Down
18 changes: 7 additions & 11 deletions db.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?php
require_once('_CONFIG.php');

try {
$dbh = new PDO("mysql:host=" . CC_DBHOST . ";dbname=" . CC_DATABASE_NAME . ";charset=utf8mb4" , CC_DBUSERNAME, CC_DBPASSWD);
}
catch(PDOException $e)
{

//400 is sent to trigger an error for ajax requests.
header('HTTP/1.1 400 Bad Request');

echo $e->getMessage();
}
$dbh = new PDO("mysql:host=" . CC_DBHOST . ";dbname=" . CC_DATABASE_NAME , CC_DBUSERNAME, CC_DBPASSWD, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode="IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"') );
}
catch(PDOException $e) {
//400 is sent to trigger an error for ajax requests.
header('HTTP/1.1 400 Bad Request');
echo $e->getMessage();
}