remove not-functional method 'maildirExists' as maildirs have chmod 700, show 'remove files' on overview-delete if mail-address is an account, fixes #1275
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -143,7 +143,6 @@ if ($page == 'overview') {
|
|||||||
|
|
||||||
if ($result['popaccountid'] != 0) {
|
if ($result['popaccountid'] != 0) {
|
||||||
// Free the Quota used by the email account
|
// Free the Quota used by the email account
|
||||||
|
|
||||||
if ($settings['system']['mail_quota_enabled'] == 1) {
|
if ($settings['system']['mail_quota_enabled'] == 1) {
|
||||||
$stmt = Database::prepare("SELECT `quota` FROM `" . TABLE_MAIL_USERS . "`
|
$stmt = Database::prepare("SELECT `quota` FROM `" . TABLE_MAIL_USERS . "`
|
||||||
WHERE `customerid`= :customerid
|
WHERE `customerid`= :customerid
|
||||||
@@ -167,7 +166,8 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['delete_userfiles'])
|
if (isset($_POST['delete_userfiles'])
|
||||||
&& (int)$_POST['delete_userfiles'] == 1) {
|
&& (int)$_POST['delete_userfiles'] == 1
|
||||||
|
) {
|
||||||
inserttask('7', $userinfo['loginname'], $result['email_full']);
|
inserttask('7', $userinfo['loginname'], $result['email_full']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ if ($page == 'overview') {
|
|||||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'");
|
||||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||||
} else {
|
} else {
|
||||||
if (maildirExists($result)) {
|
if ($result['popaccountid'] != '0') {
|
||||||
$show_checkbox = true;
|
$show_checkbox = true;
|
||||||
} else {
|
} else {
|
||||||
$show_checkbox = false;
|
$show_checkbox = false;
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of the Froxlor project.
|
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the COPYING
|
|
||||||
* file that was distributed with this source code. You can also view the
|
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
*
|
|
||||||
* @copyright (c) the authors
|
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
* @package Functions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check whether a maildir exists on the filesystem
|
|
||||||
*
|
|
||||||
* @param array $result all mail-info of customer
|
|
||||||
*
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
function maildirExists($result = null)
|
|
||||||
{
|
|
||||||
global $settings;
|
|
||||||
|
|
||||||
if(is_array($result))
|
|
||||||
{
|
|
||||||
$loginname = getCustomerDetail($result['customerid'], 'loginname');
|
|
||||||
if($loginname !== false) {
|
|
||||||
$email_user=substr($result['email_full'],0,strrpos($result['email_full'],"@"));
|
|
||||||
$email_domain=substr($result['email_full'],strrpos($result['email_full'],"@")+1);
|
|
||||||
$maildirname=trim($settings['system']['vmail_maildirname']);
|
|
||||||
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $loginname .'/'. $email_domain .'/'. $email_user . (!empty($maildirname)?'/'.$maildirname:''));
|
|
||||||
if(@file_exists($maildir)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
// backward-compatibility for old folder-structure
|
|
||||||
$maildir_old = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $loginname .'/'. $email_user);
|
|
||||||
if (@file_exists($maildir_old)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user