added support for deleting profiles

This commit is contained in:
Roland Gruber 2003-05-25 10:51:10 +00:00
parent f9687ffc6f
commit 958882cce6
1 changed files with 18 additions and 0 deletions

View File

@ -365,4 +365,22 @@ function saveHostProfile($account, $profile) {
fclose($file);
}
// deletes a user profile
function delUserProfile($file) {
if (!eregi("^([0-9]|[a-z]|-|_)*$", $profile)) exit;
$prof = substr(__FILE__, 0, strlen(__FILE__) - 16) . "config/profiles/users/".$file.".pru";
if (is_file($prof)) {
return @unlink($prof);
}
}
// deletes a host profile
function delHostProfile($file) {
if (!eregi("^([0-9]|[a-z]|-|_)*$", $profile)) exit;
$prof = substr(__FILE__, 0, strlen(__FILE__) - 16) . "config/profiles/hosts/".$file.".prh";
if (is_file($prof)) {
return @unlink($prof);
}
}
?>