Ejemplo n.º 1
0
 public function __construct()
 {
     $usr = new phpos_users();
     $my_id = logged_id();
     $usr->get_user_by_id($my_id);
     $my_dir = $usr->get_home_dir_hash();
     if (is_dir(PHPOS_HOME_DIR . $my_dir . '/_Icons')) {
         $this->my_icons_dir = PHPOS_HOME_DIR . $my_dir . '/_Icons/';
         $this->my_icons_url = PHPOS_HOME_URL . $my_dir . '/_Icons/';
     }
     $this->accepted_extensions = array('png', 'gif', 'jpg', 'jpeg');
 }
						
					}
				});
				' . $tips . '
				//$(".bslink").bstip();
				//tooltip();
				
									
				';
            $my_app->jquery_onready($keyboard);
        }
    }
    $my_user = new phpos_users();
    $my_user->set_id_user($my_user->get_logged_user());
    if ($my_user->user_id_exists()) {
        $my_user->get_user_by_id();
    }
    $my_app->set_user($my_user);
    $my_user->assign_config($config);
    $my_user->get_logged_user();
    define('MY_HOME_DIR', PHPOS_HOME_DIR . $my_user->get_home_dir_hash() . '/');
    define('MY_HOME_URL', PHPOS_HOME_URL . $my_user->get_home_dir_hash() . '/');
    define('PHPOS_ACCESS', true);
    include PHPOS_DIR . 'plugins/window.' . $apiWindow->getParam('wintype') . 'Plugin.php';
    echo $my_app->render_javascript_jquery();
    if (!$_POST['phpos_keep_result']) {
        $_SESSION['RESULT'] = NULL;
        $_SESSION['RESULT_STATUS'] = NULL;
    }
} else {
    helper::alert('error', 'Plugin not installed: ' . $apiWindow->getParam('wintype'));
Ejemplo n.º 3
0
	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;
}
echo $layout->title(txt('your_account'));
$usr = new phpos_users();
$usr->set_id_user($usr->get_logged_user());
if ($usr->user_id_exists()) {
    $usr->get_user_by_id();
}
echo helper_result('my_update_user');
$form = new phpos_forms();
echo $form->form_start('my_update', helper_ajax('section.account.php'), array('app_params' => ''));
echo $layout->txtdesc(txt('dsc_users_change_pass'));
$form->reload_after_submit(array('nowy'));
$form->input('hidden', 'action', '', '', 'my_update');
echo $layout->column('50%');
$form->title(txt('change_pass'), '', ICONS . 'auth_key.png');
$form->input('password', 'user_old_pass', txt('old_pass'), txt('dsc_users_account_old_pass_please'), '');
$form->condition('match', 'user_new_pass2', txt('pass_not_match'));
$form->input('password', 'user_new_pass', txt('new_pass'), txt('dsc_users_account_pass'), '');
$form->input('password', 'user_new_pass2', txt('new_pass_c'), txt('dsc_users_account_pass_c'), '');
$form->title(txt('change_email'), '', ICONS . 'email.png');
$form->input('text', 'user_new_email', 'Email', txt('dsc_users_account_email'), $usr->get_user_email());
Ejemplo n.º 4
0
 public function installer_db_set_data()
 {
     $root_time = time();
     include PHPOS_DIR . 'config/security_key.php';
     if (empty($phpos_key) || empty($_SESSION['phpos_install_data']['root_password1'])) {
         return false;
     }
     if ($_SESSION['phpos_install_data']['root_password1'] != $_SESSION['phpos_install_data']['root_password2']) {
         // not match
     }
     global $sql;
     require PHPOS_DIR . 'install/db_schema.php';
     if (is_array($insert)) {
         foreach ($insert as $table => $record) {
             if (!$sql->insert_array($record, $table)) {
                 $_SESSION['mysql_error'] = $sql->get_error('parse');
                 $this->set_sql_error('db_update');
                 return false;
             }
         }
     }
     $usr = new phpos_users();
     $usr->set_id_user(1);
     $usr->get_user_by_id();
     $usr->set_created_at($root_time);
     $usr->set_user_email($_SESSION['phpos_install_data']['cfg_email']);
     $usr->set_raw_pass($_SESSION['phpos_install_data']['root_password1']);
     $root_pwd = $usr->generate_password();
     $usr->set_user_pass($root_pwd);
     if ($usr->update()) {
         //echo 'uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu'.$root_pwd;
         $this->set_ok('db_update');
         // home dir
         if ($usr->create_home_dir()) {
             $this->set_ok('home_dir_ok');
         } else {
             $this->set_warn('home_dir_warn');
         }
         $t = time();
         // Save config
         $cfg = new phpos_config('phpos_config');
         $cfg->update_global('lang', $_SESSION['phpos_install_data']['cfg_lang']);
         $cfg->update_global('wallpaper', $_SESSION['phpos_install_data']['cfg_wallpaper']);
         $cfg->update_global('site_title', $_SESSION['phpos_install_data']['cfg_title']);
         $cfg->update_global('root_email', $_SESSION['phpos_install_data']['cfg_email']);
         $cfg->update_global('version', PHPOS_VERSION);
         $cfg->update_global('versionnumber', PHPOS_VERSIONNUMBER);
         $cfg->update_global('build', PHPOS_BUILD);
         $cfg->update_global('install_time', $t);
         $cfg->update_global('update_time', $t);
         //$cfg->update_global('key_copy', $phpos_key);
         $cfg->set_id_user(1);
         $cfg->update_user('lang', $_SESSION['phpos_install_data']['cfg_lang']);
         $cfg->update_user('wallpaper', $_SESSION['phpos_install_data']['cfg_wallpaper']);
         $cfg->update_user('wallpaper_type', 'global');
         return true;
     } else {
         $_SESSION['mysql_error'] = $sql->get_error('parse');
         $this->set_sql_error('db_update');
     }
 }
