Merge branch 'develop' into pr/umask

This commit is contained in:
Kijin Sung 2016-07-03 21:21:17 +09:00
commit ce878bcaf6
31 changed files with 87 additions and 248 deletions

View file

@ -185,72 +185,8 @@ class FileHandler
*/
public static function makeDir($path_string)
{
if (!ini_get('safe_mode'))
{
$path = self::getRealPath($path_string);
return Rhymix\Framework\Storage::isDirectory($path) || Rhymix\Framework\Storage::createDirectory($path);
}
// if safe_mode is on, use FTP
else
{
static $oFtp = NULL;
$ftp_info = Context::getFTPInfo();
if($oFtp == NULL)
{
if(!Context::isFTPRegisted())
{
return;
}
$oFtp = new ftp();
if(!$ftp_info->ftp_host)
{
$ftp_info->ftp_host = "127.0.0.1";
}
if(!$ftp_info->ftp_port)
{
$ftp_info->ftp_port = 21;
}
if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
{
return;
}
if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
{
$oFtp->ftp_quit();
return;
}
}
if(!($ftp_path = $ftp_info->ftp_root_path))
{
$ftp_path = DIRECTORY_SEPARATOR;
}
$path_string = str_replace(_XE_PATH_, '', $path_string);
$path_list = explode(DIRECTORY_SEPARATOR, $path_string);
$path = _XE_PATH_;
for($i = 0, $c = count($path_list); $i < $c; $i++)
{
if(!$path_list[$i])
{
continue;
}
$path .= $path_list[$i] . DIRECTORY_SEPARATOR;
$ftp_path .= $path_list[$i] . DIRECTORY_SEPARATOR;
if(!is_dir($path))
{
$oFtp->ftp_mkdir($ftp_path);
$oFtp->ftp_site("CHMOD 777 " . $ftp_path);
}
}
}
return is_dir($path_string);
$path = self::getRealPath($path_string);
return Rhymix\Framework\Storage::isDirectory($path) || Rhymix\Framework\Storage::createDirectory($path);
}
/**

View file

@ -626,8 +626,8 @@ class Debug
case \E_COMPILE_ERROR: return 'Compile-time Error';
case \E_COMPILE_WARNING: return 'Compile-time Warning';
case \E_USER_ERROR: return 'User Error';
case \E_USER_WARNING: return 'User Warning';
case \E_USER_NOTICE: return 'User Notice';
case \E_USER_WARNING: return 'Warning';
case \E_USER_NOTICE: return 'Notice';
case \E_STRICT: return 'Strict Standards';
case \E_PARSE: return 'Parse Error';
case \E_DEPRECATED: return 'Deprecated';

View file

@ -173,12 +173,18 @@ class Storage
{
if ($stream)
{
return @fopen($filename, 'r');
$result = @fopen($filename, 'r');
}
else
{
return @file_get_contents($filename);
$result = @file_get_contents($filename);
}
if ($result === false)
{
trigger_error('Cannot read file: ' . $filename, \E_USER_WARNING);
}
return $result;
}
else
{
@ -229,6 +235,7 @@ class Storage
$mkdir_success = self::createDirectory($destination_dir);
if (!$mkdir_success && !self::exists($destination_dir))
{
trigger_error('Cannot create directory to write file: ' . $filename, \E_USER_WARNING);
return false;
}
}
@ -239,7 +246,7 @@ class Storage
$filename = $filename . '.tmp.' . microtime(true);
}
if ($fp = fopen($filename, $mode))
if ($fp = @fopen($filename, $mode))
{
flock($fp, \LOCK_EX);
if (is_resource($content))
@ -253,9 +260,16 @@ class Storage
fflush($fp);
flock($fp, \LOCK_UN);
fclose($fp);
if (!$result)
{
trigger_error('Cannot write file: ' . (isset($original_filename) ? $original_filename : $filename), \E_USER_WARNING);
return false;
}
}
else
{
trigger_error('Cannot write file: ' . (isset($original_filename) ? $original_filename : $filename), \E_USER_WARNING);
return false;
}
@ -269,7 +283,7 @@ class Storage
if (!$rename_success)
{
@unlink($filename);
throw new Exception('foo');
trigger_error('Cannot write file: ' . (isset($original_filename) ? $original_filename : $filename), \E_USER_WARNING);
return false;
}
}
@ -323,12 +337,14 @@ class Storage
$destination = rtrim($destination, '/\\');
if (!self::exists($source))
{
trigger_error('Cannot copy because the source does not exist: ' . $source, \E_USER_WARNING);
return false;
}
$destination_dir = dirname($destination);
if (!self::exists($destination_dir) && !self::createDirectory($destination_dir))
{
trigger_error('Cannot create directory to copy into: ' . $destination_dir, \E_USER_WARNING);
return false;
}
elseif (self::isDirectory($destination))
@ -345,6 +361,7 @@ class Storage
$copy_success = @copy($source, $destination);
if (!$copy_success)
{
trigger_error('Cannot copy ' . $source . ' to ' . (isset($original_destination) ? $original_destination : $destination), \E_USER_WARNING);
return false;
}
@ -358,7 +375,7 @@ class Storage
if (!$rename_success)
{
@unlink($destination);
throw new Exception('foo');
trigger_error('Cannot copy ' . $source . ' to ' . (isset($original_destination) ? $original_destination : $destination), \E_USER_WARNING);
return false;
}
}
@ -400,12 +417,14 @@ class Storage
$destination = rtrim($destination, '/\\');
if (!self::exists($source))
{
trigger_error('Cannot move because the source does not exist: ' . $source, \E_USER_WARNING);
return false;
}
$destination_dir = dirname($destination);
if (!self::exists($destination_dir) && !self::createDirectory($destination_dir))
{
trigger_error('Cannot create directory to move into: ' . $destination_dir, \E_USER_WARNING);
return false;
}
elseif (self::isDirectory($destination))
@ -414,13 +433,19 @@ class Storage
}
$result = @rename($source, $destination);
if (!$result)
{
trigger_error('Cannot move ' . $source . ' to ' . $destination, \E_USER_WARNING);
return false;
}
if (function_exists('opcache_invalidate') && substr($source, -4) === '.php')
{
@opcache_invalidate($source, true);
}
clearstatcache(true, $destination);
return $result;
return true;
}
/**
@ -435,7 +460,17 @@ class Storage
public static function delete($filename)
{
$filename = rtrim($filename, '/\\');
$result = @self::exists($filename) && @is_file($filename) && @unlink($filename);
if (!self::exists($filename))
{
return false;
}
$result = @is_file($filename) && @unlink($filename);
if (!$result)
{
trigger_error('Cannot delete file: ' . $filename, \E_USER_WARNING);
}
if (function_exists('opcache_invalidate') && substr($filename, -4) === '.php')
{
@opcache_invalidate($filename, true);
@ -456,7 +491,24 @@ class Storage
{
$mode = 0777 & ~self::getUmask();
}
return @mkdir($dirname, $mode, true);
$result = @mkdir($dirname, $mode, true);
if (!$result)
{
if (!is_dir($dirname))
{
trigger_error('Cannot create directory: ' . $dirname, \E_USER_WARNING);
}
else
{
@chmod($dirname, $mode);
}
return false;
}
else
{
return true;
}
}
/**
@ -482,6 +534,7 @@ class Storage
}
catch (\UnexpectedValueException $e)
{
trigger_error('Cannot read directory: ' . $dirname, \E_USER_WARNING);
return false;
}
@ -515,10 +568,12 @@ class Storage
$destination = rtrim($destination, '/\\');
if (!self::isDirectory($source))
{
trigger_error('Cannot copy because the source does not exist: ' . $source, \E_USER_WARNING);
return false;
}
if (!self::isDirectory($destination) && !self::createDirectory($destination))
{
trigger_error('Cannot create directory to copy into: ' . $destination, \E_USER_WARNING);
return false;
}
@ -582,8 +637,13 @@ class Storage
public static function deleteDirectory($dirname, $delete_self = true)
{
$dirname = rtrim($dirname, '/\\');
if (!self::exists($dirname))
{
return false;
}
if (!self::isDirectory($dirname))
{
trigger_error('Delete target is not a directory: ' . $dirname, \E_USER_WARNING);
return false;
}
@ -597,6 +657,7 @@ class Storage
{
if (!@rmdir($path->getPathname()))
{
trigger_error('Cannot delete directory: ' . $path->getPathname(), \E_USER_WARNING);
return false;
}
}
@ -604,6 +665,7 @@ class Storage
{
if (!@unlink($path->getPathname()))
{
trigger_error('Cannot delete file: ' . $path->getPathname(), \E_USER_WARNING);
return false;
}
}
@ -611,7 +673,16 @@ class Storage
if ($delete_self)
{
return @rmdir($dirname);
$result = @rmdir($dirname);
if (!$result)
{
trigger_error('Cannot delete directory: ' . $dirname, \E_USER_WARNING);
return false;
}
else
{
return true;
}
}
else
{

View file

@ -7,8 +7,6 @@ $lang->ftp_host = 'FTP-Server hostname';
$lang->ftp_port = 'FTP Port';
$lang->about_ftp_password = 'Das Passwort des FTPs wird nicht gespeichert.';
$lang->cmd_check_ftp_connect = 'Verbindung des FTPs checken';
$lang->msg_safe_mode_ftp_needed = 'Zur Installation und Nutzung des Rhymixs muss die Angabe des FTPs festgestellt werden, wenn safe_mode in PHP \'An\' ist.';
$lang->msg_safe_mode_ftp_config = 'Die Angabe wird unter<strong>files/config/ftp.config.php</strong> gespeichert. Nach der Installation ist es auch möglich, dass die Angabe von Administrator modifiziert oder gelöscht werden kann.';
$lang->msg_ftp_no_directory = 'Succeed to connect to the host via FTP. However, can not read any directory list informaiton. Check the server configurations.';
$lang->msg_ftp_mkdir_fail = 'Der Befehl von Herstellung des Verzeichnisses durch FTP ist gescheitert. FTP_Server festlegen.';
$lang->msg_ftp_chmod_fail = 'Die Modifikation der Zugriffsberechtigung des Verzeichnisses durch FTP ist gescheitert. FTP_Server festlegen.';

View file

@ -201,7 +201,6 @@ $lang->local_ip_address = 'Local IP address';
$lang->about_admin_ip_allow = 'If this list is not empty, the administrator will only be able to log in from one of the listed IP addresses.';
$lang->about_admin_ip_deny = 'This list can be used to designate IP addresses that are not allowed to log in as administrator.';
$lang->msg_current_ip_will_be_denied = 'The given IP list cannot be applied, as they would block your own IP address.';
$lang->detail_about_ftp_info = 'FTP information is needed for easyinstall when save_mode = on.';
$lang->allow_use_favicon = 'Favicon';
$lang->about_use_favicon = 'The favicon should be 16x16 or 32x32, either ico or png format.';
$lang->allow_use_mobile_icon = 'Home Screen Icon';
@ -251,9 +250,6 @@ $lang->ftp_host = 'FTP hostname';
$lang->ftp_port = 'FTP port';
$lang->about_ftp_password = 'Password is required during access to FTP for checking FTP directories. FTP password will not be stored after this.';
$lang->cmd_check_ftp_connect = 'Check FTP Connection';
$lang->msg_safe_mode_ftp_needed = 'If safe_mode setting of PHP is On, it hepls normal functioning of Rhymix.';
$lang->msg_safe_mode_ftp_needed2 = 'Easy installation or update of module is enabled.';
$lang->msg_safe_mode_ftp_config = 'This information is stored in<strong>files/config/ftp.config.php</strong>. You can add, change or delete this on the Settings page after the installation.';
$lang->msg_ftp_no_directory = 'Succeed to connect to the host via FTP, but cannot read any directory list informaiton. Please check the server configurations.';
$lang->msg_ftp_mkdir_fail = 'Failed to create a directory using FTP. Please check the permission of FTP account.';
$lang->msg_ftp_chmod_fail = 'Chmod failed. Please check the permission and configuration of the FTP server.';

View file

@ -48,7 +48,6 @@ $lang->modify = 'Modificar';
$lang->ftp_form_title = 'Datos de conexión para FTP';
$lang->ftp = 'FTP';
$lang->cmd_check_ftp_connect = 'conexión de FTP confirmada';
$lang->msg_safe_mode_ftp_needed = 'Si la la variable safe_mode está activa[safe_mode=On], debe rellenar los datos de FTP para seguir instalando y usar con normalidad el Rhymix.';
$lang->msg_ftp_no_directory = 'Succeed to connect to the host via FTP. However, can not read any directory list informaiton. Check the server configurations.';
$lang->msg_ftp_mkdir_fail = 'Ha fallado el comando de FTP para la creación de directorio. Verifique la configuración del servicio FTP en el servidor';
$lang->msg_ftp_chmod_fail = 'Ha fallado el comando de FTP para la modificación de atributos de directorio. Verifique la configuración del servicio FTP en el servidor.';

View file

@ -133,7 +133,6 @@ $lang->local_ip_address = 'ローカルIPアドレス';
$lang->about_admin_ip_allow = 'ここでIPアドレスの一覧を表示すると、そのIPのみ、管理者のログインが可能になります。すべてのIPからのログインを許可するには、リストを空白のままに。';
$lang->about_admin_ip_deny = 'ここに記載され、IPアドレスは、管理者のログインが禁止されます。';
$lang->msg_current_ip_will_be_denied = '入力された設定によると、現在ログインして、管理者のIPアドレスもブロックされます。再度確認してください。';
$lang->detail_about_ftp_info = 'FTP情報を入力すれば簡単設置を可能にします。FTP情報は files/config/ftp.config.php ファイルに保存されます。簡単設置ができない場合、PHPのsafe_modeをOnへ変更が必要です。';
$lang->allow_use_favicon = 'ファビコン設定';
$lang->about_use_favicon = '16 x 16 サイズの<em>*.ico</em> ファイルのみ登録できます。';
$lang->allow_use_mobile_icon = '待受画面のアイコン設定';
@ -181,9 +180,6 @@ $lang->ftp_host = 'FTPサーバーアドレス';
$lang->ftp_port = 'FTPポート番号port';
$lang->about_ftp_password = 'パースワードはFTPパス確認のために使い、使用後には保存しません。';
$lang->cmd_check_ftp_connect = 'FTP接続を確認する';
$lang->msg_safe_mode_ftp_needed = 'PHPのsafe_modeがOnの場合、FTP情報を登録することで、Rhymixのインストール及び利用が可能になります。';
$lang->msg_safe_mode_ftp_needed2 = 'モジュールの簡単インストール、または更新が可能になります。';
$lang->msg_safe_mode_ftp_config = 'この情報は<strong>files/config/ftp.config.php</strong> ファイルに保存されます。インストール後カスタマ設定ページでも登録、変更、削除できます。';
$lang->msg_ftp_no_directory = 'FTPに接続しましたが、ディレクトリの情報を読み取ることができません。サーバー設定を確認してください。';
$lang->msg_ftp_mkdir_fail = 'FTPでのディレクトリ作成に失敗しました。FTPサーバーの設定を再度確認してください。';
$lang->msg_ftp_chmod_fail = 'FTPでのディレクトリのアクセス権変更に失敗しました。FTPサーバーの設定を再度確認してください。';

View file

@ -196,7 +196,6 @@ $lang->local_ip_address = '로컬 IP 주소';
$lang->about_admin_ip_allow = '여기에 IP 주소를 나열하면 해당 IP에서만 관리자 로그인이 가능하게 됩니다. 모든 IP에서 로그인을 허용하려면 목록을 비워 두십시오.';
$lang->about_admin_ip_deny = '여기에 나열된 IP 주소에서는 관리자 로그인이 금지됩니다.';
$lang->msg_current_ip_will_be_denied = '주어진 설정에 따르면 현재 로그인하신 관리자의 IP 주소도 차단됩니다. 다시 확인해 주십시오.';
$lang->detail_about_ftp_info = 'safe_mode = on 상태에서 쉬운설치를 사용하려면 FTP 정보를 입력해야 합니다.';
$lang->allow_use_favicon = '파비콘';
$lang->about_use_favicon = '16x16 또는 32x32 크기의 ico 또는 png 파일을 권장합니다.';
$lang->allow_use_mobile_icon = '모바일 홈 화면 아이콘';
@ -246,9 +245,6 @@ $lang->ftp_host = 'FTP 서버 주소';
$lang->ftp_port = 'FTP 포트';
$lang->about_ftp_password = '비밀번호는 FTP 경로 확인을 위한 FTP 접속 시 필요하며 사용 후 저장하지 않습니다.';
$lang->cmd_check_ftp_connect = 'FTP 접속 확인';
$lang->msg_safe_mode_ftp_needed = 'PHP의<strong>safe_mode=On</strong>일 경우 Rhymix의 정상적인 동작을 돕습니다.';
$lang->msg_safe_mode_ftp_needed2 = '모듈의 쉬운 설치 또는 업데이트가 가능해 집니다.';
$lang->msg_safe_mode_ftp_config = '이 정보는<strong>files/config/ftp.config.php</strong> 파일에 저장 됩니다. 설치 후 환경설정 페이지에서도 등록, 변경, 제거 할 수 있습니다.';
$lang->msg_ftp_no_directory = 'FTP 접속에 성공했으나, 디렉토리 정보를 읽어올 수 없습니다. 서버 설정을 확인해주세요.';
$lang->msg_ftp_mkdir_fail = 'FTP를 이용한 디렉토리 생성 명령에 실패했습니다. FTP 서버의 설정을 확인해주세요.';
$lang->msg_ftp_chmod_fail = 'FTP를 이용한 디렉토리의 속성 변경에 실패했습니다. FTP 서버의 설정을 확인해주세요.';

View file

@ -3,7 +3,6 @@ $lang->modify = 'Засах';
$lang->ftp_form_title = 'FTP мэдээлэл оруулах';
$lang->ftp = 'FTP';
$lang->cmd_check_ftp_connect = 'FTP холболт шалгах';
$lang->msg_safe_mode_ftp_needed = 'PHP safe_mode Onбайх тохиолдолд , FTP мэдээллийг заавал оруулснаар Rhymix идэвжvvлэх болон хэрэглэх боломжтой болно.';
$lang->msg_ftp_mkdir_fail = 'FTP-г ашиглан eгсeн eгeгдлийг биелvvлж чадсангvй. FTP серверийн идэвхжvvлэлтээ шалгана уу.';
$lang->msg_ftp_chmod_fail = 'FTP-г ашиглан eeрчлeлтийг хийж чадсангvй. FTP серверийн идэвхжvvлэлтээ шалгана уу.';
$lang->msg_ftp_connect_success = 'FTP холболт болон баталгаажуулалт хийгдлээ.';

View file

@ -96,7 +96,6 @@ $lang->ratio = 'Ratio(Yüzde Ayarı)';
$lang->admin_ip_allow = 'Yönetici sayfasına ulaşabileceğiniz IP aralığını belirleyiniz.';
$lang->local_ip_address = 'Yerel IP adresi';
$lang->about_admin_ip_limit = 'Sadece bu IP adresi üzerinden yönetici sayfasına erişim mümkündür.IP-bant bilgileri /files/config/db.config.php dosyasında saklanır. Satıra birden fazla öğe girin.';
$lang->detail_about_ftp_info = 'Kolay kurulum sağlayan FTP bilgilerini girdiğinizde. FTP bilgi, dosya / config / ftp.config.php dosyasında saklanır. Kolay yükleme sizin için mümkün değilse, PHP\'nin safe_mode ayarını On şeklinde değiştiriniz.';
$lang->allow_use_favicon = 'Favicon\'u kullanmak istiyor musunuz?';
$lang->about_use_favicon = '16 x 16 boyutunda<em>*.Ico</em> dosyalar yüklenebilir.';
$lang->allow_use_mobile_icon = 'Mobil Ana Ekran Simgesini kullanmak istiyor musunuz?';
@ -141,9 +140,6 @@ $lang->ftp_host = 'FTP Sunucu Adı';
$lang->ftp_port = 'FTP Portu';
$lang->about_ftp_password = 'FTP şifresi saklanmayacaktır.';
$lang->cmd_check_ftp_connect = 'FTP Bağlantısını kontrol ediniz';
$lang->msg_safe_mode_ftp_needed = 'Eğer PHP güvenli mod ayarları etkinse, Rhymix\'yi kurmak için FTP hesap bilgilerini girmelisiniz.';
$lang->msg_safe_mode_ftp_needed2 = 'Modülün Kolay kurulumu veya güncelleme özelliği etkindir.';
$lang->msg_safe_mode_ftp_config = 'Bu bilgiler<strong>files/config/ftp.config.php</strong> adlı dosyada saklanır. Kurulumdan sonra, Ayarlar sayfasında, bu na eklenti yapabilir, değiştirebilir ve ya silebilirsiniz';
$lang->msg_ftp_no_directory = 'FTP bağlantısı başarılı oldu ancak dizin bilgileri okunamıyor. Sunucu ayarlarını kontrol edin.';
$lang->msg_ftp_mkdir_fail = 'Dizin oluşturma başarısız oldu. Lütfen FTP hesap iznini kontrol ediniz.';
$lang->msg_ftp_chmod_fail = 'Chmod başarısız oldu. Lütfen FTP sunucusunun yapılandırmasını kontrol ediniz.';

View file

@ -66,7 +66,6 @@ $lang->ftp_host = 'Tên Host FTP';
$lang->ftp_port = 'Cổng kết nối';
$lang->about_ftp_password = 'Mật khẩu của FTP sẽ không lưu lại';
$lang->cmd_check_ftp_connect = 'Kiểm tra kết nối bằng FTP';
$lang->msg_safe_mode_ftp_needed = 'Nếu safe_mode của PHP mở, bạn có thể cài đặt các thành phần bổ xung cho Rhymix một cách tự động qua FTP.';
$lang->msg_ftp_mkdir_fail = 'Lỗi khi tạo thư mục. Xin vui lòng kiểm tra lại quyền truy cập FTP.';
$lang->msg_ftp_chmod_fail = 'CHMOD thất bại. Xin vui lòng kiểm tra lại.';
$lang->msg_ftp_connect_success = 'Đã xác nhận và kết nối thành công tới máy chủ bằng FTP.';

View file

@ -91,7 +91,6 @@ $lang->ratio = '缩放';
$lang->admin_ip_allow = '后台IP绑定';
$lang->local_ip_address = '本地IP地址';
$lang->about_admin_ip_limit = '请注意只有绑定的IP才能访问后台。IP信息将保存在 /files/config/db.config.php. 每行一个IP。';
$lang->detail_about_ftp_info = '当设定FTP信息来启用快捷安装。FTP的信息保存在 /files/config/ftp.config.php. 如果不启用快捷安装请务必将开启PHP安全模式';
$lang->allow_use_favicon = '是否启用自定义favicon?';
$lang->about_use_favicon = '请上传16*16像素的<em>*.ico</em>文件.';
$lang->allow_use_mobile_icon = '是否启用移动版屏幕图标?';
@ -135,9 +134,6 @@ $lang->ftp_host = 'FTP服务器名';
$lang->ftp_port = 'FTP端口';
$lang->about_ftp_password = 'FTP密码不会被保存。';
$lang->cmd_check_ftp_connect = '测试FTP连接';
$lang->msg_safe_mode_ftp_needed = '当PHP的safe_mode=On时请必须输入相关FTP信息否则将无法正常安装或使用Rhymix程序。';
$lang->msg_safe_mode_ftp_needed2 = '可用的安装或更新。';
$lang->msg_safe_mode_ftp_config = '该信息将会保存在<strong>files/config/ftp.config.php</strong>里面。你可以安装后在设置页面里面增加、修改或者删除该信息。';
$lang->msg_ftp_no_directory = 'FTP成功连接主机。但是无法获取目录列表。请检查服务器配置。';
$lang->msg_ftp_mkdir_fail = '新建文件夹失败。请确认 FTP服务器设置。';
$lang->msg_ftp_chmod_fail = '修改文件夹属性失败。请确认 FTP服务器设置。';

View file

@ -66,9 +66,6 @@ $lang->ftp_host = 'FTP 主機名稱';
$lang->ftp_port = 'FTP 埠口';
$lang->about_ftp_password = '不會儲存 FTP 密碼';
$lang->cmd_check_ftp_connect = '檢查 FTP 連線';
$lang->msg_safe_mode_ftp_needed = '當 PHP 的安全模式(safe_mode)開啟時,請輸入相關 FTP 資訊,否則無法正常安裝或使用程式。';
$lang->msg_safe_mode_ftp_needed2 = '可用的安裝或更新。';
$lang->msg_safe_mode_ftp_config = '此資料會儲存在<strong>files/config/ftp.config.php</strong> 檔案中。 安裝後可在設定頁面中新增、更改或刪除此資訊。';
$lang->msg_ftp_mkdir_fail = '新增資料夾失敗。請確認 FTP 主機設置。';
$lang->msg_ftp_chmod_fail = '修改資料夾權限失敗。請確認 FTP 主機設置。';
$lang->msg_ftp_connect_success = 'FTP連線成功。';

View file

@ -6,7 +6,6 @@
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/config_ftp/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<p>{$lang->detail_about_ftp_info}</p>
<form action="./" id="ftp_form" method="post" class="x_form-horizontal" ruleset="installFtpInfo">
<input type="hidden" name="module" value="admin" />
<input type="hidden" name="act" value="procAdminUpdateFTPInfo" />

View file

@ -10,8 +10,6 @@
<action name="procDBConfig" type="controller" />
<action name="procInstall" type="controller" ruleset="install" />
<action name="procInstallLicenseAgreement" type="controller" />
<action name="procInstallFTP" type="controller" />
<action name="procInstallCheckFTP" type="controller" />
<action name="procInstallAdminInstall" type="controller" />
<action name="procInstallAdminUpdate" type="controller" />
<action name="procInstallAdminUpdateIndexModule" type="controller" />

View file

@ -106,10 +106,7 @@ class installAdminController extends install
$ftp_info->ftp_root_path = $ftp_root_path.'/';
}
if(ini_get('safe_mode'))
{
$ftp_info->ftp_password = Context::get('ftp_password');
}
$ftp_info->ftp_password = Context::get('ftp_password');
$buff = '<?php if(!defined("__XE__")) exit();'."\n\$ftp_info = new stdClass;\n";
foreach($ftp_info as $key => $val)

View file

@ -264,102 +264,6 @@ class installController extends install
return new Object();
}
/**
* @brief Set FTP Information
*/
function procInstallFTP()
{
if(Context::isInstalled()) return new Object(-1, 'msg_already_installed');
$ftp_info = Context::gets('ftp_host', 'ftp_user','ftp_password','ftp_port','ftp_root_path');
$ftp_info->ftp_port = (int)$ftp_info->ftp_port;
if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
if(!$ftp_info->ftp_host) $ftp_info->ftp_host = '127.0.0.1';
if(!$ftp_info->ftp_root_path) $ftp_info->ftp_root_path = '/';
$buff = array('<?php if(!defined("__XE__")) exit();');
$buff[] = "\$ftp_info = new stdClass();";
foreach($ftp_info as $key => $val)
{
$buff[] = sprintf("\$ftp_info->%s='%s';", $key, str_replace("'","\\'",$val));
}
// If safe_mode
if(ini_get('safe_mode'))
{
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed');
$oFtp = new ftp();
if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), $ftp_info->ftp_host));
if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_invalid_auth_info');
}
if(!is_dir(_XE_PATH_.'files') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files'))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_mkdir_fail');
}
if(!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files'))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_chmod_fail');
}
if(!is_dir(_XE_PATH_.'files/config') && !$oFtp->ftp_mkdir($ftp_info->ftp_root_path.'files/config'))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_mkdir_fail');
}
if(!$oFtp->ftp_site("CHMOD 777 ".$ftp_info->ftp_root_path.'files/config'))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_chmod_fail');
}
$oFtp->ftp_quit();
}
FileHandler::WriteFile(Context::getFTPConfigFile(), join(PHP_EOL, $buff));
}
function procInstallCheckFtp()
{
$ftp_info = Context::gets('ftp_user','ftp_password','ftp_port','sftp');
$ftp_info->ftp_port = (int)$ftp_info->ftp_port;
if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
if(!$ftp_info->sftp) $ftp_info->sftp = 'N';
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed');
if($ftp_info->sftp == 'Y')
{
$connection = ssh2_connect('localhost', $ftp_info->ftp_port);
if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
{
return new Object(-1,'msg_ftp_invalid_auth_info');
}
}
else
{
$oFtp = new ftp();
if(!$oFtp->ftp_connect('127.0.0.1', $ftp_info->ftp_port)) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'localhost'));
if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
{
$oFtp->ftp_quit();
return new Object(-1,'msg_ftp_invalid_auth_info');
}
$oFtp->ftp_quit();
}
$this->setMessage('msg_ftp_connect_success');
}
/**
* @brief Result returned after checking the installation environment
*/

