From 9419f38fda24861538df0440ebdaf76aed96db92 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 22 Sep 2010 16:52:29 +0000 Subject: [PATCH] 2010-09-22 Miguel de Dios * ChangeLog: fixed previous commit of jobmate that erase some lines of ChangeLog. * index.php: cleaned source code style. * mobile/include/style/main.css: added style for the login mobile page. * mobile/include/user.class.php: the "loginShow" function have a nice login box with some style. * mobile/images/transparent_pixel.gif, mobile/images/key.gif: added image files for the login page. The key image is created for "barretr" in http://www.openclipart.org/detail/3330. * mobile/index.php: changes for to show logout and new login box. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3275 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 95 +++++++++++++++ pandora_console/index.php | 12 +- pandora_console/mobile/images/key.gif | Bin 0 -> 1810 bytes .../mobile/images/transparent_pixel.gif | Bin 0 -> 64 bytes pandora_console/mobile/include/style/main.css | 114 ++++++++++++++++++ pandora_console/mobile/include/user.class.php | 94 +++++++++++++-- pandora_console/mobile/index.php | 38 +++--- 7 files changed, 326 insertions(+), 27 deletions(-) create mode 100644 pandora_console/mobile/images/key.gif create mode 100644 pandora_console/mobile/images/transparent_pixel.gif diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 536192d354..4644dae5e4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,8 +1,102 @@ +2010-09-22 Miguel de Dios + + * ChangeLog: fixed previous commit of jobmate that erase some lines of + ChangeLog. + + * index.php: cleaned source code style. + + * mobile/include/style/main.css: added style for the login mobile page. + + * mobile/include/user.class.php: the "loginShow" function have a nice + login box with some style. + + * mobile/images/transparent_pixel.gif, mobile/images/key.gif: added image + files for the login page. The key image is created for "barretr" in + "http://www.openclipart.org/detail/3330", thanks. + + * mobile/index.php: changes for to show logout and new login box. + 2010-09-22 Sancho Lerena * godmode/reporting/visual_console_builder.elements.php, godmode/reporting/visual_console_builder.editor.php: Fixed bug #3073239: bad intervals in combo for period selection. + +2010-09-22 Sergio Martin + + * include/functions_modules.php: Fixed bad call to + enterprise function + +2010-09-21 Miguel de Dios + + * include/functions_html.php: in function "print_select_groups" and function + "print_select_from_sql" added source code to check $config['text_char_long'] + for show small text in this widgets. + + * include/functions.php: in function "get_event_types" and "get_priorities" + added source code to check $config['text_char_long'] for show small text in + this widgets. And in function "get_priority_class" cleaned source code. + + * operation/agentes/status_monitor.php, operation/events/events.php: cleaned + source code style. + + * images/pandora.ico.gif: added image file for to use in the mobile footer. + + * mobile/operation/agents/monitor_status.php, + mobile/operation/agents/view_agents.php, + mobile/operation/agents/tactical.php, + mobile/operation/agents/group_view.php, mobile/operation/events/events.php, + mobile/include/style/main.css, mobile/include/functions_web.php, + mobile/index.php, general/footer.php: continued the develop, yep the + Pandora Console Mobile is complete (only rest the bugs). + +2010-09-21 Sergio Martin + + * include/functions_db.php + godmode/agentes/modificar_agente.php: Added the calls + to enterprise to delete an agent to all their policies + when we delete it for bug 3072471 + +2010-09-21 Miguel de Dios + + * include/functions_html.php: fixed the width by default in the function + "print_table", now there isn't a default width (before it was 80%). + + * include/pchart_graph.php: fixed in the function "add_events" when tryed + to add a event out the data. + + * include/fgraph.php: check the user with the mobile methods. + + * include/functions_db.php: in function "check_login" check the user with + the mobile methods. + + * images/status_sets/default/severity_warning_pixel.png, + images/status_sets/default/severity_normal_pixel.png, + images/status_sets/default/severity_informational_pixel.png, + images/status_sets/default/severity_maintenance_pixel.png, + images/status_sets/default/severity_critical_pixel.png: added the image + files for to show in the event mobile's page. + + * mobile/operation/agents/view_agents.php, + mobile/operation/agents/tactical.php, + mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php, + mobile/operation/servers/view_servers.php, mobile/include/user.class.php, + mobile/include/system.class.php: changed the style the some pages to show + more clearly the pages in old m$-mobiles. + +2010-09-21 Junichi Satoh + + * godmode/massive/massive_add_action_alerts.php, + godmode/massive/massive_delete_action_alerts.php: Fixed + addition/deletion for compound alerts does not work. + + * include/functions_alerts.php: To fix above problem, added a function, + delete_alert_compound_action(). + +2010-09-20 Raúl Mateos + + * operation/agentes/customfields.php: Add code to show text when no + fields defined. 2010-09-20 Sancho Lerena @@ -12252,3 +12346,4 @@ svn co translation. * include/languages/index.pot: Updated po template. + \ No newline at end of file diff --git a/pandora_console/index.php b/pandora_console/index.php index 8dda55a91b..2e799cb024 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -147,13 +147,15 @@ if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) { logon_db ($loginhash_user, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $loginhash_user; $config["id_user"] = $loginhash_user; - } else { + } + else { require_once ('general/login_page.php'); audit_db ("system", $_SERVER['REMOTE_ADDR'], "Logon Failed (loginhash", ""); while (@ob_end_flush ()); exit (""); } -} elseif (! isset ($config['id_user']) && isset ($_GET["login"])) { +} +elseif (! isset ($config['id_user']) && isset ($_GET["login"])) { // Login process $config["auth_error"] = ""; //Set this to the error message from the authorization mechanism @@ -186,7 +188,8 @@ if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) { $l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$config["language"].'.mo')); $l10n->load_tables(); } - } else { + } + else { // User not known $login_failed = true; require_once ('general/login_page.php'); @@ -194,7 +197,8 @@ if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) { while (@ob_end_flush ()); exit (""); } -} elseif (! isset ($config['id_user'])) { +} +elseif (! isset ($config['id_user'])) { // There is no user connected require_once ('general/login_page.php'); while (@ob_end_flush ()); diff --git a/pandora_console/mobile/images/key.gif b/pandora_console/mobile/images/key.gif new file mode 100644 index 0000000000000000000000000000000000000000..c416da7db8d10add7c266e07539e53a69b7329ab GIT binary patch literal 1810 zcmcK3`%_bQ8prV`A%TQINC1^vHC#l%>P7|Hirpef5Q?pUw^7_RR&-!3TXnUv)h-F3 z)DhQMbnCQqRmAPs>J}?EBb9_i5(o&Wpxi?e5)y79gj~)^PWJdm>~~)Cp3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LW%LhRyLYen3{J*}CFI9TC|ti2+(7KZExv!DC%f+MS-$%Kf#kh!vxvjoDwl8q zKRx%o*MlUbdBwq9+ok0`gmcPN>gOhYDJ_LHA%B=0vsOkcNebr$w}zhZ@?BLeDr0V| zizfxd-l%J%^Voe4{KlWE)ADtgezYW`ez-6oNt9YD=EYo{p&^ZRX$8FvcD`iptAsL2 zRCTtDkty#r`^Hr>_H#cf_BGL>%K4>!AF&onWs!=MjogP}S;uHAi`hgKub%OU8ePd= z86#oUHPB+S=oFLdqLV(DpJ)7m>tuijSvxhZeJc4T$AeKk7f2 zBCn&-t3*QbQA4j6_1G7wUycrwrT!Lb)B(QKJ5DDlqwJ|F5|YmakQS*6U-7q+LvLiu z=quy?_?UFrv)J@9x;R@%x~>v=`CPiPoTh^Tg+3Pmz=~!I2Pr z*;@n>!T_zdn0$wG3y6NlkGIkMf*B=Se>*ltpbG?@4eAo;ddCZS4@kXqAt{IDV6X** d2*C+PFlA|MFAyk_l2Dg|C_4iTdJGFv{s*-f&r<*Z literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/images/transparent_pixel.gif b/pandora_console/mobile/images/transparent_pixel.gif new file mode 100644 index 0000000000000000000000000000000000000000..3be2119778794d43c05957a316e690bfa557ccfe GIT binary patch literal 64 zcmZ?wbhEHbWMp7uXkcLY4+e_=1f7dg6H8K46v{J8G8EiBeFGR2f3h%g0afWR00Brj L0~3=EBZD;n!BP<# literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 8169b88495..5cafa1ffba 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -92,6 +92,120 @@ tr.rowOdd:hover { font-size: 10px; } +/*----------------INI-LOGIN---------------------------------------------------*/ +#center_div { + display: block; + position: absolute; + top: 30px; + left: 50%; +} + +#negative_position_div { + display: block; + position: absolute; + left: -335px; +} + +#style_div #shadow { + display: block; + border: 0px; + position: absolute; + top: 15px; + left: 235px; + background: #036A3A; + + width: 200px; + height: 120px; + + color: #fff; +} + +#style_div #shadow p { + position: absolute; + bottom: 0px; + right: 2px; +} + +#style_div #shadow * { + font-size: 9px; +} + +#style_div #version { + color: #036A3A; +} + +#style_div #login_box { + background: url("../../../images/pandora_logo.png") bottom left no-repeat #fff; + + display: block; + border: 2px solid #6DC62D; + position: absolute; + top: 0px; + left: 220px; + + width: 200px; + height: 120px; +} + +#style_div #text-user { + width: 60px; + height: 15px; + position: absolute; + left: 20px; + top: 20px; +} + +#style_div #password-password { + width: 60px; + height: 15px; + position: absolute; + left: 20px; + top: 45px; +} + +#style_div .login_button { + width: 70px; + height: 70px; + background: url('../../images/key.gif') #fff center no-repeat; + border: outset 5px #A3A3A3; + position: absolute; + left: 120px; + top: 10px; +} + +#style_div .login_button:hover { + border: outset 5px #E9E9E9; +} + +/*STYLE FOR IEXPLOTER MOBILE, MAY BE ANY DAY ERASE THIS LINES*/ +#form_table td { + background: url('../../images/transparent_pixel.gif'); +} + +#table_version #text-user { + width: 60px; + height: 15px; +} + +#table_version #password-password { + width: 60px; + height: 15px; +} + +#table_version .login_button { + width: 70px; + height: 70px; + background: url('../../images/key.gif') #fff center no-repeat; + border: outset 5px #A3A3A3; +} + +#table_version_negative_position_div { + /*margin-left: -120px;*/ +} + +/*----------------END-LOGIN---------------------------------------------------*/ + + /*----------------INI-MENU----------------------------------------------------*/ #top_menu { background: #3F4E2F; diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index 90a7edba24..821bfc037a 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -54,7 +54,7 @@ class User { $password = $this->system->getRequest('password', null); } - if (process_user_login($user, $password)) { + if (process_user_login($user, $password) !== false) { $this->logged = true; $this->user = $user; } @@ -70,13 +70,93 @@ class User { $this->logged = false; } - public function login() { - echo "
"; + public function showLogin($text = '') { + global $pandora_version; + + echo ""; print_input_hidden('action', 'login'); - print_input_text('user', $this->user, __('User'), 10, 20); - print_input_password('password', '', __('Password'), 10, 20); - print_submit_button(__('Login'), 'login', false, 'class="sub next"'); - echo "
"; + ?> +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
 user, __('User'), 10, 20);?>
 
  
   
