$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 { header("Location: ./install_mysql.php?etape=1"); } } ?>
function installer_main() { global $g, $fstype, $savemsg; if (file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) { unlink("/tmp/.pc-sysinstall/pc-sysinstall.log"); } head_html(); body_html(); $disk = installer_find_first_disk(); // Only enable ZFS if this exists. The install will fail otherwise. if (file_exists("/boot/gptzfsboot")) { $zfs_enabled = "<tr bgcolor=\"#9A9A9A\"><td align=\"center\"><a href=\"installer.php?state=easy_install_zfs\">Easy installation of {$g['product_name']} using the ZFS filesystem on disk {$disk}</a></td></tr>"; } page_table_start(); echo <<<EOF \t\t<form action="installer.php" method="post" state="step1_post"> \t\t\t<div id="mainlevel"> \t\t\t\t<center> \t\t\t\t<b><font face="arial" size="+2">Welcome to the {$g['product_name']} webInstaller!</b></font><p/> \t\t\t\t<font face="arial" size="+1">This utility will install {$g['product_name']} to a hard disk, flash drive, etc.</font> \t\t\t\t<table width="100%" border="0" cellpadding="5" cellspacing="0"> \t\t\t \t\t<tr> \t\t\t \t\t<td> \t\t\t\t\t\t\t<center> \t\t\t\t\t\t\t<div id="mainarea"> \t\t\t\t\t\t\t\t<br /> \t\t\t\t\t\t\t\t<center> \t\t\t\t\t\t\t\tPlease select an installer option to begin: \t\t\t\t\t\t\t\t<p/> \t\t\t\t\t\t\t\t<table width="100%" border="0" cellpadding="5" cellspacing="5"> \t\t\t\t\t\t\t\t\t<tr> \t\t\t \t\t\t\t\t\t<td> \t\t\t\t\t\t\t\t\t\t\t<div id="pfsenseinstaller"> \t\t\t\t\t\t\t\t\t\t\t\t<center> EOF; if (!$disk) { echo gettext("ERROR: Could not find any suitable disks for installation."); echo "</div></td></tr></table></div></table></div>"; end_html(); exit; } echo <<<EOF \t\t\t\t\t\t\t\t\t\t\t\t\t<table cellspacing="5" cellpadding="5" style="border: 1px dashed;"> \t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr bgcolor="#CECECE"><td align="center"> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href="installer.php?state=easy_install_ufs">Easy installation of {$g['product_name']} using the UFS filesystem on disk {$disk}</a> \t\t\t\t\t\t\t\t\t\t\t\t\t\t</td></tr> \t\t\t\t\t\t\t\t\t\t\t\t\t \t{$zfs_enabled} \t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr bgcolor="#AAAAAA"><td align="center"> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href="installer.php?state=custominstall">Custom installation of {$g['product_name']}</a> \t\t\t\t\t\t\t\t\t\t\t\t\t\t</td></tr> \t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr bgcolor="#CECECE"><td align="center"> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href='/'>Cancel and return to Dashboard</a> \t\t\t\t\t\t\t\t\t\t\t\t\t\t</td></tr> \t\t\t\t\t\t\t\t\t\t\t\t\t</table> \t\t\t\t\t\t\t\t\t\t\t\t</center> \t\t\t\t\t\t\t\t\t\t\t</div> \t\t\t \t\t\t\t\t\t</td> \t\t\t\t\t\t\t\t\t</tr> \t\t\t\t\t\t\t\t</table> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</table> \t\t\t</div> EOF; page_table_end(); end_html(); }
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"> </div> </div> </div> <?php end_html(); }