public function set_id_user($id_user = null) { if ($id_user != null) { $this->id_user = $id_user; } else { $usr = new phpos_users(); $usr->get_logged_user(); $id_user = $usr->get_id_user(); $this->id_user = $id_user; } $this->get_all_user(); }
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'); }
GitHUB: https://github.com/phpos/ File version: 1.0.0, 2013.10.08 ********************************** */ if (!defined('PHPOS')) { die; } global $footer; echo $layout->back_button(null, helper_reload(array('msg_id' => null)), null, null); $msg = new phpos_messages(); $msg_data = $msg->get_msg($my_app->get_param('msg_id')); $form = new phpos_forms(); //$form->onsuccess(helper_reload(array('section' => 'sended'))); echo $form->form_start('', '', array('app_params' => '')); $form->texteditor('msg_body', null, null, $msg_data['msg']); if ($msg->is_to_me($my_app->get_param('msg_id'))) { $u = new phpos_users(); $u->set_id_user($msg_data['id_user_from']); $u->get_user_by_id(); $authors = '<span style="color:black; font-weight:bold;font-size:16px">' . txt('messager_tbl_from') . ': ' . $u->get_user_login() . ' </span>'; $form->button(txt('messager_btn_reply'), helper_reload(array('section' => 'new', 'reply_id' => $my_app->get_param('msg_id'))), 'reply'); } else { $u = new phpos_users(); $u->set_id_user($msg_data['id_user_to']); $u->get_user_by_id(); $authors = '<span style="color:black; font-weight:bold;font-size:16px">' . txt('messager_tbl_to') . ': ' . $u->get_user_login() . ' </span>'; } $footer = '<img src="' . MY_RESOURCES_URL . 'msg2.png" />' . $authors . ' <b style="padding-left:30px;color:black">' . txt('messager_sent') . ':</b> ' . date('Y.m.d. H:i', $msg_data['sended_at']); echo $form->render(); echo $form->form_end();
********************************** 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; } 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'), '');
$apiWindow->setContextMenu($contextMenu_shared_folders); $js .= $apiWindow->contextMenuRender('groups_shared_folders_' . $row['id'] . WIN_ID, 'img'); $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();
$tmp_old_pass = strip_tags($_POST['user_old_pass']); $tmp_pass1 = strip_tags($_POST['user_new_pass']); $tmp_pass2 = strip_tags($_POST['user_new_pass2']); $tmp_email = strip_tags($_POST['user_new_email']); $tmp_lang = strip_tags($_POST['user_new_lang']); //$tmp_group = intval(strip_tags($_POST['user_new_group'])); if ($tmp_pass1 != $tmp_pass2) { helper_result('my_update_user_result', 'result', 'error'); helper_result('my_update_user', 'error', txt('pass_not_match')); } else { //pass if (!empty($tmp_pass1) && (strlen($tmp_pass1) < 6 || strlen($tmp_pass1) > 30)) { helper_result('my_update_user_result', 'result', 'error'); helper_result('my_update_user', 'error', txt('pass_length')); } else { $new_usr = new phpos_users(); $new_usr->set_id_user($user_id); $new_usr->get_user_by_id(); $error = 0; if (!empty($tmp_pass1)) { // check old pass if (!empty($tmp_old_pass)) { // check pass $pass_now_hash = $new_usr->get_user_pass(); //check new $new_usr->set_raw_pass($tmp_old_pass); $old_pass_hash = $new_usr->generate_password(); if ($pass_now_hash == $old_pass_hash) { $new_usr->set_raw_pass($tmp_pass1); $new_pass = $new_usr->generate_password(); $new_usr->set_user_pass($new_pass);
$group->set_id($group_id); if ($group->group_exists() && $group->im_in_group()) { $group->get_group(); $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
} else { echo $layout->empty_list(); } echo $layout->tbl_end(); echo $layout->end('column'); echo $layout->column('33%'); echo $layout->subtitle(txt('groups_owner'), ICONS . 'workgroups.png'); echo $layout->txtdesc(txt('groups_own_desc')); $groups = new phpos_groups(); $group_ids = $groups->get_my_own_groups(); $c = count($group_ids); echo $layout->tbl_start(); $layout->td_classes(array('', '', 'tbl_grey')); if ($c != 0) { echo $layout->head(array('<img src="' . ICONS . 'workgroups.png" />' => '20%', txt('name') => '40%', txt('owner') => '40%')); for ($i = 0; $i < $c; $i++) { $g = new phpos_groups(); $g->set_id($group_ids[$i]['id']); $g->get_group(); $usr_count = $g->count_users(); $u = new phpos_users(); $u->set_id_user($group_ids[$i]['id_owner']); $u->get_user_by_id(); echo $layout->row(array($usr_count, '<a href="javascript:void(0);" onclick="' . helper_reload(array('section' => 'group_users', 'group_id' => $g->get_id())) . '">' . $g->get_title() . '</a>', $u->get_user_login()), $g->get_desc()); } } else { echo $layout->empty_list(); } echo $layout->tbl_end(); echo $layout->end('column'); echo $layout->clr();
$form->onsuccess(helper_reload(array('section' => 'sended'))); echo $form->form_start('new_msg', '', array('app_params' => '')); $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);
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; } } }
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 (!defined('PHPOS_EXPLORER_PLUGIN')) { die; } $items = null; $u = new phpos_users(); $u->set_id_user(logged_id()); $u->get_user_by_id(); $hash = $u->get_home_dir_hash(); $dir = PHPOS_HOME_DIR . $hash . '/'; $default_span = 'color:black'; $marked_span = 'color:black;font-weight:bold'; $span['desktop'] = $default_span; $span['docs'] = $default_span; $span['pics'] = $default_span; $span['wallpapers'] = $default_span; $span['icons'] = $default_span; $span['video'] = $default_span; $span['temp'] = $default_span; $dir_id = $my_app->get_param('dir_id'); switch ($dir_id) {
$phpos_log = new phpos_logs(); //$phpos_log->create_log('xxxx'); $_SESSION['DEBUG'] = false; /* if($_GET['root']) { $_SESSION['DEBUG'] = true; if($_SESSION['DEBUG']) define('DEBUG', true); } */ if ($_SESSION['logged_message'] == 1) { savelog('LOGIN#SUCCESS'); msg::ok(txt('msg_logged')); unset($_SESSION['logged_message']); } $user = new phpos_users(); $user->get_logged_user(); if (!empty($_GET['code'])) { $_SESSION['google_token'] = $_GET['code']; } //savelog('ACCESS#SUCCESS'); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php echo globalconfig('site_title'); ?> </title> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
} else { echo $layout->empty_list(); } echo $layout->end('column'); echo $layout->column('33%'); echo $layout->subtitle(txt('banned_users'), ICONS . 'status_error.png'); echo $layout->txtdesc(txt('dsc_users_list_banned')); $users = new phpos_users(); $how_many = $users->count_users('INACTIVE'); if ($how_many != 0) { $users_ids = $users->get_users('INACTIVE'); $c = count($users_ids); echo $layout->tbl_start(); echo $layout->head(array('<img src="' . ICONS . 'accounts/small_users.png" />' => '10%', 'Login' => '50%', txt('last_activity') => '40%')); for ($i = 0; $i < $c; $i++) { $u = new phpos_users(); $u->set_id_user($users_ids[$i]); $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'); } 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', 'user_id' => $u->get_id_user())) . '">' . $u->get_user_login() . '</a>', $d), txt('dsc_users_click')); } echo $layout->tbl_end(); } else { echo $layout->empty_list(); } echo $layout->end('column'); echo $layout->clr();
<?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; } $usr = new phpos_users(); if (!$usr->user_is_logged()) { header("Location: " . PHPOS_WEBROOT . "phpos_login.php"); exit; }
$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.'; } }
$c = $msg->count_sended(); echo $layout->subtitle(txt('messager_sended_title'), MY_RESOURCES_URL . 'msg_sended.png'); echo $layout->txtdesc(txt('messager_sended_desc')); echo $layout->tbl_start(); echo $layout->head(array('' => '5%', txt('messager_tbl_message') => '40%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'time_icon.png" /> ' . txt('messager_tbl_sended') => '15%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'time_icon.png" /> ' . txt('messager_tbl_readed') => '15%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'user_icon.png" />' . txt('messager_tbl_to') => '15%', txt('messager_tbl_actions') => '15%')); if ($c != 0) { $records = $msg->get_sended(); foreach ($records as $row) { $icon = MY_RESOURCES_URL . 'readed_icon.png'; $readed = date('Y.m.d H:i', $row['readed_at']); $title = $row['title']; if (!$msg->is_readed($row['id'])) { $icon = MY_RESOURCES_URL . 'unreaded_icon.png'; $title = '<b>' . $row['title'] . '</b>'; $readed = txt('messager_tbl_not_yet'); } $delete_action = "\n\t\t\t\$.messager.confirm('" . txt('delete') . "', '" . txt('delete_confirm') . "?', function(r){\n\t\t\tif (r){\n\t\t\t\t" . helper_reload(array('delete_sended_id' => $row['id'])) . "\n\t\t\t}\n\t\t\t});\t"; //helper_reload(array('delete_sended_id' => $row['id'])); $u = new phpos_users(); $u->set_id_user($row['id_user_to']); $u->get_user_by_id(); $row_items = array('<img src="' . $icon . '" />', '<a href="javascript:void(0);" onclick="' . helper_reload(array('msg_id' => $row['id'])) . '">' . $title . '</a>', date('Y.m.d H:i', $row['sended_at']), $readed, $u->get_user_login(), $layout->button(txt('delete'), $delete_action, 'cancel')); echo $layout->row($row_items, string_cut(strip_tags($row['msg'], '<br>'), 100)); } } else { echo $layout->empty_list(); } echo $layout->tbl_end(); } else { include MY_APP_DIR . 'views/view_message.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; } $usr = new phpos_users(); $usr->set_id_user($usr->get_logged_user()); if ($usr->user_id_exists()) { $usr->get_user_by_id(); } $selected_wallpaper = $my_app->get_param('selected_wallpaper_id'); $selected_wallpaper_type = $my_app->get_param('selected_wallpaper_type'); $this_wallpaper = $my_app->get_param('wallpaper_id'); $this_wallpaper_type = $my_app->get_param('wallpaper_type'); echo helper_result('my_update_user'); echo $layout->txtdesc(txt('dsc_users_account_wallpapers')); $wallpaper = new phpos_wallpapers(); if ($this_wallpaper_type == 'user') { $wallpapers_url = $wallpaper->get_user_wallpapers_url(); } else { $wallpapers_url = $wallpaper->get_global_wallpapers_url();
public function user_have_access_section($section_id) { $access_section = $this->get_access_level_section($section_id); $user = new phpos_users(); $user->get_logged_user(); $access_user = $user->get_access_level(); if (empty($access_section)) { return false; } if ($access_user >= $access_section) { return true; } }
} else { echo $layout->empty_list(); } 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');
} 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();
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 section access $user_id = $my_app->get_param('user_id'); if (!empty($user_id)) { $usr = new phpos_users(); if (is_root() || is_admin()) { $usr->set_id_user($user_id); $usr->get_user_by_id(); echo helper_result('update_user'); echo $layout->title(txt('edit_user'), 'icon.png'); echo $layout->txtdesc(txt('dsc_users_edit_list')); $form = new phpos_forms(); echo $form->form_start('update_user', helper_ajax('section.edit_account.php'), array('app_params' => '')); $form->reload_after_submit(array('nowy')); $form->input('hidden', 'action', '', '', 'update_user'); echo $layout->column('50%'); $form->title(txt('user_login_data'), txt('all_fields_req'), ICONS . 'accounts/toolbar_edit.png'); $form->label('Login', $usr->get_user_login(), ''); //$form->condition('not_null', true , 'Password is empty'); //$form->condition('min', 6, 'Password must have min 6 chars');
$lang_name = $lang_data['eng_name'] . ' (' . $lang_data['local_name'] . ')'; $lang_items[$lang_id] = $lang_name; } $form->select('user_new_lang', txt('language'), txt('dsc_users_account_lang'), $lang_items, myconfig('lang')); $form->status(); $form->submit('', txt('btn_create'), 'edit_add', 'right'); //$form->button('', 'button', 'edit_add'); echo $form->render(); echo $layout->end('column'); echo $layout->clr(); echo $form->form_end(); } else { echo $layout->title(txt('usr_new'), 'icon.png'); echo $layout->column('50%'); echo helper_result('new_user'); echo '<img src="' . MY_RESOURCES_URL . 'user_added_img.png" style="width:100px;padding-left:50px"/>'; echo $layout->end('column'); echo $layout->column('50%'); $result = helper_result('new_user_result'); $result_id = helper_result('new_user_id'); if ($result == 'success' && !empty($result_id)) { $usr = new phpos_users(); $usr->set_id_user($result_id); if ($usr->user_id_exists()) { $usr->get_user_by_id(); } include MY_APP_DIR . 'views/inc.account_info.php'; } echo $layout->end('column'); echo $layout->clr(); }
} if (!empty($_GET['lang'])) { $reqested_lang = filter::alfas($_GET['lang']); } elseif (!empty($_POST['lang'])) { $reqested_lang = filter::alfas($_POST['lang']); } $lang = new phpos_languages(); if (!empty($reqested_lang)) { if ($lang->lang_exists($reqested_lang)) { $login_language = $reqested_lang; $_SESSION['login_lang'] = $reqested_lang; } } $lang->lang_load($login_language); } else { $usr = new phpos_users(); $config = new phpos_config(); if ($usr->user_is_logged()) { $config->set_id_user($usr->get_logged_user()); } $usr->get_logged_user(); $access_level = $usr->get_access_level(); if (!empty($_GET['lang'])) { //$PHPOS_GLOBALCONFIG['lang'] = strtolower($_GET['lang']); //$PHPOS_USERCONFIG['lang'] = strtolower($_GET['lang']); $requested_lang = trim(filter::alfas(strtolower($_GET['lang']))); if ($langs->lang_exists($requested_lang)) { if ($config->get_global('demo_mode') != 1 || $access_level == 3) { $config->update_user('lang', $requested_lang); } else { $demo_lang = trim($requested_lang);
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; }
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'); } }
</a> <?php echo $app_param['delete_id']; ?> <table width="100%"><tr> <td width="50%" valign=top> <?php $users = new phpos_users(); $how_many = $users->count_users(); echo 'users:' . $how_many . '<br>'; $t = time(); $id = 2; // admin //id1 // admin // szczyglis //id2 // haslo /* echo 'time:'.$t.'<br>md5_demo:'.md5(md5($id.$t.'haslo')); */ if ($how_many != 0) { $users_ids = $users->get_users(); echo '<table class="phpos_table">'; $c = count($users_ids);
$download_action = browser_url(PHPOS_WEBROOT_URL . "phpos_downloader.php?hash=" . md5(PHPOS_KEY) . "&download_type=" . base64_encode('log') . "&file=" . base64_encode($log_file_id)); $download_btn = $layout->button(txt('logs_section_btn_download'), $download_action, 'download1'); $view_action = browser_url('../_phpos/' . str_replace('../', '', $log_file_id)); $view_btn = $layout->button(txt('logs_section_btn_see_raw'), $view_action, 'edit'); echo $download_btn . ' ' . $view_btn; //echo 'Download raw log file here: <a href="'.$logs->get_logs_url().$log_file_id.'" target="_blank"><b>'.basename($log_file_id).'</b></a>'; //echo nl2br($f); $logs->set_log_dir($my_app->get_param('year_id'), $my_app->get_param('month_id'), $my_app->get_param('day_id')); $logs->set_log_file(basename($log_file_id)); $parsed_log = $logs->parse_log_file($log_file_id); echo $layout->tbl_start(); $layout->td_classes(array('')); echo $layout->head(array(txt('logs_section_tbl_id') => '10%', txt('logs_section_tbl_time') => '20%', txt('logs_section_tbl_user') => '25%', txt('logs_section_tbl_ip') => '15%', txt('logs_section_tbl_action') => '20%', txt('logs_section_tbl_session') => '10%')); foreach ($parsed_log as $log_data) { $btn = txt('logs_section_btn_see_session_empty'); $sessions = new phpos_users(); if ($sessions->is_session_id($log_data['log_session'])) { $action = helper_reload(array('section' => 'sessions', 'id_session' => $log_data['log_session'])); $btn = $layout->button(txt('logs_section_btn_see_session'), $action, 'login'); } $tip = '<b>UID:</b> ' . $log_data['log_uid'] . '<br /><b>' . txt('logs_section_tbl_fulltime') . ':</b> ' . date('Y.m.d H:i:s', intval($log_data['log_timestamp'])); echo $layout->row(array($log_data['log_id'] + 1, date('H:i', intval($log_data['log_timestamp'])), $log_data['log_ulogin'], $log_data['log_ip'], $log_data['log_action'], $btn), $tip); } echo $layout->tbl_end(); } echo $layout->end('column'); echo $layout->column('30%'); echo $layout->subtitle(txt('logs_log_folders_title'), ICONS . 'logs/logfiles.png'); echo $layout->txtdesc(txt('logs_folders')); $dir = glob($logs_dir . '*'); $years = array();
function activity() { $usr = new phpos_users(); $usr->set_id_user(logged_id()); $usr->activity(); }
// user presses the "s" key case 27: phpos.windowClose(window.PHPOS_ACTIVE_WINDOW); } }); ' . $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;
<div data-options="region:'west',title:'',split:true" id="phpos_startmenu_layout_left"> <?php echo $items; ?> </div> <div id="phpos_startmenu_layout_right" data-options="region:'center',title:''"> <div class="user_area"><img src="<?php echo PHPOS_WEBROOT_URL; ?> _phpos/themes/default/icons/user_medium.png"><br /><span class="user_name"><?php $user = new phpos_users(); $user->get_logged_user(); echo $user->get_user_login(); ?> </span><br /><span class="user_type"><?php $user_type = $user->get_user_type(); switch ($user_type) { case '1': $usr_str = txt('user_user'); break; case '2': $usr_str = txt('user_admin'); break; case '3': $usr_str = '<span style="color:#FFF;background-color:#c91b1f;font-weight:bold;padding:2px;margin:2px">' . txt('user_root') . '</span>'; break;