diff options
41 files changed, 289 insertions, 234 deletions
diff --git a/frontends/php/actionconf.php b/frontends/php/actionconf.php index 72ba6e7c..8b4783a4 100644 --- a/frontends/php/actionconf.php +++ b/frontends/php/actionconf.php @@ -32,7 +32,7 @@ // if(($_REQUEST["triggerid"]!=0)&&!check_right_on_trigger("U",$_REQUEST["triggerid"])) // { // show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); -// show_footer(); +// show_page_footer(); // exit; // } ?> @@ -232,5 +232,5 @@ show_messages(); - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php index 43fa215c..b11ba206 100644 --- a/frontends/php/alarms.php +++ b/frontends/php/alarms.php @@ -29,7 +29,7 @@ if(!check_right_on_trigger("R",$_REQUEST["triggerid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -172,5 +172,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index 7cfe3007..2f744bbd 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -136,5 +136,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/audit.php b/frontends/php/audit.php index a6f6abbb..9dee41ef 100644 --- a/frontends/php/audit.php +++ b/frontends/php/audit.php @@ -159,5 +159,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/bulkloader.php b/frontends/php/bulkloader.php index de152b44..a7e923d8 100644 --- a/frontends/php/bulkloader.php +++ b/frontends/php/bulkloader.php @@ -27,7 +27,7 @@ if(!check_anyright("Default permission","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } insert_confirm_javascript(); @@ -209,6 +209,6 @@ "</form>" ), 1); table_end(); - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/chart4.php b/frontends/php/chart4.php index ff994b39..edc1db45 100644 --- a/frontends/php/chart4.php +++ b/frontends/php/chart4.php @@ -91,7 +91,7 @@ if(!check_right_on_trigger("R",$_REQUEST["triggerid"])) { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); -// show_footer(); +// show_page_footer(); ImageOut($im); ImageDestroy($im); exit; diff --git a/frontends/php/charts.php b/frontends/php/charts.php index afa32d0f..fa1ae9bf 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -331,5 +331,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/config.php b/frontends/php/config.php index 909af2e9..5bf714e4 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -34,7 +34,7 @@ { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font >"); - show_footer(); + show_page_footer(); exit; } ?> @@ -480,5 +480,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/css.css b/frontends/php/css.css index 847f8eab..96dba3fb 100644 --- a/frontends/php/css.css +++ b/frontends/php/css.css @@ -11,6 +11,7 @@ body line-height:16px; } +/********** FORM *************/ form {margin: 0px} td.form_row_l @@ -59,7 +60,21 @@ td.form_row_first padding-left: 5px; padding-right: 5px; } +tr.form_odd_row +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:10pt; + text-decoration: none; + background-color:#D8D8D8; +} +tr.form_even_row +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:10pt; + text-decoration: none; + background-color:#DFDFDF; +} td.form_row_last { color: #FFFFFF; @@ -132,37 +147,43 @@ span.divider font-weight: normal; } -a.highlight:link { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; } -a.highlight:visited { text-decoration: none; color: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; } -a.highlight:hover { text-decoration: underline; color: #ffcc00; font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; } - -.footer -{ - color:#CCCCCC; +a.highlight:link +{ + text-decoration: none; + color: #ffffff; + font-family: Verdana, Arial, sans-serif; + font-size: 10px; + font-weight: bold; } - -td,tr +a.highlight:visited { - font-family:Verdana, Arial, Helvetica, sans-serif; - font-size:10pt; text-decoration: none; + color: #ffffff; + font-family: Verdana, Arial, sans-serif; + font-size: 10px; + font-weight: bold; +} +a.highlight:hover +{ + text-decoration: underline; + color: #ffcc00; + font-family: Verdana, Arial, sans-serif; + font-size: 10px; + font-weight: bold; } -tr.form_odd_row +.footer { - font-family:Verdana, Arial, Helvetica, sans-serif; - font-size:10pt; - text-decoration: none; - background-color:#D8D8D8; + color:#CCCCCC; } -tr.form_even_row +td,tr { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10pt; text-decoration: none; - background-color:#DFDFDF; } + td.table_message { text-align: center; @@ -171,6 +192,7 @@ tr.table_header { font-family:verdana, arial, helvetica, sans-serif; font-size:10pt; + font-weight: bold; text-decoration: none; background-color:#CCCCCC; } @@ -271,25 +293,6 @@ A.on:link background-color: #AADDAA; } -td.top_header_left -{ - background-color: #FFFFFF; - vertical-align: middle; - padding: 0; -} - -td.top_header_right -{ - text-align: right; - background-color: #FFFFFF; - border-color: #AAAAAA; - border-width:1px; - border-right-style: solid; - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 8pt; - vertical-align: middle; -} - a.small_font { color: #000000; @@ -351,6 +354,67 @@ table.form width: 100%; } +/**************** PAGE HEADER ****************/ +table.page_header +{ + background-color: #FFFFFF; + border-color: #000000; + border-width:0px; + border-top-style: solid; + border-left-style: solid; + border-right-style: solid; + border-bottom-style: solid; + padding-right: 0px; + padding-left: 0px; + width: 100%; +} +td.page_header_l +{ + background-color: #FFFFFF; + vertical-align: middle; + padding: 0; +} +td.page_header_r +{ + text-align: right; + background-color: #FFFFFF; + border-width:0px; + border-right-style: solid; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 8pt; + vertical-align: middle; +} + +/**************** PAGE FOOTER ****************/ +table.page_footer +{ + color: #FFFFFF; + background: #5C7099 url(images/gradients/table_head.gif) repeat-x top left; + border-color: #000000; + font-weight: bold; + border-width:0px; + border-top-style: solid; + border-left-style: solid; + border-right-style: solid; + border-bottom-style: solid; + padding-right: 5px; + padding-left: 5px; + width: 100%; +} +td.page_footer_l +{ + font-family:verdana, arial, helvetica, sans-serif; + font-size:10px; + height: 24px; + text-align: center; +} +td.page_footer_r +{ + font-family:verdana, arial, helvetica, sans-serif; + font-size:10px; + height: 24px; + text-align: right; +} A.footer { color:#CCCCCC; diff --git a/frontends/php/graph.php b/frontends/php/graph.php index 5d1b85e4..2a31526b 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -33,7 +33,7 @@ if(!check_right("Graph","R",$_REQUEST["graphid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -248,5 +248,5 @@ show_table2_header_end(); ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index f5ffa60c..fe943347 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -33,7 +33,7 @@ if(!check_anyright("Graph","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } $_REQUEST["hostid"]=@iif(isset($_REQUEST["hostid"]),$_REQUEST["hostid"],get_profile("web.latest.hostid",0)); @@ -197,5 +197,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/history.php b/frontends/php/history.php index fc6ada99..296ed8b2 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -73,7 +73,7 @@ if(!check_right("Item","R",$_REQUEST["itemid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } @@ -241,7 +241,7 @@ } echo "</TABLE>"; - show_footer(); + show_page_footer(); exit; } @@ -260,7 +260,7 @@ $_REQUEST["from"]=($now-mktime($_REQUEST["hour"], 0, 0, $_REQUEST["month"], $_REQUEST["day"],$_REQUEST["year"]))/3600; } @show_history($_REQUEST["itemid"],$_REQUEST["from"],$effectiveperiod); - show_footer(); + show_page_footer(); exit; } @@ -350,7 +350,7 @@ } $table->show(); - show_footer(); + show_page_footer(); exit; } ?> diff --git a/frontends/php/hostprofiles.php b/frontends/php/hostprofiles.php index c7188153..a1071bed 100644 --- a/frontends/php/hostprofiles.php +++ b/frontends/php/hostprofiles.php @@ -30,14 +30,14 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } if(isset($_REQUEST["hostid"])&&!check_right("Host","R",$_REQUEST["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -153,5 +153,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 79b2942d..aef52150 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -31,7 +31,7 @@ if(!check_anyright("Host","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } @@ -636,5 +636,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php index 12adc6ef..b99e307d 100644 --- a/frontends/php/include/classes/clink.inc.php +++ b/frontends/php/include/classes/clink.inc.php @@ -35,7 +35,8 @@ { return $this->error("Incorrect value for SetUrl [$value]"); } - $this->AddOption("href",$value); + + $this->AddOption("href",htmlspecialchars($value)); } } ?> diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 5f9f7b71..91c041f9 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -997,7 +997,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! show_header("Login",0,1,1); show_error_message("Login name or password is incorrect"); insert_login_form(); - show_footer(); + show_page_footer(); exit; } @@ -1020,9 +1020,9 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - <meta http-equiv="Content-Type" content="text/html; charset=<?php echo S_HTML_CHARSET; ?>"/> - <meta name="Author" content="Alexei Vladishev"/> - <link rel="stylesheet" href="css.css"/> + <meta http-equiv="Content-Type" content="text/html; charset=<?php echo S_HTML_CHARSET; ?>"> + <meta name="Author" content="Alexei Vladishev"> + <link rel="stylesheet" href="css.css"> <?php // if($USER_DETAILS['alias']=='guest') // { @@ -1044,10 +1044,8 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! <body> <?php - if($nomenu == 0) - { -?> -<?php + if($nomenu == 0) + { $menu=array( "view"=>array( "label"=>S_MONITORING, @@ -1106,20 +1104,25 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! ) ), ); -?> -<table border=0 cellspacing=0 cellpadding=5 width="100%" bgcolor="#FFFFFF"> -<tr> -<td width="118" height="31" class="top_header_left"><img width="118" height="31" src="images/general/zabbix.png" border="0" alt="ZABBIX"></td> -<?php - if($USER_DETAILS["alias"]=="guest") { + $table = new CTable(NULL,"page_header"); + $table->SetCellSpacing(0); + $table->SetCellPadding(5); + + $col_r = array(new CLink(S_HELP, "http://www.zabbix.com/manual/v1.1/index.php", "small_font")); + if($USER_DETAILS["alias"]!="guest") { + array_push($col_r, "|"); + array_push($col_r, new CLink(S_PROFILE, "profile.php", "small_font")); + } + + $table->AddRow(array( + new CCol(new CLink(new CImg("images/general/zabbix.png","ZABBIX")), + "page_header_l"), + new CCol($col_r, + "page_header_r"))); + + $table->Show(); ?> -<td width="662" class="top_header_right"><a href="http://www.zabbix.com/manual/v1.1/index.php" class="small_font"><?php echo S_HELP;?></a></td> -<?php } else { ?> -<td width="662" class="top_header_right"><a href="http://www.zabbix.com/manual/v1.1/index.php" class="small_font"><?php echo S_HELP;?></a> | <a href="profile.php" class="small_font"><?php echo S_PROFILE;?></a></td> -<?php } ?> -</tr> -</table> <table class="menu" cellspacing=0 cellpadding=5> <tr> @@ -1166,14 +1169,12 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! else if($i==4) $url="0"; if($url=="0") $url=$sub["level2"][0]["url"]; - if($active==1) - { - echo "<td class=\"horizontal_menu\" height=24 colspan=9><b><a href=\"$url\" class=\"highlight\">".$sub["label"]."</a></b></td>\n"; - } + if($active==1) + $class = "horizontal_menu"; else - { - echo "<td class=\"horizontal_menu_n\" height=24 colspan=9><b><a href=\"$url\" class=\"highlight\">".$sub["label"]."</a></b></td>\n"; - } + $class = "horizontal_menu_n"; + + echo "<td class=\"$class\" height=24 colspan=9><b><a href=\"$url\" class=\"highlight\">".$sub["label"]."</a></b></td>\n"; $i++; } ?> @@ -1183,7 +1184,6 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! <table class="menu" width="100%" cellspacing=0 cellpadding=5> <tr><td class="horizontal_menu" height=24 colspan=9><b> <?php -// $i=0; if(isset($active_level1)) foreach($menu[$active_level1]["level2"] as $label=>$sub) { @@ -1214,17 +1214,13 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! if(($sub["url"]=="screenedit.php")&&!check_anyright("Screen","U")) continue; if(($sub["url"]=="screenconf.php")&&!check_anyright("Screen","U")) continue; if(($sub["url"]=="services.php")&&!check_anyright("Service","U")) continue; -// End of check permissions -// if($i==0) + echo "<a href=\"".$sub["url"]."\" class=\"highlight\">".$sub["label"]."</a><span class=\"divider\"> | </span>\n"; -// else -// echo "<a href=\"".$sub["url"]."\" class=\"highlight\">".$sub["label"]."</a><span class=\"divider\"> | </span>"; -// $i++; } ?> </b></td></tr> </table> -<p align=center> +<br/> <?php } } @@ -2390,7 +2386,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! show_table2_header_end(); - show_footer(); + show_page_footer(); } # Show in plain text @@ -2426,25 +2422,29 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! show_table2_header_end(); - show_footer(); + show_page_footer(); } - function show_footer() + function show_page_footer() { global $USER_DETAILS; -?> -<p> -<table class="menu" width="100%" cellspacing=0 cellpadding=5> -<tr> -<td class="horizontal_menu" height=24 colspan=9 align=center><b><?php echo "<a href=\"http://www.zabbix.com\" class=\"highlight\">".S_ZABBIX_VER."</a> ".S_COPYRIGHT_BY."<a href=\"http://www.zabbix.com\" class=\"highlight\">".S_SIA_ZABBIX."</a>"; ?></b></td> -<td class="horizontal_menu" height=24 colspan=9 align=right><b><span class="divider"> | </span><?php echo " ".S_CONNECTED_AS." ".$USER_DETAILS["alias"];?></b></td> -</tr> -</table> - -</body> -</html> -<?php + echo BR; + $table = new CTable(NULL,"page_footer"); + $table->SetCellSpacing(0); + $table->SetCellPadding(1); + $table->AddRow(array( + new CCol(new CLink( + S_ZABBIX_VER.SPACE.S_COPYRIGHT_BY.SPACE.S_SIA_ZABBIX, + "http://www.zabbix.com", "highlight"), + "page_footer_l"), + new CCol("<span class='divider'> | </span>". + S_CONNECTED_AS." ".$USER_DETAILS["alias"], + "page_footer_r") + )); + $table->Show(); + echo "</body>\n"; + echo "</html>\n"; } function get_stats() @@ -2824,20 +2824,19 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!! function insert_confirm_javascript() { - echo "<script language=\"JavaScript\" type=\"text/javascript\">"; - - echo "function Confirm(msg)"; - echo "{"; - echo " if(confirm( msg))"; - echo " {"; - echo " return true;"; - echo " }"; - echo " else"; - echo " {"; - echo " return false;"; - echo " }"; - echo "}"; - echo "</script>"; + echo "<script language=\"JavaScript\" type=\"text/javascript\">\n"; + echo "function Confirm(msg)\n"; + echo "{\n"; + echo " if(confirm( msg))\n"; + echo " {\n"; + echo " return true;\n"; + echo " }\n"; + echo " else\n"; + echo " {\n"; + echo " return false;\n"; + echo " }\n"; + echo "}\n"; + echo "</script>\n"; } /* Use ImageSetStyle+ImageLIne instead of bugged ImageDashedLine */ diff --git a/frontends/php/include/html.inc.php b/frontends/php/include/html.inc.php index 8d7f6e41..65d9337b 100644 --- a/frontends/php/include/html.inc.php +++ b/frontends/php/include/html.inc.php @@ -24,15 +24,22 @@ function bold($str) { - if(is_array($str)) - { + if(is_array($str)){ foreach($str as $key => $val) if(is_string($val)) $str[$key] = "<b>$val</b>"; - return $str; + } elseif(is_string($str)) { + $str = "<b>$str</b>"; } - if(is_string($str)) - return "<b>$str</b>"; + return $str; + } + + function bfirst($str) // mark first symbol of string as bold + { + $res = bold($str[0]); + for($i=1; $i<strlen($str); $i++) $res .= $str[$i]; + $str = $res; + return $str; } function nbsp($str) diff --git a/frontends/php/index.php b/frontends/php/index.php index 9c7d54e2..7fd9f857 100644 --- a/frontends/php/index.php +++ b/frontends/php/index.php @@ -125,5 +125,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/items.php b/frontends/php/items.php index c0f97c7e..46681d41 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -33,7 +33,7 @@ if(!check_anyright("Host","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -423,5 +423,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/latest.php b/frontends/php/latest.php index e3b55921..d161b07a 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -29,7 +29,7 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } if(isset($_REQUEST["select"])&&($_REQUEST["select"]!="")) @@ -41,7 +41,7 @@ if(isset($_REQUEST["hostid"])&&!check_right("Host","R",$_REQUEST["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -303,5 +303,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php index 6df99d75..050fb64b 100644 --- a/frontends/php/latestalarms.php +++ b/frontends/php/latestalarms.php @@ -198,5 +198,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/maps.php b/frontends/php/maps.php index 372f65cb..af0a03ca 100644 --- a/frontends/php/maps.php +++ b/frontends/php/maps.php @@ -42,7 +42,7 @@ if(isset($_REQUEST["sysmapid"])&&!check_right("Network map","R",$_REQUEST["sysmapid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -128,5 +128,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/media.php b/frontends/php/media.php index 2373f461..f549e945 100644 --- a/frontends/php/media.php +++ b/frontends/php/media.php @@ -33,7 +33,7 @@ { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font >"); - show_footer(); + show_page_footer(); exit; } ?> @@ -132,5 +132,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/overview.php b/frontends/php/overview.php index 4e5e7115..3d67d3a3 100644 --- a/frontends/php/overview.php +++ b/frontends/php/overview.php @@ -35,7 +35,7 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } if(isset($_REQUEST["select"])&&($_REQUEST["select"]!="")) @@ -47,7 +47,7 @@ if(isset($_REQUEST["hostid"])&&!check_right("Host","R",$_REQUEST["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -259,5 +259,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/popup.php b/frontends/php/popup.php index 7e5f2a29..ce9e40d6 100644 --- a/frontends/php/popup.php +++ b/frontends/php/popup.php @@ -31,7 +31,7 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> diff --git a/frontends/php/profile.php b/frontends/php/profile.php index 8d06f4b8..e6399fa7 100644 --- a/frontends/php/profile.php +++ b/frontends/php/profile.php @@ -33,7 +33,7 @@ if($USER_DETAILS["alias"]=="guest") { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -68,5 +68,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/queue.php b/frontends/php/queue.php index dab3d76a..ffc73f4b 100644 --- a/frontends/php/queue.php +++ b/frontends/php/queue.php @@ -30,7 +30,7 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -121,5 +121,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/report1.php b/frontends/php/report1.php index 1ced2e06..eaf45dd1 100644 --- a/frontends/php/report1.php +++ b/frontends/php/report1.php @@ -59,5 +59,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/report2.php b/frontends/php/report2.php index 67d61a18..8bedc6c0 100644 --- a/frontends/php/report2.php +++ b/frontends/php/report2.php @@ -29,7 +29,7 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -155,5 +155,5 @@ <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/report3.php b/frontends/php/report3.php index 0d787beb..5290d4d7 100644 --- a/frontends/php/report3.php +++ b/frontends/php/report3.php @@ -29,7 +29,7 @@ // if(!check_right("Host","R",0)) // { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); -// show_footer(); +// show_page_footer(); // exit; // } ?> @@ -38,7 +38,7 @@ if(!isset($_REQUEST["serviceid"])) { show_table_header("<font color=\"AA0000\">Undefined serviceid !</font>"); - show_footer(); + show_page_footer(); exit; } $service=get_service_by_serviceid($_REQUEST["serviceid"]); @@ -283,5 +283,5 @@ } $table->show(); - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 0a66d944..3187c73a 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -32,7 +32,7 @@ if(!check_right("Screen","U",0)) { // show_table_header("<font color=\"AA0000\">No permissions !</font>"); -// show_footer(); +// show_page_footer(); // exit; } update_profile("web.menu.config.last",$page["file"]); @@ -96,5 +96,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index 8c47eee1..603d17cd 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -34,7 +34,7 @@ if(!check_right("Screen","U",$_REQUEST["screenid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -336,5 +336,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/screens.php b/frontends/php/screens.php index 28ebac10..0e6072a3 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -221,5 +221,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/services.php b/frontends/php/services.php index c14fd6c7..50976b8f 100644 --- a/frontends/php/services.php +++ b/frontends/php/services.php @@ -32,7 +32,7 @@ if(!check_anyright("Service","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } update_profile("web.menu.config.last",$page["file"]); @@ -542,5 +542,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php index cced74f1..9f6bdca2 100644 --- a/frontends/php/srv_status.php +++ b/frontends/php/srv_status.php @@ -42,7 +42,7 @@ echo "</TD>"; echo "</TR>"; echo "</TABLE>"; - show_footer(); + show_page_footer(); exit; } @@ -210,5 +210,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index bb2b4eed..42309e43 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -29,7 +29,7 @@ if(!check_right("Network map","U",$_REQUEST["sysmapid"])) { show_table_header("<font color=\"AA0000\">No permissions !</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -427,5 +427,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index 6fc94385..e670a74f 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -30,7 +30,7 @@ if(!check_anyright("Network map","U")) { show_table_header("<font color=\"AA0000\">No permissions !</font>"); - show_footer(); + show_page_footer(); exit; } update_profile("web.menu.config.last",$page["file"]); @@ -214,5 +214,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/tr_comments.php b/frontends/php/tr_comments.php index e98845c9..49720858 100644 --- a/frontends/php/tr_comments.php +++ b/frontends/php/tr_comments.php @@ -29,7 +29,7 @@ if(!check_right("Trigger comment","R",$_REQUEST["triggerid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -69,5 +69,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index db8b392e..a3eef85d 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -97,13 +97,13 @@ if(!check_anyright("Host","R")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } if(isset($_REQUEST["hostid"])&&!check_right("Host","R",$_REQUEST["hostid"])) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } update_profile("web.menu.view.last",$page["file"]); @@ -617,5 +617,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index b846a24a..b2dae17b 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -33,7 +33,7 @@ if(!check_anyright("Host","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } ?> @@ -338,5 +338,5 @@ ?> <?php - show_footer(); + show_page_footer(); ?> diff --git a/frontends/php/users.php b/frontends/php/users.php index 86ef198f..b479b194 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -28,23 +28,20 @@ show_header($page["title"],0,0); insert_confirm_javascript(); ?> - <?php if(!check_anyright("User","U")) { show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_footer(); + show_page_footer(); exit; } $_REQUEST["config"]=@iif(isset($_REQUEST["config"]),$_REQUEST["config"],get_profile("web.users.config",0)); update_profile("web.users.config",$_REQUEST["config"]); ?> - <?php update_profile("web.menu.config.last",$page["file"]); ?> - <?php if(isset($_REQUEST["save"])&&($_REQUEST["config"]==0)) { @@ -194,7 +191,10 @@ if($db_user=DBfetch($db_users)) $users .= $db_user["alias"]; while($db_user=DBfetch($db_users)) $users .= ", ".$db_user["alias"]; - $table->addRow(array($row["usrgrpid"], $name, $users)); + $table->addRow(array( + $row["usrgrpid"], + $name, + $users)); } $table->show(); } @@ -211,46 +211,42 @@ $table=new CTableInfo(S_NO_USERS_DEFINED); $table->setHeader(array(S_ID,S_ALIAS,S_NAME,S_SURNAME,S_IS_ONLINE_Q,S_ACTIONS)); - $result=DBselect("select u.userid,u.alias,u.name,u.surname from users u order by u.alias"); - $col=0; - while($row=DBfetch($result)) + $db_users=DBselect("select u.userid,u.alias,u.name,u.surname from users u order by u.alias"); + while($db_user=DBfetch($db_users)) { - if(!check_right("User","R",$row["userid"])) - { - continue; - } + if(!check_right("User","R",$db_user["userid"])) continue; - $alias="<A HREF=\"users.php?register=change&form=0&config=".$_REQUEST["config"]."&userid=".$row["userid"]."#form\">".$row["alias"]."</A>"; + $alias = new CLink($db_user["alias"], + "users.php?register=change&form=0&config=".$_REQUEST["config"]. + "&userid=".$db_user["userid"]."#form"); - $sql="select count(*) as count from sessions where userid=".$row["userid"]." and lastaccess-600<".time(); - $result2=DBselect($sql); - $row2=DBfetch($result2); - if($row2["count"]>0) + $db_sessions = DBselect("select count(*) as count from sessions ". + "where userid=".$db_user["userid"]." and lastaccess-600<".time()); + $db_ses_cnt=DBfetch($db_sessions); + if($db_ses_cnt["count"]>0) $online=new CCol(S_YES,"on"); else $online=new CCol(S_NO,"off"); - if(check_right("User","U",$row["userid"])) + if(check_right("User","U",$db_user["userid"])) { - if(get_media_count_by_userid($row["userid"])>0) + $actions = S_MEDIA; + if(get_media_count_by_userid($db_user["userid"])>0) { - $actions="<A HREF=\"media.php?userid=".$row["userid"]."\"><b>M</b>edia</A>"; - } - else - { - $actions="<A HREF=\"media.php?userid=".$row["userid"]."\">".S_MEDIA."</A>"; + bfirst(&$actions); } + $actions = new CLink($actions,"media.php?userid=".$db_user["userid"]); } else { - $actions=S_CHANGE." - ".S_MEDIA; + $actions=S_CHANGE.SPACE."-".SPACE.S_MEDIA; } $table->addRow(array( - $row["userid"], + $db_user["userid"], $alias, - $row["name"], - $row["surname"], + $db_user["name"], + $db_user["surname"], $online, $actions )); @@ -263,45 +259,34 @@ } } ?> - <?php if(isset($_REQUEST["userid"])&&isset($_REQUEST["form"])&&($_REQUEST["config"]==0)) { echo BR; - echo "<a name=\"form\"></a>"; show_table_header("USER PERMISSIONS"); $table = new CTableInfo(); $table->setHeader(array(S_PERMISSION,S_RIGHT,S_RESOURCE_NAME,S_ACTIONS)); - $result=DBselect("select rightid,name,permission,id from rights where userid=".$_REQUEST["userid"]." order by name,permission,id"); - $col=0; - while($row=DBfetch($result)) + + $db_rights = DBselect("select rightid,name,permission,id from rights ". + "where userid=".$_REQUEST["userid"]." order by name,permission,id"); + while($db_right = DBfetch($db_rights)) { - if($row["permission"]=="R") - { - $permission=S_READ_ONLY; - } - else if($row["permission"]=="U") - { - $permission=S_READ_WRITE; - } - else if($row["permission"]=="H") - { - $permission=S_HIDE; - } - else if($row["permission"]=="A") - { - $permission=S_ADD; - } - else - { - $permission=$row["permission"]; - } - $actions="<A HREF=users.php?userid=".$_REQUEST["userid"]."&rightid=".$row["rightid"]."®ister=delete_permission>".S_DELETE."</A>"; + if($db_right["permission"]=="R") $permission=S_READ_ONLY; + else if($db_right["permission"]=="U") $permission=S_READ_WRITE; + else if($db_right["permission"]=="H") $permission=S_HIDE; + else if($db_right["permission"]=="A") $permission=S_ADD; + else $permission=$db_right["permission"]; + + $actions= new CLink( + S_DELETE, + "users.php?userid=".$_REQUEST["userid"]."&rightid=". + $db_right["rightid"]."®ister=delete_permission>"); + $table->addRow(array( - $row["name"], + $db_right["name"], $permission, - get_resource_name($row["name"],$row["id"]), + get_resource_name($db_right["name"],$db_right["id"]), $actions )); } @@ -312,7 +297,6 @@ insert_permissions_form($_REQUEST["userid"]); } ?> - <?php - show_footer(); + show_page_footer(); ?> |