mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2009-03-05 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/auth/ldap.php: Fixed a small issue to check on a variable * include/functions_extensions.php: Fixed an issue since errors produced with @function will filter into custom error handlers * include/functions_ui.php: Added RSS link in the header to display RSS feed availability in RSS-enabled browsers * operation/events/events_marquee.php, operation/events/events_statistics.php: require_once so it won't load the same function files twice * operation/events/events_rss.php: Better error handling. Require_once required because it was giving a problem with certain function files. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1517 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
d54394321b
commit
5adb390628
@ -1,3 +1,20 @@
|
|||||||
|
2009-03-05 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||||
|
|
||||||
|
* include/auth/ldap.php: Fixed a small issue to check on a variable
|
||||||
|
|
||||||
|
* include/functions_extensions.php: Fixed an issue since errors
|
||||||
|
produced with @function will filter into custom error handlers
|
||||||
|
|
||||||
|
* include/functions_ui.php: Added RSS link in the header to display
|
||||||
|
RSS feed availability in RSS-enabled browsers
|
||||||
|
|
||||||
|
* operation/events/events_marquee.php,
|
||||||
|
operation/events/events_statistics.php: require_once so it won't load
|
||||||
|
the same function files twice
|
||||||
|
|
||||||
|
* operation/events/events_rss.php: Better error handling. Require_once
|
||||||
|
required because it was giving a problem with certain function files.
|
||||||
|
|
||||||
2009-03-05 Esteban Sanchez <estebans@artica.es>
|
2009-03-05 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* include/functions_config.php: Fixed auth files inclusion that may
|
* include/functions_config.php: Fixed auth files inclusion that may
|
||||||
|
@ -466,9 +466,9 @@ function ldap_connect_bind () {
|
|||||||
|
|
||||||
$ret = false;
|
$ret = false;
|
||||||
|
|
||||||
if (!empty ($config["auth"]["ldap_port"]) && !is_resource ($ldap_cache["ds"])) {
|
if (!empty ($config["auth"]["ldap_port"]) && (empty ($ldap_cache["ds"]) || !is_resource ($ldap_cache["ds"]))) {
|
||||||
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"], $config["auth"]["ldap_port"]);
|
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"], $config["auth"]["ldap_port"]);
|
||||||
} elseif (!is_resource ($ldap_cache["ds"])) {
|
} elseif (empty ($ldap_cache["ds"]) || !is_resource ($ldap_cache["ds"])) {
|
||||||
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"]);
|
$ldap_cache["ds"] = @ldap_connect ($config["auth"]["ldap_server"]);
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
@ -83,12 +83,16 @@ function is_extension ($page) {
|
|||||||
*/
|
*/
|
||||||
function get_extensions ($enterprise = false) {
|
function get_extensions ($enterprise = false) {
|
||||||
$dir = EXTENSIONS_DIR;
|
$dir = EXTENSIONS_DIR;
|
||||||
|
$handle = false;
|
||||||
if ($enterprise)
|
if ($enterprise)
|
||||||
$dir = ENTERPRISE_DIR.'/'.EXTENSIONS_DIR;
|
$dir = ENTERPRISE_DIR.'/'.EXTENSIONS_DIR;
|
||||||
$handle = @opendir ($dir);
|
|
||||||
if (! $handle) {
|
if (file_exists ($dir))
|
||||||
|
$handle = @opendir ($dir);
|
||||||
|
|
||||||
|
if (empty ($handle))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
$file = readdir ($handle);
|
$file = readdir ($handle);
|
||||||
$extensions = array ();
|
$extensions = array ();
|
||||||
$ignores = array ('.', '..');
|
$ignores = array ('.', '..');
|
||||||
|
@ -569,7 +569,8 @@ function process_page_head ($string, $bitfield) {
|
|||||||
<link rel="stylesheet" href="include/styles/common.css" type="text/css"/>
|
<link rel="stylesheet" href="include/styles/common.css" type="text/css"/>
|
||||||
<!--[if gte IE 6]>
|
<!--[if gte IE 6]>
|
||||||
<link rel="stylesheet" href="include/styles/ie.css" type="text/css"/>
|
<link rel="stylesheet" href="include/styles/ie.css" type="text/css"/>
|
||||||
<![endif]-->';
|
<![endif]-->
|
||||||
|
<link rel="alternate" href="operation/events/events_rss.php" title="Pandora RSS Feed" type="application/rss+xml" />';
|
||||||
|
|
||||||
if ($config["language"] != "en") {
|
if ($config["language"] != "en") {
|
||||||
//Load translated strings - load them last so they overload all the objects
|
//Load translated strings - load them last so they overload all the objects
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Load global vars
|
// Load global vars
|
||||||
require("include/config.php");
|
require_once ("include/config.php");
|
||||||
|
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ $MARQUEE_FONT_SIZE="32px";
|
|||||||
$MARQUEE_SPEED=12;
|
$MARQUEE_SPEED=12;
|
||||||
|
|
||||||
$output = "";
|
$output = "";
|
||||||
require "../../include/config.php";
|
require_once "../../include/config.php";
|
||||||
require_once "../../include/functions.php";
|
require_once "../../include/functions.php";
|
||||||
require_once "../../include/functions_db.php";
|
require_once "../../include/functions_db.php";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// ========================================
|
// ========================================
|
||||||
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info
|
||||||
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas
|
||||||
// Copyright (c) 2008 Evi Vanoost, vanooste@rcbi.rochester.edu
|
// Copyright (c) 2008-2009 Evi Vanoost, vanooste@rcbi.rochester.edu
|
||||||
|
|
||||||
// This program is free software; you can redistribute it and/or
|
// This program is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License
|
// modify it under the terms of the GNU General Public License
|
||||||
@ -16,10 +16,35 @@
|
|||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require "../../include/config.php";
|
ini_set ('display_errors', 0); //Don't display other errors, messes up XML
|
||||||
require "../../include/functions.php";
|
header("Content-Type: application/xml; charset=UTF-8"); //Send header before starting to output
|
||||||
|
|
||||||
|
require_once "../../include/config.php";
|
||||||
|
require_once "../../include/functions.php";
|
||||||
require_once "../../include/functions_db.php";
|
require_once "../../include/functions_db.php";
|
||||||
|
|
||||||
|
function rss_error_handler ($errno, $errstr, $errfile, $errline) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$base = 'http'.(isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == TRUE ? 's': '').'://'.$_SERVER['HTTP_HOST'];
|
||||||
|
$url = $base.$config["homeurl"];
|
||||||
|
$selfurl = $base.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
|
||||||
|
|
||||||
|
$rss_feed = '<?xml version="1.0" encoding="utf-8" ?>'; //' Fixes certain highlighters freaking out on the PHP closing tag
|
||||||
|
$rss_feed .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
|
||||||
|
$rss_feed .= '<channel><title>Pandora RSS Feed</title><description>Latest events on Pandora</description>';
|
||||||
|
$rss_feed .= '<lastBuildDate>'.date (DATE_RFC822, 0).'</lastBuildDate>';
|
||||||
|
$rss_feed .= '<link>'.$url.'</link>'; //Link back to the main Pandora page
|
||||||
|
$rss_feed .= '<atom:link href="'.htmlentities ($selfurl).'" rel="self" type="application/rss+xml" />'; //Alternative for Atom feeds. It's the same.
|
||||||
|
|
||||||
|
$rss_feed .= '<item><guid>'.$url.'/index.php?sec=eventos&sec2=operation/events/events</guid><title>Error creating feed</title>';
|
||||||
|
$rss_feed .= '<description>There was an error creating the feed: '.$errno.' - '.$errstr.' in '.$errfile.' on line '.$errline.'</description>';
|
||||||
|
$rss_feed .= '<link>'.$url.'/index.php?sec=eventos&sec2=operation/events/events</link></item>';
|
||||||
|
|
||||||
|
exit ($rss_feed); //Exit by displaying the feed
|
||||||
|
}
|
||||||
|
|
||||||
|
set_error_handler ('rss_error_handler', E_ALL); //Errors output as RSS
|
||||||
$ev_group = get_parameter ("ev_group", 0); // group
|
$ev_group = get_parameter ("ev_group", 0); // group
|
||||||
$search = get_parameter ("search", ""); // free search
|
$search = get_parameter ("search", ""); // free search
|
||||||
$event_type = get_parameter ("event_type", ''); // 0 all
|
$event_type = get_parameter ("event_type", ''); // 0 all
|
||||||
@ -36,11 +61,11 @@ if ($status == 1)
|
|||||||
if ($status == 0)
|
if ($status == 0)
|
||||||
$sql_post .= " AND `tevento`.`estado` = 0";
|
$sql_post .= " AND `tevento`.`estado` = 0";
|
||||||
if ($search != "")
|
if ($search != "")
|
||||||
$sql_post .= " AND `tevento`.`evento` LIKE '%$search%'";
|
$sql_post .= " AND `tevento`.`evento` LIKE '%$search%'";
|
||||||
if ($event_type != "")
|
if ($event_type != "")
|
||||||
$sql_post .= " AND `tevento`.`event_type` = '$event_type'";
|
$sql_post .= " AND `tevento`.`event_type` = '$event_type'";
|
||||||
if ($severity != -1)
|
if ($severity != -1)
|
||||||
$sql_post .= " AND `tevento`.`criticity` >= ".$severity;
|
$sql_post .= " AND `tevento`.`criticity` >= ".$severity;
|
||||||
if ($id_agent != -1)
|
if ($id_agent != -1)
|
||||||
$sql_post .= " AND `tevento`.`id_agente` = ".$id_agent;
|
$sql_post .= " AND `tevento`.`id_agente` = ".$id_agent;
|
||||||
if ($id_event != -1)
|
if ($id_event != -1)
|
||||||
@ -58,17 +83,24 @@ $sql="SELECT `tevento`.`id_evento` AS event_id,
|
|||||||
|
|
||||||
$result= get_db_all_rows_sql ($sql);
|
$result= get_db_all_rows_sql ($sql);
|
||||||
|
|
||||||
//$url = "https://".$_SERVER['HTTP_HOST']."/pandora_console";
|
$base = 'http'.(isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == TRUE ? 's': '').'://'.$_SERVER['HTTP_HOST'];
|
||||||
|
$url = $base.$config["homeurl"];
|
||||||
|
$selfurl = $base.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
|
||||||
|
|
||||||
$url = 'http://'.$_SERVER['HTTP_HOST'].$config["homeurl"];
|
if (empty ($result)) {
|
||||||
$selfurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
|
$lastbuild = 0; //Last build in 1970
|
||||||
$rss_feed = '<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
|
} else {
|
||||||
|
$lastbuild = (int) $result[0]['unix_timestamp'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$rss_feed = '<?xml version="1.0" encoding="utf-8" ?>'; //' Fixes certain highlighters freaking out on the PHP closing tag
|
||||||
|
$rss_feed .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
|
||||||
$rss_feed .= '<channel><title>Pandora RSS Feed</title><description>Latest events on Pandora</description>';
|
$rss_feed .= '<channel><title>Pandora RSS Feed</title><description>Latest events on Pandora</description>';
|
||||||
$rss_feed .= '<lastBuildDate>'.date(DATE_RFC822, $result[0]['unix_timestamp']).'</lastBuildDate>';
|
$rss_feed .= '<lastBuildDate>'.date (DATE_RFC822, $lastbuild).'</lastBuildDate>'; //Last build date is the last event - that way readers won't mark it as having new posts
|
||||||
$rss_feed .= '<link>'.$url.'</link>';
|
$rss_feed .= '<link>'.$url.'</link>'; //Link back to the main Pandora page
|
||||||
$rss_feed .= '<atom:link href="'.htmlentities ($selfurl).'" rel="self" type="application/rss+xml" />';
|
$rss_feed .= '<atom:link href="'.htmlentities ($selfurl).'" rel="self" type="application/rss+xml" />'; //Alternative for Atom feeds. It's the same.
|
||||||
|
|
||||||
if ($result === false) {
|
if (empty ($result)) {
|
||||||
$result = array();
|
$result = array();
|
||||||
$rss_feed .= '<item><guid>'.$url.'/index.php?sec=eventos&sec2=operation/events/events</guid><title>No results</title>';
|
$rss_feed .= '<item><guid>'.$url.'/index.php?sec=eventos&sec2=operation/events/events</guid><title>No results</title>';
|
||||||
$rss_feed .= '<description>There are no results. Click on the link to see all Pending events</description>';
|
$rss_feed .= '<description>There are no results. Click on the link to see all Pending events</description>';
|
||||||
@ -99,6 +131,5 @@ foreach ($result as $row) {
|
|||||||
|
|
||||||
$rss_feed .= "</channel></rss>";
|
$rss_feed .= "</channel></rss>";
|
||||||
|
|
||||||
header("Content-Type: application/xml; charset=UTF-8");
|
|
||||||
echo $rss_feed;
|
echo $rss_feed;
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user