Exemplo n.º 1
0
 public function delete_item($id)
 {
     global $sql;
     $my_id = logged_id();
     //$records = $sql->records($this->db_startmenu);
     $sql->cond('id', $id);
     $sql->cond('id_user', $my_id);
     if ($sql->delete($this->db_startmenu)) {
         return true;
     }
 }
Exemplo n.º 2
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');
 }
Exemplo n.º 3
0
 public function unshare_folder($id)
 {
     global $sql;
     $my_id = logged_id();
     $sql->cond('id_user', $my_id);
     $sql->cond('folder_id', $id);
     echo $id;
     if ($sql->delete($this->db_shared)) {
         return true;
     }
 }
Exemplo n.º 4
0
                    helper_result('update_user_result', 'result', 'error');
                } else {
                    helper_result('update_user_result', 'result', 'error');
                    helper_result('update_user', 'error', txt('error'));
                }
            }
        }
        $_POST['action'] = null;
    }
}
// my update
// update
if (globalconfig('demo_mode') != 1 || is_root()) {
    if (form_submit('my_update')) {
        if ($_POST['action'] == 'my_update') {
            $user_id = logged_id();
            $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 {
Exemplo n.º 5
0
 public function rename($id_file, $new_name)
 {
     global $sql;
     $my_id = logged_id();
     $sql->cond('id_user', $my_id);
     $sql->cond('id_file', $id_file);
     $items = array('file_title' => $new_name);
     if ($sql->update($this->db_name, $items)) {
         return true;
     }
 }
Exemplo n.º 6
0
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
echo $layout->title(txt('logs_section_sessions_title'), 'icon.png');
echo $layout->txtdesc(txt('logs_section_sessions_subdesc'));
$id_session = $my_app->get_param('id_session');
$limit = 30;
if ($id_session === null) {
    $sessions = new phpos_users();
    $sessions->set_id_user(logged_id());
    $sessions_list = $sessions->get_last_sessions_ids($limit);
    $c = count($sessions_list);
    $today = '';
    $log_title = txt('logs_log_from_title') . $my_app->get_param('year_id') . ' - ' . $my_app->get_param('month_id') . ' - ' . $my_app->get_param('day_id') . $today;
    echo $layout->subtitle(str_replace('%limit%', $limit, $txt['logs_section_sessions_last_title']), ICONS . 'logs/section_sessions.png');
    echo $layout->txtdesc(str_replace('%limit%', $limit, $txt['logs_section_sessions_last_desc']));
    if ($c != 0) {
        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%'));
        foreach ($sessions_list as $id_session) {
            $session_info = $sessions->get_session_id_data($id_session);
            $u_info = new phpos_users();
            $u_info->set_id_user($session_info['id_user']);
            $u_info->get_user_by_id();
Exemplo n.º 7
0
function activity()
{
    $usr = new phpos_users();
    $usr->set_id_user(logged_id());
    $usr->activity();
}
Exemplo n.º 8
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;
    }
Exemplo n.º 9
0
cache_param('msg_id');
$form = new phpos_forms();
$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) {
Exemplo n.º 10
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;
         }
     }
 }
Exemplo n.º 11
0
	(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) {
    case $dir . '_Desktop':
Exemplo n.º 12
0
 public function update_cloud($id, $title, $desc, $user, $pass, $public = null, $url = null, $param1 = null, $param2 = null, $param3 = null, $param4 = null)
 {
     global $sql;
     $my_id = logged_id();
     $items = array('title' => $title, 'login' => $user, 'password' => $pass, 'url' => $url, 'description' => $desc, 'public' => $public, 'param1' => $param1, 'param2' => $param2, 'param3' => $param3, 'param4' => $param4);
     $sql->cond('id', $id);
     if ($sql->update($this->db_clouds, $items)) {
         return true;
     }
 }
Exemplo n.º 13
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';
 }
Exemplo n.º 14
0
 public function update_ftp($id, $title, $desc, $host, $user, $pass, $port, $public = null, $remote_dir = null)
 {
     global $sql;
     $my_id = logged_id();
     $items = array('title' => $title, 'host' => $host, 'port' => $port, 'login' => $user, 'password' => $pass, 'remote_dir' => $remote_dir, 'description' => $desc, 'public' => $public);
     $sql->cond('id', $id);
     if ($sql->update($this->db_ftp, $items)) {
         return true;
     }
 }
Exemplo n.º 15
0
 public function im_owner($group)
 {
     $my_id = logged_id();
     global $sql;
     $sql->cond('id_group', $group);
     $sql->cond('id_owner', $my_id);
     if ($sql->is_row($this->db_groups)) {
         return true;
     }
 }
Exemplo n.º 16
0
 public function send($to = null, $title, $msg)
 {
     $my_id = logged_id();
     global $sql;
     $items = array('id_user_from' => $my_id, 'id_user_to' => $to, 'title' => $title, 'sended_at' => time(), 'msg' => $msg, 'sender_deleted' => 0, 'receiver_deleted' => 0);
     if ($sql->add($this->db_msg, $items)) {
         return true;
     }
 }