Skip to content

Commit

Permalink
Inconsistent if-else block format.
Browse files Browse the repository at this point in the history
As per http://www.mantisbt.org/guidelines.php:

if ... else blocks should be in this format:

if (...) {
    blah1
} else {
    blah2
}
  • Loading branch information
mantis committed Nov 26, 2008
1 parent 71bdfd2 commit a8f55d5
Show file tree
Hide file tree
Showing 87 changed files with 914 additions and 1,839 deletions.
6 changes: 2 additions & 4 deletions adm_config_set.php
Expand Up @@ -96,14 +96,12 @@
$t_new_key = constant_replace( trim( $t_split[0] ) );
$t_new_value = constant_replace( trim( $t_split[1] ) );
$t_value[ $t_new_key ] = $t_new_value;
}
else {
} else {
// regular array
$t_value[ $key ] = constant_replace( trim( $value ) );
}
}
}
else {
} else {
// scalar value
$t_value = constant_replace( trim( $t_full_string ) );
}
Expand Down
113 changes: 52 additions & 61 deletions admin/check.php
Expand Up @@ -64,8 +64,7 @@ function print_test_row( $p_description, $p_pass ) {

if( $p_pass ) {
print_test_result( GOOD );
}
else {
} else {
print_test_result( BAD );
}

Expand All @@ -81,8 +80,7 @@ function test_bug_download_threshold() {

if( $t_view_threshold > $t_download_threshold ) {
$t_pass = false;
}
else {
} else {
if( $t_download_threshold > $t_delete_threshold ) {
$t_pass = false;
}
Expand All @@ -103,8 +101,7 @@ function test_bug_attachments_allow_flags() {

if(( $t_own_delete == ON ) && ( $t_own_download == FALSE ) ) {
$t_pass = false;
}
else {
} else {
if(( $t_own_download == ON ) && ( $t_own_view == OFF ) ) {
$t_pass = false;
}
Expand Down Expand Up @@ -245,8 +242,7 @@ function test_bug_attachments_allow_flags() {
<?php
if( ON != config_get_global( 'validate_email' ) ) {
print_test_result( GOOD );
}
else {
} else {
print_test_result( BAD );
}
?>
Expand All @@ -260,8 +256,7 @@ function test_bug_attachments_allow_flags() {
<?php
if( ON != config_get_global( 'check_mx_record' ) ) {
print_test_result( GOOD );
}
else {
} else {
print_test_result( BAD );
}
?>
Expand Down Expand Up @@ -366,8 +361,7 @@ function test_bug_attachments_allow_flags() {
</table>

<br /><?php
}
elseif( MD5 != config_get_global( 'login_method' ) ) {?>
} elseif( MD5 != config_get_global( 'login_method' ) ) {?>
<br />

<table width="100%" bgcolor="#222222" border="0" cellpadding="20" cellspacing="1">
Expand All @@ -383,7 +377,7 @@ function test_bug_attachments_allow_flags() {
</table>

<br /><?php
}
}
?>
<br />

Expand All @@ -397,19 +391,19 @@ function test_bug_attachments_allow_flags() {
?>
<p>File uploads are ENABLED.</p>
<p>File uploads will be stored <?php
switch( config_get_global( 'file_upload_method' ) ) {
case DATABASE:
echo 'in the DATABASE.';
break;
case DISK:
echo 'on DISK in the directory specified by the project.';
break;
case FTP:
echo 'on an FTP server (' . config_get_global( 'file_upload_ftp_server' ) . '), and cached locally.';
break;
default:
echo 'in an illegal place.';
}?> </p>
switch( config_get_global( 'file_upload_method' ) ) {
case DATABASE:
echo 'in the DATABASE.';
break;
case DISK:
echo 'on DISK in the directory specified by the project.';
break;
case FTP:
echo 'on an FTP server (' . config_get_global( 'file_upload_ftp_server' ) . '), and cached locally.';
break;
default:
echo 'in an illegal place.';
}?> </p>

<p>The following size settings are in effect. Maximum upload size will be whichever of these is SMALLEST. </p>
<p>PHP variable 'upload_max_filesize': <?php echo ini_get_number( 'upload_max_filesize' )?> bytes<br />
Expand All @@ -418,21 +412,19 @@ function test_bug_attachments_allow_flags() {

<?php
if( DATABASE == config_get_global( 'file_upload_method' ) ) {
echo '<p>There may also be settings in your web server and database that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information. ';
if( 500 < min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get_global( 'max_file_size' ) ) ) {
echo '<span class="error">Your current settings will most likely need adjustments to the PHP max_execution_time or memory_limit settings, the MySQL max_allowed_packet setting, or equivalent.</span>';
}
}
else {
echo '<p>There may also be settings in your web server that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information.';
}
echo '</p>';
}
else {
echo '<p>There may also be settings in your web server and database that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information. ';
if( 500 < min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get_global( 'max_file_size' ) ) ) {
echo '<span class="error">Your current settings will most likely need adjustments to the PHP max_execution_time or memory_limit settings, the MySQL max_allowed_packet setting, or equivalent.</span>';
}
} else {
echo '<p>There may also be settings in your web server that prevent you from uploading files or limit the maximum file size. See the documentation for those packages if you need more information.';
}
echo '</p>';
} else {
?>
<p>File uploads are DISABLED. To enable them, make sure <tt>$g_file_uploads = on</tt> is in your php.ini file and <tt>allow_file_upload = ON</tt> is in your mantis config file.</p>
<?php
}
}
?>
</td>
</tr>
Expand All @@ -448,29 +440,28 @@ function test_bug_attachments_allow_flags() {
<p>You can test the ability for Mantis to send email notifications with this form. Just click "Send Mail". If the page takes a very long time to reappear or results in an error then you will need to investigate your php/mail server settings (see PHPMailer related settings in your config_inc.php, if they don't exist, copy from config_defaults_inc.php). Note that errors can also appear in the server error log. More help can be found at the <a href="http://www.php.net/manual/en/ref.mail.php">PHP website</a> if you are using the mail() PHPMailer sending mode.</p>
<?php
if( $f_mail_test ) {
echo '<b><font color="#ff0000">Testing Mail</font></b> - ';

# @@@ thraxisp - workaround to ensure a language is set without authenticating
# will disappear when this is properly localized
lang_push( 'english' );

$t_email_data = new EmailData;
$t_email_data->email = config_get_global( 'administrator_email' );
$t_email_data->subject = 'Testing PHP mail() function';
$t_email_data->body = 'Your PHP mail settings appear to be correctly set.';
$t_email_data->metadata['priority'] = config_get( 'mail_priority' );
$t_email_data->metadata['charset'] = lang_get( 'charset', lang_get_current() );
$result = email_send( $t_email_data );

# $result = email_send( config_get_global( 'administrator_email' ), 'Testing PHP mail() function', 'Your PHP mail settings appear to be correctly set.');

if( !$result ) {
echo ' PROBLEMS SENDING MAIL TO: ' . config_get_global( 'administrator_email' ) . '. Please check your php/mail server settings.<br />';
}
else {
echo ' mail() send successful.<br />';
}
}
echo '<b><font color="#ff0000">Testing Mail</font></b> - ';

# @@@ thraxisp - workaround to ensure a language is set without authenticating
# will disappear when this is properly localized
lang_push( 'english' );

$t_email_data = new EmailData;
$t_email_data->email = config_get_global( 'administrator_email' );
$t_email_data->subject = 'Testing PHP mail() function';
$t_email_data->body = 'Your PHP mail settings appear to be correctly set.';
$t_email_data->metadata['priority'] = config_get( 'mail_priority' );
$t_email_data->metadata['charset'] = lang_get( 'charset', lang_get_current() );
$result = email_send( $t_email_data );

# $result = email_send( config_get_global( 'administrator_email' ), 'Testing PHP mail() function', 'Your PHP mail settings appear to be correctly set.');

if( !$result ) {
echo ' PROBLEMS SENDING MAIL TO: ' . config_get_global( 'administrator_email' ) . '. Please check your php/mail server settings.<br />';
} else {
echo ' mail() send successful.<br />';
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>#email">
Email Address: <?php echo config_get_global( 'administrator_email' );?><br />
Expand Down
6 changes: 2 additions & 4 deletions admin/copy_field.php
Expand Up @@ -106,12 +106,10 @@
if( !bug_set_field( $v_bug_id, $f_dest_field, $t_cust_value ) ) {
echo 'database update failed';
$t_failures++;
}
else {
} else {
echo 'applied';
}
}
else {
} else {
echo 'field value was not valid or previously defined';
$t_failures++;
}
Expand Down

0 comments on commit a8f55d5

Please sign in to comment.