Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Parker committed Sep 21, 2016
2 parents c63cedb + cfd6c48 commit d6f0225
Show file tree
Hide file tree
Showing 750 changed files with 96,825 additions and 18,031 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ composer.json
composer.lock
app/plugins/etsis-smtp/
app/plugins/amazonS3Backup/
etmigrate.php
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ location /sis {

* Take eduTrac SIS for a test drive by checking out the full featured [demo] (http://demo.edutrac.net/).
* [Online User's Manual] (http://www.edutracsis.com/): everything you need to get eduTrac SIS installed and setup.
* [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.
* Bug fixing: contribute by helping to squash [bugs] (http://trac.edutracsis.com/projects/edutrac-sis/issues)
* 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.
* [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.
* Bug fixing: contribute by helping to squash [bugs] (https://trac.edutracsis.com/projects/edutrac-sis/issues)
* 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.

## Mailing Lists

* [etsis-announce] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-announce) - Announcement list pertaining to eduTrac SIS updates.
* [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).
* [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).
* [etsis-core] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-core) - Discussion around the core development of eduTrac SIS.
* [etsis-docs] (http://reformed.edutrac.org/cgi-bin/mailman/listinfo/etsis-docs) - Discussion regarding eduTrac SIS Handbook and Online User's Manual.
* [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.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.2.10
14 changes: 10 additions & 4 deletions app/functions/auth-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hasPermission($perm)
{
$acl = new \app\src\ACL(get_persondata('personID'));

if ($acl->hasPermission($perm) && isUserLoggedIn()) {
if ($acl->hasPermission($perm) && is_user_logged_in()) {
return true;
} else {
return false;
Expand Down Expand Up @@ -42,11 +42,17 @@ function get_persondata($field)
}
}

function isUserLoggedIn()
/**
* Checks if a visitor is logged in or not.
*
* @since 6.2.10
* @return boolean
*/
function is_user_logged_in()
{
$person = get_person_by('personID', get_persondata('personID'));

if (count($person->personID) > 0) {
if ('' != $person->personID) {
return true;
}

Expand Down Expand Up @@ -423,7 +429,7 @@ function etsis_authenticate($login, $password, $rememberme)
->findOne();

if (false == $person) {
$app->flash('error_message', _t('Your account is deactivated.'));
$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'));
redirect($app->req->server['HTTP_REFERER']);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/functions/core-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author Joshua Parker <[email protected]>
*/
define('CURRENT_RELEASE', '6.2.0');
define('RELEASE_TAG', '6.2.9');
define('RELEASE_TAG', trim( _file_get_contents(BASE_PATH . 'RELEASE') ));

$app = \Liten\Liten::getInstance();
use \League\Event\Event;
Expand Down
140 changes: 24 additions & 116 deletions app/functions/deprecated-function.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if (! defined('BASE_PATH'))
if (!defined('BASE_PATH'))
exit('No direct script access allowed');

/**
Expand Down Expand Up @@ -27,129 +27,25 @@
function subject_code_dropdown($subjectCode = NULL)
{
_deprecated_function(__FUNCTION__, '6.1.12', 'table_dropdown');

$app = \Liten\Liten::getInstance();
$subj = $app->db->subject()
->select('subjectCode,subjectName')
->where('subjectCode <> "NULL"');

$q = $subj->find(function ($data) {
$array = [];
foreach ($data as $d) {
$array[] = $d;
}
return $array;
});

foreach ($q as $v) {
echo '<option value="' . _h($v['subjectCode']) . '"' . selected($subjectCode, _h($v['subjectCode']), false) . '>' . _h($v['subjectCode']) . ' ' . _h($v['subjectName']) . '</option>' . "\n";
}
}

/**
*
* @deprecated since release 6.2.0
* @param unknown $file
* @param string $delimiter
*/
function upgradeSQL($file, $delimiter = ';')
{
_deprecated_function(__FUNCTION__, '6.2.0');

$app = \Liten\Liten::getInstance();
set_time_limit(0);

$contents = _file_get_contents($file);

if (strlen($contents) !== 0) {
$file = fopen($file, 'r');

if (is_resource($file) === true) {
$query = [];

while (feof($file) === false) {
$query[] = fgets($file);

if (preg_match('~' . preg_quote($delimiter, '~') . '\s*$~iS', end($query)) === 1) {
$query = trim(implode('', $query));

if ($app->db->query($query) === false) {
echo '<p><font color="red">ERROR:</font> ' . $query . '</p>' . "\n";
} else {
echo '<p><font color="green">SUCCESS:</font> ' . $query . '</p>' . "\n";
}

/*
* while (ob_get_level() > 0) {
* ob_end_flush();
* }
*
* flush();
*/
}

if (is_string($query) === true) {
$query = [];
}
}

fclose($file);
redirect(get_base_url() . 'dashboard/upgrade/');
}
}
}

/**
*
* @deprecated since release 6.2.0
*/
function redirect_upgrade_db()
{
_deprecated_function(__FUNCTION__, '6.2.0');

$app = \Liten\Liten::getInstance();
$acl = new \app\src\ACL(get_persondata('personID'));
if ($acl->userHasRole(8)) {
if (RELEASE_TAG == \app\src\Core\etsis_Updater::inst()->init('RELEASE_TAG')) {
if (get_option('dbversion') < \app\src\Core\etsis_Updater::inst()->init('DB_VERSION')) {
if (basename($app->req->server["REQUEST_URI"]) != "upgrade") {
redirect(get_base_url() . 'dashboard/upgrade/');
}
}
}
}
}

/**
* Fires the dashboard_right_widgets action.
*
* @deprecated since 5.0.0
* @since 1.0.0
*/
function dashboard_right_widgets()
{
_deprecated_function(__FUNCTION__, '5.0.0');
/**
* Prints widgets on the right side of the dashboard.
*
* @deprecated since 5.0.0
* @since 1.0.0
*/
do_action('dashboard_right_widgets');
}

/**
* An action called to create db tables needed
* for a plugin
*
* @see Plugin::register_activation_hook()
*
* @deprecated since release 6.1.06
* @since 4.2.0
* @uses do_action() Calls 'create_db_table' hook.
*/
do_action('create_db_table');

/**
* Merge user defined arguments into defaults array.
*
Expand All @@ -167,7 +63,7 @@ function dashboard_right_widgets()
function et_parse_args($args, $defaults = '')
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_parse_args');

return etsis_parse_args($args, $defaults);
}

Expand All @@ -183,7 +79,7 @@ function et_parse_args($args, $defaults = '')
function et_hash_password($password)
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_hash_password');

return etsis_hash_password($password);
}

Expand All @@ -203,7 +99,7 @@ function et_hash_password($password)
function et_check_password($password, $hash, $person_id = '')
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_check_password');

return etsis_check_password($password, $hash, $person_id);
}

Expand All @@ -222,7 +118,7 @@ function et_check_password($password, $hash, $person_id = '')
function et_set_password($password, $person_id)
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_set_password');

return etsis_set_password($password, $person_id);
}

Expand All @@ -241,7 +137,7 @@ function et_set_password($password, $person_id)
function et_parse_str($string, $array)
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_parse_str');

return etsis_parse_str($string, $array);
}

Expand All @@ -254,7 +150,7 @@ function et_parse_str($string, $array)
function et_autop($pee, $br = 1)
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_autop');

return etsis_autop($pee, $br);
}

Expand All @@ -266,6 +162,18 @@ function et_autop($pee, $br = 1)
function et_dropdown_languages($active = '')
{
_deprecated_function(__FUNCTION__, '6.2.0', 'etsis_dropdown_languages');

return etsis_dropdown_languages($active);
}
}

/**
*
* @deprecated since release 6.2.10
* @return function
*/
function isUserLoggedIn()
{
_deprecated_function(__FUNCTION__, '6.2.10', 'is_user_logged_in');

return is_user_logged_in();
}
4 changes: 2 additions & 2 deletions app/functions/person-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ function get_initials($ID, $initials = 2)
$name = get_person_by('personID', $ID);

if ($initials == 2) {
return substr(_h($name->fname), 0, 1) . '. ' . substr(_h($name->lname), 0, 1) . '.';
return mb_substr(_h($name->fname), 0, 1, 'UTF-8') . '. ' . mb_substr(_h($name->lname), 0, 1, 'UTF-8') . '.';
} else {
return _h($name->lname) . ', ' . substr(_h($name->fname), 0, 1) . '.';
return _h($name->lname) . ', ' . mb_substr(_h($name->fname), 0, 1, 'UTF-8') . '.';
}
}

Expand Down
Loading

0 comments on commit d6f0225

Please sign in to comment.