Skip to content

Commit

Permalink
* manage_prune.php:
Browse files Browse the repository at this point in the history
  + rename to manage_user_prune.php
  + add a confirmation before pruning users


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1789 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Julian Fitzell committed Jan 30, 2003
1 parent 54c04bf commit 3f297e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
12 changes: 7 additions & 5 deletions lang/strings_english.txt
Expand Up @@ -9,11 +9,11 @@
###########################################################################
# English strings for Mantis
# -------------------------------------------------
# $Revision: 1.107 $
# $Author: beerfrick $
# $Date: 2003-01-29 22:19:08 $
# $Revision: 1.108 $
# $Author: jfitzell $
# $Date: 2003-01-30 07:16:38 $
#
# $Id: strings_english.txt,v 1.107 2003-01-29 22:19:08 beerfrick Exp $
# $Id: strings_english.txt,v 1.108 2003-01-30 07:16:38 jfitzell Exp $
###########################################################################
?>
<?php
Expand Down Expand Up @@ -583,8 +583,10 @@
# manage_user_delete_page.php
$s_delete_account_sure_msg = 'Are you sure you wish to delete this account?';

# manage_prune.php
# manage_user_prune.php
$s_accounts_pruned_msg = 'All accounts that have never logged in and are older than 1 week have been removed';
$s_prune_accounts_button = 'Prune';
$s_confirm_account_pruning = 'Are you sure you want to delete old accounts that have never logged in?';

# manage_user_page.php
$s_edit_user_title = 'Edit User';
Expand Down
2 changes: 1 addition & 1 deletion manage_user_page.php
Expand Up @@ -107,7 +107,7 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
<?php echo lang_get( 'never_logged_in_title' ) ?> [<?php echo $user_count ?>] <?php print_bracket_link( 'manage_prune.php', lang_get( 'prune_accounts' ) ) ?>
<?php echo lang_get( 'never_logged_in_title' ) ?> [<?php echo $user_count ?>] <?php print_bracket_link( 'manage_user_prune.php', lang_get( 'prune_accounts' ) ) ?>
</td>
</tr>
<tr class="row-2">
Expand Down
11 changes: 9 additions & 2 deletions manage_prune.php → manage_user_prune.php 100644 → 100755
Expand Up @@ -9,7 +9,7 @@
<?php login_cookie_check() ?>
<?php
check_access( ADMINISTRATOR );

# Delete the users who have never logged in and are older than 1 week
$days_old = 7;
$days_old = (integer)$days_old;
Expand All @@ -18,7 +18,14 @@
WHERE login_count=0 AND TO_DAYS(NOW()) - '$days_old' > TO_DAYS(date_created)";
$result = db_query($query);

for ($i=0; $i < db_num_rows( $result ); $i++) {
$count = db_num_rows( $result );

if ( $count > 0 ) {
helper_ensure_confirmed( lang_get( 'confirm_account_pruning' ),
lang_get( 'prune_accounts_button' ) );
}

for ($i=0; $i < $count; $i++) {
$row = db_fetch_array( $result );
user_delete($row['id']);
}
Expand Down

0 comments on commit 3f297e1

Please sign in to comment.