Ejemplo n.º 5
0
         $apiWindow->resetContextMenu();
         $html['icons'] .= '<div id="groups_shared_folders_' . $row['id'] . WIN_ID . '" title="<b>' . $row['title'] . '</b> ' . $row['desc'] . '" class="phpos_server_icon"><a href="javascript:void(0);" ondblclick="' . $action_open . '"><img src="' . ICONS . 'server/shared1.png" /></a><p><b>' . $row['title'] . '</b><br />' . string_cut($row['description'], 20) . '<br /><span class="desc">' . $user_info['user_login'] . '</span></p></div>';
     }
     $html['icons'] .= $layout->area_end();
     // right items
     $html['right_items_title'] = txt('explorer_right_group_users');
     $html['right_items_desc'] = txt('explorer_right_group_users_desc');
     $html['right_items_img'] = 'shared1.png';
     //$group->get_group();
     $users_in_group = $group->get_users_in_group();
     $k = count($users_in_group);
     if ($k != 0) {
         foreach ($users_in_group as $grp_user) {
             $usr_data = new phpos_users();
             $usr_data->set_id_user($grp_user['id_user']);
             $usr_data->get_user_by_id();
             $right_item['name'] = $usr_data->get_user_login();
             $right_item['onclick'] = link_action('shared', 'workgroup_id:' . $workgroup_id . ',workgroup_user_id:' . $grp_user['id_user'] . ',fs:local_files');
             $right_item['icon'] = 'user.png';
             $right_item['marked'] = false;
             if ($shared_id_user == $grp_user['id_user']) {
                 $right_item['marked'] = true;
             }
             $explorer_right_items[] = $right_item;
         }
     }
     /* ================================================== */
 } else {
     $html['icons'] = $layout->area_start(txt('shared_error')) . $layout->txtdesc(txt('st_shared')) . txt('shared_not_exists') . $layout->area_end();
 }
 /* ================================================== */
