diff --git a/functions.inc.php b/functions.inc.php index 428178da..4689e593 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -734,6 +734,10 @@ function check_owner ($username, $domain) $result = db_query ("SELECT 1 FROM $table_domain_admins WHERE username='$username' AND (domain='$domain' OR domain='ALL') AND active='1'"); if ($result['rows'] != 1) { + if ($result['rows'] > 1) { # "ALL" + specific domain permissions. 2.3 doesn't create such entries, but they are available as leftover from older versions + flash_error("Permission check returned more than one result. Please go to 'edit admin' for your username and press the save " + . "button once to fix the database. If this doesn't help, open a bugreport."); + } return false; } else diff --git a/list-virtual.php b/list-virtual.php index 2a5a7614..110cc1b8 100644 --- a/list-virtual.php +++ b/list-virtual.php @@ -70,6 +70,7 @@ if($fDomain) { if (count($list_domains) == 0) { # die("no domains"); + flash_error( $PALANG['invalid_parameter'] ); header("Location: list-domain.php"); # no domains (for this admin at least) - redirect to domain list exit; } @@ -78,6 +79,7 @@ if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) if (empty ($fDoma if (!check_owner(authentication_get_username(), $fDomain)) { # die($PALANG['invalid_parameter']); + flash_error( $PALANG['invalid_parameter'] ); header("Location: list-domain.php"); # domain not owned by this admin exit(0); }