Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tidying up code
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@100 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Dec 23, 2000
1 parent 7202f2c commit 438c6db
Show file tree
Hide file tree
Showing 63 changed files with 356 additions and 294 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -20,6 +20,10 @@ To Do:
12.XX.2000 - 0.12.1

* Fixed bug in vote adding with inccorect variable name.
* Fixed bug where bugnote text not properl deleted when bug deleted
* Uncluttered large portions of code
* Fixed another problem with the date created being updated improperly when
dealing with bugnotes.

12.20.2000 - 0.12.0

Expand Down
17 changes: 10 additions & 7 deletions account_delete.php3
Expand Up @@ -60,19 +60,22 @@
}
### FAILURE
else {
PRINT "ERROR!!! An error has occured. Email the <a href=\"mailto:$g_administrator_email\">administrator</a> with this query:<p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
echo $query;
}
?>
<p>

<? if ( $f_protected=="on" ) { ?>
<a href="<? echo $g_account_page ?>"><? echo $s_go_back ?></a>
<? } else { ?>
<a href="<? echo $g_logout_page ?>"><? echo $s_proceed ?></a>
<? } ?>
<?
if ( $f_protected=="on" ) {
PRINT "<a href=\"$g_account_page\">$s_go_back</a>";
}
else {
PRINT "<a href=\"$g_logout_page\">$s_proceed</a>";
}
?>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_delete_page.php3
Expand Up @@ -30,12 +30,12 @@
<form method=post action="<? echo $g_account_delete ?>">
<input type=hidden name=f_id value="<? echo $f_id ?>">
<input type=hidden name=f_protected value="<? echo $f_protected ?>">
<input type=submit value="<? echo $s_delete_account ?>">
<input type=submit value="<? echo $s_delete_account_button ?>">
</form>

<hr size=1 width=50%>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
2 changes: 1 addition & 1 deletion account_page.php3
Expand Up @@ -116,6 +116,6 @@
</table>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
14 changes: 5 additions & 9 deletions account_prefs_page.php3
Expand Up @@ -18,11 +18,7 @@
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

### grab the user id
$query = "SELECT id
FROM $g_mantis_user_table
WHERE cookie_string='$g_string_cookie_val'";
$result = db_mysql_query($query);
$u_id = mysql_result( $result, 0 );
$u_id = get_current_user_id();

### Grab the data
$query = "SELECT *
Expand Down Expand Up @@ -64,9 +60,9 @@
<td bgcolor=<? echo $g_white_color ?>>
<table width=100% cols=2>
<form method=post action="<? echo $g_account_prefs_update ?>">
<input type=hidden name=f_action value="update">
<input type=hidden name=f_id value="<? echo $u_id ?>">
<input type=hidden name=f_user_id value="<? echo $u_user_id ?>">
<input type=hidden name=f_action value="update">
<input type=hidden name=f_id value="<? echo $u_id ?>">
<input type=hidden name=f_user_id value="<? echo $u_user_id ?>">
<tr>
<td colspan=2 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_default_account_preferences ?></b>
Expand Down Expand Up @@ -108,6 +104,6 @@
</table>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
22 changes: 15 additions & 7 deletions account_prefs_update.php3
Expand Up @@ -25,16 +25,15 @@
WHERE id='$f_id'";
$result = mysql_query( $query );
}
else {
echo "ERROR: invalid action";
}
?>
<? print_html_top() ?>
<? print_head_top() ?>
<? print_title( $g_window_title ) ?>
<? print_css( $g_css_include_file ) ?>
<?
print_meta_redirect( $g_account_prefs_page, $g_wait_time );
if ( $result ) {
print_meta_redirect( $g_account_prefs_page, $g_wait_time );
}
?>
<? include( $g_meta_include_file ) ?>
<? print_head_bottom() ?>
Expand All @@ -45,11 +44,20 @@

