示例#1
0
} else if (!$etape) {
    $erreur = '';
    if (@file_exists($nom_fic)) {
        $f = @fopen($nom_fic, "r+");
        if (!$f) $erreur = "<p>Le fichier \"".$nom_fic."\" n'est pas accessible en écriture.</p>";
    } else {
        $f = @fopen($nom_fic, "w");
        if (!$f) $erreur = "<p>Impossible de créer le fichier \"".$nom_fic."\".</p>";
    }
    if ($f)
      if (!@fclose($f))
        $erreur = "<p>Impossible de sauvegarder le fichier \"".$nom_fic."\".</p>";

    if ($erreur!='') {
        echo begin_page("Installation de GRR");
        begin_html();
        echo "<h2>Installation de la base $dbsys : problème de droits d'accès</h2>";
        echo $erreur;
        if (@file_exists($nom_fic))
            echo "<p>Vous pouvez également renseigner manuellement le fichier \"".$nom_fic."\".</p>";
        else if (@file_exists($nom_fic.".ori")) {
            echo "<p>Vous pouvez renommer manuellement le fichier \"".$nom_fic.".ori\" en \"".$nom_fic."\", et lui donner les droits suffisants.</p>";
            echo "<p>Une fois le fichier \"".$nom_fic.".ori\" renommé en \"".$nom_fic."\", vous pouvez également renseigner manuellement le fichier \"".$nom_fic."\".</p>";
        }
        echo "<p>Vous pouvez par exemple utilisez votre client FTP afin de régler ce problème ou bien contactez l'administrateur technique. Une fois cette manipulation effectuée, vous pourrez continuer.</p>";
        echo "<p><form action='install_mysql.php' method='get'>";
        echo "<input type='hidden' name='etape' value='' />";
        echo "<input type='submit' class='fondl' name='Continuer' />";
        echo "</form>";
        end_html();
    } else {
示例#2
0
function view_downtime($global_stats, $status)
{
    global $STATUS_FILE, $COMMAND_FILE;
    global $HOST_STATUS_BY, $SERVICE_STATUS_BY;
    global $BASE_URL;
    $host_id = $_GET["host_id"];
    $host_status = $status["hosts"][$host_id];
    $host = $host_status["host_name"];
    $service_id = $_GET["service_id"];
    $service_status;
    if (!isset($service_id)) {
        $id = $host_id;
    } else {
        $id = "{$host_id}_{$service_id}";
        $service_status = $host_status["services"][$service_id];
    }
    begin_html();
    ?>
<div data-role="page" id="dt_<?php 
    echo $id;
    ?>
" data-theme="a">

  <div data-role="header">
    <h1>downtime</h1>
    <a href="<?php 
    echo $BASE_URL;
    ?>
" data-icon="home" data-iconpos="notext"  data-direction="reverse" class="ui-btn-right">Home</a>
  </div>

  <div data-role="content">
    <h2>Information</h2>
    <div class="information rounded">
      <dl>
        <dt>Host</dt>
        <dd><?php 
    echo $host;
    ?>
</dd>
<?php 
    if (isset($service_id)) {
        print "\n        <dt>Serivice</dt>\n        <dd>{$service_status['service_description']}</dd>";
    }
    ?>
      </dl>
    </div>

    <h2>Command Options</h2>
    <form
          id="dt_<?php 
    echo $id;
    ?>
_form"
          data-dt_host="<?php 
    echo $host;
    ?>
"
          data-dt_service="<?php 
    echo isset($service_id) ? $service_status['service_description'] : '';
    ?>
"
    >
      <div data-role="fieldcontain">
        <label for="dt_<?php 
    echo $id;
    ?>
_comment">Comment:</label>
        <input type="text" name="dt_<?php 
    echo $id;
    ?>
_comment" id="dt_<?php 
    echo $id;
    ?>
_comment" value="schedule down" />
      </div>

      <div data-role="fieldcontain">
        <label for="dt_<?php 
    echo $id;
    ?>
_end_date">End Time:</label>
        <select id="dt_<?php 
    echo $id;
    ?>
_end_date">
<?php 
    for ($i = 0, $t = time(); $i < 7; $t += 86400, $i++) {
        printf("      <option>%s</option>\n", strftime("%Y-%m-%d", $t));
    }
    ?>
        </select>
        <select id="dt_<?php 
    echo $id;
    ?>
_end_time">
<?php 
    $now_h = strftime("%H");
    $now_m = strftime("%M");
    if ($now_m < 30) {
        $now_m = 30;
    } else {
        $now_h = intval(($now_h + 1) % 24);
        $now_m = 0;
    }
    $time_selected = sprintf("%02d:%02d", $now_h, $now_m);
    $minutes = array(0, 30);
    for ($h = 0; $h < 24; $h++) {
        foreach ($minutes as $m) {
            $tm = sprintf("%02d:%02d", $h, $m);
            printf("      <option %s>%s</option>\n", $tm === $time_selected ? "selected" : "", $tm);
        }
    }
    ?>
        </select>
      </div>
      <a href="#"
         class="submitDowntimeButton"
         data-role="button"
         data-theme="e"
         data-dt_id="<?php 
    echo $id;
    ?>
"
      >Commit</a>
    </form>
    <div id="dt_<?php 
    echo $id;
    ?>
_result" class="result">&nbsp;</div>
  </div>
</div>
<?php 
    end_html();
}