2008-08-05 Esteban Sanchez <estebans@artica.es>

* include/functions_extensions.php: Added function to call login
        functions of the extensions. Functions renamed.

        * include/styles/pandora.css: Added style to notify bubble.

        * general/logon_ok.php: Added extensions login functions call. Style
        correction.

        * include/functions.php: Fixed array values cleanup on safe_input(). 
        Documentation added to clean_output_breaks().

        * index.php: Renamed functions fix.

        * operation/menu.php: Style correction.

        * ChangeLog: Added comment about commit #1000.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1001 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2008-08-05 10:47:40 +00:00
parent 00bb3be3f1
commit 6173f0bf72
7 changed files with 67 additions and 29 deletions

View File

@ -1,3 +1,22 @@
2008-08-05 Esteban Sanchez <estebans@artica.es>
* include/functions_extensions.php: Added function to call login
functions of the extensions. Functions renamed.
* include/styles/pandora.css: Added style to notify bubble.
* general/logon_ok.php: Added extensions login functions call. Style
correction.
* include/functions.php: Fixed array values cleanup on safe_input().
Documentation added to clean_output_breaks().
* index.php: Renamed functions fix.
* operation/menu.php: Style correction.
* ChangeLog: Added comment about commit #1000.
2008-08-04 Esteban Sanchez <estebans@artica.es>
* index.php: Set id_user in config array when login. This fixes errors
@ -12,6 +31,10 @@
* godmode/extensions.php: It was showing main functions of extensions
instead of godmode ones.
This commit is #1000. Congratulations to all the Pandora crew and
thanks all the Pandora users around the world. Pandora 2.0 is a bit
closer now.
2008-08-04 Esteban Sánchez <estebans@artica.es>
* extensions/hello.php: Fixed old function name. Activate the

View File