<p>
<div align=center>
<? echo $s_prefs_updated ?>
<p>
<?
### SUCCESS
if ( $result ) {
PRINT "$s_prefs_updated<p>";
}
### FAILURE
else {
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
echo $query;
}
?>
<a href="<? echo $g_account_prefs_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_profile_add.php3
Expand Up @@ -55,13 +55,13 @@
}
### FAILURE
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
}
?>
<p>
<a href="<? echo $g_account_profile_manage_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_profile_delete.php3
Expand Up @@ -45,13 +45,13 @@
PRINT "$s_profile_deleted<p>";
}
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
}
?>
<p>
<a href="<? echo $g_account_profile_manage_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_profile_edit_page.php3
Expand Up @@ -60,7 +60,7 @@
<td bgcolor=<? echo $g_white_color ?>>
<table cols=2 width=100%>
<form method=post action="<? echo $g_account_profile_update ?>">
<input type=hidden name=f_id value="<? echo $v_id ?>">
<input type=hidden name=f_id value="<? echo $v_id ?>">
<tr>
<td colspan=2 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_edit_profile_title ?></b>
Expand Down Expand Up @@ -110,6 +110,6 @@
</table>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_profile_make_default.php3
Expand Up @@ -53,13 +53,13 @@
}
### FAILURE
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
}
?>
<p>
<a href="<? echo $g_account_profile_manage_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
13 changes: 3 additions & 10 deletions account_profile_manage_page.php3
Expand Up @@ -14,13 +14,6 @@
header( "Location: $g_logout_page" );
exit;
}

### Get user information and prefix with u_
$query = "SELECT id
FROM $g_mantis_user_table
WHERE cookie_string='$g_string_cookie_val'";
$result = db_mysql_query($query);
$u_id = mysql_result( $result, 0 );
?>
<? print_html_top() ?>
<? print_head_top() ?>
Expand All @@ -41,7 +34,7 @@
<td bgcolor=<? echo $g_white_color ?>>
<table cols=2 width=100%>
<form method=post action="<? echo $g_account_profile_add ?>">
<input type=hidden name=f_user_id value="<? echo $u_id ?>">
<input type=hidden name=f_user_id value="<? echo get_current_user_id() ?>">
<tr>
<td colspan=2 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_add_profile ?></b>
Expand Down Expand Up @@ -98,7 +91,7 @@
<td bgcolor=<? echo $g_white_color ?>>
<table width=100%>
<form method=post action="<? echo $g_account_profile_edit_page ?>">
<input type=hidden name=f_user_id value="<? echo $u_id ?>">
<input type=hidden name=f_user_id value="<? echo get_current_user_id() ?>">
<tr>
<td colspan=2 bgcolor=<? echo $g_table_title_color ?>>
<b><? echo $s_edit_or_delete_profiles ?></b>
Expand Down Expand Up @@ -133,6 +126,6 @@
</table>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
4 changes: 2 additions & 2 deletions account_profile_update.php3
Expand Up @@ -54,13 +54,13 @@
}
### FAILURE
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
}
?>
<p>
<a href="<? echo $g_account_profile_manage_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
6 changes: 3 additions & 3 deletions account_update.php3
Expand Up @@ -18,7 +18,7 @@
WHERE id='$f_id'";
$result = mysql_query( $query );

### Update password if changed and the two match
### Update password if changed and the two match and not empty
if ( !empty( $f_password ) ) {
if ( $f_password==$f_password_confirm ) {
$t_password = crypt( $f_password );
Expand Down Expand Up @@ -59,14 +59,14 @@
}
### FAILURE
else {
PRINT "ERROR!!! An error has occured. Email the <a href=\"mailto:$g_administrator_email\">administrator</a> with this query:<p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
echo $query;
}
?>
<p>
<a href="<? echo $g_account_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
21 changes: 19 additions & 2 deletions bug_delete.php3
Expand Up @@ -21,6 +21,23 @@
WHERE id='$f_bug_text_id'";
$result = mysql_query($query);

### Delete the bugnote text items
$query = "SELECT bugnote_text_id
FROM $g_mantis_bugnote_table
WHERE bug_id='$f_id'";
$result = mysql_query($query);
$bugnote_count = mysql_num_rows( $result );
for ($i=0;$i<$bugnote_count;$i++){
$row = mysql_fetch_array( $result );
$t_bugnote_text_id = $row["bugnote_text_id"];

### Delete the corresponding bugnote texts
$query = "DELETE
FROM $g_mantis_bugnote_text_table
WHERE id='$t_bugnote_text_id'";
$result2 = mysql_query( $query );
}

### Delete the corresponding bugnotes
$query = "DELETE
FROM $g_mantis_bugnote_table
Expand Down Expand Up @@ -54,14 +71,14 @@
}
### FAILURE
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
PRINT "$s_sql_error_detected <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
echo $query;
}
?>
<p>
<a href="<? echo $g_view_bug_all_page ?>"><? echo $s_proceed ?></a>
</div>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>
2 changes: 1 addition & 1 deletion bug_delete_page.php3
Expand Up @@ -33,6 +33,6 @@
</div>
<hr size=1 width=50%>

<? print_footer() ?>
<? print_footer(__FILE__) ?>
<? print_body_bottom() ?>
<? print_html_bottom() ?>

0 comments on commit 438c6db

Please sign in to comment.