Changeset 602

Show
Ignore:
Timestamp:
05/26/2007 10:01:10 AM (1 year ago)
Author:
malte
Message:

Branched for gnif see http://www.isp-control.net/forum/ssl-patches-t-528-4.htm

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ssl-addon/trunk/gui/tools/filemanager/includes/browse.inc.php

    r371 r602  
    895895        } 
    896896 
     897// Hack for ispCP: ftpserver always 'localhost', check the username for the host and drop the "htdocs" folder in the path 
     898        elseif (($net2ftp_globals['ftpserver'] == 'localhost') && (strpos($_REQUEST['username'], '@') !== false)) { 
     899                // take ftp-username to get the domainname 
     900                list(, $userdomain) = explode('@', $_REQUEST['username']); 
     901                // remove htdocs from the directory if available (otherwise -> error!!!) 
     902                $specialdirectories[1] = 'htdocs'; 
     903                for ($i=1; $i<=sizeof($specialdirectories); $i++) { 
     904                        $pos = strpos($directory, $specialdirectories[$i]); 
     905                        if ($pos !== false) { 
     906                                $directory = substr($directory, $pos + strlen($specialdirectories[$i])); 
     907                                break; 
     908                        } 
     909                } 
     910                // error if not in htdocs... 
     911                if ($pos == false) { 
     912                        $list_links[1] = 'You are not in the "htdocs" Webfolder - you cannot access this folder from the web...'; 
     913                } else { 
     914                // create the URL 
     915                for ($i=1; $i<=sizeof($list_files); $i++) { 
     916                        $URL = 'http://www.' . $userdomain . $directory . '/' . $list_files[$i][$encoding]; 
     917                        if ($htmltags == 'no') { $list_links[$i] = $URL; } 
     918                        else                   { $list_links[$i] = "<a href=\"" . $URL . "\" target=\"_blank\" title=\"" . 
     919                                                __("Execute %1\$s in a new window", $list_files[$i][$encoding]) . "\">" . $list_files[$i][$encoding] . "</a>"; } 
     920                } // end for 
     921                } 
     922        } 
    897923// ------------------------------------------------------------------------- 
    898924// "http://192.168.0.1/directory/file" can be determined using "192.168.0.1/directory/file":