Skip to content

Commit

Permalink
Added g_allow_account_delete global to prevent self account deletion.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@662 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Jan 18, 2002
1 parent 0e9965b commit 931b0dc
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions account_delete.php
Expand Up @@ -13,6 +13,10 @@
<?php
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( OFF == $g_allow_account_delete ) {
print_header_redirect( $g_account_page );
}

# get protected state
$t_protected = get_current_user_field( "protected" );

Expand Down
4 changes: 4 additions & 0 deletions account_delete_page.php
Expand Up @@ -12,6 +12,10 @@
<?php login_cookie_check() ?>
<?php
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );

if ( OFF == $g_allow_account_delete ) {
print_header_redirect( $g_account_page );
}
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
Expand Down
6 changes: 6 additions & 0 deletions account_page.php
Expand Up @@ -144,11 +144,17 @@
<input type="submit" value="<?php echo $s_update_user_button ?>">
</td>
</form>
<? if ( ON == $g_allow_account_delete ) { ?>
<form method="post" action="<?php echo $g_account_delete_page ?>">
<td class="right">
<input type="submit" value="<?php echo $s_delete_account_button ?>">
</td>
</form>
<? } else { ?>
<td>
&nbsp;
</td>
<? } ?>
</tr>
<?php } ?>
</table>
Expand Down
4 changes: 4 additions & 0 deletions config_inc.php
Expand Up @@ -377,6 +377,10 @@
# Allow developers and above to close bugs immediately when resolving bugs
$g_allow_close_immediately = OFF;

# --- account delete -----------
# Allow users to delete their own accounts
$g_allow_account_delete = OFF;

##############################
# Mantis Color Variables
##############################
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -34,6 +34,7 @@ Mantis
* Added a check to make sure the cookie_string really is unique.
* Added a check for a duplciate user in the manage create user page.
* Added Romanian translation.
* Added g_allow_account_delete global to prevent self account deletion.
* Removed site_settings pages.
* Removed unused cookie variables.
* Removed sql_to_unix_time() function. Unecessary with removal of TIMESTAMPS.
Expand Down
8 changes: 8 additions & 0 deletions doc/configuration.html
Expand Up @@ -1127,6 +1127,14 @@ <h2>Content</h2>
Allow developers and above to close bugs immediately when resolving bugs.
</td>
</tr>
<tr>
<td width="20%" bgcolor="#ddddff">
$g_allow_account_delete
</td>
<td width="80%" bgcolor="#ffffff">
Allow users to delete their own accounts.
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#eeeeee">
Access level needed to re-open bugs. Look in the constant_inc.php file if you want to set a different value.
Expand Down

0 comments on commit 931b0dc

Please sign in to comment.