Esempio n. 1
0
*/
if (!defined('PHPOS')) {
    die;
}
if (APP_ACTION == 'shared') {
    $html['right_items_img'] = 'shared1.png';
    $shared_id = $my_app->get_param('shared_id');
    $workgroup_id = $my_app->get_param('workgroup_id');
    $address_icon = ICONS . 'server/shared1.png';
    if (!empty($workgroup_id)) {
        $group = new phpos_groups();
        $group->set_id($workgroup_id);
        $group->get_group();
        if ($group->im_in_group()) {
            $group_name = $group->get_title();
            $shared = new phpos_shared();
            $shared_id_user = $my_app->get_param('workgroup_user_id');
            $shared->set_id_user($shared_id_user);
            $records = $shared->get_user_shared();
            $group_user = new phpos_users();
            $group_user->set_id_user($shared_id_user);
            $group_user->get_user_by_id();
            $title = '<img src="' . ICONS . 'server/workgroup.png' . '" style="width:30px; display:inline-block; vertical-align:middle" /> <span style="color:black">' . txt('workgroup') . ':</span> ' . $group_name;
            $html['icons'] .= $layout->area_start($title);
            $html['icons'] .= $layout->txtdesc(txt('st_shared'));
            $html['icons'] .= $layout->subtitle($group_user->get_user_login(), ICONS . 'user.png');
            foreach ($records as $row) {
                $tmp_usr = new phpos_users();
                $user_info = $tmp_usr->get_user_by_id($row['id_user']);
                $action_open = link_action('index', 'reset_shared:0,shared_id:' . $row['id'] . ',in_shared:1,fs:local_files');
                $contextMenu_shared_folders = array('open::' . txt('open') . '::' . $action_open . '::folder_open');
Esempio n. 2
0
<?php

/*
**********************************

	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (form_submit('share_folder')) {
    $shared = new phpos_shared();
    if (globalconfig('demo_mode') != 1 || is_root()) {
        $shared->share_folder($_POST['new_folder_name'], $_POST['new_folder_desc'], 'local_files', $shared_id, $_POST['new_folder_readonly']);
    }
    msg::ok(txt('shared'));
}
Esempio n. 3
0
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.09
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (!defined('PHPOS_EXPLORER_PLUGIN')) {
    die;
}
$items = null;
$shared = new phpos_shared();
$records = $shared->get_my_shared();
if (count($records) != 0) {
    foreach ($records as $row) {
        $items .= '<li data-options="iconCls:\'icon-sharedfolder\'"><span><a title="' . $row['title'] . ' ' . $row['desc'] . '"  href="javascript:void(0);" onclick="' . link_action('index', 'workgroup_id:0,reset_shared:0,in_shared:1,shared_id:' . $row['id'] . ',user_id:' . $root_id . ',fs:local_files') . '"><span style="color: black">' . $row['title'] . '</span></a></span>	</li>';
    }
} else {
    $items .= '<li data-options="iconCls:\'icon-blank\'"><span>' . txt('shared_no_folders') . '</span></li>';
}
$html['left_tree'] .= '<br/><br/>
<ul id="tt3" class="easyui-tree">
	<li data-options="iconCls:\'icon-sharedfolder\'">
        <span><a title="' . txt('shared_folders') . '" href="javascript:void(0);" onclick="' . link_action('shared', 'shared_id:0,tmp_shared_id:0,in_shared:1,reset_shared:0,workgroup_id:0,fs:local_files') . '"><span style="color: black;"><b>' . txt('shared_folders') . '</b></span></a></span>
				<ul>
				' . $items . '
				</ul>
Esempio n. 4
0
	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
global $readonly, $my_app, $context_fs, $tmp_shared_id;
$app_menu = array('title:' . txt('new_folder') . ',action:actionNewFolder,icon:icon-folder_files', 'title:' . txt('my_server') . ',action:actionGoServer,icon:icon-myserver', 'title:' . txt('control_panel') . ',action:actionGoCP,icon:icon-login');
if (!empty($tmp_shared_id)) {
    $shared = new phpos_shared();
    if ($shared->is_my($tmp_shared_id)) {
        $app_menu[] = 'title:' . txt('stop_share_folder') . ',action:actionStopShare,icon:icon-cancel';
    }
}
if (!$readonly && $context_fs != 'db_mysql') {
    $app_menu[] = 'title:' . txt('upload') . ',action:actionUpload,icon:icon-download';
}
$app_menu[] = 'title:' . txt('icon_size') . ',action:actionChangeIcons,icon:icon-application';
$app_menu[] = array('title:' . txt('icon_size_s') . ',icon_size:small,check:icon_size,if:' . $my_app->get_param('icon_size') . ',action:actionChangeIcons', 'title:' . txt('icon_size_m') . ',icon_size:medium,check:icon_size,if:' . $my_app->get_param('icon_size') . ',action:actionChangeIcons');
if ($context_fs == 'ftp') {
    $check_ftp = new phpos_ftp();
    if (is_root() || $check_ftp->is_my($my_app->get_param('ftp_id'))) {
        $app_menu[] = 'title:' . txt('dsc_ftp_a_edit') . ',action:actionEditFtp,icon:icon-edit';
    }
}
Esempio n. 5
0
    public function render_nav_bar()
    {
        global $my_app;
        $dir_id = $this->my_app->get_param('dir_id');
        $nav = new phpos_navigation();
        if (!$my_app->get_param('minus_index')) {
            $nav->next_index();
            $nav->add_item();
            $_SESSION['phpos_navigation_stopindex'][WIN_ID] = true;
        } else {
            $nav->set_index($my_app->get_param('set_index'));
            $nav->add_item();
            $my_app->set_param('minus_index', null);
            $my_app->set_param('set_index', null);
            cache_param('minus_index');
            cache_param('set_index');
        }
        //$nav->debug();
        //link_action($action, $params = null)
        //$navBar.='<img src="'.PHPOS_WEBROOT_URL.'_phpos/themes/default/windows/explorer_header_nav_back_transparent.png">';
        /*.............................................. */
        if ($nav->is_prev_index()) {
            global $my_app;
            $index = $nav->get_index();
            $link_index = $index - 1;
            $go_to_index = $nav->get_prev_index();
            $action = 'phpos.windowActionChange(\'' . WIN_ID . '\', \'' . $nav->get_action($go_to_index) . '\', \'' . $nav->parse_params($go_to_index) . ',minus_index:1,set_index:' . $link_index . '\');';
            $navBar .= '<a 
			class="easyui-tooltip" 
			title="' . txt('tip_nav_go_to') . ': ' . $link_index . '" 
			href="javascript:void(0);" 
			onclick="' . $action . '"><img 
			class="nav_back" 
			src="' . THEME_URL . 'windows/explorer_header_nav_back.png"></a>';
        } else {
            $navBar .= '<img 
			src="' . THEME_URL . 'windows/explorer_header_nav_back_transparent.png">';
        }
        /*.............................................. */
        if ($nav->is_next_index()) {
            global $my_app;
            $index = $nav->get_index();
            $link_index = $index + 1;
            $go_to_index = $nav->get_next_index();
            $action = 'phpos.windowActionChange(\'' . WIN_ID . '\', \'' . $nav->get_action($go_to_index) . '\', \'' . $nav->parse_params($go_to_index) . ',minus_index:0,set_index:' . $link_index . '\');';
            $navBar .= '<a 
			class="easyui-tooltip" 
			title="' . txt('tip_nav_go_to') . ': ' . $link_index . '" 
			href="javascript:void(0);" 
			onclick="' . $action . '"><img 
			class="nav_next" 
			src="' . THEME_URL . 'windows/explorer_header_nav_next.png"></a>';
        } else {
            $navBar .= '<img src="' . THEME_URL . 'windows/explorer_header_nav_next_transparent.png">';
        }
        /*.............................................. */
        if ($this->filesystem->have_parent($dir_id)) {
            $parent_dir = $this->filesystem->get_parent_dir($dir_id);
            $in_shared = $this->my_app->get_param('in_shared');
            if (!$in_shared) {
                // not shared
                $navBar .= '<a 
				class="easyui-tooltip" 
				title="' . txt('tip_nav_go_to') . ': ' . $parent_dir . '" 
				href="javascript:void(0);" 
				onclick="' . helper_reload(array('dir_id' => $parent_dir, 'dir_navigation_index' => $navigation['next']['index_id'])) . '"><img class="nav_top"  
				src="' . THEME_URL . 'windows/explorer_header_nav_top.png"></a>';
                /*.............................................. */
            } else {
                // shared, if(not) parent shared
                $shared = new phpos_shared();
                $check_dir_id = $dir_id;
                if (substr($check_dir_id, -1) == '/') {
                    $check_dir_id = substr($check_dir_id, 0, -1);
                }
                $check = $shared->find_shared($check_dir_id);
                /*.............................................. */
                if ($check == 0) {
                    // can up, parent is not outside shared
                    $navBar .= '<a 
					class="easyui-tooltip" 
					title="' . txt('tip_nav_go_to') . ': ' . $parent_dir . '" 
					href="javascript:void(0);" 
					onclick="' . helper_reload(array('dir_id' => $parent_dir, 'dir_navigation_index' => $navigation['next']['index_id'])) . '"><img 
					class="nav_top" 
					src="' . THEME_URL . 'windows/explorer_header_nav_top.png" /></a>';
                } else {
                    $navBar .= '<img 
					class="nav_top_inactive" 
					src="' . THEME_URL . 'windows/explorer_header_nav_top_transparent.png /">';
                }
            }
        } else {
            $navBar .= '<img class="nav_top_inactive" src="' . THEME_URL . 'windows/explorer_header_nav_top_transparent.png">';
        }
        return $navBar;
    }
 if ($context_fs == 'db_mysql' && !$phposFS->is_directory($icons[$i])) {
     $plugged_context_menu[] = '---';
     $plugged_context_menu[] = $explorer->generate_to_start_context($my_app->get_param('fs'), $icons[$i]['plugin_id'], $icons[$i]['app_id'], $icons[$i]['id']);
     $plugged_context_menu[] = $explorer->generate_to_edit_context($my_app->get_param('fs'), $icons[$i]['plugin_id'], $icons[$i]['app_id'], $icons[$i]['id']);
 }
 /*.............................................. */
 // delete
 if ($icons[$i]['no_delete'] != 1 && (!$readonly || is_root())) {
     $plugged_context_menu[] = '---';
     $plugged_context_menu[] = 'del::' . txt('delete') . '::explorer_delete_file("' . WIN_ID . '", "' . $icons[$i]['id'] . '", "' . $icons[$i]['basename'] . '");::delete';
 }
 /*.............................................. */
 $icons[$i]['is_shared'] = false;
 // share
 if ($context_fs == 'local_files' && $phposFS->is_directory($icons[$i])) {
     $shared = new phpos_shared();
     if (!defined('SHARED')) {
         $plugged_context_menu[] = '---';
         if (!$shared->is_folder_shared($icons[$i]['id'])) {
             $plugged_context_menu[] = 'share::' . txt('share_folder') . '::' . winmodal(txt('share_folder'), 'app', 'app_id:shortcuts@share,width:300,height:350', 'desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',shared_id:' . base64_encode($icons[$i]['id']) . ',after_reload:' . WIN_ID) . '::ftpfolder';
         } else {
             $icons[$i]['is_shared'] = true;
             $plugged_context_menu[] = 'share::' . txt('stop_share_folder') . '::' . winmodal(txt('share_folder'), 'app', 'app_id:shortcuts@share,width:300,height:350', 'stop_share:1,desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',shared_id:' . base64_encode($icons[$i]['id']) . ',after_reload:' . WIN_ID) . '::ftpfolder';
         }
     }
 }
 /*.............................................. */
 // file properties
 if ((APP_ACTION == 'index' || APP_ACTION == 'desktop') && $context_fs == 'ftp' || $context_fs == 'local_files') {
     $plugged_context_menu[] = '---';
     $plugged_context_menu[] = 'properties::' . txt('fileinfo_context') . '::' . winmodal(txt('file_info'), 'app', 'app_id:shortcuts@file_info', 'location:' . $context_location . ',fs:' . $context_fs . ',edit_id:' . base64_encode($icons[$i]['id']) . ',dir_name:' . base64_encode(dirname($icons[$i]['id'])) . ',file_name:' . base64_encode($icons[$i]['basename']) . ',file_modified:' . base64_encode($icons[$i]['modified_at']) . ',file_type:' . base64_encode($icons[$i]['extension']) . ',file_chmod:' . base64_encode($icons[$i]['chmod']) . ',file_created:' . base64_encode($icons[$i]['created_at']) . ',after_reload:' . WIN_ID) . '::edit';
Esempio n. 7
0
<?php

/*
**********************************

	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
$shared_id = $my_app->get_param('shared_id');
if ($stop_share == 1) {
    $shared = new phpos_shared();
    if (globalconfig('demo_mode') != 1 || is_root()) {
        $shared->unshare_folder($shared_id);
    }
    msg::ok(txt('msg_stop_shared'));
    $my_app->jquery_onready(winclose(WIN_ID) . "  \$('#" . $my_app->get_param('after_reload') . "').panel('refresh'); ");
}
        cache_param('shared_id');
        jquery_onready(link_action('my_server', ''));
        msg::error(txt('access_denied'));
    }
    $my_app->set_param('shared_id', null);
    /*.............................................. */
} else {
    //$my_app->set_param('root_id', null);
    //$my_app->set_param('dir_id', null);
}
// If shared and readonly
$in_shared = $my_app->get_param('in_shared');
$readonly = $my_app->get_param('readonly');
/*.............................................. */
if ($in_shared == 1) {
    $shared = new phpos_shared();
    $share_dir_id = $my_app->get_param('dir_id');
    if (substr($share_dir_id, -1) == '/') {
        $share_dir_id = substr($share_dir_id, 0, -1);
    }
    //echo $share_dir_id;
    $shared_id = $shared->find_shared($share_dir_id);
    /*.............................................. */
    if (!empty($shared_id) && !$shared->is_my($shared_id)) {
        $shared->set_id($shared_id);
        $shared->get_shared();
        $readonly = $shared->get_readonly();
    }
    /*.............................................. */
    if ($readonly) {
        $my_app->set_param('readonly', 1);