Ejemplo n.º 6
0
 $count_users = $group->count_users();
 $records = $group->get_users_in_group();
 $title = '<img src="' . ICONS . 'server/workgroup.png' . '" style="width:30px; display:inline-block; vertical-align:middle" /> <span style="color:black">' . txt('workgroup') . ':</span> ' . $group->get_title();
 $html['icons'] .= $layout->area_start($title);
 $html['icons'] .= $layout->txtdesc(txt('shared_folders_serv_desc'));
 if ($count_users != 0) {
     foreach ($records as $row) {
         $action_open = link_action('shared', 'workgroup_id:' . $group_id . ',workgroup_user_id:' . $row['id_user'] . ',fs:local_files');
         $contextMenu_shared = array('open::' . txt('open') . '::' . $action_open . '::folder_open');
         $apiWindow->setContextMenu($contextMenu_shared);
         $js .= $apiWindow->contextMenuRender('groups_shared_list_' . $row['id_user'] . WIN_ID, 'img');
         $apiWindow->resetContextMenu();
         $tmp_usr = new phpos_users();
         $tmp_usr->set_id_user($row['id_user']);
         if ($tmp_usr->user_id_exists()) {
             $user_info = $tmp_usr->get_user_by_id($row['id_user']);
             $owner = '';
             if ($row['id_user'] == $group->get_id_owner()) {
                 $owner = txt('owner') . '';
             }
             $html['icons'] .= '<div id="groups_shared_list_' . $row['id_user'] . WIN_ID . '" class="phpos_server_icon" title="<b>' . $group->get_title() . '</b> / ' . $user_info['user_login'] . '"><a href="javascript:void(0);" ondblclick="' . $action_open . '"><img src="' . ICONS . 'accounts/user-icon.png" /></a><p><b>' . $user_info['user_login'] . '</b><br />' . $user_info['user_email'] . '<br /><span class="desc">' . $owner . '</span></p></div>';
         }
     }
 } else {
     $html['icons'] .= txt('group_no_users');
 }
 $html['icons'] .= $layout->area_end();
 // right items
 $html['right_items_title'] = txt('explorer_right_groups');
 $html['right_items_desc'] = txt('explorer_right_groups_desc');
 $html['right_items_img'] = 'workgroup.png';
Ejemplo n.º 7
0
    }
    echo $layout->end('column');
    // ----------------
    echo $layout->column('50%');
    echo $layout->subtitle(txt('group_out_group'), ICONS . 'status/status_error.png');
    echo $layout->txtdesc(txt('dsc_cp_groups_users_out'));
    // usrs in group
    $users_ids = $group->get_users_out_group();
    $c = count($users_ids);
    if ($c != 0) {
        echo $layout->tbl_start();
        echo $layout->head(array('<img src="' . ICONS . 'accounts/ico_admin.png" />' => '10%', 'Login' => '40%', txt('last_activity') => '30%', txt('action') => '30%'));
        for ($i = 0; $i < $c; $i++) {
            $u = new phpos_users();
            $u->set_id_user($users_ids[$i]['id_user']);
            $u->get_user_by_id();
            if ($u->get_last_activity() != 0) {
                $d = date('d.m.Y H:i:s', $u->get_last_activity());
            } else {
                $d = txt('never');
            }
            $action = helper_reload(array('section' => 'group_users', 'add_user_id' => $u->get_id_user()));
            echo $layout->row(array('<img src="' . ICONS . 'accounts/ico_admin.png"  style="height:20px"/>', $u->get_user_login(), $d, $layout->button(txt('group_add_user'), $action, 'edit_add')));
        }
        echo $layout->tbl_end();
    } else {
        echo $layout->empty_list();
    }
    echo $layout->end('column');
} else {
    winreload(WIN_ID, array('section' => 'list'));
Ejemplo n.º 8
0
            $u_info->set_id_user($session_info['id_user']);
            $u_info->get_user_by_id();
            $tip = '<b>UID:</b> ' . $session_info['id_user'] . '<br /><b>' . txt('logs_sessions_fulltime') . '</b> ' . date('d.m.Y H:i:s', intval($session_info['start_time'])) . ' - ' . date('d.m.Y H:i:s', intval($session_info['end_time']));
            $usr_link = '<b>' . $u_info->get_user_login() . '</b> (UID: ' . $session_info['id_user'] . ')';
            $action = helper_reload(array('section' => 'sessions', 'action' => 'delete_session', 'id_session' => $session_info['id_session']));
            echo $layout->row(array($session_info['id_session'], date('d.m.Y H:i:s', intval($session_info['start_time'])), date('d.m.Y H:i:s', intval($session_info['end_time'])), $usr_link, $session_info['user_ip'], $session_info['user_browser'], $session_info['php_sessid'], $layout->button(txt('btn_delete'), $action, 'cancel')), $tip);
        }
        echo $layout->tbl_end();
    }
} else {
    // log session
    $sessions = new phpos_users();
    if ($sessions->is_session_id($id_session)) {
        echo $layout->subtitle($txt['logs_section_sessions_view_title'], ICONS . 'logs/section_sessions.png');
        echo $layout->txtdesc($txt['logs_section_sessions_view_desc']);
        echo $layout->tbl_start();
        $layout->td_classes(array(''));
        echo $layout->head(array(txt('logs_section_sessions_tbl_id') => '5%', txt('logs_section_sessions_tbl_starttime') => '10%', txt('logs_section_sessions_tbl_endtime') => '10%', txt('logs_section_sessions_tbl_user') => '25%', txt('logs_section_sessions_tbl_ip') => '15%', txt('logs_section_sessions_tbl_browser') => '20%', txt('logs_section_sessions_tbl_sid') => '5%', txt('logs_section_sessions_tbl_action') => '10%'));
        $session_info = $sessions->get_session_id_data($id_session);
        $tip = '<b>UID:</b> ' . $session_info['id_user'] . '<br /><b>' . txt('logs_sessions_fulltime') . '</b> ' . date('d.m.Y H:i:s', intval($session_info['start_time'])) . ' - ' . date('d.m.Y H:i:s', intval($session_info['end_time']));
        $u_info = new phpos_users();
        $u_info->set_id_user($session_info['id_user']);
        $u_info->get_user_by_id();
        $usr_link = '<b>' . $u_info->get_user_login() . '</b> (UID: ' . $session_info['id_user'] . ')';
        $action = helper_reload(array('section' => 'sessions', 'action' => 'delete_session', 'id_session' => $session_info['id_session']));
        echo $layout->row(array($session_info['id_session'], date('d.m.Y H:i:s', intval($session_info['start_time'])), date('d.m.Y H:i:s', intval($session_info['end_time'])), $usr_link, $session_info['user_ip'], $session_info['user_browser'], $session_info['php_sessid'], $layout->button(txt('btn_delete'), $action, 'cancel')), $tip);
        echo $layout->tbl_end();
    } else {
        echo 'Session not exists in DB.';
    }
}
Ejemplo n.º 9
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;
    }
