diff --git a/customer_domains.php b/customer_domains.php index 6d115bb9..369c54c5 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -541,10 +541,17 @@ elseif($page == 'domains') if(preg_match('/^https?\:\/\//', $result['documentroot']) && validateUrl($idna_convert->encode($result['documentroot'])) - && $settings['panel']['pathedit'] == 'Dropdown') - { - $urlvalue = $result['documentroot']; - $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); + ) { + if($settings['panel']['pathedit'] == 'Dropdown') + { + $urlvalue = $result['documentroot']; + $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); + } + else + { + $urlvalue = ''; + $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot'], true); + } } else { diff --git a/lib/functions/filedir/function.makePathfield.php b/lib/functions/filedir/function.makePathfield.php index ee3fba4e..289c5774 100644 --- a/lib/functions/filedir/function.makePathfield.php +++ b/lib/functions/filedir/function.makePathfield.php @@ -32,9 +32,10 @@ * @author Manuel Bernhardt */ -function makePathfield($path, $uid, $gid, $fieldType, $value = '') +function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false) { global $lng; + $value = str_replace($path, '', $value); $field = array(); @@ -42,7 +43,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '') // but dirList holds the paths with starting slash // so we just add one here to get the correct // default path selected, #225 - if (substr($value, 0, 1) != '/') { + if (substr($value, 0, 1) != '/' && !$dom) { $value = '/'.$value; }