diff -Naur WebCalendar-1.2.1.orig/includes/classes/WebCalendar.class WebCalendar-1.2.1.new/includes/classes/WebCalendar.class --- WebCalendar-1.2.1.orig/includes/classes/WebCalendar.class 2010-05-07 19:24:50.000000000 +0200 +++ WebCalendar-1.2.1.new/includes/classes/WebCalendar.class 2010-05-07 19:27:24.000000000 +0200 @@ -143,7 +143,8 @@ */ function _initInitSecondPhase () { global $ALLOW_VIEW_OTHER, $can_add, $can_add, $cat_id, $CATEGORIES_ENABLED, - $CATEGORY_VIEW, $caturl, $date, $DMW, $friendly, $override, $fullname, $GROUPS_ENABLED, + $CATEGORY_VIEW, $caturl, $date, $DMW, $friendly, $ignore_user_case, + $override, $fullname, $GROUPS_ENABLED, $hour, $id, $is_admin, $is_assistant, $is_nonuser, $login, $minute, $month, $NONUSER_ENABLED, $nonusers, $ovrd, $PUBLIC_ACCESS, $PUBLIC_ACCESS_CAN_ADD, $PUBLIC_ACCESS_FULLNAME, $PUBLIC_ACCESS_OTHERS, $readonly, $u_url, $user, @@ -170,6 +171,9 @@ if ( empty ( $PUBLIC_ACCESS ) ) $PUBLIC_ACCESS = 'N'; + if ($ignore_user_case) + $user = strtolower($user); + // Initialize access settings ($user_access string) // and make sure user is allowed to view the current page. access_init (); @@ -425,9 +429,9 @@ */ function _initValidate () { global $c, $cryptpw, $db_database, $db_host, $db_login, $db_password, - $encoded_login, $HTTP_ENV_VARS, $HTTP_SERVER_VARS, $is_nonuser, $login, - $login_return_path, $PHP_AUTH_USER, $REMOTE_USER, $SCRIPT, - $session_not_found, $settings, $single_user, $single_user_login, + $encoded_login, $HTTP_ENV_VARS, $HTTP_SERVER_VARS, $ignore_user_case, + $is_nonuser, $login, $login_return_path, $PHP_AUTH_USER, $REMOTE_USER, + $SCRIPT, $session_not_found, $settings, $single_user, $single_user_login, $use_http_auth, $user_inc, $validate_redirect, $webcalendar_session; /* If WebCalendar is configured to use http authentication, then we can @@ -571,6 +575,10 @@ } } } + + // If login is not case-sensitive, map it to lowercase now. + if ($ignore_user_case) + $login = strtolower($login); } /* Initializations from includes/connect.php. diff -Naur WebCalendar-1.2.1.orig/includes/config.php WebCalendar-1.2.1.new/includes/config.php --- WebCalendar-1.2.1.orig/includes/config.php 2010-04-09 15:47:49.000000000 +0200 +++ WebCalendar-1.2.1.new/includes/config.php 2010-05-07 19:27:24.000000000 +0200 @@ -92,9 +92,10 @@ function do_config ( $fileLoc ) { global $db_database, $db_host, $db_login, $db_password, $db_persistent, - $db_type, $NONUSER_PREFIX, $phpdbiVerbose, $PROGRAM_DATE, $PROGRAM_NAME, - $PROGRAM_URL, $PROGRAM_VERSION, $readonly, $run_mode, $settings, $single_user, - $single_user_login, $TROUBLE_URL, $use_http_auth, $user_inc; + $db_type, $ignore_user_case, $NONUSER_PREFIX, $phpdbiVerbose, $PROGRAM_DATE, + $PROGRAM_NAME, $PROGRAM_URL, $PROGRAM_VERSION, $readonly, $run_mode, + $settings, $single_user, $single_user_login, $TROUBLE_URL, $use_http_auth, + $user_inc; $PROGRAM_VERSION = 'v1.2.1'; $PROGRAM_DATE = '09 Apr 2010'; @@ -220,6 +221,11 @@ $use_http_auth = ( preg_match ( '/(1|yes|true|on)/i', $settings['use_http_auth'] ) ? true : false ); + // Whether user name is case-insensitive. + $ignore_user_case = isset($settings['ignore_user_case'])? + preg_match("/(1|yes|true|on)/i", $settings['ignore_user_case'])? + true: false: false; + // Type of user authentication. $user_inc = $settings['user_inc']; diff -Naur WebCalendar-1.2.1.orig/includes/settings.php.orig WebCalendar-1.2.1.new/includes/settings.php.orig --- WebCalendar-1.2.1.orig/includes/settings.php.orig 2010-04-06 16:29:09.000000000 +0200 +++ WebCalendar-1.2.1.new/includes/settings.php.orig 2010-05-07 19:27:24.000000000 +0200 @@ -71,5 +71,10 @@ # need to modify user-ldap.php to configure some settings. user_inc: user.php +# Set the following to true if the user name authentication is not +# case-sensitive. This results in translating all authenticated user names +# to lowercase. +ignore_user_case: false + # end */ ?> diff -Naur WebCalendar-1.2.1.orig/install/index.php WebCalendar-1.2.1.new/install/index.php --- WebCalendar-1.2.1.orig/install/index.php 2010-05-07 19:24:50.000000000 +0200 +++ WebCalendar-1.2.1.new/install/index.php 2010-05-07 19:27:24.000000000 +0200 @@ -660,6 +660,7 @@ $settings['install_password'] = ''; $settings['single_user_login'] = ''; $settings['use_http_auth'] = 'false'; + $settings['ignore_user_case'] = 'false'; $settings['single_user'] = 'false'; } } else { @@ -686,6 +687,7 @@ $y = getPostValue ( 'app_settings' ); if ( ! empty ( $y ) ) { $settings['single_user_login'] = getPostValue ( 'form_single_user_login' ); + $settings['ignore_user_case'] = getPostValue ( 'form_ignore_user_case' ); $settings['readonly'] = getPostValue ( 'form_readonly' ); $settings['mode'] = getPostValue ( 'form_mode' ); if ( getPostValue ( 'form_user_inc' ) == 'http' ) { @@ -835,8 +837,10 @@ } if ( form.form_user_inc.options[listid].selected ) { makeVisible ( "singleuser" ); + makeInvisible ( "usercase" ); } else { makeInvisible ( "singleuser" ); + makeVisible ( "usercase" ); } } @@ -1495,6 +1499,16 @@ <td> <input name="form_single_user_login" size="20" value="<?php echo ( empty ( $settings['single_user_login'] ) ? '' : $settings['single_user_login'] );?>" /></td> </tr> + <tr id="usercase"> + <td class="prompt"><?php etranslate ( 'Case-insensitive user name' ) ?>:</td> + <td> + <input name="form_ignore_user_case" value="true" type="radio" + <?php echo ( $settings['ignore_user_case'] == 'true' )? $checked : '';?> /><?php etranslate ( 'Yes' ) ?> + + <input name="form_ignore_user_case" value="false" type="radio" + <?php echo ( $settings['ignore_user_case'] != 'true' )? $checked : '';?> /><?php etranslate ( 'No' ) ?> + </td> + </tr> <tr> <td class="prompt"><?php etranslate ( 'Read-Only' ) ?>:</td> <td> diff -Naur WebCalendar-1.2.1.orig/tools/send_reminders.php WebCalendar-1.2.1.new/tools/send_reminders.php --- WebCalendar-1.2.1.orig/tools/send_reminders.php 2010-05-07 19:24:50.000000000 +0200 +++ WebCalendar-1.2.1.new/tools/send_reminders.php 2010-05-07 19:27:24.000000000 +0200 @@ -103,6 +103,10 @@ for ( $i = 0; $i < $allusercnt; $i++ ) { $names[$allusers[$i]['cal_login']] = $allusers[$i]['cal_fullname']; $emails[$allusers[$i]['cal_login']] = $allusers[$i]['cal_email']; + + if ($ignore_user_case) + $names[$allusers[$i]['cal_login']] = + strtolower($names[$allusers[$i]['cal_login']]); } $attachics = $htmlmail = $languages = $noemail = $t_format = $tz = array (); @@ -254,7 +258,8 @@ // But, don't send to users who rejected (cal_status='R' ). function send_reminder ( $id, $event_date ) { global $ALLOW_EXTERNAL_USERS, $debug, $def_tz, $emails, - $EXTERNAL_REMINDERS, $attachics, $htmlmail, $is_task, $LANGUAGE, $languages, $names, + $EXTERNAL_REMINDERS, $attachics, $htmlmail, $ignore_user_case, + $is_task, $LANGUAGE, $languages, $names, $only_testing, $SERVER_URL, $site_extras, $t_format, $tz; $ext_participants = $participants = array (); @@ -271,7 +276,11 @@ if ( $res ) { while ( $row = dbi_fetch_row ( $res ) ) { - $participants[$num_participants++] = $row[0]; + if ($ignore_user_case) + $participants[$num_participants++] = strtolower($row[0]); + else + $participants[$num_participants++] = $row[0]; + $percentage[$row[0]] = $row[1]; } } diff -Naur WebCalendar-1.2.1.orig/translations/English-US.txt WebCalendar-1.2.1.new/translations/English-US.txt --- WebCalendar-1.2.1.orig/translations/English-US.txt 2010-05-07 19:24:50.000000000 +0200 +++ WebCalendar-1.2.1.new/translations/English-US.txt 2010-05-07 19:27:24.000000000 +0200 @@ -1846,6 +1846,7 @@ Web Server (detected): Web Server (detected) Web Server (not detected): Web Server (not detected) None (Single-User): None (Single-User) +Case-insensitive user name: Case-insensitive user name Read-Only: Read-Only Environment: Environment Production: Production diff -Naur WebCalendar-1.2.1.orig/translations/French.txt WebCalendar-1.2.1.new/translations/French.txt --- WebCalendar-1.2.1.orig/translations/French.txt 2010-05-07 19:24:50.000000000 +0200 +++ WebCalendar-1.2.1.new/translations/French.txt 2010-05-07 19:27:24.000000000 +0200 @@ -1794,6 +1794,7 @@ Web Server (detected): = Web Server (not detected): = None (Single-User): = +Case-insensitive user name: = Read-Only: = Environment: = Production: =