summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-05-09 10:32:51 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-05-09 10:32:51 +0000
commitb5b74d89f942b5e2f7861ee3fe2ec1cc1ed65ed6 (patch)
treeed7f05a774de72d4c2d99a8c3174c2f746b4d4cf /frontends/php/include
parentb83c0b90c424eed96b2f9739f5b550112fa0f6d1 (diff)
- added support for configurable after-login screen (Alexei)
- added column users.url (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@1335 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php80
-rw-r--r--frontends/php/include/forms.inc.php96
2 files changed, 103 insertions, 73 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 3b491c41..ce3ce60f 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -19,8 +19,8 @@
**/
?>
<?php
- include "include/defines.inc.php";
- include "include/db.inc.php";
+ include_once "include/defines.inc.php";
+ include_once "include/db.inc.php";
$USER_DETAILS ="";
$ERROR_MSG ="";
@@ -2616,7 +2616,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
# Update User definition
- function update_user($userid,$name,$surname,$alias,$passwd)
+ function update_user($userid,$name,$surname,$alias,$passwd, $url)
{
global $ERROR_MSG;
@@ -2628,12 +2628,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
if($passwd=="")
{
- $sql="update users set name='$name',surname='$surname',alias='$alias' where userid=$userid";
+ $sql="update users set name='$name',surname='$surname',alias='$alias',url='$url' where userid=$userid";
}
else
{
$passwd=md5($passwd);
- $sql="update users set name='$name',surname='$surname',alias='$alias',passwd='$passwd' where userid=$userid";
+ $sql="update users set name='$name',surname='$surname',alias='$alias',passwd='$passwd',url='$url' where userid=$userid";
}
return DBexecute($sql);
}
@@ -2648,7 +2648,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
# Add User definition
- function add_user($name,$surname,$alias,$passwd)
+ function add_user($name,$surname,$alias,$passwd,$url)
{
global $ERROR_MSG;
@@ -2659,7 +2659,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
}
$passwd=md5($passwd);
- $sql="insert into users (name,surname,alias,passwd) values ('$name','$surname','$alias','$passwd')";
+ $sql="insert into users (name,surname,alias,passwd,url) values ('$name','$surname','$alias','$passwd','$url')";
return DBexecute($sql);
}
@@ -4290,72 +4290,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
show_table2_header_end();
}
-
- # Insert form for User
- function insert_user_form($userid)
- {
- if(isset($userid))
- {
- $result=DBselect("select u.alias,u.name,u.surname,u.passwd from users u where u.userid=$userid");
-
- $alias=DBget_field($result,0,0);
- $name=DBget_field($result,0,1);
- $surname=DBget_field($result,0,2);
-# $password=DBget_field($result,0,3);
- $password="";
- }
- else
- {
- $alias="";
- $name="";
- $surname="";
- $password="";
- }
-
- show_table2_header_begin();
- echo "User";
-
- show_table2_v_delimiter();
- echo "<form method=\"get\" action=\"users.php\">";
- if(isset($userid))
- {
- echo "<input class=\"biginput\" name=\"userid\" type=\"hidden\" value=\"$userid\" size=8>";
- }
- echo "Alias";
- show_table2_h_delimiter();
- echo "<input class=\"biginput\" name=\"alias\" value=\"$alias\" size=20>";
-
- show_table2_v_delimiter();
- echo "Name";
- show_table2_h_delimiter();
- echo "<input class=\"biginput\" name=\"name\" value=\"$name\" size=20>";
-
- show_table2_v_delimiter();
- echo "Surname";
- show_table2_h_delimiter();
- echo "<input class=\"biginput\" name=\"surname\" value=\"$surname\" size=20>";
-
- show_table2_v_delimiter();
- echo "Password";
- show_table2_h_delimiter();
- echo "<input class=\"biginput\" type=\"password\" name=\"password1\" value=\"$password\" size=20>";
-
- show_table2_v_delimiter();
- echo nbsp("Password (once again)");
- show_table2_h_delimiter();
- echo "<input class=\"biginput\" type=\"password\" name=\"password2\" value=\"$password\" size=20>";
-
- show_table2_v_delimiter2();
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">";
- if(isset($userid))
- {
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">";
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete selected user?');\">";
- }
-
- show_table2_header_end();
- }
-
# Insert form for Problem
function insert_problem_form($problemid)
{
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
new file mode 100644
index 00000000..f47daa4f
--- /dev/null
+++ b/frontends/php/include/forms.inc.php
@@ -0,0 +1,96 @@
+<?php
+/*
+** Zabbix
+** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**/
+?>
+<?php
+ include_once "include/defines.inc.php";
+ include_once "include/db.inc.php";
+
+ # Insert form for User
+ function insert_user_form($userid)
+ {
+ if(isset($userid))
+ {
+ $result=DBselect("select u.alias,u.name,u.surname,u.passwd,u.url from users u where u.userid=$userid");
+
+ $alias=DBget_field($result,0,0);
+ $name=DBget_field($result,0,1);
+ $surname=DBget_field($result,0,2);
+# $password=DBget_field($result,0,3);
+ $password="";
+ $url=DBget_field($result,0,4);
+ }
+ else
+ {
+ $alias="";
+ $name="";
+ $surname="";
+ $password="";
+ $url="";
+ }
+
+ show_table2_header_begin();
+ echo "User";
+
+ show_table2_v_delimiter();
+ echo "<form method=\"get\" action=\"users.php\">";
+ if(isset($userid))
+ {
+ echo "<input class=\"biginput\" name=\"userid\" type=\"hidden\" value=\"$userid\" size=8>";
+ }
+ echo "Alias";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"alias\" value=\"$alias\" size=20>";
+
+ show_table2_v_delimiter();
+ echo "Name";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"name\" value=\"$name\" size=20>";
+
+ show_table2_v_delimiter();
+ echo "Surname";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"surname\" value=\"$surname\" size=20>";
+
+ show_table2_v_delimiter();
+ echo "Password";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" type=\"password\" name=\"password1\" value=\"$password\" size=20>";
+
+ show_table2_v_delimiter();
+ echo nbsp("Password (once again)");
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" type=\"password\" name=\"password2\" value=\"$password\" size=20>";
+
+ show_table2_v_delimiter();
+ echo "URL (after login)";
+ show_table2_h_delimiter();
+ echo "<input class=\"biginput\" name=\"url\" value=\"$url\" size=50>";
+
+ show_table2_v_delimiter2();
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">";
+ if(isset($userid))
+ {
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete selected user?');\">";
+ }
+
+ show_table2_header_end();
+ }
+?>