function is_super_admin() { if (get_user_type() == 1) { return TRUE; } return FALSE; }
function busines_card($id = '') { redirect('home/generate'); if (get_user_type() == 2 || $id == '') { $id = get_user_id(); } if (!$_POST) { $_POST = $this->users->get_user_by_id($id); } $this->data['page_title'] = 'Custom Busines Card'; $this->template->write_view('content', 'home/business-card', $this->data, FALSE); $this->template->render(); }
//redirect the encoder to the regions exit; } if ($_SERVER['REQUEST_METHOD'] == "POST") { /** * check if the user is logged in * check login status is from php file "controller secure access" * it checks if the use is logged in */ if (TRUE == check_login_status()) { /** * check if the type of the user is admin * get_user_type function is from a php file"Controller secure access" * it returns the type of the user */ $user_type = get_user_type(); /** * if the user type is admin instantiate an Admin_controller and do what you got to do */ if ($user_type == User_Type::ENCODER) { /** * get the logged in user */ $encoder = $_SESSION['Logged_In_User']; /** * instantiate admin controller with the logged in user */ $encoder_con = new Encoder_Controller($encoder); /** * get the street name in english */
function user_type() { echo get_user_type(); }
function get_user_title($id = 0) { $user = bb_get_user(bb_get_user_id($id)); return empty($user->title) ? get_user_type($id) : apply_filters('get_user_title', $user->title, $user->ID); }
function get_pos_login() { if (HAS_PROJECTS) { set_session('start', 'Start-' . get_user_type()); return 'index.php/index/start'; } if (HAS_VIDEOS) { if (get_session('user_level') == MINIMUM_TO_BROWSE) { return 'tvideos'; } else { if (is_permitted(MINIMUM_TO_UPDATE)) { return POS_LOGIN_INTERNAL; } else { return POS_LOGIN_EXTERNAL; } } } if (HAS_EVENTS) { if (!is_session('event_id')) { if (is_permitted(MINIMUM_TO_UPDATE)) { $model = MODEL . 'Events'; $Events = new $model(); set_new_event($Events->getIdByCompany(COMPANY_ID)); return INDEX . POS_LOGIN_INTERNAL; } else { if (is_session('start')) { return 'index.php/index/start'; } else { // return INDEX . 'index/dashboard'; // index.php is required in linux server return 'index.php/index/dashboard'; // index.php is required in linux server } } } else { if (is_permitted(MINIMUM_TO_UPDATE)) { return POS_LOGIN_INTERNAL; } else { return POS_LOGIN_EXTERNAL; } } } else { if (is_permitted(MINIMUM_TO_UPDATE)) { return POS_LOGIN_INTERNAL; } else { return POS_LOGIN_EXTERNAL; } } }
function get_tutor_language() { $ci =& get_instance(); if (isset($_COOKIE["search_user_id"])) { $user_id = $_COOKIE["search_user_id"]; $user_type = get_user_type(); if ($user_type == 1) { $tutor_language_list = $ci->tutor_model->get_tutor_languages($user_id); return $tutor_language_list; } else { return ""; } } else { return ""; } }
<a href="<?php echo site_url('/'); ?> ">Dashboard</a><span>|</span> </li> <li> <a target="_blank" href="<?php echo site_url('home/busines_card/'); ?> ">Business Card</a><span>|</span> </li> <li> <a href="javascript:;">Profile</a> <ul class="sub-menu" class="noJS" > <?php if (get_user_type() == 1) { ?> <li> <a href="<?php echo site_url('accounts'); ?> ">Profiles List</a> </li> <li> <a href="<?php echo site_url('accounts/create'); ?> ">Create Profile</a> </li> <?php }
<tr> <td> <img class="img-rounded" src="uploads/avatars/<?php echo $row['avatar']; ?> "> </td> <td> <?php echo $row['last'] . ', ' . $row['first']; ?> </td> <td> <?php get_user_type($dbc, $row['type'], 'echo'); ?> </td> <td> <?php echo $row['email']; ?> </td> <td> <?php get_user_status($dbc, $row['status'], 'echo'); ?> </td> </tr>
function languages() { if (get_user_type() == 2) { redirect('/'); } $this->data['languages'] = $this->languages->get_all(); $this->data['page_title'] = 'Languages List'; $this->template->add_css('layout/css/admin/jquery.dataTables.css'); $this->template->add_js('layout/js/jquery/jquery.dataTables.min.js'); $this->template->write_view('content', 'accounts/languages', $this->data, FALSE); $this->template->render(); }