View file

@ -102,18 +102,6 @@ class installView extends install
Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y');
}
// FTP config is disabled in Rhymix.
/*
if(ini_get('safe_mode') && !Context::isFTPRegisted())
{
Context::set('progressMenu', '3');
Context::set('server_ip_address', $_SERVER['SERVER_ADDR']);
Context::set('server_ftp_user', get_current_user());
$this->setTemplateFile('ftp');
return;
}
*/
$defaultDatabase = 'mysqli';
$disableList = DB::getDisableList();
if(is_array($disableList))
@ -128,8 +116,6 @@ class installView extends install
}
}
Context::set('defaultDatabase', $defaultDatabase);
Context::set('progressMenu', '4');
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type')));
$this->setTemplateFile('db_config');
}

View file

@ -5,8 +5,6 @@ $lang->ftp_host = 'FTP-Server hostname';
$lang->ftp_port = 'FTP Port';
$lang->about_ftp_password = 'Das Passwort des FTPs wird nicht gespeichert.';
$lang->cmd_check_ftp_connect = 'Verbindung des FTPs checken';
$lang->msg_safe_mode_ftp_needed = 'Zur Installation und Nutzung des Rhymixs muss die Angabe des FTPs festgestellt werden, wenn safe_mode in PHP \'An\' ist.';
$lang->msg_safe_mode_ftp_config = 'Die Angabe wird unter <strong>files/config/ftp.config.php</strong> gespeichert. Nach der Installation ist es auch möglich, dass die Angabe von Administrator modifiziert oder gelöscht werden kann.';
$lang->msg_ftp_not_connected = 'Ein Verbindungsfehler des FTPs an localhost ist aufgetreten. Bitte FTP_Port checken, oder ob FTP_Service möglich ist.';
$lang->msg_ftp_invalid_auth_info = 'Anmeldungsfehler mit der Angabe des FTPs Bitte die Angabe des FTPs festlegen.';
$lang->msg_ftp_mkdir_fail = 'Der Befehl von Herstellung des Verzeichnisses durch FTP ist gescheitert. FTP_Server festlegen.';

