Skip to content

Commit

Permalink
Install: allow admin to select time zone
Browse files Browse the repository at this point in the history
Fixes #15205
  • Loading branch information
dregad committed Oct 17, 2013
1 parent 3f238c3 commit 8213d69
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion admin/install.php
Expand Up @@ -173,6 +173,7 @@ function InsertData( $p_table, $p_data ) {
$f_db_schema = config_get( 'db_schema', '' );
$f_db_username = config_get( 'db_username', '' );
$f_db_password = config_get( 'db_password', '' );
$f_timezone = config_get( 'default_timezone', '' );
} else {
# read control variables with defaults
$f_dsn = gpc_get( 'dsn', config_get( 'dsn', '' ) );
Expand All @@ -185,6 +186,7 @@ function InsertData( $p_table, $p_data ) {
if( CONFIGURED_PASSWORD == $f_db_password ) {
$f_db_password = config_get( 'db_password' );
}
$f_timezone = gpc_get( 'timezone', config_get( 'default_timezone' ) );
}
$f_admin_username = gpc_get( 'admin_username', '' );
$f_admin_password = gpc_get( 'admin_password', '' );
Expand Down Expand Up @@ -562,6 +564,19 @@ function InsertData( $p_table, $p_data ) {
</td>
</tr>

<?php if( !$g_database_upgrade ) {?>
<tr>
<td>
Default Time Zone
</td>
<td>
<select id="timezone" name="timezone">
<?php print_timezone_option_list( config_get_global( 'default_timezone' ) ) ?>
</select>
</td>
</tr>
<?php } ?>

<tr>
<td>
<?php echo ( $g_failed
Expand Down Expand Up @@ -908,7 +923,10 @@ function InsertData( $p_table, $p_data ) {
default:
break;
}
$t_config .= "\n";

$t_config .= "\n"
. "\t\$g_default_timezone = '$f_timezone';\n"
. "\n";

/* Automatically generate a strong master salt/nonce for MantisBT
* cryptographic purposes. If a strong source of randomness is not
Expand Down

0 comments on commit 8213d69

Please sign in to comment.