+
 
 
  + ' . __('Your IP').':' . $this->system->getConfig("remote_addr") . ' ';?> +
   
+
+
+ "; + + /* + ?> +
+
+
+
+

+ ' . __('Your IP').':' . $this->system->getConfig("remote_addr"); + ?> +

+
+ "; + echo "
" . $pandora_version . "
"; + print_input_hidden('action', 'login'); + print_input_text('user', $this->user, __('User'), 10, 20); + print_input_password('password', '', __('Password'), 10, 20); + print_submit_button(__(''), 'login', false, 'onclick="javascript: click();" class="login_button" alt="' . __('Login') . '" title="' . __('Login') . '"'); + echo ""; + ?> +
+
+
+ hackinjectConfig(); Pandora FMS - <?php echo __('the Flexible Monitoring System (mobile version)'); ?> -
@@ -50,29 +49,35 @@ $user->hackinjectConfig(); switch ($action) { case 'login': if (!$user->checkLogin()) { - $user->login(); + $user->showLogin(); } else { - $user->hackinjectConfig(); - menu(); - - if (! give_acl($system->getConfig('id_user'), 0, "AR")) { - audit_db($system->getConfig('id_user'), $_SERVER['REMOTE_ADDR'], "ACL Violation", - "Trying to access Agent Data view"); - require ("../general/noaccess.php"); - return; - } - - $tactical = new Tactical(); - $tactical->show(); + if ($user->isLogged()) { + $user->hackinjectConfig(); + menu(); + + if (! give_acl($system->getConfig('id_user'), 0, "AR")) { + audit_db($system->getConfig('id_user'), $_SERVER['REMOTE_ADDR'], "ACL Violation", + "Trying to access Agent Data view"); + require ("../general/noaccess.php"); + return; + } + + $tactical = new Tactical(); + $tactical->show(); + } + else { + $user->showLogin(); + } } break; case 'logout': $user->logout(); + $user->showLogin('' . __('LOGOUT') . ''); break; default: if (!$user->isLogged()) { - $user->login(); + $user->showLogin(); } else { menu(); @@ -80,7 +85,8 @@ $user->hackinjectConfig(); switch ($page) { case 'reports': if ($enterpriseHook !== ENTERPRISE_NOT_HOOK) { - $enterprise = new Enterprise($page); + $enterprise = new Enterprise($page); + $enterprise->show(); } break; default: