mirror of
https://github.com/DanWin/mail-hosting.git
synced 2024-11-21 23:20:25 +00:00
Also remove squirrelmail .sig files when deleting an account
This commit is contained in:
parent
511eaff924
commit
56aa005a57
1 changed files with 8 additions and 7 deletions
15
cron.php
15
cron.php
|
@ -32,16 +32,17 @@ while ( $tmp = $stmt->fetch( PDO::FETCH_ASSOC ) ) {
|
|||
if ( file_exists( $mail_files ) ) {
|
||||
exec( 'rm -r ' . escapeshellarg( $mail_files ) );
|
||||
}
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '@' . $domain_basename . '.pref' );
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '@' . $domain_basename . '.abook' );
|
||||
$files = glob( '/var/local/squirrelmail/data/' . $local_basename . '@' . $domain_basename . '.{pref,abook,sig}', GLOB_BRACE );
|
||||
if ( $tmp[ 'domain' ] === 'danwin1210.de' ) {
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '.pref' );
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '.abook' );
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion.pref' );
|
||||
@unlink( '/var/local/squirrelmail/data/' . $local_basename . '@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion.abook' );
|
||||
$files = array_merge( $files, glob( '/var/local/squirrelmail/data/' . $local_basename . '{@danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion,}.{pref,abook,sig}', GLOB_BRACE ) );
|
||||
$delete_prosody->execute( [ $tmp[ 'local_part' ], $tmp[ 'domain' ] ] );
|
||||
$delete_prosody_archive->execute( [ $tmp[ 'local_part' ], $tmp[ 'domain' ] ] );
|
||||
}
|
||||
if ( is_array( $files ) ) {
|
||||
foreach ( $files as $file ) {
|
||||
@unlink( $file );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $tmp[ 'active' ] === -2 ) {
|
||||
$delete->execute( [ $tmp[ 'username' ] ] );
|
||||
|
@ -60,7 +61,7 @@ while ( $tmp = $stmt->fetch( PDO::FETCH_ASSOC ) ) {
|
|||
if ( ! in_array( $domain_basename, [ '..', '.', '' ], true ) ) {
|
||||
$del_alias->execute( [ $tmp[ 'domain' ] ] );
|
||||
$del_mailbox->execute( [ $tmp[ 'domain' ] ] );
|
||||
$files = glob( '/var/local/squirrelmail/data/*@' . $domain_basename . '.{pref,abook}', GLOB_BRACE );
|
||||
$files = glob( '/var/local/squirrelmail/data/*@' . $domain_basename . '.{pref,abook,sig}', GLOB_BRACE );
|
||||
$mail_files = '/var/mail/vmail/' . $domain_basename . '/';
|
||||
if ( file_exists( $mail_files ) ) {
|
||||
exec( 'rm -r ' . escapeshellarg( $mail_files ) );
|
||||
|
|
Loading…
Reference in a new issue