Example #1
0
 /**
  * Show the central personal view
  **/
 static function showMyView()
 {
     global $DB, $CFG_GLPI;
     $showticket = Session::haveRight("show_all_ticket", "1") || Session::haveRight("show_assign_ticket", "1");
     $showproblem = Session::haveRight("show_all_problem", "1") || Session::haveRight("show_my_problem", "1");
     echo "<table class='tab_cadre_central'>";
     if (Session::haveRight("config", "w")) {
         $logins = User::checkDefaultPasswords();
         $user = new User();
         if (!empty($logins)) {
             $accouts = array();
             foreach ($logins as $login) {
                 $user->getFromDBbyName($login);
                 $accounts[] = $user->getLink();
             }
             $message = sprintf(__('For security reasons, please change the password for the default users: %s'), implode(" ", $accounts));
             echo "<tr><th colspan='2'>";
             Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message);
             echo "</th></tr>";
         }
         if (file_exists(GLPI_ROOT . "/install/install.php")) {
             echo "<tr><th colspan='2'>";
             $message = sprintf(__('For security reasons, please remove file: %s'), "install/install.php");
             Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message);
             echo "</th></tr>";
         }
     }
     if ($DB->isSlave() && !$DB->first_connection) {
         echo "<tr><th colspan='2'>";
         Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", __('MySQL replica: read only'), __('MySQL replica: read only'));
         echo "</th></tr>";
     }
     echo "<tr><td class='top'><table class='central'>";
     echo "<tr><td>";
     if (Session::haveRight('validate_request', 1) || Session::haveRight('validate_incident', 1)) {
         Ticket::showCentralList(0, "tovalidate", false);
     }
     if (Ticket::isAllowedStatus(Ticket::SOLVED, Ticket::CLOSED)) {
         Ticket::showCentralList(0, "toapprove", false);
     }
     Ticket::showCentralList(0, "rejected", false);
     Ticket::showCentralList(0, "requestbyself", false);
     Ticket::showCentralList(0, "observed", false);
     if ($showticket) {
         Ticket::showCentralList(0, "process", false);
         Ticket::showCentralList(0, "waiting", false);
     }
     if ($showproblem) {
         Problem::showCentralList(0, "process", false);
     }
     echo "</td></tr>";
     echo "</table></td>";
     echo "<td class='top'><table class='central'>";
     echo "<tr><td>";
     Planning::showCentral(Session::getLoginUserID());
     Reminder::showListForCentral();
     if (Session::haveRight("reminder_public", "r")) {
         Reminder::showListForCentral(false);
     }
     echo "</td></tr>";
     echo "</table></td></tr></table>";
 }
Example #2
0
 /**
  * Show the central personal view
  **/
 static function showMyView()
 {
     global $DB, $CFG_GLPI;
     $showticket = Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READALL, Ticket::READASSIGN));
     $showproblem = Session::haveRightsOr('problem', array(Problem::READALL, Problem::READMY));
     echo "<table class='tab_cadre_central'>";
     if (Session::haveRight("config", UPDATE)) {
         $logins = User::checkDefaultPasswords();
         $user = new User();
         if (!empty($logins)) {
             $accouts = array();
             foreach ($logins as $login) {
                 $user->getFromDBbyName($login);
                 $accounts[] = $user->getLink();
             }
             $message = sprintf(__('For security reasons, please change the password for the default users: %s'), implode(" ", $accounts));
             echo "<tr><th colspan='2'>";
             Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message);
             echo "</th></tr>";
         }
         if (file_exists(GLPI_ROOT . "/install/install.php")) {
             echo "<tr><th colspan='2'>";
             $message = sprintf(__('For security reasons, please remove file: %s'), "install/install.php");
             Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message);
             echo "</th></tr>";
         }
     }
     if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
         if (!DBMysql::isMySQLStrictMode()) {
             echo "<tr><th colspan='2'>";
             $message = __('MySQL strict mode is not enabled');
             Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", $message, $message);
             echo "</th></tr>";
         }
     }
     if ($DB->isSlave() && !$DB->first_connection) {
         echo "<tr><th colspan='2'>";
         Html::displayTitle($CFG_GLPI['root_doc'] . "/pics/warning.png", __('MySQL replica: read only'), __('MySQL replica: read only'));
         echo "</th></tr>";
     }
     echo "<tr class='noHover'><td class='top' width='50%'><table class='central'>";
     echo "<tr class='noHover'><td>";
     if (Session::haveRightsOr('ticketvalidation', TicketValidation::getValidateRights())) {
         Ticket::showCentralList(0, "tovalidate", false);
     }
     if ($showticket) {
         if (Ticket::isAllowedStatus(Ticket::SOLVED, Ticket::CLOSED)) {
             Ticket::showCentralList(0, "toapprove", false);
         }
         Ticket::showCentralList(0, "survey", false);
         Ticket::showCentralList(0, "rejected", false);
         Ticket::showCentralList(0, "requestbyself", false);
         Ticket::showCentralList(0, "observed", false);
         Ticket::showCentralList(0, "process", false);
         Ticket::showCentralList(0, "waiting", false);
     }
     if ($showproblem) {
         Problem::showCentralList(0, "process", false);
     }
     echo "</td></tr>";
     echo "</table></td>";
     echo "<td class='top'  width='50%'><table class='central'>";
     echo "<tr class='noHover'><td>";
     Planning::showCentral(Session::getLoginUserID());
     Reminder::showListForCentral();
     if (Session::haveRight("reminder_public", READ)) {
         Reminder::showListForCentral(false);
     }
     echo "</td></tr>";
     echo "</table></td></tr></table>";
 }