View file

@ -103,9 +103,6 @@ $lang->ftp_host = 'FTP hostname';
$lang->ftp_port = 'FTP server port';
$lang->about_ftp_password = 'FTP password will not be stored.';
$lang->cmd_check_ftp_connect = 'Check FTP Connection';
$lang->msg_safe_mode_ftp_needed = 'When safe_mode setting of PHP is On, you should enter FTP account information to install Rhymix.';
$lang->msg_safe_mode_ftp_needed2 = 'Easy installation or update of module is enabled.';
$lang->msg_safe_mode_ftp_config = 'This information is stored in <strong>files/config/ftp.config.php</strong>. You can add, change or delete this on the Settings page after the installation.';
$lang->msg_ftp_not_connected = 'Connection to the localhost via FTP failed. Please check the port number and whether the FTP service is available.';
$lang->msg_ftp_invalid_auth_info = 'Authentication failed. Please check the username and password.';
$lang->msg_ftp_mkdir_fail = 'Failed to create a directory using FTP. Please check the permission of FTP account.';

View file

@ -62,7 +62,6 @@ $lang->msg_install_failed = 'Ha ocurrido un error al crear el archivo de instala
$lang->ftp_form_title = 'Datos de conexión para FTP';
$lang->ftp = 'FTP';
$lang->cmd_check_ftp_connect = 'conexión de FTP confirmada';
$lang->msg_safe_mode_ftp_needed = 'Si la la variable safe_mode está activa[safe_mode=On], debe rellenar los datos de FTP para seguir instalando y usar con normalidad el Rhymix.';
$lang->msg_ftp_not_connected = 'Ha ocurrico un error de conexión al FTP del localhost. Verifique el puerto del FTP y/o el funcionamiento del servicio FTP.';
$lang->msg_ftp_invalid_auth_info = 'Los datos de login para el FTP no son correctos. Veriféquelos.';
$lang->msg_ftp_mkdir_fail = 'Ha fallado el comando de FTP para la creación de directorio. Verifique la configuración del servicio FTP en el servidor';

