$list = sumo_get_table_header($table['data']['group2accesspoints']);
while ($tab = $rs->FetchRow()) {
    $style = sumo_alternate_str('tab-row-on', 'tab-row-off');
    $query = "SELECT id,node,path,name FROM " . SUMO_TABLE_ACCESSPOINTS . "\n\t\t\t  WHERE (\n\t\t\t  \t\t usergroup LIKE '" . $tab['usergroup'] . "' \n\t\t\t\t\t OR usergroup LIKE '" . $tab['usergroup'] . ";%'\n\t\t\t\t\t OR usergroup LIKE '%;" . $tab['usergroup'] . "'\n\t\t\t\t\t OR usergroup LIKE '%;" . $tab['usergroup'] . ";%'\n\t\t\t\t\t )\n\t\t\t  ORDER BY node,name,path";
    $rs2 = $SUMO['DB']->Execute($query);
    $ap = "<table width='100%'>";
    $a = 0;
    while ($tab2 = $rs2->FetchRow()) {
        $style2 = sumo_alternate_str('tab-row-on', 'tab-row-off', $tab['usergroup']);
        $tab2['name'] = sumo_get_accesspoint_name($tab2['name'], $_COOKIE['language']);
        $ap .= "<tr>" . "<td width='100%' class='" . $style2 . "' nowrap>" . "<a href='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=edit&id=" . $tab2['id'] . "\");'>" . $tab2['name'] . "</a>" . "</td>" . "<td class='" . $style2 . "'>" . "<a href='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=edit&id=" . $tab2['id'] . "\");'>" . $tab2['path'] . "</a>" . "</td>" . "</tr>\n";
        $a++;
    }
    $ap .= "</table>";
    if ($search) {
        $tab['usergroup'] = sumo_color_match_string($field['usergroup'][1], $tab['usergroup']);
    }
    $width = $a > 5 ? " width='450'" : '';
    $list .= "<tr>\n" . " <td class='" . $style . "'><b>" . "<a href='javascript:sumo_ajax_get(\"groups\",\"?module=groups&action=edit&id=" . $tab['id'] . "\");'>" . $tab['usergroup'] . "</a>" . "</b>" . "<br>({$a} " . $language['accesspoints'] . ")</td>\n";
    if ($_SESSION['relationship']['group2accesspoints']['col'][100]) {
        $list .= " <td>" . $ap . "</td>\n";
    }
    if ($_SESSION['relationship']['group2accesspoints']['col'][101]) {
        $list .= " <td style='border-bottom:1px solid #DCDCDC'><img onclick='javascript:window.open(\"services.php?module=relationship&service=relationship&cmd=GET_GROUP2ACCESSPOINTS&id=" . $tab['id'] . "\",\"group2accesspoints\",\"height=200,width=500,resizable=yes,scrollbars=yes\");' " . " src='services.php?module=relationship&service=relationship&cmd=GET_GROUP2ACCESSPOINTS&id=" . $tab['id'] . "' alt=''{$width}></td>\n" . "</tr>\n";
    }
}
$list .= "</table>";
$searched = $search ? $_SESSION['search_relationship_group2accesspoints'] : '';
// Template Data
$tpl = array('GET:Theme' => $SUMO['page']['theme'], 'GET:MenuModule' => $tpl['GET:MenuModule'], 'GET:List' => $list, 'GET:TotalRows' => number_format($tot, 0, "", "."), 'GET:StartRow' => number_format($_SESSION['start_relationship_group2accesspoints'], 0, "", "."), 'GET:EndRow' => number_format($_SESSION['start_relationship_group2accesspoints'] + $vis, 0, "", "."), 'GET:PagingResults' => sumo_paging_results($tot, $vis, $_SESSION['rows_relationship_group2accesspoints'], 5, $_SESSION['start_relationship_group2accesspoints'], 'start_relationship_group2accesspoints'), 'GET:TableSettings' => sumo_get_table_settings($table['data']['group2accesspoints']), 'GET:SearchForm' => sumo_get_form_search($searched), 'GET:ExportData' => sumo_get_export_data());
$tpl['GET:Pagination'] = $tot > 0 ? $tpl['GET:StartRow'] . "..." . $tpl['GET:EndRow'] . "&nbsp;&nbsp;" . $language['of'] . "&nbsp;<b>" . $tpl['GET:TotalRows'] . "</b>" : "";
Esempio n. 2
0
 }
 $color = 'green';
 if ($tab['expire'] < $SUMO['server']['time'] + 500) {
     $color = 'orange';
 }
 if ($tab['expire'] < $SUMO['server']['time'] + 300) {
     $color = 'red';
 }
 $country = explode('-', $tab['country_name']);
 $country[0] = ucwords(strtolower($country[0]));
 $country[1] = strtolower($country[1]);
 $flag = trim($country[1]) ? trim($country[1]) . ".png" : "blank.png";
 if (!$country[1]) {
     $country[1] = 'blank';
 }
 $user = $search ? sumo_color_match_string($field['user'][1], $tab['username']) : $tab['username'];
 $username = sumo_get_username($tab['username']);
 $apinfo = sumo_get_accesspoint_info(sumo_get_normalized_accesspoint($tab['url']), 'path');
 $apname = sumo_get_accesspoint_name($apinfo['name'], $_COOKIE['language']);
 $list .= "<tr>\n";
 if ($col[1]) {
     $list .= " <td class='" . $style . "'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/sessions/status_" . $color . ".gif' class='session-status'>&nbsp;&nbsp;" . $tab['id'] . "</td>\n";
 }
 if ($col[4]) {
     $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"users\",\"?module=users&action=view&id=" . $tab['id_user'] . "\");" . "' title='" . $language['ViewUser'] . ": " . $username . "'>" . $user . "</a></td>\n";
 }
 if ($col[2]) {
     $list .= " <td class='" . $style . "' align='right'><a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_node&id=" . $node[$tab['node']]['id'] . "\");'>" . $node[$tab['node']]['name'] . "</a></td>\n";
 }
 //if($col[2])  $list .= " <td class='".$style."'><a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=nlist\");'>".$node[$tab['node']]['name']."</a></td>\n";
 if ($col[7]) {
Esempio n. 3
0
$query2 = $query1 . " ORDER BY " . $_SESSION['relationship']['user2accesspoints']['col_sql'] . " " . $_SESSION['relationship']['user2accesspoints']['mode_sql'];
$rs = $SUMO['DB']->Execute($query1);
$tot = $rs->PO_RecordCount();
$rs = $SUMO['DB']->SelectLimit($query2, $_SESSION['rows_relationship_user2accesspoints'], $_SESSION['start_relationship_user2accesspoints']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
$list = sumo_get_table_header($table['data']['user2accesspoints']);
while ($tab = $rs->FetchRow()) {
    $style = sumo_alternate_str('tab-row-on', 'tab-row-off', $tab['username']);
    $ap = sumo_get_user_accesspoints($tab['id'], true);
    if ($search) {
        $tab['username'] = sumo_color_match_string($field['username'][1], $tab['username']);
        $tab['firstname'] = sumo_color_match_string($field['firstname'][1], $tab['firstname']);
        $tab['lastname'] = sumo_color_match_string($field['lastname'][1], $tab['lastname']);
    }
    //$width = $a > 5 ? " width='400'" : '';
    $list .= "<tr>\n" . " <td class='" . $style . "' style='padding:10px'>" . "<a href='javascript:sumo_ajax_get(\"users\",\"?module=users&action=view&id=" . $tab['id'] . "\");'>" . "<b>" . $tab['username'] . "</b><br>" . $tab['lastname'] . " " . $tab['firstname'] . "</a>" . "</td>\n";
    if ($_SESSION['relationship']['user2accesspoints']['col'][100]) {
        $list .= " <td>" . $ap . "</td>\n";
    }
    /*
    if($_SESSION['relationship']['user2accesspoints']['col'][101])
    {
    	$list .= " <td style='border-bottom:1px solid #DCDCDC'><img onclick='javascript:window.open(\"services.php?module=relationship&service=relationship&cmd=GET_USER2ACCESSPOINTS&id=".$tab['id']."\",\"user2accesspoints\",\"height=200,width=500,resizable=yes,scrollbars=yes\");' "
    			." src='services.php?module=relationship&service=relationship&cmd=GET_USER2ACCESSPOINTS&id=".$tab['id']."' alt=''$width></td>\n"
    			."</tr>\n";		
    }
    */
}
Esempio n. 4
0
$query2 = $query1 . " ORDER BY " . $_SESSION['sessions']['clist']['col_sql'] . " " . $_SESSION['sessions']['clist']['mode_sql'];
$rs = $SUMO['DB']->CacheExecute(5, $query1);
$tot = $rs->PO_RecordCount();
$SUMO['DB']->cacheSecs = 5;
$rs = $SUMO['DB']->CacheSelectLimit($query2, $_SESSION['rows_sessions_clist'], $_SESSION['start_sessions_clist']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
if ($tot > 0) {
    $list = sumo_get_table_header($table['data']['clist']);
    $col = $_SESSION['sessions']['clist']['col'];
    while ($tab = $rs->FetchRow()) {
        $style = sumo_alternate_str('tab-row-on', 'tab-row-off');
        if ($search) {
            $tab['ip'] = sumo_color_match_string($field['ip'][1], $tab['ip']);
        }
        $list .= "<tr>\n";
        if ($col[1]) {
            $list .= " <td class='" . $style . "' align='right'>" . "<a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=nlist\");'>" . $tab['node'] . "</a></td>\n";
        }
        if ($col[2]) {
            $list .= " <td class='" . $style . "' align='right'>" . $tab['ip'] . "</td>\n";
        }
        if ($col[3]) {
            $list .= " <td class='" . $style . "' align='right'>" . $tab['requests'] . "</td>\n";
        }
        if ($col[4]) {
            $list .= " <td class='" . $style . "'>" . sumo_get_human_date($tab['time'], TRUE, TRUE) . "</td>\n";
        }
        if ($col[2]) {
Esempio n. 5
0
    $search = $field['ip'][0] ? " WHERE " . $field['ip'][0] . " " : '';
}
$query1 = "SELECT * FROM " . SUMO_TABLE_BANNED . " " . $search . " ";
$query2 = $query1 . " ORDER BY " . $_SESSION['security']['banned']['col_sql'] . " " . $_SESSION['security']['banned']['mode_sql'];
$rs = $SUMO['DB']->Execute($query1);
$tot = $rs->PO_RecordCount();
$rs = $SUMO['DB']->SelectLimit($query2, $_SESSION['rows_security_banned'], $_SESSION['start_security_banned']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
$col = $_SESSION['security']['banned']['col'];
if ($tot > 0) {
    $list = sumo_get_table_header($table['data']['banned']);
    while ($tab = $rs->FetchRow()) {
        $ip = $search ? sumo_color_match_string($field['ip'][1], $tab['ip']) : $tab['ip'];
        $time = sumo_get_human_date($tab['time'] + $SUMO['config']['security']['banned_time'], true, true);
        $style = sumo_alternate_str('tab-row-on', 'tab-row-off');
        $list .= "<tr>\n";
        if ($col[2]) {
            $list .= " <td class='" . $style . "'>" . $ip . "</td>\n";
        }
        if ($col[3]) {
            $list .= " <td class='" . $style . "'>" . $time . "</td>\n";
        }
        if (($col[2] || $col[3]) && $enableip) {
            $list .= " <td class='" . $style . "'>" . "<a href='javascript:sumo_ajax_get(\"security\",\"?module=security&action=banned&enableip=" . $tab['id'] . "\");'>" . $language['enable'] . "</a></td>\n";
        }
        $list .= "</tr>\n";
    }
    $list .= "</table>";
Esempio n. 6
0
 $group = preg_replace("/sumo:7/", "<b><font color='#BB0000'>sumo:7</font></b>", $tab['usergroup']);
 $group = preg_replace("/sumo:/", "<font color='#BB0000'>sumo</font>:", $group);
 $group = str_replace(';', ', ', $group);
 $group = strlen(strip_tags($group)) > 50 ? substr($group, 0, 50) . '...' : $group;
 //
 $usergroup = sumo_get_grouplevel($tab['usergroup'], true);
 for ($g = 0; $g < count($usergroup); $g++) {
     if (!in_array($usergroup[$g], $available_group)) {
         $group = str_replace($usergroup[$g], '<strike>' . $usergroup[$g] . '</strike>', $group);
     }
 }
 if ($search) {
     $tab['username'] = sumo_color_match_string($field['username'][1], $tab['username']);
     $tab['email'] = sumo_color_match_string($field['email'][1], $tab['email']);
     $group = sumo_color_match_string($field['usergroup'][1], strip_tags($group));
     $username = sumo_color_match_string(array_merge($field['firstname'][1], $field['lastname'][1]), $username);
 }
 $list .= "<tr" . $rowcolor . ">\n";
 if ($col[6]) {
     $list .= " <td class='" . $style . "'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/users/user_" . $color . ".gif' alt='&bull;'></td>\n";
 }
 if ($col[1]) {
     $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"users.content\",\"?module=users&action=view&id=" . $tab['id'] . "&decoration=false\");' title='" . $language['ViewUser'] . "'>" . $tab['id'] . "</a></td>\n";
 }
 if ($col[2]) {
     $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"users.content\",\"?module=users&action=view&id=" . $tab['id'] . "&decoration=false\");' title='" . $language['ViewUser'] . "'>" . $tab['username'] . "</a></td>\n";
 }
 if ($col[4]) {
     $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"users.content\",\"?module=users&action=view&id=" . $tab['id'] . "&decoration=false\");' title='" . $language['ViewUser'] . "'>" . $username . "</a></td>\n";
 }
 if ($col[8]) {
Esempio n. 7
0
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
if ($tot > 0) {
    $list = sumo_get_table_header($table['data'][$action]);
    $col = $_SESSION['security'][$action]['col'];
    while ($tab = $rs->FetchRow()) {
        $style = "class='" . sumo_alternate_str('tab-row-on', 'tab-row-off') . "'";
        $node = sumo_get_node_info($tab['node'], 'ip');
        $node['name'] = !$node['name'] ? '&minus;' : $node['name'];
        if ($search) {
            $tab['code'] = sumo_color_match_string($field['code'][1], $tab['code']);
            $tab['ip'] = sumo_color_match_string($field['ip'][1], $tab['ip']);
            $tab['message'] = sumo_color_match_string($field['message'][1], $tab['message']);
            $tab['country_name'] = sumo_color_match_string($field['country_name'][1], $tab['country_name']);
        }
        $list .= "<tr>\n";
        if ($col[2]) {
            $list .= " <td {$style} align='center'><img src='themes/" . $SUMO['page']['theme'] . "/images/modules/security/priority_" . $tab['priority'] . ".gif' class='log-priority' alt='" . $tab['priority'] . "'></td>\n";
        }
        if ($col[3]) {
            $list .= " <td {$style} align='right'>" . $tab['code'] . "</td>\n";
        }
        if ($col[4]) {
            $list .= " <td {$style} align='right'>" . $node['name'] . "</td>\n";
        }
        if ($col[5]) {
            $list .= " <td {$style} align='right'>" . $tab['ip'] . "</td>\n";
        }
        if ($col[6]) {
Esempio n. 8
0
$query2 = $query1 . " ORDER BY " . $_SESSION['accesspoints']['list']['col_sql'] . " " . $_SESSION['accesspoints']['list']['mode_sql'];
$rs = $SUMO['DB']->Execute($query1);
$tot = $rs->PO_RecordCount();
$rs = $SUMO['DB']->SelectLimit($query2, $_SESSION['rows_accesspoints_list'], $_SESSION['start_accesspoints_list']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
if ($tot > 0) {
    $list = sumo_get_table_header($table['data']['list']);
    $col = $_SESSION['accesspoints']['list']['col'];
    while ($tab = $rs->FetchRow()) {
        if ($search) {
            $path2 = sumo_color_match_string($field['a.path'][1], $tab['path']);
            $path3 = sumo_color_match_string($field['a.name'][1], sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']));
            $node = sumo_color_match_string($field['b.name'][1], $tab['node_name']);
        } else {
            $path2 = $tab['path'];
            $path3 = sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']);
            $node = $tab['node_name'];
        }
        $http_auth = $tab['http_auth'] ? 'httpauth' : 'nohttpauth';
        $filtering = $tab['filtering'] ? 'filtering' : 'nofiltering';
        $pwd_encrypt = $tab['pwd_encrypt'] ? 'encrypt' : 'noencrypt';
        $registration = $tab['registration'] ? 'reg' : 'noreg';
        $change_pwd = $tab['change_pwd'] ? 'changepwd' : 'nochangepwd';
        $group = str_replace(';', ', ', $tab['usergroup']);
        $group = strlen($group) > 50 ? substr($group, 0, 50) . '...' : $group;
        $theme = ucwords($tab['theme']);
        $created = $tab['created'] ? sumo_get_human_date($tab['created']) : '';
        $updated = $tab['updated'] ? sumo_get_human_date($tab['updated']) : '';
Esempio n. 9
0
$query2 = $query1 . " ORDER BY " . $_SESSION['groups']['list']['col_sql'] . " " . $_SESSION['groups']['list']['mode_sql'];
$rs = $SUMO['DB']->Execute($query1);
$tot = $rs->PO_RecordCount();
$rs = $SUMO['DB']->SelectLimit($query2, $_SESSION['rows_groups_list'], $_SESSION['start_groups_list']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
if ($tot > 0) {
    $list = sumo_get_table_header($table['data']['list']);
    $col = $_SESSION['groups']['list']['col'];
    while ($tab = $rs->FetchRow()) {
        $style = sumo_alternate_str('tab-row-on', 'tab-row-off');
        if ($search) {
            $tab['usergroup'] = sumo_color_match_string($field['usergroup'][1], $tab['usergroup']);
            $tab['description'] = sumo_color_match_string($field['description'][1], $tab['description']);
        }
        if (!$tab['description']) {
            $tab['description'] = '&nbsp;';
        }
        if ($_SESSION['groups']['list']['col'][100]) {
            $users = sumo_get_group_users($tab['id']);
            if ($users == 0) {
                $users = "<font color='red'>" . $language['NoUsers'] . "</font>";
            } else {
                $users = "<a href=\"javascript:sumo_ajax_get('relationship','?module=relationship&action=group2users&id=" . $tab['id'] . "');\">" . $users . "</a>";
            }
        }
        $created = $tab['created'] ? sumo_get_human_date($tab['created']) : '&nbsp;';
        $updated = $tab['updated'] ? sumo_get_human_date($tab['updated']) : '&nbsp;';
        $style2 = $tab['updated'] > $SUMO['server']['time'] - 10 ? " style='border-top:1px solid #FF7722;border-bottom:1px solid #FF7722'" : "";
Esempio n. 10
0
 $list = sumo_get_table_header($table['data']['stats']);
 while ($tab = $rs->FetchRow()) {
     $query2 = "SELECT MAX(access) FROM " . SUMO_TABLE_ACCESSPOINTS_STATS;
     $query3 = "SELECT MAX(activity) FROM " . SUMO_TABLE_ACCESSPOINTS_STATS;
     $style = sumo_alternate_str('tab-row-on', 'tab-row-off');
     $rs2 = $SUMO['DB']->CacheExecute(15, $query2);
     $rs3 = $SUMO['DB']->CacheExecute(15, $query3);
     $max2 = $rs2->FetchRow();
     $max3 = $rs3->FetchRow();
     $path2 = $tab['path'];
     $path3 = sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']);
     $max_access = $max2[0];
     $max_activity = $max3[0];
     if ($search) {
         $path2 = sumo_color_match_string($field['path'][1], $tab['path']);
         $path3 = sumo_color_match_string($field['name'][1], sumo_get_accesspoint_name($tab['name'], $_COOKIE['language']));
     }
     // verify if user is current node/path
     if ($SUMO['page']['node'] == $tab['node'] && $SUMO['page']['path'] == $tab['path']) {
         $style = 'tab-row-highlight';
     }
     $list .= "<tr>\n";
     if ($_SESSION['accesspoints']['stats']['col'][3]) {
         $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=view&id=" . $tab['id_page'] . "\");'>" . $path3 . "</a></td>\n";
     }
     if ($_SESSION['accesspoints']['stats']['col'][1]) {
         $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"network\",\"?module=network&action=view_node&id=" . $tab['node'] . "\");'>" . $node[$tab['node']]['name'] . "</a></td>\n";
     }
     if ($_SESSION['accesspoints']['stats']['col'][4]) {
         $list .= " <td class='" . $style . "'><a href='javascript:sumo_ajax_get(\"accesspoints\",\"?module=accesspoints&action=view&id=" . $tab['id_page'] . "\");'>" . $path2 . "</a></td>\n";
     }