diff --git a/include/class-FTP.php b/include/class-FTP.php index 97e9d7c..1e33632 100644 --- a/include/class-FTP.php +++ b/include/class-FTP.php @@ -1,84 +1,83 @@ . /** * An FTP user */ class FTP extends Domain { const T = 'ftp'; /** * Constructor * * Normalize the object obtained from the database */ public function __construct() { $this->booleans( 'ftp_active' ); $this->integers( 'ftp_ulbandwidth', 'ftp_dlbandwidth', 'ftp_quotasize', 'ftp_quotafiles' ); } /** * Get the FTP login username * * @return string E-mail */ public function getFTPLogin() { return $this->get( 'ftp_login' ); } /** * Check if this FTP account is active * * @return bool */ public function isFTPActive() { return $this->get( 'ftp_active' ); } /** * Get the mailbox permalink * * @return string */ public function getFTPPermalink( $absolute = false ) { return FTP::permalink( $this->getDomainName(), $this->getFTPLogin() ); } /** * Get the FTP permalink from domain name and FTP login * * @param string $domain Domain name * @param string $login FTP user login * @return string */ - public static function permalink( $domain, $login ) { - return sprintf( - '%s/%s/%s', - ROOT . '/ftp.php', - $domain, - $login - ); + public static function permalink( $domain, $login = null ) { + $url = sprintf( '%s/%s', ROOT . '/ftp.php', $domain ); + if( $login ) { + $url = "/$login"; + } + return $url; } }