View file

@ -97,8 +97,6 @@ $lang->ftp_host = 'FTPサーバーアドレス';
$lang->ftp_port = 'FTPサーバーポート';
$lang->about_ftp_password = 'FTP情報は保存できません。';
$lang->cmd_check_ftp_connect = 'FTP接続を確認する';
$lang->msg_safe_mode_ftp_needed = 'PHPのsafe_modeがOnの場合、FTP情報を登録することで、Rhymixのインストール及び利用が可能になります。';
$lang->msg_safe_mode_ftp_needed2 = 'モジュールのイージーインストール、または更新が可能になります。';
$lang->msg_ftp_not_connected = 'localhostへのFTP接続エラーが発生しました。FTPポート(port)番号をはじめ、FTPサービスが可能であるかを確認してください。';
$lang->msg_ftp_invalid_auth_info = 'ログインに失敗しました。FTPアクセス情報を再度確認してください。';
$lang->msg_ftp_mkdir_fail = 'FTPでのディレクトリ生成に失敗しました。FTPサーバーの設定を再度確認してください。';

View file

@ -103,9 +103,6 @@ $lang->ftp_host = 'FTP 서버 주소';
$lang->ftp_port = 'FTP 서버 포트';
$lang->about_ftp_password = '비밀번호는 FTP 경로 확인을 위한 FTP 접속 시 필요하며 사용 후 저장하지 않습니다.';
$lang->cmd_check_ftp_connect = 'FTP 접속 확인';
$lang->msg_safe_mode_ftp_needed = 'PHP의 <strong>safe_mode=On</strong>일 경우 Rhymix의 정상적인 동작을 돕습니다.';
$lang->msg_safe_mode_ftp_needed2 = '모듈의 쉬운 설치 또는 업데이트가 가능해 집니다.';
$lang->msg_safe_mode_ftp_config = '이 정보는 <strong>files/config/ftp.config.php</strong> 파일에 저장 됩니다. 설치 후 환경설정 페이지에서도 등록, 변경, 제거 할 수 있습니다.';
$lang->msg_ftp_not_connected = 'localhost로의 FTP 접속 오류가 발생했습니다. FTP 포트 번호를 확인하거나 FTP 서비스가 가능한지 확인해주세요.';
$lang->msg_ftp_invalid_auth_info = '입력한 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요.';
$lang->msg_ftp_mkdir_fail = 'FTP를 이용한 디렉토리 생성 명령에 실패했습니다. FTP 서버의 설정을 확인해주세요.';