Ejemplo n.º 10
0
$form->input('hidden', 'action', '', '', 'new_msg');
echo $layout->column('50%');
$form->condition('not_null', true, txt('login_empty'));
$form->input('text', 'msg_title', txt('messager_form_title'), txt('messager_form_title_desc'), $start_title);
$form->status();
echo $form->render();
echo $layout->end('column');
echo $layout->column('50%');
$users = new phpos_users();
$users_ids = $users->get_users('ALL');
$i = 0;
$my_id = logged_id();
foreach ($users_ids as $id) {
    $usr_info = new phpos_users();
    $usr_info->set_id_user($id);
    $usr_info->get_user_by_id();
    $items[$id] = $usr_info->get_user_login();
    if ($my_id == $id) {
        $items[$id] = txt('messager_tbl_me');
    }
    $i++;
}
$reply_id = $my_app->get_param('reply_id');
$start_user_to = '';
$start_title = '';
$start_msg = '';
if ($reply_id !== null) {
    $msg = new phpos_messages();
    $reply = $msg->get_msg($reply_id);
    $start_user_to = $reply['id_user_from'];
    $start_title = 'Re: ' . $reply['title'];
Ejemplo n.º 11
0
 public function create_log($row)
 {
     if (!empty($row)) {
         $data = $this->get_log_file_data();
         $my_id = logged_id();
         $u = new phpos_users();
         $u->set_id_user($my_id);
         $u->get_user_by_id();
         $id_session = $u->get_my_session_id();
         $log = 'LOG| date: ' . date('Y.m.d H:i:s') . '; timestamp: ' . time() . '; UID: ' . $my_id . '; ULOGIN: '******'; IP: ' . getIP() . '; ACTION: {' . str_replace(';', ',', strip_tags($row)) . '}; IDSESSION: ' . $id_session;
         $new_data = $log . ';;' . PHP_EOL . $data;
         $this->log_file_data = $new_data;
         if ($this->save_log_file()) {
             return true;
         }
     }
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     $this->global_wallpapers_dir = PHPOS_WEBROOT_DIR . '_phpos/wallpapers/*.jpg';
     $this->global_wallpapers_url = PHPOS_WEBROOT_URL . '_phpos/wallpapers/';
     $usr = new phpos_users();
     $my_id = logged_id();
     $usr->get_user_by_id($my_id);
     $my_dir = $usr->get_home_dir_hash();
     if (is_dir(PHPOS_HOME_DIR . $my_dir . '/_Wallpapers')) {
         $this->user_wallpapers_dir = PHPOS_HOME_DIR . $my_dir . '/_Wallpapers/*.jpg';
         $this->user_wallpapers_url = PHPOS_HOME_URL . $my_dir . '/_Wallpapers/';
     }
     $this->lang_dir = PHPOS_DIR . 'lang/';
     $this->flag_dir = PHPOS_WEBROOT_URL . '_phpos/icons_lang/';
     $this->lang_list = array();
     $this->lang_default = 'en';
 }