From e7e250e4ecfe06fe9c3108a8069dca77480ff718 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 16 Jun 2011 19:26:45 +0000 Subject: [PATCH] 2011-06-16 Sancho Lerena * include/styles/install.css, include/styles/pandora.css, install.php: Yeeeha!, new look & feel for 4.0 version ! :-) * index.php: Minimal changes in session close (after the header render). * images/greyback.gif: New background for 4.0 (included the installer) * COPYING: removed bad carriage returns. * general/login_page.php: Small modifications to have a better style. * operation/system_alert.php, include/javascript/jquery.pandora.js, general/header.php: Implemented a "alert" icon who shows the general problems, instead naggin the user in each page. Incorporated the new feature to warn user when he doesn't change the default password :-) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4463 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/COPYING | 9 +- pandora_console/ChangeLog | 20 ++++ pandora_console/general/header.php | 101 ++++++++++++------ pandora_console/general/login_page.php | 4 +- pandora_console/images/greyback.gif | Bin 0 -> 1865 bytes .../include/javascript/jquery.pandora.js | 31 +++++- pandora_console/include/styles/install.css | 27 +++-- pandora_console/include/styles/pandora.css | 5 +- pandora_console/index.php | 15 ++- pandora_console/install.php | 89 ++++++++------- pandora_console/operation/system_alert.php | 9 ++ 11 files changed, 204 insertions(+), 106 deletions(-) create mode 100644 pandora_console/images/greyback.gif create mode 100644 pandora_console/operation/system_alert.php diff --git a/pandora_console/COPYING b/pandora_console/COPYING index b8c5c964ff..bcfae5693f 100644 --- a/pandora_console/COPYING +++ b/pandora_console/COPYING @@ -1,12 +1,9 @@ GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble @@ -89,4 +86,4 @@ NO WARRANTY 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS \ No newline at end of file +END OF TERMS AND CONDITIONS diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3ca2aa2547..8ed720c9b7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,23 @@ +2011-06-16 Sancho Lerena + + * include/styles/install.css, + include/styles/pandora.css, + install.php: Yeeeha!, new look & feel for 4.0 version ! :-) + + * index.php: Minimal changes in session close (after the header render). + + * images/greyback.gif: New background for 4.0 (included the installer) + + * COPYING: removed bad carriage returns. + + * general/login_page.php: Small modifications to have a better style. + + * operation/system_alert.php, + include/javascript/jquery.pandora.js, + general/header.php: Implemented a "alert" icon who shows the general + problems, instead naggin the user in each page. Incorporated the new + feature to warn user when he doesn't change the default password :-) + 2011-06-16 Miguel de Dios Merge from the branch. diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 6baffea6f6..dbdafc826d 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -19,6 +19,28 @@ require_once ('include/functions_servers.php'); $msg_cnt = 0; +$alert_cnt = 0; +$_SESSION["alert_msg"] = ""; + +// Check permissions + +// Global error checking. + +if (!is_writable ("attachment")){ + $alert_cnt++; + + // At this first version I'm passing errors using session variables, because the error management + // is done by an AJAX request. Better solutions could be implemented in the future :-) + + $_SESSION["alert_msg"] .= '

'.__('Attachment directory is not writable by HTTP Server').'

'.'

'.__('Please check that the web server has write rights on the {HOMEDIR}/attachment directory').'

'; +} + +// Check default password for "admin" +$hashpass = db_get_sql ("SELECT password FROM tusuario WHERE id_user = 'admin'"); +if ($hashpass == "1da7ee7d45b96d0e1f45ee4ee23da560"){ + $alert_cnt++; + $_SESSION["alert_msg"] .= '

'.__('Default password for "Admin" user has not been changed.').'

'.'

'.__('Please change the default password because is a common vulnerability reported.').'

