Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
0c4be73f
Commit
0c4be73f
authored
Dec 07, 2008
by
tbrehm
Browse files
Bugfix: Don't remove delete mailbox under home/vmail
parent
93f15ebe
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/mail_plugin.inc.php
View file @
0c4be73f
...
...
@@ -53,7 +53,7 @@ class mail_plugin {
//* Mail Domains
//$app->plugins->registerEvent('mail_domain_insert',$this->plugin_name,'domain_insert');
//$app->plugins->registerEvent('mail_domain_update',$this->plugin_name,'domain_update');
//
$app->plugins->registerEvent('mail_domain_delete',$this->plugin_name,'domain_delete');
$app
->
plugins
->
registerEvent
(
'mail_domain_delete'
,
$this
->
plugin_name
,
'domain_delete'
);
}
...
...
@@ -125,6 +125,22 @@ class mail_plugin {
}
}
function
domain_delete
(
$event_name
,
$data
)
{
global
$app
,
$conf
;
// get the config
$app
->
uses
(
"getconf"
);
$mail_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
"server_id"
],
'mail'
);
$old_maildomain_path
=
escapeshellcmd
(
$mail_config
[
'homedir_path'
]
.
'/'
.
$data
[
'old'
][
'domain'
]);
if
(
!
stristr
(
$old_maildomain_path
,
'..'
)
&&
!
stristr
(
$old_maildomain_path
,
'*'
)
&&
strlen
(
$old_maildomain_path
)
>=
10
)
{
exec
(
'rm -rf '
.
escapeshellcmd
(
$old_maildomain_path
));
$app
->
log
(
'Deleted the mail domain directory: '
.
$old_maildomain_path
,
LOGLEVEL_DEBUG
);
}
else
{
$app
->
log
(
'Possible security violation when deleting the mail domain directory: '
.
$old_maildomain_path
,
LOGLEVEL_ERROR
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment