GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
// if section access
$new_id = helper_result('update_ftp_id');
$ftp_id = $my_app->get_param('ftp_id');
if (!empty($ftp_id)) {
    $ftp = new phpos_ftp();
    if ($ftp->is_my_ftp($ftp_id) || is_root() || is_admin() && $ftp->is_my_ftp($ftp_id)) {
        $ftp->set_id($ftp_id);
        $ftp->get_ftp();
        echo $layout->title(txt('edit_ftp'), 'icon.png');
        echo $layout->txtdesc(txt('dsc_ftp_title'));
        echo helper_result('update_ftp');
        $form = new phpos_forms();
        echo $form->form_start('update_ftp', helper_ajax('section.edit_account.php'), array('app_params' => ''));
        $form->reload_after_submit(array('nowy'));
        $form->input('hidden', 'action', '', '', 'update_ftp');
        echo $layout->column('50%');
        $form->title($ftp->get_title(), null, ICONS . 'edit.png');
        $form->condition('not_null', true, txt('form_empty_field') . txt('title'));
        $form->input('text', 'ftp_new_title', txt('title'), txt('dsc_ftp_name'), $ftp->get_title());
        $form->input('text', 'ftp_new_desc', txt('desc'), txt('dsc_ftp_desc'), $ftp->get_desc());
        if (is_root() || is_admin()) {
            $items = array('0' => txt('no'), '1' => txt('yes'));
            $form->radio('ftp_new_public', txt('ftp_form_public'), txt('ftp_form_public_desc'), $items, $ftp->get_is_public());
示例#2
0
}
echo $layout->column('33%');
echo $layout->subtitle(txt('ftp_public'));
if (is_root() || is_admin()) {
    echo $layout->txtdesc(txt('dsc_ftp_list_public'));
} else {
    echo $layout->txtdesc(txt('dsc_ftp_list_public_user'));
}
$ftp = new phpos_ftp();
$ftp_ids = $ftp->get_public_ftp();
$c = count($ftp_ids);
if ($c != 0) {
    echo $layout->tbl_start();
    $layout->td_classes(array('', '', 'tbl_grey'));
    echo $layout->head(array('<img src="' . ICONS . 'accounts/small_users.png" />' => '20%', txt('ftp_account') => '40%', 'Host' => '40%'));
    for ($i = 0; $i < $c; $i++) {
        $f = new phpos_ftp();
        $f->set_id($ftp_ids[$i]['id']);
        $f->get_ftp();
        //$usr_count = $f->count_users();
        $u = new phpos_users();
        $u->set_id_user($group_ids[$i]['id_owner']);
        $u->get_user_by_id();
        echo $layout->row(array('<img src="' . ICONS . 'accounts/small_users.png"  style="height:20px"/>', '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'edit_account', 'ftp_id' => $f->get_id())) . '">' . $f->get_title() . '</a>', $f->get_host()), $f->get_desc());
    }
    echo $layout->tbl_end();
} else {
    echo $layout->txtdesc(txt('dsc_ftp_list_empty'));
}
echo $layout->end('column');
echo $layout->clr();
示例#3
0
    public function render_address_links()
    {
        $links = $this->get_address_links();
        $c = count($links);
        $separator = '<img class="arrow" 
		src="' . THEME_URL . 'icons/arrow_small_right.png">';
        global $my_app;
        $tmp_shared_id = $my_app->get_param('tmp_shared_id');
        if (!empty($tmp_shared_id)) {
            $shared = new phpos_shared();
            $shared->set_id($tmp_shared_id);
            $shared->get_shared();
            $shared_dir = $shared->get_folder_id();
        }
        $in_shared = $my_app->get_param('in_shared');
        /*.............................................. */
        // If not in shared:
        if (!$in_shared) {
            if ($c != 0) {
                for ($i = 0; $i < $c; $i++) {
                    $item = $this->filesystem->get_file_info($links[$i]);
                    if ($item['id'] != $shared_dir) {
                        if (is_root()) {
                            $item = $this->root_homedir_address_parse($item);
                        }
                        $address .= '<a 
						onclick="' . helper_reload(array('dir_id' => $item['id'])) . '" 
						href="javascript:void(0);">' . $item['basename'] . '</a>' . $separator;
                    }
                }
            }
        }
        $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
		href="javascript:void(0);"><b>' . $this->filesystem->protocol_name . '</b></a>';
        /*.............................................. */
        if (APP_ACTION == 'my_server') {
            $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
			href="javascript:void(0);"><b>' . txt('my_server') . '</b></a>';
        }
        /*.............................................. */
        if (APP_ACTION == 'cp') {
            $address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '" 
			href="javascript:void(0);"><b>' . txt('control_panel') . '</b></a>';
        }
        /*.............................................. */
        if (APP_ACTION == 'shared') {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            if (!empty($group_id)) {
                $group->set_id($group_id);
                $group->get_group();
                $group_user = new phpos_users();
                $id_user = $my_app->get_param('workgroup_user_id');
                $group_user->set_id_user($id_user);
                $group_user->get_user_by_id();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
            } else {
                $id_user = logged_id();
                $group_user = new phpos_users();
                $group_user->set_id_user($id_user);
                $group_user->get_user_by_id();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
            }
        }
        /*.............................................. */
        if (APP_ACTION == 'workgroup') {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            if (!empty($group_id)) {
                $group->set_id($group_id);
                $group->get_group();
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>';
            } else {
                $address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>Workgroups</b></a>';
            }
        }
        $in_shared = $my_app->get_param('in_shared');
        $tmp_shared_id = $my_app->get_param('tmp_shared_id');
        /*.............................................. */
        if (APP_ACTION == 'index' && (defined('SHARED') || $in_shared)) {
            $group = new phpos_groups();
            $group_id = $my_app->get_param('workgroup_id');
            $group->set_id($group_id);
            $group->get_group();
            $shared_id = $my_app->get_param('tmp_shared_id');
            $shared = new phpos_shared();
            $shared->set_id($shared_id);
            $shared->get_shared();
            $group_user = new phpos_users();
            $id_user = $shared->get_id_user();
            $group_user->set_id_user($id_user);
            $group_user->get_user_by_id();
            $address_start = '<a 
			onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'index\', \'shared_id:' . $shared_id . ',in_shared:1,fs:local_files\')" href="javascript:void(0);"><b>' . $shared->get_title() . '</b></a>';
        }
        /*.............................................. */
        //if(APP_ACTION != 'index') $address = '';
        $address_bar = $address_start . $separator . $address;
        $ftp_id = $my_app->get_param('ftp_id');
        if (!empty($ftp_id)) {
            $ftp = new phpos_ftp();
            $ftp->set_id($ftp_id);
            $ftp->get_ftp();
            $address_bar = '<a 
			onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'index\', \'dir_id:.,ftp_id:' . $ftp_id . ',in_shared:1,fs:ftp\')"  href="javascript:void(0);"><b>' . $ftp->get_login() . '@' . $ftp->get_host() . '</b></a>' . $separator;
        }
        return $address_bar;
    }
/*.............................................. */
if ($context_fs == 'ftp') {
    $ftp_res = $phposFS->get_status() . '<br />';
    if (strstr($ftp_res, 'Resource')) {
        $ftp_connect_status = '<div class="server_conn_ok">' . txt('ftp_connected') . '</div>';
        $ftp_connected = true;
    } else {
        $ftp_connect_status = '<div class="server_conn_error">' . txt('ftp_not_connected') . '</div>';
    }
}
/*.............................................. */
// FS headers
if (APP_ACTION == 'index' && $context_fs == 'ftp' && $ftp_connected) {
    $ftp_info = new phpos_ftp();
    $ftp_info->set_id($my_app->get_param('ftp_id'));
    $ftp_info->get_ftp();
    $title = '<span style="color:black">FTP:</span> ' . $ftp_info->get_host();
    $html['icons'] .= $layout->subtitle($title, ICONS . 'server/ftp.png');
}
if (APP_ACTION == 'index' && $context_fs == 'clouds_google_drive') {
    $html['icons'] .= $layout->txtdesc('ggggggodle');
}
/*.............................................. */
$icons = $phposFS->get_files_list();
$hidden_icons = array('_Desktop', '_Documents', '_Log', '_Icons', '_Pictures', '_Shared', '_Temp', '_Userdata', '_Video', '_Wallpapers', 'index.php', 'index.htm', 'index.html', 'index.php5');
/*
**************************
*/
if ($context_fs != 'clouds_google_drive') {
    $c = count($icons);
    $plugin = new phpos_plugins();