$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()); } else { $form->input('hidden', 'ftp_new_public', '', '', '0'); } echo $form->render(); echo $layout->end('column'); echo $layout->column('50%'); $form->title(txt('ftp_authentication'), '', ICONS . 'system_info/key_icon.png'); $form->condition('not_null', true, txt('form_empty_field') . 'Host'); $form->input('text', 'ftp_new_host', 'Host/IP', txt('dsc_ftp_host'), $ftp->get_host());
$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->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 . 'accounts/small_users.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()); echo $form->render(); echo $layout->end('column'); echo $layout->column('50%'); $form->title(txt('ftp_authentication'), '', ICONS . 'small_options.png'); $form->condition('not_null', true, txt('form_empty_field') . 'Host'); $form->input('text', 'ftp_new_host', 'Host/IP', txt('dsc_ftp_host'), $ftp->get_host()); $form->condition('not_null', true, txt('form_empty_field') . 'Login'); $form->input('text', 'ftp_new_login', 'Login', txt('dsc_ftp_login'), $ftp->get_login()); $form->condition('not_null', true, txt('form_empty_field') . txt('password')); $form->input('password', 'ftp_new_pass', txt('password'), txt('dsc_ftp_pass'), $ftp->get_password()); $form->input('text', 'ftp_new_port', 'Port', txt('dsc_ftp_port'), $ftp->get_port()); $form->status();
} 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();
} 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 . 'server/ftp.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(); if (is_root() || $f->is_my($ftp_ids[$i]['id'])) { $item = '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'edit_account', 'ftp_id' => $f->get_id())) . '">' . $f->get_title() . '</a>'; } else { $item = $f->get_title(); } echo $layout->row(array('<img src="' . ICONS . 'server/ftp.png" style="height:20px"/>', $item, $f->get_host()), $f->get_desc()); } echo $layout->tbl_end(); } else { echo $layout->empty_list(); } echo $layout->end('column'); echo $layout->clr();