function login_main() { if (check_session_exists()) { redirect('admin/users_list', 'refresh'); } else { $data = array(); $data['login'] = '******'; $this->template->write('admin_header', $this->load->view('admin_header', $data, true)); $this->template->write('common_js', $this->load->view('js/common_js', $data, true)); $this->template->write('admin_js', $this->load->view('js/login_js', $data, true)); $this->template->write('main_content', $this->load->view('admin_login_form', $data, true)); $this->template->write('admin_footer', $this->load->view('admin_footer', $data, true)); $this->template->render(); } }
function users_sessions_list() { if (check_session_exists()) { log_message('error', __METHOD__ . 'allowed'); $data = array(); $data['uri_segment'] = $this->uri->segment(1); $this->template->write('admin_header', $this->load->view('admin_header', $data, true)); $this->template->write('left_menu', $this->load->view('left_menu', $data, true)); $this->template->write('common_js', $this->load->view('js/common_js', $data, true)); $this->template->write('admin_js', $this->load->view('js/user_js', $data, true)); $this->template->write('main_content', $this->load->view('admin_user_sessions_list', $data, true)); $this->template->write('admin_footer', $this->load->view('admin_footer', $data, true)); $this->template->render(); } else { redirect('admin/login', 'refresh'); } }
<?php require_once 'config_tinybrowser.php'; require_once 'fns_tinybrowser.php'; // Set language set_language(); // Check session exists check_session_exists(); // Initialise error array $errors = array(); if (!$_SESSION['tinybrowser']['allowupload']) { $errors[] = TB_UPDENIED; } // Check request token if (!$_SESSION['tinybrowser']['debug_mode']) { $find_token = array_search($_GET['obfuscate'], $_SESSION['get_tokens']); if ($find_token === false) { $errors[] = TB_DENIED; } } // Check and assign get variables if (isset($_GET['type']) && in_array($_GET['type'], $_SESSION['tinybrowser']['valid']['type'])) { $typenow = $_GET['type']; } else { $errors[] = TB_INVALID_FILETYPE; } if (isset($_GET['folder'])) { $dest_folder = urldecode($_GET['folder']); } else { $errors[] = TB_NOT_IN_ALLOWED_DIR; }
<!-- Navigation --> <nav class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <b><a class="welcome-text" href="#"><?php echo strtoupper(APP_TITLE); ?> </a></b> </div> <?php if (check_session_exists()) { ?> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> Welcome <?php echo $this->uri->segment(1) == 'admin' ? 'Admin' : $this->session->userdata('username'); ?> </li> <li> <a href="<?php echo base_url(); ?> admin/logout">Logout</a> </li> </ul> </div> <?php }