function __construct($port_mode = FALSE, $verb = FALSE, $le = FALSE)
 {
     $this->LocalEcho = $le;
     $this->Verbose = $verb;
     $this->_lastaction = NULL;
     $this->_error_array = array();
     $this->_eol_code = array(FTP_OS_Unix => "\n", FTP_OS_Mac => "\r", FTP_OS_Windows => "\r\n");
     $this->AuthorizedTransferMode = array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY);
     $this->OS_FullName = array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS');
     $this->AutoAsciiExt = array("ASP", "BAT", "C", "CPP", "CSS", "CSV", "JS", "H", "HTM", "HTML", "SHTML", "INI", "LOG", "PHP3", "PHTML", "PL", "PERL", "SH", "SQL", "TXT");
     $this->_port_available = $port_mode == TRUE;
     $this->SendMSG("Staring FTP client class" . ($this->_port_available ? "" : " without PORT mode support"));
     $this->_connected = FALSE;
     $this->_ready = FALSE;
     $this->_can_restore = FALSE;
     $this->_code = 0;
     $this->_message = "";
     $this->_ftp_buff_size = 4096;
     $this->_curtype = NULL;
     $this->SetUmask(022);
     $this->SetType(FTP_AUTOASCII);
     $this->SetTimeout(30);
     $this->Passive(!$this->_port_available);
     $this->_login = "******";
     $this->_password = "******";
     $this->_features = array();
     $this->OS_local = FTP_OS_Unix;
     $this->OS_remote = FTP_OS_Unix;
     $this->features = array();
     if (isWindows() == true) {
         $this->OS_local = FTP_OS_Windows;
     } elseif (isMac() == true) {
         $this->OS_local = FTP_OS_Mac;
     }
 }
    define('E_STRICT', 2048);
}
if (!defined('E_RECOVERABLE_ERROR')) {
    define('E_RECOVERABLE_ERROR', 4096);
}
if (!defined('E_DEPRECATED')) {
    define('E_DEPRECATED', 8192);
}
if (!defined('E_USER_DEPRECATED')) {
    define('E_USER_DEPRECATED', 16384);
}
/* EOL constant from PHP-Compat */
if (!defined('PHP_EOL')) {
    if (isWindows() == true) {
        define('PHP_EOL', "\r\n");
    } elseif (isMac() == true) {
        define('PHP_EOL', "\r");
    } else {
        define('PHP_EOL', "\n");
    }
}
/* File constants from PHP-Compat */
if (!defined('FILE_USE_INCLUDE_PATH')) {
    define('FILE_USE_INCLUDE_PATH', 1);
}
if (!defined('FILE_IGNORE_NEW_LINES')) {
    define('FILE_IGNORE_NEW_LINES', 2);
}
if (!defined('LOCK_EX')) {
    define('LOCK_EX', 2);
}
Example #3
0
            $value = sprintf(gettext('<em>unknown</em> (<code>%o</code>)'), $chmod);
        }
        if ($chmod > 0664) {
            if (isset($_zp_conf_vars['CHMOD'])) {
                $severity = -3;
            } else {
                $severity = -1;
            }
        } else {
            $severity = -2;
        }
        $msg = sprintf(gettext('File Permissions [are %s]'), $value);
        checkMark($severity, $msg, $msg, '<p>' . gettext('If file permissions are not set to <em>strict</em> or tighter there could be a security risk. However, on some servers Zenphoto does not function correctly with tight file permissions. If Zenphoto has permission errors, run setup again and select a more relaxed permission.') . '</p>' . $chmodselector);
        if (setupUserAuthorized()) {
            if ($environ) {
                if (isMac()) {
                    checkMark(-1, '', gettext('Your filesystem is Macintosh'), gettext('Zenphoto is unable to deal with Macintosh file names containing diacritical marks. You should avoid these.'), false);
                    ?>
											<input
												type="hidden" name="FILESYSTEM_CHARSET" value="UTF-8" />

											<?php 
                } else {
                    primeMark(gettext('Character set'));
                    $charset_defined = str_replace('-', '&#8209;', FILESYSTEM_CHARSET);
                    $charset = LOCAL_CHARSET;
                    if (empty($charset)) {
                        $charset = 'UTF-8';
                    }
                    $test = '';
                    if (($dir = opendir($serverpath . '/' . DATA_FOLDER . '/')) !== false) {
Example #4
0
/**
 * @return \Closure
 */
function isNotMac()
{
    return negate(isMac());
}
Example #5
0
 /**
  * Strip ending '/' or '\' from path.
  *
  * @access private
  * @param $path string Path.
  * @return bool New path (destructive)
  */
 function _strip_last_pathchar(&$path)
 {
     if (isMac()) {
         if (substr($path, -1) == ':' or substr($path, -1) == "/") {
             $path = substr($path, 0, -1);
         }
     } else {
         if (substr($path, -1) == '/' or substr($path, -1) == "\\") {
             $path = substr($path, 0, -1);
         }
     }
     return $path;
 }