'; +} ?> @@ -48,8 +70,8 @@ $msg_cnt = 0; if ($config["metaconsole"] == 0){ $msg_cnt = messages_get_count ($config["id_user"]); if ($msg_cnt > 0) { - echo ''; + echo ''; ui_require_css_file ('dialog'); ui_require_jquery_file ('ui.core'); ui_require_jquery_file ('ui.dialog'); @@ -57,41 +79,55 @@ $msg_cnt = 0; html_print_image ("images/email.png", false, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot")); echo ''; + echo " "; + echo " "; } } - ?> -   - __('Logout'), "class" => 'bot', "title" => __('Logout')))?> - - - '; + echo '
-'; + if ($alert_cnt > 0){ + echo ''; + ui_require_css_file ('dialog'); + ui_require_jquery_file ('ui.core'); + ui_require_jquery_file ('ui.dialog'); + + echo ''; + html_print_image ("images/error.png", false, + array ("title" => __('You have %d warning(s)', $alert_cnt), "id" => "yougotalert", "class" => "bot")); + echo ''; + echo " "; + echo " "; + } - $servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver'); - $servers["up"] = (int) servers_check_status (); - $servers["down"] = $servers["all"] - $servers["up"]; - if ($servers["up"] == 0) { - //All Servers down or no servers at all - echo html_print_image("images/cross.png", true, array("alt" => 'cross', "class" => 'bot')) . ' '.__('All systems').': '.__('Down'); - } - elseif ($servers["down"] != 0) { - //Some servers down - echo html_print_image("images/error.png", true, array("alt" => 'error', "class" => 'bot')) . ' '.$servers["down"].' '.__('servers down'); - } - else { - //All servers up - echo html_print_image("images/ok.png", true, array("alt" => 'ok', "class" => 'bot')) . ' '.__('All systems').': '.__('Ready'); - } - unset ($servers); // Since this is the header, we don't like to trickle down variables. - echo ''; - } else { - // TODO: Put here to remark this is a metaconsole - echo ""; + echo ''; + html_print_image("images/log-out.png", false, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout'))); + echo ''; - } + if ($config["metaconsole"] == 0){ + echo ''; + + $servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver'); + $servers["up"] = (int) servers_check_status (); + $servers["down"] = $servers["all"] - $servers["up"]; + if ($servers["up"] == 0) { + //All Servers down or no servers at all + echo html_print_image("images/cross.png", true, array("alt" => 'cross', "class" => 'bot')) . ' '.__('All systems').': '.__('Down'); + } + elseif ($servers["down"] != 0) { + //Some servers down + echo html_print_image("images/error.png", true, array("alt" => 'error', "class" => 'bot')) . ' '.$servers["down"].' '.__('servers down'); + } + else { + //All servers up + echo html_print_image("images/ok.png", true, array("alt" => 'ok', "class" => 'bot')) . ' '.__('All systems').': '.__('Ready'); + } + unset ($servers); // Since this is the header, we don't like to trickle down variables. + echo ''; + } else { + // TODO: Put here to remark this is a metaconsole + echo ""; + + } ?> @@ -178,6 +214,9 @@ $(document).ready (function () { 0): ?> $("#yougotmail").pulsate (); + 0): ?> + $("#yougotalert").pulsate (); + t = new Date(); t.setTime (t.getTime () + ); diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 5647b55c18..a08231c848 100644 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -28,7 +28,7 @@ echo '
'; echo '

'; echo ' -
+
'; @@ -38,7 +38,7 @@ if (isset ($login_failed)) { echo ''; } -echo '
'; +echo '
'; if (!empty ($page) && !empty ($sec)) { foreach ($_POST as $key => $value) { diff --git a/pandora_console/images/greyback.gif b/pandora_console/images/greyback.gif new file mode 100644 index 0000000000000000000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yX;xJGsnY`rWzHkyAbT76XMY z_1`q3E;{RsXRb5sn!7H!>VgNpy6uE+e!A|re-1IUpaVZVv&BaYIPt+dt2DO93*UUE z&oe(gw|bv_{oH(en|<7H;~IV6;kQk<1sH$*{rPK;4{ZA7-d%p)?#u0c_i5V?)%^O? ze?R-&`wuSsfvJZ3YHD*sLqaZEJg5|ya9Cpr#{FC?QAyJ$uziV<>a z!COzrFMDp>FejMZ{P1#9Q<`9&tRAnd&DMd$Ok(7vpCE;xO zx;)~Mma*hyD=|4q=Velum$V)P>vzol1ygzwT;DRqS4>GZGi=Gsp8#crMqJj8mxh$3 z7QG2aZRS#xQM@HLd&x>brn8a0eC0W}3C>!+bDZLAp)Tb(Pk6?&oBKrPI@$TpS@zSP z0sUq>0qRPG7Brms9AZ5kO3oOn@&BHqeCQDeYEF#OGosmS=tVvHMT>?Mq;%wH8y9)d zM`~1`3zg?eS4dGel603ZwdYC8xzUzmq6Bps#LB~ zeQQyrnN(t?5}3n8>Ryf7S7-*7d<;C`QQLRT_tmYM6+Gr&R{)~>fT?Jr$B zSj5g&ewLMOah)05$0j$j!yrvyY>}H+zeZQEr3G$v@w(i}PM5IFeINxDo7v~esQ>^w D+&!tK literal 0 HcmV?d00001 diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 3509c4eeb5..5f864db67a 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -58,4 +58,33 @@ $(document).ready (function () { return false; }); -}); + + $("a#show_systemalert_dialog").click (function () { + jQuery.get ("ajax.php", + {"page": "operation/system_alert"}, + function (data, status) { + $("#alert_messages").hide () + .empty () + .append (data) + .dialog ({ + title: $("a#show_systemalert_dialog").attr ("title"), + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + bgiframe: jQuery.browser.msie, + width: 700, + height: 300 + }) + .show (); + }, + "html" + ); + return false; + }); +} + +); diff --git a/pandora_console/include/styles/install.css b/pandora_console/include/styles/install.css index cdf872df6b..bf28b79680 100644 --- a/pandora_console/include/styles/install.css +++ b/pandora_console/include/styles/install.css @@ -18,20 +18,20 @@ h1 { font: bold 1em Arial, Sans-serif; - text-transform: uppercase; font-size: 18px; color: #ffffff; + text-align: center; } h2 { font: bold 1em Arial, Sans-serif; - text-transform: uppercase; - font-size: 14px; + border-bottom: solid 1px #00aa00; + font-size: 16px; } div#install_container { margin: 0 auto; - margin-top: 15px; - width: 600px; + margin-top: 45px; + width: 650px; } div#logo_img { text-align: center; @@ -43,14 +43,14 @@ div#wizard { margin-top: 1em; padding: 20px; padding-left: 20px; - width: 600px; + width: 650px; background-color: #fafafa; } div#install_box, div#install_img { float: right; padding-right: 20px; margin-top: 0px; - width: 350px; + width: 400px; } div#install_img { margin-bottom: 25px; @@ -66,7 +66,7 @@ div#foot_install { padding-right: 20px; text-align: center; background: #777; - width: 600px; + width: 650px; border-left: 1px solid #999; border-right: 1px solid #999; } @@ -100,9 +100,14 @@ span.arr { font-family: verdana,arial, sans; font-size: 8.5pt; } -body { - font-family: verdana,arial, sans; + +body, td { + font-family: Sans, Arial, sans; font-size: 9pt; - background-color: #fff; + line-height: 15px; +} + +body{ + background: url(../../images/greyback.gif); } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 68b0eb68ad..6e36f87975 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -31,7 +31,10 @@ svg * { body { text-align: center; background-color: #555555; + background-image: url(../../images/greyback.gif); + } + body.pure { background-color: #fff; } @@ -255,7 +258,7 @@ input.datos_readonly { background-color: #050505; } input.login { - border-color: #3f4e2f; + border-color: #aaa; background-color: #f5f5f5; margin: 2px 0 8px; width: 90px; diff --git a/pandora_console/index.php b/pandora_console/index.php index 461a55dea3..a2b036637a 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -219,10 +219,6 @@ if (isset ($_GET["bye"])) { exit (""); } -// http://es2.php.net/manual/en/ref.session.php#64525 -// Session locking concurrency speedup! -session_write_close (); - // Header if ($config["pure"] == 0) { echo '