View file

@ -2,7 +2,6 @@
$lang->ftp_form_title = 'FTP мэдээлэл оруулах';
$lang->ftp = 'FTP';
$lang->cmd_check_ftp_connect = 'FTP холболт шалгах';
$lang->msg_safe_mode_ftp_needed = 'PHP의 safe_mode가 Onбайх тохиолдолд , FTP мэдээллийг заавал оруулснаар Rhymix идэвжvvлэх болон хэрэглэх боломжтой болно.';
$lang->msg_ftp_not_connected = 'localhost-ын FTP холболт амжилтгvй боллоо. FTP дугаараа шалгах буюу эсвэл FTP vйлчилгээг ашиглах боломжтой эсэхээ шалгана уу.';
$lang->msg_ftp_invalid_auth_info = 'Таны оруулсан FTP мэдээллээр нэвтэрч чадсангvй. FTPмэдээллээ шалгана уу.';
$lang->msg_ftp_mkdir_fail = 'FTP-г ашиглан eгсeн eгeгдлийг биелvvлж чадсангvй. FTP серверийн идэвхжvvлэлтээ шалгана уу.';

View file

@ -66,7 +66,6 @@ $lang->ftp_host = 'FTP sistem adı';
$lang->ftp_port = 'FTP portu';
$lang->about_ftp_password = 'FTP şifresi saklanmayacaktır.';
$lang->cmd_check_ftp_connect = 'FTP Bağlantısını kontrol ediniz';
$lang->msg_safe_mode_ftp_needed = 'Eğer PHP güvenli mod ayarları etkinse, Rhymix\'yi kurmak için FTP hesap bilgilerini girmelisiniz.';
$lang->msg_ftp_not_connected = 'Yerel web alanına FTP bağlantısı sağlanamadı. Lütfen port numarasını ve FTP servisinin mevcut olup-olmadığını kontrol ediniz .';
$lang->msg_ftp_invalid_auth_info = 'Kimlik doğrulama başarısız oldu. Lütfen kullanıcı adını ve şifreyi kontrol ediniz.';
$lang->msg_ftp_mkdir_fail = 'Dizin oluşturma başarısız oldu. Lütfen FTP hesap iznini kontrol ediniz.';

