Example #1
0
?>
" />
				</div>
				<?php 
if ($pconfig['do_action']) {
    echo sprintf("<div id='cmdoutput'>%s</div>", gettext("Command output:"));
    echo '<pre class="cmdoutput">';
    //ob_end_flush();
    if (isset($pconfig['init']) && true === $pconfig['init']) {
        // Initialize and encrypt the disk.
        echo sprintf(gettext("Encrypting '%s'... Please wait") . "!<br />", $pconfig['devicespecialfile']);
        disks_geli_init($pconfig['devicespecialfile'], $pconfig['aalgo'], $pconfig['ealgo'], $pconfig['keylen'], $pconfig['passphrase'], true);
    }
    // Attach the disk.
    echo sprintf(gettext("Attaching provider '%s'."), $pconfig['devicespecialfile']) . "<br />";
    disks_geli_attach($pconfig['devicespecialfile'], $pconfig['passphrase'], true);
    echo '</pre>';
}
?>
				<?php 
include "formend.inc";
?>
			</form>
		</td>
	</tr>
</table>
<script type="text/javascript">
<!--
ealgo_change();
//-->
</script>
Example #2
0
					</tr>
				</table>
				<div id="submit">
					<input name="Submit" type="submit" class="formbtn" value="<?php 
echo gettext("Execute");
?>
" />
				</div>
				<?php 
if ($pconfig['do_action']) {
    echo sprintf("<div id='cmdoutput'>%s</div>", gettext("Command output:"));
    echo '<pre class="cmdoutput">';
    //ob_end_flush();
    switch ($pconfig['action']) {
        case "attach":
            $result = disks_geli_attach($geli['device'][0], $pconfig['passphrase'], true);
            // When attaching the disk, then also mount it.
            if (FALSE !== ($cnid = array_search_ex($geli['devicespecialfile'], $a_mount, "mdisk"))) {
                echo "<br />" . gettext("Mounting device.") . "<br />";
                echo 0 == disks_mount($a_mount[$cnid]) ? gettext("Successful.") : gettext("Failed.");
            }
            break;
        case "detach":
            $result = disks_geli_detach($geli['devicespecialfile'], true);
            echo 0 == $result ? gettext("Done.") : gettext("Failed.");
            break;
        case "setkey":
            disks_geli_setkey($geli['devicespecialfile'], $pconfig['oldpassphrase'], $pconfig['passphrase'], true);
            break;
        case "list":
            system("/sbin/geli list");