From c73d7a3089f53c29a14489c65a5a292a7eaed6c1 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Mon, 25 Mar 2024 14:35:07 -0600 Subject: [PATCH 01/38] spelling --- export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export.php b/export.php index a6a7f733a..9f907eddf 100644 --- a/export.php +++ b/export.php @@ -31,7 +31,7 @@ - ' . generate_export_select ( 'toggel_catfilter' ) . ' + ' . generate_export_select ( 'toggle_catfilter' ) . ' '; @@ -126,7 +126,7 @@ function toggle_datefields( name, ele ) { updateDateFields(); } - function toggel_catfilter() { + function toggle_catfilter() { if ( $('#exformat option:selected').index() == 0 ) { // ICalendar $('#catfilter').show(); From 9c07f7b3cba0137fae7c4f3a856e09aabb4da050 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Mon, 25 Mar 2024 14:37:19 -0600 Subject: [PATCH 02/38] redundant test --- view_entry.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/view_entry.php b/view_entry.php index c098ac61e..c7d9f5d71 100644 --- a/view_entry.php +++ b/view_entry.php @@ -542,13 +542,15 @@ if ($single_user == 'N' && !empty($createby_fullname)) { echo '
' . translate('Created by') . "
\n"; echo '
'; -if ($is_private && !access_is_enabled()) { -echo '[' . translate('Private') . ']'; -} else if ($is_confidential && !access_is_enabled()) { -echo '[' . translate('Confidential') . ']'; + +if ( ! access_is_enabled() ) { + if ( $is_private ) { + echo '[' . translate ( 'Private' ) . ']'; + } elseif ( $is_confidential ) { + echo '[' . translate ( 'Confidential' ) . ']'; + } } else { -if (access_is_enabled()) { -$can_email = access_user_calendar('email', $create_by); + $can_email = access_user_calendar ( 'email', $create_by ); } $pubAccStr = ($row[0] == '__public__') ? translate('Public Access') : $createby_fullname; if (strlen($email_addr) && $can_email != 'N') { From 34055aff1d4b7152d8ede91deb62455b88a7efd3 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Mon, 25 Mar 2024 16:57:16 -0600 Subject: [PATCH 03/38] another redundant test --- week_ssi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/week_ssi.php b/week_ssi.php index 8c8341d33..95746f078 100644 --- a/week_ssi.php +++ b/week_ssi.php @@ -34,7 +34,7 @@ // TODO This is suspect $today = time(); -if ( ! empty ( $date ) && ! empty ( $date ) ) { +if ( ! empty ( $date ) ) { $thisyear = substr ( $date, 0, 4 ); $thismonth = substr ( $date, 4, 2 ); $thisday = substr ( $date, 6, 2 ); From 91938380d206e4e0e5b37da8814aa923dcc7961f Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Mon, 25 Mar 2024 17:13:14 -0600 Subject: [PATCH 04/38] tag not closed --- week_ssi.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/week_ssi.php b/week_ssi.php index 95746f078..550390c37 100644 --- a/week_ssi.php +++ b/week_ssi.php @@ -79,9 +79,10 @@ . date ( 'd', $days[$i] ) . ''; $tmpOut2 .= ' - ' . + print_date_entries ( $date, $login, true, true ) . ' '; } echo ' From f14db8940ba6dbbcb2e01c4905417ad00219ae57 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Wed, 27 Mar 2024 05:04:27 -0600 Subject: [PATCH 05/38] use arrays before empty them --- view_l.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/view_l.php b/view_l.php index 09a2e8d89..bc1ed0369 100644 --- a/view_l.php +++ b/view_l.php @@ -74,15 +74,13 @@ } $e_save = $re_save = []; -for ( $i = 0, $cnt = count ( $viewusers ); $i < $cnt; $i++ ) { +$events = $repeated_events = []; +foreach ( $viewusers as $i ) { /* Pre-Load the repeated events for quicker access */ - $repeated_events = read_repeated_events ( $viewusers[$i], $startdate, $enddate, '' ); - $re_save = array_merge ( $re_save, $repeated_events ); + $re_save = read_repeated_events ( $i, $startdate, $enddate, '' ); /* Pre-load the non-repeating events for quicker access */ - $events = read_events ( $viewusers[$i], $startdate, $enddate ); - $e_save = array_merge ( $e_save, $events ); + $e_save = read_events ( $i, $startdate, $enddate ); } -$events = $repeated_events = []; for ( $i = 0, $cnt = count ( $e_save ); $i < $cnt; $i++ ) { $should_add = 1; From dbd1836831993f4ccd9dfb82084212060d905567 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 5 Apr 2024 23:23:01 -0600 Subject: [PATCH 06/38] remove translate being called twice --- edit_entry.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/edit_entry.php b/edit_entry.php index a336ab430..1dfc81576 100644 --- a/edit_entry.php +++ b/edit_entry.php @@ -1196,10 +1196,10 @@ function time_selection($prefix, $time = '', $trigger = false) $rpt_byday_label++ ) { $rpt_byday_mod = $rpt_byday_label % 7; - $class = (is_weekend($rpt_byday_mod) ? ' class="weekend" ' : ''); - echo ' - '; + $class = ( is_weekend ( $rpt_byday_mod ) ? 'class="weekend" ' : '' ); + echo " + '; } echo ' From 2dbc1b4f18426207c348e8d04edd63d27ab0c615 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Thu, 18 Apr 2024 17:08:25 -0600 Subject: [PATCH 07/38] close anchor properly If we start the anchor outside the if, we need to close it outside the if. --- upcoming.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upcoming.php b/upcoming.php index dcaf170e7..31fa385a9 100644 --- a/upcoming.php +++ b/upcoming.php @@ -192,10 +192,10 @@ function print_upcoming_event ( $e, $date ) { $catNum = abs(intval($e->getCategory())); if ($catNum > 0 && !empty($categories[$catNum]['cat_icon_mime'])) { $catIcon = "getIcon.php?cat_id=" . $catNum; - $link .= 'category icon'; + $link .= 'category icon'; } } - echo $link; + echo "$link"; } } if ( $private ) { From eb1b8328bee6b02b5d66e5cbb16d519283cf494f Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 19 Apr 2024 12:46:55 -0600 Subject: [PATCH 08/38] a little shorter Missed the closing anchor lower down, still don't need 2 close tags. Also, delete un needed if/else. --- upcoming.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/upcoming.php b/upcoming.php index 31fa385a9..bfa6c932b 100644 --- a/upcoming.php +++ b/upcoming.php @@ -155,17 +155,12 @@ function print_upcoming_event ( $e, $date ) { $popupid = 'pop' . $e->getId() . '-' . $date; - $private = $confidential = false; // Access: P=Public, R=Private, C=Confidential - if ( $e->getAccess() == 'R' ) { - // not a public event, so we will just display "Private" - $private = true; - } - else if ( $e->getAccess() == 'C' ) { - // not a public event, so we will just display "Confidential" - $confidential = true; - } - + // not a public event, just "Private" + $private = ( $e->getAccess() == 'R' ); + // not a public event, just "Confidential" + $confidential = ( $e->getAccess() == 'C' ); + if ( ! empty ( $SERVER_URL ) && ! $private && ! $confidential) { echo "
\n"; if ( $display_link ) { @@ -195,7 +190,7 @@ function print_upcoming_event ( $e, $date ) { $link .= 'category icon'; } } - echo "$link"; + echo $link; } } if ( $private ) { From 1e99299e43fc8716fdf0b8b4ba1455ac81a5f7a2 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Wed, 24 Apr 2024 02:56:12 -0600 Subject: [PATCH 09/38] Update autocomplete_ajax.php $sendplaintext was always true --- autocomplete_ajax.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/autocomplete_ajax.php b/autocomplete_ajax.php index 1b1714ca4..e3f9feeb8 100644 --- a/autocomplete_ajax.php +++ b/autocomplete_ajax.php @@ -49,13 +49,10 @@ if (empty($query)) $query = getValue('query'); -$sendPlainText = false; $format = getValue('format'); -if ( - !empty($format) && - ($format == 'text' || $format == 'plain') -); -$sendPlainText = true; +$sendPlainText = (! empty ( $format ) && + ( $format === 'text' || $format === 'plain' ) ); + if ($sendPlainText) { Header('Content-Type: text/plain'); } else { From 1f6308d10d00b9d31d2426ea84786d24726cdd5d Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Wed, 24 Apr 2024 03:04:50 -0600 Subject: [PATCH 10/38] Update events_ajax.php $sendPlainText was always true --- events_ajax.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/events_ajax.php b/events_ajax.php index 45752b25b..7104b272a 100644 --- a/events_ajax.php +++ b/events_ajax.php @@ -63,11 +63,10 @@ $user = $login; $get_unapproved = true; -$sendPlainText = false; $format = getValue ( 'format' ); -if ( ! empty ( $format ) && + +$sendPlainText = ( ! empty ( $format ) && ( $format == 'text' || $format == 'plain' ) ); -$sendPlainText = true; $startdate = getIntValue ( 'startdate' ); if ( empty ( $startdate ) ) From ad082ba7e527b914361e274112847cbbacb2bc36 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Wed, 24 Apr 2024 03:15:24 -0600 Subject: [PATCH 11/38] Update layers_ajax.php $sendPlainText was always true here, also. --- layers_ajax.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/layers_ajax.php b/layers_ajax.php index 57db7ec96..9bc75d1db 100644 --- a/layers_ajax.php +++ b/layers_ajax.php @@ -28,12 +28,10 @@ $action = getValue ( 'action' ); $public = getValue ( 'public' ); - -$sendPlainText = false; $format = getValue ( 'format' ); -if ( ! empty ( $format ) && + +$sendPlainText = ( ! empty ( $format ) && ( $format == 'text' || $format == 'plain' ) ); -$sendPlainText = true; $error = ''; From aa0e63fefc0fb8ca6472edf81e14110b71fbfbb8 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sun, 5 May 2024 11:06:41 -0600 Subject: [PATCH 12/38] spelling --- icalclient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icalclient.php b/icalclient.php index 0ac31f41a..ee3bd13fd 100644 --- a/icalclient.php +++ b/icalclient.php @@ -142,9 +142,9 @@ if ( ( empty( $_SERVER['PHP_AUTH_USER'] ) or empty( $_SERVER['PHP_AUTH_PW'] ) ) and isset( $_REQUEST['BAD_HOSTING'] ) - and preg_match( '/Basic\s+(.*)$/i', $_REQUEST['BAD_HOSTING'], $matc ) ) + AND preg_match ( '/Basic\s+(.*)$/i', $_REQUEST['BAD_HOSTING'], $match ) ) list( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) = - explode( ':', base64_decode( $matc[1] ) ); + explode ( ':', base64_decode ( $match[1] ) ); unset( $_ENV['REMOTE_USER'] ); From 4bb8a570902a5b5984cfd0c3971c464d6b7e0f54 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sun, 5 May 2024 11:07:44 -0600 Subject: [PATCH 13/38] 'label for' has to match the ID tag --- includes/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 8dd9c6000..8ff256f4b 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2581,9 +2581,9 @@ function get_groups($user, $includeUserlist=false) $res = dbi_execute($sql, [$groups[$i]['cal_group_id']]); while ($row = dbi_fetch_row($res)) { if (isset($users_by_name[$row[0]])){ - // It is possible some users assigned to this group may not exist, - // so we skip those that don't. For example, if users are fetched - // from an external source via user-app-*.php, and one of those + // It is possible some users assigned to this group may not exist, + // so we skip those that don't. For example, if users are fetched + // from an external source via user-app-*.php, and one of those // users is deleted externally. $users[] = $users_by_name[$row[0]]; } @@ -4632,7 +4632,7 @@ function print_color_input_html ($varname, $title, $varval = '', $id='', $tag='d } return '<' . $tag . ' class="form-inline">' . - (empty($title) ? '' : ('')) . + (empty($title) ? '' : ('')) . ''; From a431e4b4ca7acf235d708cba3588d7832a9ae8df Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Thu, 9 May 2024 14:51:05 -0600 Subject: [PATCH 14/38] missing dollar sign --- rss_unapproved.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rss_unapproved.php b/rss_unapproved.php index d0dd61240..be1138504 100644 --- a/rss_unapproved.php +++ b/rss_unapproved.php @@ -97,7 +97,7 @@ if ( access_is_enabled() ) { if ( ! access_user_calendar ( 'approve', $user ) ) { // not allowed - $user = login; + $user = $login; } } else if ( ! $is_admin && $user != $login && ! $is_assistant && ! access_is_enabled() ) { From 853c8dd45bf42924daf18bdf96c31c30038cf8dc Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 11 May 2024 17:12:34 -0600 Subject: [PATCH 15/38] change typos ' is=" ' to ' id=" ' --- groups.php | 2 +- user_mgmt.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/groups.php b/groups.php index a480fabfd..9d400abfa 100644 --- a/groups.php +++ b/groups.php @@ -86,7 +86,7 @@
-
+
diff --git a/user_mgmt.php b/user_mgmt.php index 0be470b41..10804c04c 100644 --- a/user_mgmt.php +++ b/user_mgmt.php @@ -95,21 +95,21 @@ -
+
- +
- +
- +
- +
@@ -201,7 +201,7 @@
-
+
From 9c7f121db268762625841930abed74681480218f Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Tue, 14 May 2024 10:38:35 -0600 Subject: [PATCH 16/38] missed db in FROM clause in purge.php --- purge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purge.php b/purge.php index c22dbb990..2f44371b7 100644 --- a/purge.php +++ b/purge.php @@ -96,7 +96,7 @@ $M_ids = get_ids ( 'SELECT DISTINCT(we.cal_id) FROM webcal_entry we, webcal_entry_user weu, webcal_entry_repeats wer WHERE we.cal_type = \'M\' - AND we.cal_id = wer.cal_id AND we.cal_id = wer.cal_id ' + AND we.cal_id = wer.cal_id AND weu.cal_id = wer.cal_id ' . "AND cal_end IS NOT NULL AND cal_end < '$end_date' $tail", $ALL ); $ids = array_merge ( $E_ids, $M_ids ); From d9db68a3a4603ff50d66e04a6a90804ea29a6800 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 17 May 2024 16:59:04 -0600 Subject: [PATCH 17/38] Update user_mgmt.php tags thead and tbody were interlaced --- user_mgmt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_mgmt.php b/user_mgmt.php index 10804c04c..8c3b50f48 100644 --- a/user_mgmt.php +++ b/user_mgmt.php @@ -63,9 +63,9 @@ + -
From acae2638f94eac661e07b0bbbbc7b0c3de3f739e Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 18 May 2024 12:58:43 -0600 Subject: [PATCH 18/38] Update user_mgmt.php crap! fix one, create another fix spelling maxlengtHH --- user_mgmt.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_mgmt.php b/user_mgmt.php index 8c3b50f48..e0beb2900 100644 --- a/user_mgmt.php +++ b/user_mgmt.php @@ -97,19 +97,19 @@
- +
- +
- +
- +
From 66efff90a7a1467dea39070fc8819a3c455687a8 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sat, 18 May 2024 13:02:48 -0600 Subject: [PATCH 19/38] Update user_mgmt.php missing quote on class=" s --- user_mgmt.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/user_mgmt.php b/user_mgmt.php index e0beb2900..ec54ad55c 100644 --- a/user_mgmt.php +++ b/user_mgmt.php @@ -100,31 +100,31 @@
- +
- +
- +
- +
- +
- +
- +
@@ -163,11 +163,11 @@
- +
- +
From 1d294169afb29a557311fe2344767862906dd9de Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Fri, 24 May 2024 17:19:39 -0600 Subject: [PATCH 20/38] Update functions.php 'slow' to 'slot' in comment --- includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 8ff256f4b..9189695a3 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -249,7 +249,7 @@ function build_entry_label ( $event, $popupid, * @param string $time Input time in HHMMSS format * @param bool $round_down Should we change 1100 to 1059? * (This will make sure a 10AM-100AM appointment just - * shows up in the 10AM slow and not in the 11AM slot + * shows up in the 10AM slot and not in the 11AM slot * also.) * * @return int The time slot index. From a8b29cdb10ee706a10aee5349d9c70b4945db992 Mon Sep 17 00:00:00 2001 From: Bruce Bannon Date: Sun, 2 Jun 2024 10:52:36 -0600 Subject: [PATCH 21/38] fix spelling and syntax --- groups.php | 2 +- includes/xcal.php | 12 ++++++------ remotecal_mgmt.php | 2 +- resourcecal_mgmt.php | 2 +- user_mgmt.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/groups.php b/groups.php index 9d400abfa..3ed4d1658 100644 --- a/groups.php +++ b/groups.php @@ -80,7 +80,7 @@