View file

@ -61,7 +61,6 @@ $lang->ftp_host = 'Tên Host FTP';
$lang->ftp_port = 'Cổng kết nối';
$lang->about_ftp_password = 'Mật khẩu của FTP sẽ không lưu lại';
$lang->cmd_check_ftp_connect = 'Kiểm tra kết nối bằng FTP';
$lang->msg_safe_mode_ftp_needed = 'Nếu safe_mode của PHP mở, bạn có thể cài đặt các thành phần bổ xung cho Rhymix một cách tự động qua FTP.';
$lang->msg_ftp_not_connected = 'Kết nối bằng FTP không thành công. Xin vui lòng kiểm tra lại thông tin tài khoản và cổng kết nối!';
$lang->msg_ftp_invalid_auth_info = 'Xác nhận thất bại. Xin vui lòng kiểm tra lại tên sử dụng và mật khẩu.';
$lang->msg_ftp_mkdir_fail = 'Lỗi khi tạo thư mục. Xin vui lòng kiểm tra lại quyền truy cập FTP.';

View file

@ -77,7 +77,6 @@ $lang->ftp_host = 'FTP服务器名';
$lang->ftp_port = 'FTP端口';
$lang->about_ftp_password = 'FTP密码不会被保存。';
$lang->cmd_check_ftp_connect = '测试FTP连接';
$lang->msg_safe_mode_ftp_needed = '当PHP的safe_mode=On时请必须输入相关FTP信息否则将无法正常安装或使用Rhymix程序。';
$lang->msg_ftp_not_connected = '发生本地(localhost)FTP连接错误。请确认ftp端口号及支持ftp服务与否。';
$lang->msg_ftp_invalid_auth_info = 'FTP登录失败。请确认输入的FTP信息。';
$lang->msg_ftp_mkdir_fail = '新建文件夹失败。请确认 FTP服务器设置。';

