diff --git a/ChangeLog b/ChangeLog index 0fa8a6fbe..085c1fa0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ Version 1.1.1 (?? ??? 2006) + - Created commom error function to hopefully cleanup the code - Fixed bug 1554383: Times next to events during import is wrong - Fixed bug 1555860: SQL Error on import - Changed translate.php to ignore /install/ files if unneeded diff --git a/access.php b/access.php index e8356d078..9e0240eef 100644 --- a/access.php +++ b/access.php @@ -26,7 +26,7 @@ $ALLOW_VIEW_OTHER == 'Y' ? true : false ); if ( ! access_is_enabled () ) { - etranslate ( 'You are not authorized' ); + echo print_not_auth (); exit; } diff --git a/activity_log.php b/activity_log.php index e8625df41..26652dff4 100644 --- a/activity_log.php +++ b/activity_log.php @@ -20,7 +20,7 @@ if ( ! $is_admin || ( access_is_enabled () && ! access_can_access_function ( ACCESS_ACTIVITY_LOG ) ) ) { - die_miserable_death ( translate ( 'You are not authorized' ) ); + die_miserable_death ( print_not_auth () ); } print_header(); diff --git a/admin.php b/admin.php index 549ec8ae2..ef9333139 100644 --- a/admin.php +++ b/admin.php @@ -59,7 +59,7 @@ function save_pref( $prefs, $src) { $currenttab = ''; if ( ! $is_admin ) { - $error = translate ( 'You are not authorized' ); + $error = print_not_auth (); } if ( ! empty ( $_POST ) && empty ( $error )) { diff --git a/approve_entry.php b/approve_entry.php index d69626359..63d5e790c 100644 --- a/approve_entry.php +++ b/approve_entry.php @@ -8,7 +8,7 @@ $error = ''; if ( $readonly == 'Y' ) { - $error = translate( 'You are not authorized' ); + $error = print_not_auth (); } diff --git a/availability.php b/availability.php index 3383b8f44..86c03c0d8 100644 --- a/availability.php +++ b/availability.php @@ -26,14 +26,15 @@ // input args in URL // users: list of comma-separated users +$programStr = translate ( 'Program Error' ) . ': '; if ( empty ( $users ) ) { - echo 'Program Error: No users specified!'; exit; + echo $programStr . translate ( 'No users specified!' ); exit; } else if ( empty ( $year ) ) { - echo 'Program Error: No year specified!'; exit; + echo $programStr . translate ( 'No year specified!' ); exit; } else if ( empty ( $month ) ) { - echo 'Program Error: No month specified!'; exit; + echo $programStr . translate ( 'No month specified!' ); exit; } else if ( empty ( $day ) ) { - echo 'Program Error: No day specified!'; exit; + echo $programStr . translate ( 'No day specified!' ); exit; } $parent_form = getGetValue ('form'); diff --git a/category.php b/category.php index 8c6a5fb3b..031aad3c6 100644 --- a/category.php +++ b/category.php @@ -24,7 +24,7 @@ if ( $row[0] != $id ) $error = translate( 'Invalid entry id' ) . ': ' . $id; else if ( $row[1] != $login && ! $is_admin ) - $error = translate ( 'You are not authorized' ) . '.'; + $error = print_not_auth () . '.'; } dbi_free_result ( $res ); } else { @@ -122,6 +122,6 @@ } if ( ! empty ( $error ) ) { - echo "" . translate ( 'Error' ) . ':' . $error; + echo print_error ( $error ); } echo print_trailer(); ?> diff --git a/category_handler.php b/category_handler.php index 03f6fd4b9..30fa16ac7 100644 --- a/category_handler.php +++ b/category_handler.php @@ -42,7 +42,7 @@ function renameIcon ( $id ) { } if ( ! $is_my_event ) - $error = translate ( 'You are not authorized' ) . '.'; + $error = print_not_auth () . '.'; $delete = getPostValue ( 'delete' ); if ( empty ( $error ) && ! empty ( $delete ) ) { diff --git a/del_entry.php b/del_entry.php index 25e645ffe..2a4119694 100644 --- a/del_entry.php +++ b/del_entry.php @@ -81,7 +81,7 @@ } if ( ! $can_edit ) { - $error = translate ( 'You are not authorized' ); + $error = print_not_auth (); } // Is this a repeating event? @@ -259,7 +259,7 @@ $del_user = $user; } else { // Error: user cannot delete from other user's calendar - $error = translate ( 'You are not authorized' ); + $error = print_not_auth (); } } if ( empty ( $error ) ) { diff --git a/del_layer.php b/del_layer.php index 22142ab45..410516fa2 100644 --- a/del_layer.php +++ b/del_layer.php @@ -6,7 +6,7 @@ if ( $ALLOW_VIEW_OTHER != 'Y' || empty ( $id )) { print_header (); - etranslate( 'You are not authorized' ); + echo print_not_auth (); echo print_trailer (); exit; } diff --git a/doc.php b/doc.php index c8a1258c9..664242e23 100644 --- a/doc.php +++ b/doc.php @@ -179,7 +179,7 @@ } } if ( empty ( $error ) && ! $can_view ) { - $error = translate ( 'You are not authorized' ); + $error = print_not_auth (); } } diff --git a/docadd.php b/docadd.php index 139fa1b00..0ac58d5c1 100644 --- a/docadd.php +++ b/docadd.php @@ -77,14 +77,14 @@ if ( $type == 'A' ) { if ( empty ( $ALLOW_ATTACH ) || $ALLOW_ATTACH != 'Y' ) - $error = translate( 'You are not authorized' ); + $error = print_not_auth (); else if ( empty ( $error ) && $ALLOW_ATTACH_PART == 'Y' && $is_my_event ) $can_add = true; else if ( $ALLOW_ATTACH_ANY == 'Y' ) $can_add = true; } else if ( $type == 'C' ) { if ( empty ( $ALLOW_COMMENTS ) || $ALLOW_COMMENTS != 'Y' ) - $error = translate( 'You are not authorized' ); + $error = print_not_auth (); else if ( empty ( $error ) && $ALLOW_COMMENTS_PART == 'Y' && $is_my_event ) $can_add = true; else if ( $ALLOW_COMMENTS_ANY == 'Y' ) @@ -96,11 +96,11 @@ } if ( ! $can_add ) - $error = translate ( 'You are not authorized' ); + $error = print_not_auth (); if ( ! empty ( $error ) ) { print_header (); - echo '