@ -19,6 +19,9 @@
require ("include/functions_reporting.php");
/* Call all extensions login function */
extensions_call_login_function ();
echo "<div class='jus'>";
$nick = $_SESSION['id_usuario'];
echo "<h1>" . lang_string ("welcome_title") . "</h1>";
@ -28,9 +31,9 @@ echo "</p>";
// Private messages pending to read !
$sql=sprintf("SELECT COUNT(id_mensaje) AS count FROM tmensajes WHERE id_usuario_destino='%s' AND estado='FALSE';",$nick);
$sql = sprintf ("SELECT COUNT(id_mensaje) AS count FROM tmensajes WHERE id_usuario_destino='%s' AND estado='FALSE';",$nick);
$resultado = get_db_sql ($sql);
if ($resultado != 0){
if ($resultado != 0) {
echo "<h2>". lang_string ("new_message_bra") . '
<a href="index.php?sec=messages&sec2=operation/messages/message">'
.$row["count"] . ' <img src="images/email.png" border="0">'

View File

@ -46,7 +46,7 @@ function safe_input ($value) {
if (is_numeric ($value))
return $value;
if (is_array ($value)) {
$value = array_walk($value,'safe_input');
array_walk (&$value,'safe_input');
return $value;
}
return htmlentities (utf8_decode ($value), ENT_QUOTES);
@ -86,15 +86,15 @@ function salida_limpia ($string) {
}
/**
* Replace all \n characters with <br /> to show line breaks in HTML code.
*
* @param string String to replace the characters
*
* @param string
*
* @return
* @return The string with the characters replaced.
*/
function clean_output_breaks ($string){
$myoutput = salida_limpia($string);
return preg_replace ('/\n/',"<br>", $myoutput);
$myoutput = salida_limpia ($string);
return preg_replace ('/\n/',"<br />", $myoutput);
}
/**

View File

@ -2,7 +2,7 @@
$extension_file = '';
function extension_main_function ($filename) {
function extension_call_main_function ($filename) {
global $config;
$extension = &$config['extensions'][$filename];
@ -12,7 +12,7 @@ function extension_main_function ($filename) {
}
}
function extension_godmode_function ($filename) {
function extension_call_godmode_function ($filename) {
global $config;
$extension = &$config['extensions'][$filename];
@ -22,6 +22,17 @@ function extension_godmode_function ($filename) {
}
}
function extensions_call_login_function () {
global $config;
$params = array ();
foreach ($config['extensions'] as $extension) {
if ($extension['login_function'] == '')
continue;
call_user_func_array ($extension['login_function'], $params);
}
}
function is_extension ($page) {
global $config;
@ -113,7 +124,7 @@ function add_extension_godmode_function ($function_name) {
$extension['godmode_function'] = $function_name;
}
function add_login_action_function ($function_name) {
function add_extension_login_function ($function_name) {
global $config;
global $extension_file;

View File

@ -375,11 +375,6 @@ td.datos_jus, td.datos2_jus {
border-bottom: 1px solid #708090;
width: 100%;
}
.suc {
color: #5a8629;
background: url(../../images/suc.png) no-repeat 1px;
padding: 4px 1px 6px 30px;
}
.green {
color: #5a8629;
}
@ -754,3 +749,10 @@ a.big_data {
text-decoration: none; font: bold 1em Arial, Sans-serif;
color: #000;
}
.notify {
background-color: #f7ffa5;
text-align: center;
font-weight: bold;
padding: 8px;
}

View File

@ -241,9 +241,9 @@ if ($page != "") {
require ($page);
} else {
if ($sec[0] == 'g') {
extension_godmode_function (basename ($page));
extension_call_godmode_function (basename ($page));
} else {
extension_main_function (basename ($page));
extension_call_main_function (basename ($page));
}
}
} else {

View File

@ -230,7 +230,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
}
// SNMP console
if($sec2 == "operation/snmpconsole/snmp_view") {
if ($sec2 == "operation/snmpconsole/snmp_view") {
$selected = ' menu-selected';
} else {
$selected = '';
@ -238,10 +238,10 @@ if (give_acl ($config['id_user'], 0, "AR")) {
echo '<div id="op6" class="operation-menu'.$selected.'">';
echo '<ul class="mn"><li><a href="index.php?sec=snmpconsole&amp;sec2=operation/snmpconsole/snmp_view&amp;refr=30" class="mn">'.lang_string ("SNMP_console").'</a></li></ul></div>';
if ((give_acl($config['id_user'], 0, "AW")==1)){
if (give_acl($config['id_user'], 0, "AW")) {
// SNMP Console alert (submenu)
if ($sec == "snmpconsole"){
if($sec2 == "operation/snmpconsole/snmp_alert") {
if ($sec == "snmpconsole") {
if ($sec2 == "operation/snmpconsole/snmp_alert") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
@ -251,7 +251,7 @@ if (give_acl ($config['id_user'], 0, "AR")) {
}
// Messages
if($sec2 == "operation/messages/message" && !isset($_GET["nuevo_g"])) {
if($sec2 == "operation/messages/message" && !isset ($_GET["nuevo_g"])) {
$selected = ' menu-selected';
} else {
$selected = '';
@ -260,8 +260,8 @@ if (give_acl ($config['id_user'], 0, "AR")) {
echo '<ul class="mn"><li><a href="index.php?sec=messages&amp;sec2=operation/messages/message" class="mn">'. lang_string ("messages").'</a></li></ul></div>';
// New message (submenu)
if ($sec == "messages"){
if(isset($_GET["nuevo_g"])) {
if ($sec == "messages") {
if(isset ($_GET["nuevo_g"])) {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";
@ -288,10 +288,9 @@ if (give_acl ($config['id_user'], 0, "AR")) {
lang_string ("reporting").'</a></li></ul></div>';
// Custom reporting
if ($sec == "reporting"){
if ($sec2 ==
"operation/reporting/custom_reporting" || $sec2 ==
"operation/reporting/reporting_viewer") {
if ($sec == "reporting") {
if ($sec2 == "operation/reporting/custom_reporting"
|| $sec2 == "operation/reporting/reporting_viewer") {
echo "<div class='operation-submenu submenu-selected'>";
} else {
echo "<div class='operation-submenu'>";