summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-14 11:01:08 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-14 11:01:08 +0000
commitc86a9791f2b5d097f011d41899009fb0946ce0bc (patch)
tree84a6a253428e88b58128f613f2f64f03d74adc48 /frontends/php/include
parent2d62dcd5944deea452509ee5a1067c34a0a4733d (diff)
downloadzabbix-c86a9791f2b5d097f011d41899009fb0946ce0bc.tar.gz
zabbix-c86a9791f2b5d097f011d41899009fb0946ce0bc.tar.xz
zabbix-c86a9791f2b5d097f011d41899009fb0946ce0bc.zip
- developed configuration of Jabber messaging (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3826 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/defines.inc.php1
-rw-r--r--frontends/php/include/forms.inc.php36
-rw-r--r--frontends/php/include/locales/en_gb.inc.php4
-rw-r--r--frontends/php/include/media.inc.php9
4 files changed, 26 insertions, 24 deletions
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 5b547bae..ccf394a2 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -183,6 +183,7 @@
define("ALERT_TYPE_EMAIL",0);
define("ALERT_TYPE_EXEC",1);
define("ALERT_TYPE_SMS",2);
+ define("ALERT_TYPE_JABBER",3);
define("ACTION_STATUS_ENABLED",0);
define("ACTION_STATUS_DISABLED",1);
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index d37405c2..ce9aa963 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -2828,11 +2828,12 @@
$smtp_email = get_request("smtp_email","zabbix@localhost");
$exec_path = get_request("exec_path","");
$gsm_modem = get_request("gsm_modem","/dev/ttyS0");
+ $username = get_request("username","user@server");
+ $password = get_request("password","");
if(isset($_REQUEST["mediatypeid"]) && !isset($_REQUEST["form_refresh"]))
{
- $result = DBselect("select mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem ".
- "from media_type where mediatypeid=".$_REQUEST["mediatypeid"]);
+ $result = DBselect("select * from media_type where mediatypeid=".$_REQUEST["mediatypeid"]);
$row = DBfetch($result);
$mediatypeid = $row["mediatypeid"];
@@ -2843,6 +2844,8 @@
$smtp_email = $row["smtp_email"];
$exec_path = $row["exec_path"];
$gsm_modem = $row["gsm_modem"];
+ $username = $row["username"];
+ $password = $row["passwd"];
}
$frmMeadia = new CFormTable(S_MEDIA);
@@ -2856,32 +2859,27 @@
$frmMeadia->AddRow(S_DESCRIPTION,new CTextBox("description",$description,30));
$cmbType = new CComboBox("type",$type,"submit()");
$cmbType->AddItem(ALERT_TYPE_EMAIL,S_EMAIL);
- $cmbType->AddItem(ALERT_TYPE_EXEC,S_SCRIPT);
+ $cmbType->AddItem(ALERT_TYPE_JABBER,S_JABBER);
$cmbType->AddItem(ALERT_TYPE_SMS,S_SMS);
+ $cmbType->AddItem(ALERT_TYPE_EXEC,S_SCRIPT);
$frmMeadia->AddRow(S_TYPE,$cmbType);
- if($type==ALERT_TYPE_EMAIL)
+ switch($type)
{
- $frmMeadia->AddVar("exec_path",$exec_path);
- $frmMeadia->AddVar("gsm_modem",$gsm_modem);
+ case ALERT_TYPE_EMAIL:
$frmMeadia->AddRow(S_SMTP_SERVER,new CTextBox("smtp_server",$smtp_server,30));
$frmMeadia->AddRow(S_SMTP_HELO,new CTextBox("smtp_helo",$smtp_helo,30));
$frmMeadia->AddRow(S_SMTP_EMAIL,new CTextBox("smtp_email",$smtp_email,30));
- }elseif($type==ALERT_TYPE_SMS)
- {
- $frmMeadia->AddVar("exec_path",$exec_path);
- $frmMeadia->AddVar("smtp_server",$smtp_server);
- $frmMeadia->AddVar("smtp_helo",$smtp_helo);
- $frmMeadia->AddVar("smtp_email",$smtp_email);
+ break;
+ case ALERT_TYPE_SMS:
$frmMeadia->AddRow(S_GSM_MODEM,new CTextBox("gsm_modem",$gsm_modem,50));
- }elseif($type==ALERT_TYPE_EXEC)
- {
- $frmMeadia->AddVar("gsm_modem",$gsm_modem);
- $frmMeadia->AddVar("smtp_server",$smtp_server);
- $frmMeadia->AddVar("smtp_helo",$smtp_helo);
- $frmMeadia->AddVar("smtp_email",$smtp_email);
-
+ break;
+ case ALERT_TYPE_EXEC:
$frmMeadia->AddRow(S_SCRIPT_NAME,new CTextBox("exec_path",$exec_path,50));
+ break;
+ case ALERT_TYPE_JABBER:
+ $frmMeadia->AddRow(S_JABBER_IDENTIFIER, new CTextBox("username",$username,30));
+ $frmMeadia->AddRow(S_PASSWORD, new CPassBox("password",$password,30));
}
$frmMeadia->AddItemToBottomRow(new CButton("save",S_SAVE));
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index a8464b85..1fff5adb 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -628,8 +628,10 @@
"S_DISABLE_SELECTED_ITEMS_Q"=> "Disable selected items?",
"S_DELETE_SELECTED_ITEMS_Q"=> "Delete selected items?",
"S_EMAIL"=> "Email",
- "S_SCRIPT"=> "Script",
+ "S_JABBER"=> "Jabber",
+ "S_JABBER_IDENTIFIER"=> "Jabber Identifier",
"S_SMS"=> "SMS",
+ "S_SCRIPT"=> "Script",
"S_GSM_MODEM"=> "GSM modem",
"S_UNITS"=> "Units",
"S_MULTIPLIER"=> "Multiplier",
diff --git a/frontends/php/include/media.inc.php b/frontends/php/include/media.inc.php
index b90f4b79..b20b6ec6 100644
--- a/frontends/php/include/media.inc.php
+++ b/frontends/php/include/media.inc.php
@@ -25,6 +25,7 @@
$str_type[ALERT_TYPE_EMAIL] = S_EMAIL;
$str_type[ALERT_TYPE_EXEC] = S_SCRIPT;
$str_type[ALERT_TYPE_SMS] = S_SMS;
+ $str_type[ALERT_TYPE_JABBER] = S_JABBER;
if(isset($str_type[$type]))
return $str_type[$type];
@@ -115,7 +116,7 @@
# Update media type
- function update_mediatype($mediatypeid,$type,$description,$smtp_server,$smtp_helo,$smtp_email,$exec_path,$gsm_modem)
+ function update_mediatype($mediatypeid,$type,$description,$smtp_server,$smtp_helo,$smtp_email,$exec_path,$gsm_modem,$username,$password)
{
$ret = 0;
@@ -127,7 +128,7 @@
}
else
{
- $sql="update media_type set type=$type,description=".zbx_dbstr($description).",smtp_server=".zbx_dbstr($smtp_server).",smtp_helo=".zbx_dbstr($smtp_helo).",smtp_email=".zbx_dbstr($smtp_email).",exec_path=".zbx_dbstr($exec_path).",gsm_modem=".zbx_dbstr($gsm_modem)." where mediatypeid=$mediatypeid";
+ $sql="update media_type set type=$type,description=".zbx_dbstr($description).",smtp_server=".zbx_dbstr($smtp_server).",smtp_helo=".zbx_dbstr($smtp_helo).",smtp_email=".zbx_dbstr($smtp_email).",exec_path=".zbx_dbstr($exec_path).",gsm_modem=".zbx_dbstr($gsm_modem).",username=".zbx_dbstr($username).",passwd=".zbx_dbstr($password)." where mediatypeid=$mediatypeid";
$ret = DBexecute($sql);
}
return $ret;
@@ -135,7 +136,7 @@
# Add Media type
- function add_mediatype($type,$description,$smtp_server,$smtp_helo,$smtp_email,$exec_path,$gsm_modem)
+ function add_mediatype($type,$description,$smtp_server,$smtp_helo,$smtp_email,$exec_path,$gsm_modem,$username,$password)
{
$ret = 0;
@@ -153,7 +154,7 @@
else
{
$mediatypeid=get_dbid("media_type","mediatypeid");
- $sql="insert into media_type (mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem) values ($mediatypeid,$type,".zbx_dbstr($description).",".zbx_dbstr($smtp_server).",".zbx_dbstr($smtp_helo).",".zbx_dbstr($smtp_email).",".zbx_dbstr($exec_path).",".zbx_dbstr($gsm_modem).")";
+ $sql="insert into media_type (mediatypeid,type,description,smtp_server,smtp_helo,smtp_email,exec_path,gsm_modem,username,passwd) values ($mediatypeid,$type,".zbx_dbstr($description).",".zbx_dbstr($smtp_server).",".zbx_dbstr($smtp_helo).",".zbx_dbstr($smtp_email).",".zbx_dbstr($exec_path).",".zbx_dbstr($gsm_modem).",".zbx_dbstr($username).",".zbx_dbstr($password).")";
$ret = DBexecute($sql);
if($ret) $ret = $mediatypeid;
}