View file

@ -76,9 +76,6 @@ $lang->ftp_host = 'FTP 主機名稱';
$lang->ftp_port = 'FTP 埠口';
$lang->about_ftp_password = '不會儲存 FTP 密碼';
$lang->cmd_check_ftp_connect = '檢查 FTP 連線';
$lang->msg_safe_mode_ftp_needed = '當 PHP 的安全模式(safe_mode)開啟時,請輸入相關 FTP 資訊,否則無法正常安裝或使用程式。';
$lang->msg_safe_mode_ftp_needed2 = '可用的安裝或更新。';
$lang->msg_safe_mode_ftp_config = '此資料會儲存在 <strong>files/config/ftp.config.php</strong> 檔案中。 安裝後可在設定頁面中新增、更改或刪除此資訊。';
$lang->msg_ftp_not_connected = '本地(localhost) FTP連線錯誤。請檢查 FTP 埠口並確認是否支援 FTP 功能。';
$lang->msg_ftp_invalid_auth_info = 'FTP登入失敗。請確認輸入的 FTP 資訊。';
$lang->msg_ftp_mkdir_fail = '新增資料夾失敗。請確認 FTP 主機設置。';

View file

@ -42,11 +42,6 @@
<ul id="ftplist"></ul>
<p class="install_help">{$lang->install_ftp_reason}</p>
<ul>
<li>{$lang->msg_safe_mode_ftp_needed}</li>
<li>{$lang->msg_safe_mode_ftp_needed2}</li>
</ul>
<p class="install_help">{$lang->msg_safe_mode_ftp_config}</p>
</div>
<div id="buttons">
<div class="align-left">

