Skip to content

Commit d6f0225

Browse files
author
Joshua Parker
committed
Merge branch 'develop'
2 parents c63cedb + cfd6c48 commit d6f0225

File tree

750 files changed

+96825
-18031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

750 files changed

+96825
-18031
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ composer.json
2828
composer.lock
2929
app/plugins/etsis-smtp/
3030
app/plugins/amazonS3Backup/
31+
etmigrate.php

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ location /sis {
7171

7272
* Take eduTrac SIS for a test drive by checking out the full featured [demo] (http://demo.edutrac.net/).
7373
* [Online User's Manual] (http://www.edutracsis.com/): everything you need to get eduTrac SIS installed and setup.
74-
* [et 101] (http://et101.edutracsis.com/): more of a visual learner; this training videos will take through step by step on how to install, setup and use eduTrac SIS.
75-
* Bug fixing: contribute by helping to squash [bugs] (http://trac.edutracsis.com/projects/edutrac-sis/issues)
76-
* Handbook: majority of the classes, functions, methods and hooks are documented in the [developer's handbook] (http://developer.edutracsis.com); contribute to it or use it to write plugins for the community.
74+
* [et 101] (https://et101.edutracsis.com/): more of a visual learner; this training videos will take through step by step on how to install, setup and use eduTrac SIS.
75+
* Bug fixing: contribute by helping to squash [bugs] (https://trac.edutracsis.com/projects/edutrac-sis/issues)
76+
* Handbook: majority of the classes, functions, methods and hooks are documented in the [developer's handbook] (https://developer.edutracsis.com); contribute to it or use it to write plugins for the community.
7777

7878
## Mailing Lists
7979

8080
* [etsis-announce] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-announce) - Announcement list pertaining to eduTrac SIS updates.
81-
* [etsis-bugs] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-bugs) - Announcement list pertaining to bugs, but all bugs should be reported on [Trac] (http://trac.edutracsis.com/projects/edutrac-sis/issues).
81+
* [etsis-bugs] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-bugs) - Announcement list pertaining to bugs, but all bugs should be reported on [Trac] (https://trac.edutracsis.com/projects/edutrac-sis/issues).
8282
* [etsis-core] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-core) - Discussion around the core development of eduTrac SIS.
8383
* [etsis-docs] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-docs) - Discussion regarding eduTrac SIS Handbook and Online User's Manual.
8484
* [etsis-reports] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-reports) - Discussion list pertaining to writing and sharing SQL queries for advanced ad-hoc reporting.

RELEASE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.2.10

app/functions/auth-function.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function hasPermission($perm)
1313
{
1414
$acl = new \app\src\ACL(get_persondata('personID'));
1515

16-
if ($acl->hasPermission($perm) && isUserLoggedIn()) {
16+
if ($acl->hasPermission($perm) && is_user_logged_in()) {
1717
return true;
1818
} else {
1919
return false;
@@ -42,11 +42,17 @@ function get_persondata($field)
4242
}
4343
}
4444

45-
function isUserLoggedIn()
45+
/**
46+
* Checks if a visitor is logged in or not.
47+
*
48+
* @since 6.2.10
49+
* @return boolean
50+
*/
51+
function is_user_logged_in()
4652
{
4753
$person = get_person_by('personID', get_persondata('personID'));
4854

49-
if (count($person->personID) > 0) {
55+
if ('' != $person->personID) {
5056
return true;
5157
}
5258

@@ -423,7 +429,7 @@ function etsis_authenticate($login, $password, $rememberme)
423429
->findOne();
424430

425431
if (false == $person) {
426-
$app->flash('error_message', _t('Your account is deactivated.'));
432+
$app->flash('error_message', sprintf(_t('Your account is not active. <a href="%s">More info.</a>'), 'https://www.edutracsis.com/manual/troubleshooting/#Your_Account_is_Deactivated'));
427433
redirect($app->req->server['HTTP_REFERER']);
428434
return;
429435
}

app/functions/core-function.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @author Joshua Parker <joshmac3@icloud.com>
1212
*/
1313
define('CURRENT_RELEASE', '6.2.0');
14-
define('RELEASE_TAG', '6.2.9');
14+
define('RELEASE_TAG', trim( _file_get_contents(BASE_PATH . 'RELEASE') ));
1515

1616
$app = \Liten\Liten::getInstance();
1717
use \League\Event\Event;

app/functions/deprecated-function.php

Lines changed: 24 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
if (! defined('BASE_PATH'))
2+
if (!defined('BASE_PATH'))
33
exit('No direct script access allowed');
44

55
/**
@@ -27,129 +27,25 @@
2727
function subject_code_dropdown($subjectCode = NULL)
2828
{
2929
_deprecated_function(__FUNCTION__, '6.1.12', 'table_dropdown');
30-
30+
3131
$app = \Liten\Liten::getInstance();
3232
$subj = $app->db->subject()
3333
->select('subjectCode,subjectName')
3434
->where('subjectCode <> "NULL"');
35-
35+
3636
$q = $subj->find(function ($data) {
3737
$array = [];
3838
foreach ($data as $d) {
3939
$array[] = $d;
4040
}
4141
return $array;
4242
});
43-
43+
4444
foreach ($q as $v) {
4545
echo '<option value="' . _h($v['subjectCode']) . '"' . selected($subjectCode, _h($v['subjectCode']), false) . '>' . _h($v['subjectCode']) . ' ' . _h($v['subjectName']) . '</option>' . "\n";
4646
}
4747
}
4848

49-
/**
50-
*
51-
* @deprecated since release 6.2.0
52-
* @param unknown $file
53-
* @param string $delimiter
54-
*/
55-
function upgradeSQL($file, $delimiter = ';')
56-
{
57-
_deprecated_function(__FUNCTION__, '6.2.0');
58-
59-
$app = \Liten\Liten::getInstance();
60-
set_time_limit(0);
61-
62-
$contents = _file_get_contents($file);
63-
64-
if (strlen($contents) !== 0) {
65-
$file = fopen($file, 'r');
66-
67-
if (is_resource($file) === true) {
68-
$query = [];
69-
70-
while (feof($file) === false) {
71-
$query[] = fgets($file);
72-
73-
if (preg_match('~' . preg_quote($delimiter, '~') . '\s*$~iS', end($query)) === 1) {
74-
$query = trim(implode('', $query));
75-
76-
if ($app->db->query($query) === false) {
77-
echo '<p><font color="red">ERROR:</font> ' . $query . '</p>' . "\n";
78-
} else {
79-
echo '<p><font color="green">SUCCESS:</font> ' . $query . '</p>' . "\n";
80-
}
81-
82-
/*
83-
* while (ob_get_level() > 0) {
84-
* ob_end_flush();
85-
* }
86-
*
87-
* flush();
88-
*/
89-
}
90-
91-
if (is_string($query) === true) {
92-
$query = [];
93-
}
94-
}
95-
96-
fclose($file);
97-
redirect(get_base_url() . 'dashboard/upgrade/');
98-
}
99-
}
100-
}
101-
102-
/**
103-
*
104-
* @deprecated since release 6.2.0
105-
*/
106-
function redirect_upgrade_db()
107-
{
108-
_deprecated_function(__FUNCTION__, '6.2.0');
109-
110-
$app = \Liten\Liten::getInstance();
111-
$acl = new \app\src\ACL(get_persondata('personID'));
112-
if ($acl->userHasRole(8)) {
113-
if (RELEASE_TAG == \app\src\Core\etsis_Updater::inst()->init('RELEASE_TAG')) {
114-
if (get_option('dbversion') < \app\src\Core\etsis_Updater::inst()->init('DB_VERSION')) {
115-
if (basename($app->req->server["REQUEST_URI"]) != "upgrade") {
116-
redirect(get_base_url() . 'dashboard/upgrade/');
117-
}
118-
}
119-
}
120-
}
121-
}
122-
123-
/**
124-
* Fires the dashboard_right_widgets action.
125-
*
126-
* @deprecated since 5.0.0
127-
* @since 1.0.0
128-
*/
129-
function dashboard_right_widgets()
130-
{
131-
_deprecated_function(__FUNCTION__, '5.0.0');
132-
/**
133-
* Prints widgets on the right side of the dashboard.
134-
*
135-
* @deprecated since 5.0.0
136-
* @since 1.0.0
137-
*/
138-
do_action('dashboard_right_widgets');
139-
}
140-
141-
/**
142-
* An action called to create db tables needed
143-
* for a plugin
144-
*
145-
* @see Plugin::register_activation_hook()
146-
*
147-
* @deprecated since release 6.1.06
148-
* @since 4.2.0
149-
* @uses do_action() Calls 'create_db_table' hook.
150-
*/
151-
do_action('create_db_table');
152-
15349
/**
15450
* Merge user defined arguments into defaults array.
15551
*
@@ -167,7 +63,7 @@ function dashboard_right_widgets()
16763
function et_parse_args($args, $defaults = '')
16864
{
16965
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_parse_args');
170-
66+
17167
return etsis_parse_args($args, $defaults);
17268
}
17369

@@ -183,7 +79,7 @@ function et_parse_args($args, $defaults = '')
18379
function et_hash_password($password)
18480
{
18581
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_hash_password');
186-
82+
18783
return etsis_hash_password($password);
18884
}
18985

@@ -203,7 +99,7 @@ function et_hash_password($password)
20399
function et_check_password($password, $hash, $person_id = '')
204100
{
205101
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_check_password');
206-
102+
207103
return etsis_check_password($password, $hash, $person_id);
208104
}
209105

@@ -222,7 +118,7 @@ function et_check_password($password, $hash, $person_id = '')
222118
function et_set_password($password, $person_id)
223119
{
224120
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_set_password');
225-
121+
226122
return etsis_set_password($password, $person_id);
227123
}
228124

@@ -241,7 +137,7 @@ function et_set_password($password, $person_id)
241137
function et_parse_str($string, $array)
242138
{
243139
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_parse_str');
244-
140+
245141
return etsis_parse_str($string, $array);
246142
}
247143

@@ -254,7 +150,7 @@ function et_parse_str($string, $array)
254150
function et_autop($pee, $br = 1)
255151
{
256152
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_autop');
257-
153+
258154
return etsis_autop($pee, $br);
259155
}
260156

@@ -266,6 +162,18 @@ function et_autop($pee, $br = 1)
266162
function et_dropdown_languages($active = '')
267163
{
268164
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_dropdown_languages');
269-
165+
270166
return etsis_dropdown_languages($active);
271-
}
167+
}
168+
169+
/**
170+
*
171+
* @deprecated since release 6.2.10
172+
* @return function
173+
*/
174+
function isUserLoggedIn()
175+
{
176+
_deprecated_function(__FUNCTION__, '6.2.10', 'is_user_logged_in');
177+
178+
return is_user_logged_in();
179+
}

app/functions/person-function.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ function get_initials($ID, $initials = 2)
230230
$name = get_person_by('personID', $ID);
231231

232232
if ($initials == 2) {
233-
return substr(_h($name->fname), 0, 1) . '. ' . substr(_h($name->lname), 0, 1) . '.';
233+
return mb_substr(_h($name->fname), 0, 1, 'UTF-8') . '. ' . mb_substr(_h($name->lname), 0, 1, 'UTF-8') . '.';
234234
} else {
235-
return _h($name->lname) . ', ' . substr(_h($name->fname), 0, 1) . '.';
235+
return _h($name->lname) . ', ' . mb_substr(_h($name->fname), 0, 1, 'UTF-8') . '.';
236236
}
237237
}
238238

0 commit comments

Comments
 (0)