Ejemplo n.º 1
0
     $sort_item = 'username';
 }
 for ($i = 97; $i <= 122; $i++) {
     $proof .= " AND u.username NOT LIKE '" . chr($i) . "%' ";
 }
 $alpha_where = $alphanum == '0' ? $proof : ($alphanum != '' ? "AND u.username LIKE '" . $db->sql_escape($alphanum) . "%'" : '');
 $user_where = !empty($user_search) ? " AND u.username LIKE ('" . $db->sql_escape($user_search) . "'%)" : '';
 $per_page = $config['topics_per_page'];
 if ($sort_item == 'user_modules') {
     $sql = "SELECT u.username, u.user_id, u.user_active, u.user_color, u.user_rank, u.user_allow_pm, u.user_allowavatar\n\t\t\tFROM " . USERS_TABLE . " u, " . JR_ADMIN_TABLE . " j\n\t\t\tWHERE u.user_id <> " . ANONYMOUS . "\n\t\t\t{$alpha_where}\n\t\t\t{$user_where}\n\t\t\t\tAND j.user_id = u.user_id\n\t\t\tORDER BY u.username ASC\n\t\t\tLIMIT {$start}, {$per_page}";
 } else {
     $sql = "SELECT u.username, u.user_id, u.user_active, u.user_color, u.user_rank, u.user_allow_pm, u.user_allowavatar\n\t\t\tFROM " . USERS_TABLE . " u\n\t\t\tWHERE u.user_id <> " . ANONYMOUS . "\n\t\t\t{$alpha_where}\n\t\t\t{$user_where}\n\t\t\tORDER BY u." . $sort_item . " " . $order . "\n\t\t\tLIMIT {$start}, {$per_page}";
 }
 $result = $db->sql_query($sql);
 while ($row = $db->sql_fetchrow($result)) {
     $jr_admin_row = jr_admin_get_user_info($row['user_id']);
     $module_count = !empty($jr_admin_row['user_jr_admin']) ? sizeof(explode(EXPLODE_SEPARATOR_CHAR, $jr_admin_row['user_jr_admin'])) : 0;
     $block_text = 'userrow';
     $template->assign_block_vars($block_text, array('USERNAME_FULL' => colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']), 'NAME' => $row['username'], 'ID' => $row['user_id'], 'ALLOW_PM' => $row['user_allow_pm'] ? 'checked="checked"' : '', 'ALLOW_AVATAR' => $row['user_allowavatar'] ? 'checked="checked"' : '', 'ACTIVE' => $row['user_active'] ? 'checked="checked"' : '', 'ROW_CLASS' => $i++ % 2 ? 'row1' : 'row2', 'RANK_LIST' => jr_admin_make_rank_list($row['user_id'], $row['user_rank']), 'BOOKMARK' => !$assigned_current_letter_link ? '<a name="' . $current_letter . '">' : '', 'BOOKMARK_END' => !$assigned_current_letter_link ? '</a>' : '', 'MODULES' => $module_count != 0 ? sprintf($lang['Modules_Owned'], $module_count) : '&nbsp;', 'MODULE_COUNT' => $module_count != 0 ? sprintf($lang['Modules_Owned'], $module_count) : ''));
     //We 'know' we assigned it if it wasn't already now
     $assigned_current_letter_link = true;
 }
 if ($sort_item == 'user_modules') {
     $sql = "SELECT u.user_id\n\t\t\tFROM " . USERS_TABLE . " u, " . JR_ADMIN_TABLE . " j\n\t\t\tWHERE u.user_id <> " . ANONYMOUS . "\n\t\t\t{$alpha_where}\n\t\t\t{$user_where}\n\t\t\t\tAND j.user_id = u.user_id";
 } else {
     $sql = "SELECT u.user_id\n\t\t\tFROM " . USERS_TABLE . " u\n\t\t\tWHERE u.user_id <> " . ANONYMOUS . "\n\t\t\t{$alpha_where}\n\t\t\t{$user_where}";
 }
 $result = $db->sql_query($sql);
 $row = $db->sql_numrows($result);
 $total_users_count = $row;
 $template->assign_vars(array('PAGINATION' => generate_pagination('admin_jr_admin.' . PHP_EXT . '?sort_item=' . $sort_item . '&amp;order=' . $order . '&amp;alphanum=' . $alphanum, $total_users_count, $per_page, $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $per_page) + 1, ceil($total_users_count / $per_page))));
function jr_admin_make_admin_link()
{
    global $lang, $userdata, $phpEx;
    if ($userdata['user_level'] == ADMIN) {
        return '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />';
    } elseif ($userdata['user_id'] == ANONYMOUS) {
        return '';
    } else {
        $jr_admin_userdata = jr_admin_get_user_info($userdata['user_id']);
        if (!empty($jr_admin_userdata['user_jr_admin'])) {
            return '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />';
        } else {
            return '';
        }
    }
}
Ejemplo n.º 3
0
//
if (isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left') {
    /* Orginal phpBB
    		$dir = @opendir(".");
    
    		$setmodules	= 1;
    		while(($file = readdir($dir)) !== false)
    		{
    			if(	preg_match("/^admin_.*?\." . $phpEx	. "$/",	$file) )
    			{
    				include($file);
    			}
    		}
    		@closedir($dir);
    	*/
    $jr_admin_userdata = jr_admin_get_user_info($userdata['user_id']);
    $module = jr_admin_get_module_list($jr_admin_userdata['user_jr_admin']);
    //reset($mvModules);
    //foreach ($mvModules as $name => $value)
    //{
    //	  if ($value['state'] != 1 && $value['state'] != 5)
    //		  continue;
    //	  reset($value['admin']);
    //	  foreach ($value['admin'] as $n =>	$file)
    //	  {
    //		  include($phpbb_root_path . 'modules/'	. $name	. '/admin/'	. $file);
    //	  }
    //}
    //unset($setmodules);
    include './page_header_admin.' . $phpEx;
    $template->set_filenames(array("body" => "index_navigate.tpl"));
Ejemplo n.º 4
0
function jr_admin_make_admin_link()
{
    global $user, $lang;
    if (!$user->data['session_logged_in']) {
        return '&nbsp;';
    }
    $full_server_url = create_server_url();
    if ($user->data['user_level'] == ADMIN) {
        return '<a href="' . $full_server_url . ADM . '/index.' . PHP_EXT . '?sid=' . $user->data['session_id'] . '">' . $lang['Admin_panel'] . '</a>';
    }
    $jr_admin_userdata = jr_admin_get_user_info($user->data['user_id']);
    if (!empty($jr_admin_userdata['user_jr_admin'])) {
        return '<a href="' . $full_server_url . ADM . '/index.' . PHP_EXT . '?sid=' . $user->data['session_id'] . '">' . $lang['Admin_panel'] . '</a>';
    } else {
        return '&nbsp;';
    }
}