ltp_redirect_to("viewer"); } // redirect users with incorrect roles if (is_user_logged_in()) { if (!ltp_is_admin()) { if (!ltp_is_student() && !ltp_is_wpp()) { ltp_redirect_to("invalid_role"); } elseif (ltp_is_student()) { ltp_redirect_to("builder"); } } } else { ltp_redirect_to('login'); } // get the people pages - admins see drafts as well $post_status = ltp_is_admin() ? array('publish', 'draft') : 'publish'; $people_pages = get_posts(array('post_type' => 'people', 'nopaging' => true, 'post_status' => $post_status, 'orderby' => 'modified')); ltp_data::save_actions(); get_header(); print '<div class="section sticky toolbar">'; global $current_user; $previous_login_date = ltp_data::get_previous_login($current_user->ID); $profiles_added = ltp_data::get_profiles_added_since($previous_login_date); print ltp_template::wpp_toolbar($current_user->ID, $previous_login_date, $profiles_added); print '</div>'; print '<div class="ltp-profiles">'; if (count($people_pages)) { // get all students $students = array(); $users = get_users(array('role' => 'student', 'fields' => 'all')); if (count($users)) {
<?php $options = ltp_options::get_options(); // redirect to https if (!isset($_SERVER["HTTPS"]) && (isset($options["debug_ssl"]) && intval($options["debug_ssl"]) > 0)) { ltp_redirect_to("invalid-role"); } if (is_user_logged_in()) { if (!ltp_is_admin()) { if (!ltp_is_student() && !ltp_is_wpp()) { ltp_redirect_to("invalid_role"); } elseif (ltp_is_student()) { ltp_redirect_to("builder"); } elseif (ltp_is_wpp()) { ltp_redirect_to("viewer"); } } else { ltp_redirect_to("viewer"); } } else { ltp_redirect_to("login"); }
?> "><?php echo $theme_options["header_title"]; ?> </a></h2> <?php } ?> </div> <div class="content"> <h1><a href="<?php echo home_url('/'); ?> " title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?> " rel="home"><span><?php bloginfo('name'); ?> </span></a></h1> <?php if (ltp_is_admin()) { wp_nav_menu(array('theme_location' => 'tabs', 'menu_class' => 'nav-main', 'depth' => 1)); } ?> <div class="content-main">