Beispiel #1
0
 public function updateViaFtp($content, $settings)
 {
     $this->saveBackup();
     $tmp_file = fn_create_temp_file();
     fn_put_contents($tmp_file, $content);
     $ftp_copy_result = fn_copy_by_ftp($tmp_file, $this->path, $settings);
     fn_rm($tmp_file);
     $status = $ftp_copy_result === true;
     return array($status, $ftp_copy_result);
 }
Beispiel #2
0
                     Tygh::$app['ajax']->assign('force_redirection', fn_url('themes.manage'));
                     exit;
                 }
             }
         }
     }
     if (defined('AJAX_REQUEST')) {
         Tygh::$app['view']->display('views/themes/components/upload_theme.tpl');
         exit;
     }
 } elseif ($mode == 'recheck') {
     $source = fn_get_cache_path(false) . 'tmp/theme_pack/';
     $destination = Registry::get('config.dir.themes_repository');
     if ($action == 'ftp_upload') {
         $ftp_access = array('hostname' => $_REQUEST['ftp_access']['ftp_hostname'], 'username' => $_REQUEST['ftp_access']['ftp_username'], 'password' => $_REQUEST['ftp_access']['ftp_password'], 'directory' => $_REQUEST['ftp_access']['ftp_directory']);
         $ftp_copy_result = fn_copy_by_ftp($source, $destination, $ftp_access);
         if ($ftp_copy_result !== true) {
             fn_set_notification('E', __('error'), $ftp_copy_result);
         }
         if (defined('AJAX_REQUEST')) {
             Tygh::$app['ajax']->assign('force_redirection', fn_url('themes.manage'));
             exit;
         } else {
             return array(CONTROLLER_STATUS_OK, 'themes.manage');
         }
     }
     $non_writable_folders = fn_check_copy_ability($source, $destination);
     if (!empty($non_writable_folders)) {
         if (!empty($_REQUEST['ftp_access'])) {
             Tygh::$app['view']->assign('ftp_access', $_REQUEST['ftp_access']);
         }