View file

@ -2,8 +2,7 @@
<ul>
<li class="active"|cond="($act==''||$act=='dispInstallLicenseAgreement')">{$lang->install_progress_menu['license_agreement']}</li>
<li class="active"|cond="$act=='dispInstallCheckEnv'">{$lang->install_progress_menu['condition']}</li>
<li cond="ini_get('safe_mode')" class="active"|cond="false && $act=='dispInstallSelectDB' && $progressMenu == '3'">{$lang->install_progress_menu['ftp']}</li>
<li class="active"|cond="$act=='dispInstallDBConfig' && $progressMenu == '4'">{$lang->install_progress_menu['dbInfo']}</li>
<li class="active"|cond="$act=='dispInstallDBConfig'">{$lang->install_progress_menu['dbInfo']}</li>
<li class="active"|cond="$act=='dispInstallAdminConfig'">{$lang->install_progress_menu['adminInfo']}</li>
</ul>
</div>

View file

@ -277,7 +277,7 @@ class StorageTest extends \Codeception\TestCase\Test
$this->assertTrue(Rhymix\Framework\Storage::copyDirectory($sourcedir, $targetdir));
$this->assertTrue(file_exists($targetdir . '/bar'));
$this->assertTrue(file_exists($targetdir . '/subdir/baz'));
$this->assertFalse(Rhymix\Framework\Storage::copyDirectory($sourcedir, '/opt/nonexistent.foobar'));
$this->assertFalse(@Rhymix\Framework\Storage::copyDirectory($sourcedir, '/opt/nonexistent.foobar'));
}
public function testMoveDirectory()