summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-24 06:16:28 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-24 06:16:28 +0000
commit42db7dd434e76d2d1d3c5b0631091d7d7369e7b0 (patch)
tree2a2f8365354b158cb12dd98f3a3cd6f8234b6fd8 /frontends/php/include
parent505acfb155eb4f9265fe1d803997cd0f2a24c569 (diff)
- configurable refresh rate. Thanks to James Wells. (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2217 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php26
-rw-r--r--frontends/php/include/db.inc.php3
-rw-r--r--frontends/php/include/forms.inc.php9
-rw-r--r--frontends/php/include/locales/de_de.inc.php1
-rw-r--r--frontends/php/include/locales/en_gb.inc.php1
-rw-r--r--frontends/php/include/locales/fr_fr.inc.php1
-rw-r--r--frontends/php/include/locales/it_it.inc.php1
-rw-r--r--frontends/php/include/locales/lv_lv.inc.php1
-rw-r--r--frontends/php/include/locales/ru_ru.inc.php1
-rw-r--r--frontends/php/include/locales/sp_sp.inc.php1
-rw-r--r--frontends/php/include/users.inc.php16
11 files changed, 39 insertions, 22 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 6567942a..4fd2f119 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -961,7 +961,7 @@
if(isset($sessionid))
{
- $sql="select u.userid,u.alias,u.name,u.surname,u.lang from sessions s,users u where s.sessionid='$sessionid' and s.userid=u.userid and ((s.lastaccess+u.autologout>".time().") or (u.autologout=0))";
+ $sql="select u.userid,u.alias,u.name,u.surname,u.lang,u.refresh from sessions s,users u where s.sessionid='$sessionid' and s.userid=u.userid and ((s.lastaccess+u.autologout>".time().") or (u.autologout=0))";
$result=DBselect($sql);
if(DBnum_rows($result)==1)
{
@@ -974,6 +974,7 @@
$USER_DETAILS["name"]=DBget_field($result,0,2);
$USER_DETAILS["surname"]=DBget_field($result,0,3);
$USER_DETAILS["lang"]=DBget_field($result,0,4);
+ $USER_DETAILS["refresh"]=DBget_field($result,0,5);
return;
}
else
@@ -983,7 +984,7 @@
}
}
- $sql="select u.userid,u.alias,u.name,u.surname,u.lang from users u where u.alias='guest'";
+ $sql="select u.userid,u.alias,u.name,u.surname,u.lang,u.refresh from users u where u.alias='guest'";
$result=DBselect($sql);
if(DBnum_rows($result)==1)
{
@@ -992,6 +993,7 @@
$USER_DETAILS["name"]=DBget_field($result,0,2);
$USER_DETAILS["surname"]=DBget_field($result,0,3);
$USER_DETAILS["lang"]=DBget_field($result,0,4);
+ $USER_DETAILS["refresh"]=DBget_field($result,0,5);
return;
}
@@ -1008,13 +1010,13 @@
# Header for HTML pages
- function show_header($title,$refresh,$nomenu)
+ function show_header($title,$dorefresh,$nomenu)
{
- show_special_header($title,$refresh,$nomenu,0);
+ show_special_header($title,$dorefresh,$nomenu,0);
}
- function show_special_header($title,$refresh,$nomenu,$noauth)
+ function show_special_header($title,$dorefresh,$nomenu,$noauth)
{
global $page;
global $USER_DETAILS;
@@ -1038,15 +1040,15 @@
<link rel="stylesheet" href="css.css">
<?php
- if($USER_DETAILS['alias']=='guest')
- {
- $refresh=2*$refresh;
- }
+// if($USER_DETAILS['alias']=='guest')
+// {
+// $refresh=2*$refresh;
+// }
if(defined($title)) $title=constant($title);
- if($refresh!=0)
+ if($dorefresh && $USER_DETAILS["refresh"])
{
- echo "<meta http-equiv=\"refresh\" content=\"$refresh\">\n";
- echo "<title>$title [refreshed every $refresh sec]</title>\n";
+ echo "<meta http-equiv=\"refresh\" content=\"".$USER_DETAILS["refresh"]."\">\n";
+ echo "<title>$title [refreshed every ".$USER_DETAILS["refresh"]." sec]</title>\n";
}
else
{
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index 888f1b87..dc61fa37 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -30,7 +30,8 @@
$DB_PASSWORD ="";
// END OF DATABASE CONFIGURATION
- $USER_DETAILS ="";
+// $USER_DETAILS ="";
+ global $USER_DETAILS;
if($DB_TYPE == "MYSQL")
{
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 6ba00843..f13e14c2 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -139,7 +139,7 @@
{
if(isset($userid))
{
- $result=DBselect("select u.alias,u.name,u.surname,u.passwd,u.url,u.autologout,u.lang from users u where u.userid=$userid");
+ $result=DBselect("select u.alias,u.name,u.surname,u.passwd,u.url,u.autologout,u.lang,u.refresh from users u where u.userid=$userid");
$alias=DBget_field($result,0,0);
$name=DBget_field($result,0,1);
@@ -149,6 +149,7 @@
$url=DBget_field($result,0,4);
$autologout=DBget_field($result,0,5);
$lang=DBget_field($result,0,6);
+ $refresh=DBget_field($result,0,7);
}
else
{
@@ -159,6 +160,7 @@
$url="";
$autologout="900";
$lang="en_gb";
+ $refresh="30";
}
$col=0;
@@ -233,6 +235,11 @@
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"url\" value=\"$url\" size=50>";
+ show_table2_v_delimiter($col++);
+ echo S_SCREEN_REFRESH;
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"refresh\" value=\"$refresh\" size=5>";
+
show_table2_v_delimiter2($col++);
if($profile==0)
{
diff --git a/frontends/php/include/locales/de_de.inc.php b/frontends/php/include/locales/de_de.inc.php
index a7c78d9a..8c0e97ce 100644
--- a/frontends/php/include/locales/de_de.inc.php
+++ b/frontends/php/include/locales/de_de.inc.php
@@ -701,6 +701,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Kennwort (Wiederholung)",
"S_URL_AFTER_LOGIN"=> "URL-Umleitung nach Login",
"S_AUTO_LOGOUT_IN_SEC"=> "Inaktivit&auml;tslimit in Sekunden (0 = deaktiviert)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Aktivit&auml;tsprotokoll",
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 039b0d60..94b20817 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -749,6 +749,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Password (once again)",
"S_URL_AFTER_LOGIN"=> "URL (after login)",
"S_AUTO_LOGOUT_IN_SEC"=> "Auto-logout (in sec=>0 - disable)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Audit log",
diff --git a/frontends/php/include/locales/fr_fr.inc.php b/frontends/php/include/locales/fr_fr.inc.php
index b863f071..5aa1e3bf 100644
--- a/frontends/php/include/locales/fr_fr.inc.php
+++ b/frontends/php/include/locales/fr_fr.inc.php
@@ -694,6 +694,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Mot de passe (une autre fois)",
"S_URL_AFTER_LOGIN"=> "URL (après connexion)",
"S_AUTO_LOGOUT_IN_SEC"=> "Déconnection automatique (dans =>0 secondes - désactiver)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Journal de vérification",
diff --git a/frontends/php/include/locales/it_it.inc.php b/frontends/php/include/locales/it_it.inc.php
index 1cf46027..4cb8130b 100644
--- a/frontends/php/include/locales/it_it.inc.php
+++ b/frontends/php/include/locales/it_it.inc.php
@@ -696,6 +696,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Password (ripeti)",
"S_URL_AFTER_LOGIN"=> "URL (dopo il login)",
"S_AUTO_LOGOUT_IN_SEC"=> "Auto-logout (in secondi, 0=disabilitato)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Audit log",
diff --git a/frontends/php/include/locales/lv_lv.inc.php b/frontends/php/include/locales/lv_lv.inc.php
index 299f9a88..f9f12259 100644
--- a/frontends/php/include/locales/lv_lv.inc.php
+++ b/frontends/php/include/locales/lv_lv.inc.php
@@ -694,6 +694,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Password (once again)",
"S_URL_AFTER_LOGIN"=> "URL (after login)",
"S_AUTO_LOGOUT_IN_SEC"=> "Auto-logout (in sec=>0 - disable)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Audit log",
diff --git a/frontends/php/include/locales/ru_ru.inc.php b/frontends/php/include/locales/ru_ru.inc.php
index 6d5535e2..de63fda5 100644
--- a/frontends/php/include/locales/ru_ru.inc.php
+++ b/frontends/php/include/locales/ru_ru.inc.php
@@ -694,6 +694,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Password (once again)",
"S_URL_AFTER_LOGIN"=> "URL (after login)",
"S_AUTO_LOGOUT_IN_SEC"=> "Auto-logout (in sec=>0 - disable)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Audit log",
diff --git a/frontends/php/include/locales/sp_sp.inc.php b/frontends/php/include/locales/sp_sp.inc.php
index badfc3dc..7f5c2964 100644
--- a/frontends/php/include/locales/sp_sp.inc.php
+++ b/frontends/php/include/locales/sp_sp.inc.php
@@ -694,6 +694,7 @@
"S_PASSWORD_ONCE_AGAIN"=> "Contraseña (una vez más)",
"S_URL_AFTER_LOGIN"=> "URL (después del login)",
"S_AUTO_LOGOUT_IN_SEC"=> "Auto-logout (en segs=>0 - deshabilitado)",
+ "S_SCREEN_REFRESH"=> "Refresh (in seconds)",
// audit.php
"S_AUDIT_LOG"=> "Log de Auditoria",
diff --git a/frontends/php/include/users.inc.php b/frontends/php/include/users.inc.php
index 11ad50f9..10e6cb94 100644
--- a/frontends/php/include/users.inc.php
+++ b/frontends/php/include/users.inc.php
@@ -21,7 +21,7 @@
<?php
# Add User definition
- function add_user($name,$surname,$alias,$passwd,$url,$autologout,$lang)
+ function add_user($name,$surname,$alias,$passwd,$url,$autologout,$lang,$refresh)
{
if(!check_right("User","A",0))
{
@@ -31,13 +31,13 @@
$passwd=md5($passwd);
- $sql="insert into users (name,surname,alias,passwd,url,autologout,lang) values ('$name','$surname','$alias','$passwd','$url',$autologout,'$lang')";
+ $sql="insert into users (name,surname,alias,passwd,url,autologout,lang,refresh) values ('$name','$surname','$alias','$passwd','$url',$autologout,'$lang',$refresh)";
return DBexecute($sql);
}
# Update User definition
- function update_user($userid,$name,$surname,$alias,$passwd, $url,$autologout,$lang)
+ function update_user($userid,$name,$surname,$alias,$passwd, $url,$autologout,$lang,$refresh)
{
if(!check_right("User","U",$userid))
{
@@ -47,19 +47,19 @@
if($passwd=="")
{
- $sql="update users set name='$name',surname='$surname',alias='$alias',url='$url',autologout=$autologout,lang='$lang' where userid=$userid";
+ $sql="update users set name='$name',surname='$surname',alias='$alias',url='$url',autologout=$autologout,lang='$lang',refresh=$refresh where userid=$userid";
}
else
{
$passwd=md5($passwd);
- $sql="update users set name='$name',surname='$surname',alias='$alias',passwd='$passwd',url='$url',autologout=$autologout,lang='$lang' where userid=$userid";
+ $sql="update users set name='$name',surname='$surname',alias='$alias',passwd='$passwd',url='$url',autologout=$autologout,lang='$lang',refresh=$refresh where userid=$userid";
}
return DBexecute($sql);
}
# Update User Profile
- function update_user_profile($userid,$passwd, $url,$autologout,$lang)
+ function update_user_profile($userid,$passwd, $url,$autologout,$lang,$refresh)
{
global $USER_DETAILS;
@@ -71,12 +71,12 @@
if($passwd=="")
{
- $sql="update users set url='$url',autologout=$autologout,lang='$lang' where userid=$userid";
+ $sql="update users set url='$url',autologout=$autologout,lang='$lang',refresh=$refresh where userid=$userid";
}
else
{
$passwd=md5($passwd);
- $sql="update users set passwd='$passwd',url='$url',autologout=$autologout,lang='$lang' where userid=$userid";
+ $sql="update users set passwd='$passwd',url='$url',autologout=$autologout,lang='$lang',refresh=$refresh where userid=$userid";
}
return DBexecute($sql);
}