Esempio n. 1
0
function getSyncStatus()
{
    if (trim(suExec("getsyncstatus")) == "true") {
        return true;
    } else {
        return false;
    }
}
Esempio n. 2
0
                                $desc .= "{$line}\n";
                            }
                        }
                    }
                }
            }
        }
    }
    if (isset($_POST['NetBootImage']) && ($_GET['service'] = "NetBoot")) {
        $wasrunning = getNetBootStatus();
        $nbi = $_POST['NetBootImage'];
        if ($nbi != "") {
            $nbconf = file_get_contents("/var/appliance/conf/dhcpd.conf");
            $nbsubnets = "";
            foreach ($conf->getSubnets() as $key => $value) {
                $nbsubnets .= "subnet " . $value['subnet'] . " netmask " . $value['netmask'] . " {\n\tallow unknown-clients;\n}\n\n";
            }
            $nbconf = str_replace("##SUBNETS##", $nbsubnets, $nbconf);
            suExec("touchconf \"/var/appliance/conf/dhcpd.conf.new\"");
            if (file_put_contents("/var/appliance/conf/dhcpd.conf.new", $nbconf) === FALSE) {
                echo "<div class=\"errorMessage\">ERROR: Unable to update dhcpd.conf</div>";
            }
            suExec("disablenetboot");
            suExec("installdhcpdconf");
            if ($wasrunning || isset($_POST['enablenetboot'])) {
                suExec("setnbimages " . $nbi);
            }
            $conf->setSetting("netbootimage", $nbi);
        }
    }
}
Esempio n. 3
0
function getFirewallstatus()
{
    if (trim(suExec("getFirewallstatus")) == "true") {
        return true;
    } else {
        return false;
    }
}
Esempio n. 4
0
				<li>
					<span>Number of Active AFP Connections:</span>
					<br>
					<br>
					<span><?php 
echo suExec("afpconns");
?>
</span>
				</li>

				<li>
					<span>Shadow File Usage:</span>
					<br>
					<br>
					<span><?php 
echo suExec("shadowusage");
?>
</span>
				</li>

			</ul>

		</div>
		</div>
		
		<div id="netboot-server">

		<h3>LDAP Proxy Server</h3>

		<div class="container">
Esempio n. 5
0
?>
>
			<br>
			<br>

		</form> <!-- end form Restart -->

		<hr>
		<br>

		<input type="button" id="back-button" name="action" class="btn btn-sm btn-default" value="Back" onclick="document.location.href='<?php 
echo $_SERVER['HTTP_REFERER'];
?>
'" <?php 
if (isset($_POST['confirm'])) {
    echo "disabled";
}
?>
>

	</div>
</div>

<?php 
include "inc/footer.php";
?>

<?php 
if (isset($_POST['confirm'])) {
    suExec("restart");
}
Esempio n. 6
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
$currentIP = trim(getCurrentIP());
if ($_GET['restart']) {
    $sURL = "SMB.php";
    echo suExec("restartsmb");
}
if ($_GET['start']) {
    echo suExec("startsmb");
    $sURL = "smb://" . $currentIP . "/NetBoot";
}
header('Location: ' . $sURL);
include "inc/footer.php";
?>

Esempio n. 7
0
}
if (isset($_POST['SSH'])) {
    if (getSSHstatus()) {
        suExec("disableSSH");
        echo "<div class=\"alert alert-warning\">SSH Disabled.</div>";
    } else {
        suExec("enableSSH");
        echo "<div class=\"alert alert-success\">SSH Enabled.</div>";
    }
}
if (isset($_POST['Firewall'])) {
    if (getFirewallstatus()) {
        suExec("disableFirewall");
        echo "<div class=\"alert alert-warning\">Firewall Disabled.</div>";
    } else {
        suExec("enableFirewall");
        echo "<div class=\"alert alert-success\">Firewall Enabled.</div>";
    }
}
$type = getNetType();
$dns = getCurrentNameServers();
?>

<script>
window.onload = function()
{
	document.getElementById('ip').disabled = document.getElementById('dhcp').checked;
	document.getElementById('netmask').disabled = document.getElementById('dhcp').checked;
	document.getElementById('gateway').disabled = document.getElementById('dhcp').checked;
	document.getElementById('dns1').disabled = document.getElementById('dhcp').checked;
	document.getElementById('dns2').disabled = document.getElementById('dhcp').checked;
Esempio n. 8
0
?>
>3 p.m.</option>
				<option value="18"<?php 
echo $syncschedule == "18" ? " selected=\"selected\"" : "";
?>
>6 p.m.</option>
				<option value="21"<?php 
echo $syncschedule == "21" ? " selected=\"selected\"" : "";
?>
>9 p.m.</option>
			</select>
			<br>
			<div class="labelDescriptionWrapper">
				<span style="font-weight:bold;">Last Sync: </span><span><?php 
if (trim(suExec("lastsussync")) != "") {
    print suExec("lastsussync");
} else {
    echo "Never";
}
?>
</span>
			</div>

		</div> <!-- end #form-inside -->

	</form> <!-- end form SUS -->

</div> <!-- end #form-wrapper -->

<?php 
include "inc/footer.php";
Esempio n. 9
0
        $accounterror = "Incorrect current password.";
    }
}
$shelluser = "";
// Change the shell account
if (isset($_POST['saveShellAccount'])) {
    if (isset($_POST['shellUsername']) && isset($_POST['shellPassword']) && isset($_POST['shellConfirm']) && $_POST['shellUsername'] != "" && $_POST['shellPassword'] != "" && $_POST['shellConfirm'] != "") {
        if ($_POST['shellPassword'] == $_POST['shellConfirm']) {
            $shelluser = $_POST['shellUsername'];
            if ($shelluser != $conf->getSetting("shelluser")) {
                print suExec("changeshelluser {$shelluser} " . $conf->getSetting("shelluser"));
                $conf->setSetting("shelluser", $shelluser);
            }
            $shelluser = $conf->getSetting("shelluser");
            // TODO: Find more secure method
            print suExec("changeshellpass {$shelluser} " . $_POST['shellPassword']);
            // Have to pass the password in clear text, unfortunately
            $accountsuccess = "Shell account changed.";
            $conf->changedPass("shellaccount");
        } else {
            $accounterror = "Passwords do not match.";
        }
    } else {
        $accounterror = "All fields are required.";
    }
} else {
    // Load current account name
    $shelluser = $conf->getSetting("shelluser");
    if ($shelluser == NULL || $shelluser == "") {
        $shelluser = "******";
        $conf->setSetting("shelluser", $shelluser);
Esempio n. 10
0
        } else {
            if (isValidIPAddress($_POST['ip']) && !isLoopbackAddress($_POST['ip']) && getNetAddress($_POST['ip'], $_POST['netmask']) != $_POST['ip'] && getBcastAddress($_POST['ip'], $_POST['netmask']) != $_POST['ip'] && isValidNetmask($_POST['netmask']) && isValidIPAddress($_POST['gateway']) && !isLoopbackAddress($_POST['gateway']) && getNetAddress($_POST['gateway'], $_POST['netmask']) != $_POST['gateway'] && getBcastAddress($_POST['gateway'], $_POST['netmask']) != $_POST['gateway'] && $_POST['gateway'] != $_POST['ip'] && isValidIPAddress($_POST['dns1']) && (isValidIPAddress($_POST['dns2']) || $_POST['dns2'] == "")) {
                //address netmask gateway
                suExec("setip " . $_POST['ip'] . " " . $_POST['netmask'] . " " . $_POST['gateway']);
                suExec("setdns " . $_POST['dns1'] . " " . $_POST['dns2']);
            }
        }
        echo "<div class=\"successMessage\">Configuration saved.</div>";
    }
}
if (isset($_POST['SSH'])) {
    if (getSSHstatus()) {
        suExec("disableSSH");
        echo "<div class=\"successMessage\">SSH Disabled.</div>";
    } else {
        suExec("enableSSH");
        echo "<div class=\"successMessage\">SSH Enabled.</div>";
    }
}
$type = getNetType();
$dns = getCurrentNameServers();
?>

<script>
window.onload = function()
{
	document.getElementById('ip').disabled = document.getElementById('dhcp').checked;
	document.getElementById('netmask').disabled = document.getElementById('dhcp').checked;
	document.getElementById('gateway').disabled = document.getElementById('dhcp').checked;
	document.getElementById('dns1').disabled = document.getElementById('dhcp').checked;
	document.getElementById('dns2').disabled = document.getElementById('dhcp').checked;
Esempio n. 11
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
$title = "AFP";
include "inc/header.php";
$accounterror = "";
$accountsuccess = "";
if (isset($_POST['afppass'])) {
    $afppw1 = $_POST['afppass1'];
    $afppw2 = $_POST['afppass2'];
    if ($afppw1 != "") {
        if ($afppw1 == $afppw2) {
            $result = suExec("resetafppw " . $afppw1);
            if (strpos($result, 'BAD PASSWORD') !== false) {
                $accounterror = $result;
            } else {
                $accountsuccess = "AFP password changed.";
                $conf->changedPass("afpaccount");
            }
        } else {
            $accounterror = "Passwords do not match.";
        }
    } else {
        $accounterror = "All fields required.";
    }
}
?>
<script>
// function validateafpPW()
Esempio n. 12
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
if ($_GET['sync']) {
    echo suExec("reposync");
}
if ($_GET['purge']) {
    echo suExec("repopurge");
}
$sURL = "SUS.php";
header('Location: ' . $sURL);
include "inc/footer.php";
?>

Esempio n. 13
0
    $ldapproxies = "";
    foreach ($conf->getProxies() as $key => $value) {
        $ldapproxies .= "database\tldap\nsuffix\t\"" . $value['outLDAP'] . "\"\noverlay\trwm\nrwm-suffixmassage\t\"" . $value['outLDAP'] . "\" \"" . $value['inLDAP'] . "\"\nuri\t\"" . $value['inURL'] . "\"\nrebind-as-user\nreadonly\tyes\n\n";
    }
    $lpconf = str_replace("##PROXIES##", $ldapproxies, $lpconf);
    suExec("touchconf \"/var/appliance/conf/slapd.conf.new\"");
    if (file_put_contents("/var/appliance/conf/slapd.conf.new", $lpconf) === FALSE) {
        echo "<div class=\"errorMessage\">ERROR: Unable to update slapd.conf</div>";
    }
    $wasrunning = getLDAPProxyStatus();
    if ($wasrunning) {
        suExec("disableproxy");
    }
    suExec("installslapdconf");
    if ($wasrunning) {
        suExec("enableproxy");
    }
}
// ####################################################################
// End of GET/POST parsing
// ####################################################################
?>


<style>         
  <!--       
	@media (max-width: 600px) {

		tr:first-child { display: none; }
	
	  td:nth-of-type(1):before { content: "Exposed Distinguished Name";}
Esempio n. 14
0
</td>
<td></td>
<td>
Num of Branches: <?echo suExec(numofbranches);
?>
</td>
<td></td>
<td>
</td>
</tr>

<tr>
<td>

Shadow File Usage: <?echo suExec(shadowusage);
?>

</td>
<td></td>
<td>
</td>
<td></td>
<td>
</td>
</tr>

<tr>
<td>
</td>
<td></td>
Esempio n. 15
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
if ($_GET['sync']) {
    echo suExec("reposync");
}
$sURL = "SUS.php";
header('Location: ' . $sURL);
include "inc/footer.php";
?>

Esempio n. 16
0
echo $syncschedule == "15" ? " selected=\"selected\"" : "";
?>
>3 p.m.</option>
				<option value="18"<?php 
echo $syncschedule == "18" ? " selected=\"selected\"" : "";
?>
>6 p.m.</option>
				<option value="21"<?php 
echo $syncschedule == "21" ? " selected=\"selected\"" : "";
?>
>9 p.m.</option>
			</select>
			<br>
			<div class="labelDescriptionWrapper">
				<span style="font-weight:bold;">Last Sync: </span><span><?php 
echo suExec("lastsussync");
?>
</span>
			</div>

		</div> <!-- end #form-inside -->

	</form> <!-- end form SUS -->

</div> <!-- end #form-wrapper -->

<?php 
include "inc/footer.php";
?>

Esempio n. 17
0
    suExec("touchconf \"/var/appliance/conf/appliance.private.key\"");
    if (file_put_contents("/var/appliance/conf/appliance.private.key", $_POST['privatekey']) === FALSE) {
        echo "<div class=\"errorMessage\">ERROR: Unable to update appliance.private.key</div>";
        return;
    }
    suExec("touchconf \"/var/appliance/conf/appliance.certificate.pem\"");
    if (file_put_contents("/var/appliance/conf/appliance.certificate.pem", $_POST['certificate']) === FALSE) {
        echo "<div class=\"errorMessage\">ERROR: Unable to update appliance.certificate.pem</div>";
        return;
    }
    suExec("touchconf \"/var/appliance/conf/appliance.chain.pem\"");
    if (file_put_contents("/var/appliance/conf/appliance.chain.pem", $_POST['chain']) === FALSE) {
        echo "<div class=\"errorMessage\">ERROR: Unable to update appliance.chain.pem</div>";
        return;
    }
    suExec("updateCert");
    echo "<div class=\"successMessage\">Configuration saved.  Restart required.</div>";
}
?>

<h2>Certificates</h2>

<div id="form-wrapper">

	<form action="certificates.php" method="post" name="certificates" id="certificates">

		<div id="form-inside">

			<span class="label">Private Key</span>
			<textarea class="wide" name="privatekey" cols="40" rows="40"></textarea>
			<br>
Esempio n. 18
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
$title = "SMB";
include "inc/header.php";
$accounterror = "";
$accountsuccess = "";
if (isset($_POST['smbpass'])) {
    $smbpw1 = $_POST['smbpass1'];
    $smbpw2 = $_POST['smbpass2'];
    if ($smbpw1 != "") {
        if ($smbpw1 == $smbpw2) {
            suExec("resetsmbpw " . $smbpw1);
            $accountsuccess = "SMB password changed.";
            $conf->changedPass("smbaccount");
        } else {
            $accounterror = "Passwords do not match.";
        }
    } else {
        $accounterror = "All fields required.";
    }
}
?>

<div id="restarting" class="alert alert-warning" style="display:none">
	<span><img src="images/progress.gif" width="25"> Restarting...</span>
</div>

<?php 
Esempio n. 19
0
    $nbsubnets = "";
    foreach ($conf->getSubnets() as $key => $value) {
        $nbsubnets .= "subnet " . $value['subnet'] . " netmask " . $value['netmask'] . " {\n\tallow unknown-clients;\n}\n\n";
    }
    $nbconf = str_replace("##SUBNETS##", $nbsubnets, $nbconf);
    suExec("touchconf \"/var/appliance/conf/dhcpd.conf.new\"");
    if (file_put_contents("/var/appliance/conf/dhcpd.conf.new", $nbconf) === FALSE) {
        echo "<div class=\"errorMessage\">ERROR: Unable to update dhcpd.conf</div>";
    }
    $wasrunning = getNetBootStatus();
    if ($wasrunning) {
        suExec("disablenetboot");
    }
    suExec("installdhcpdconf");
    if ($wasrunning) {
        suExec("setnbimages " . $conf->getSetting("netbootimage"));
    }
}
// ####################################################################
// End of GET/POST parsing
// ####################################################################
?>

<script>
function validateSubnet()
{
	if (document.getElementById("subnet").value != "" && document.getElementById("netmask").value != "")
		document.getElementById("addsubnet").disabled = false;
	else
		document.getElementById("addsubnet").disabled = true;
}
Esempio n. 20
0
include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
if (isset($_POST['hostname'])) {
    setHostName($_POST['hostname']);
}
$status = "";
if (isset($_POST['nettype'])) {
    $type = $_POST['nettype'];
    if ($type == "dhcp") {
        suExec("setdhcp");
    } else {
        //address netmask gateway
        suExec("setip " . $_POST['ip'] . " " . $_POST['netmask'] . " " . $_POST['gateway']);
        suExec("setdns " . $_POST['dns1'] . " " . $_POST['dns2']);
    }
    $status = "<p><b>Configuration saved!</b></p>";
}
$type = getNetType();
$dns = getCurrentNameServers();
$jsscriptfiles = "<script type=\"text/javascript\" src=\"scripts/networkingSet.js\"></script>";
$onloadjs = "onLoadStaticOptionsToggle('{$type}');";
$title = "Network Configuration";
include "inc/header.php";
?>
<center><?php 
echo $status;
?>
<form action="networkingSet.php" method="post" name="networkingSet"><br />
<br />
Esempio n. 21
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
if ($_GET['restart']) {
    echo suExec("restartsmb");
}
$sURL = "admin.php";
header('Location: ' . $sURL);
include "inc/footer.php";
?>

Esempio n. 22
0
	if (isset($_POST['enablesyncsch']) && $_GET['service'] = "SUS")
	{
		$conf->setSetting("syncschedule", $_POST['enablesyncsch']);
		if ($_POST['enablesyncsch'] != "Off")
		{
			suExec("addsch \"".$_POST['enablesyncsch']."\"");
		}
		else
		{
			suExec("delsch");
		}
	}
	
	if (isset($_GET['getprodinfo']) && isset($_GET['id']))
	{
		$res = suExec("prodinfo ".$_GET['id']);
		
		if (strpos($res, "No product id") !== FALSE)
		{
			echo $res;
		}
		else
		{
			echo "Product ID: ".$_GET['id']."<br/>\n";
			$lines = explode("\n", $res);
			$desc = "";
			$captureDesc = false;
			foreach ($lines as $line)
			{
				if (strpos($line, "Title:") !== FALSE 
				 || strpos($line, "Version:") !== FALSE 
Esempio n. 23
0
    ?>
" onKeyUp="validateSubnet();" onChange="validateSubnet();" />
			<br>

			<span class="label">Netmask</span>
			<input type="text" name="netmask" id="netmask" value="<?php 
    if (!array_key_exists($currentSubnet . " " . $currentNetmask, $conf->getSubnets())) {
        echo $currentNetmask;
    }
    ?>
" onKeyUp="validateSubnet();" onChange="validateSubnet();" />
			<input type="submit" name="addsubnet" id="addsubnet" class="insideActionButton" value="Add" disabled="disabled" />
			<br>
			<table class="branchesTable">
				<?php 
    $branchstr = trim(suExec("getBranchlist"));
    $branches = explode(" ", $branchstr);
    ?>
				<tr>
					<th>Subnet</th>
					<th>Netmask</th>
					<th></th>
				</tr>
				<?php 
    foreach ($conf->getSubnets() as $key => $value) {
        ?>
				<tr class="<?php 
        echo $key % 2 == 0 ? "object0" : "object1";
        ?>
">
					<td><?php 
Esempio n. 24
0
    echo "disabled";
}
?>
>

			</div>

		</div>

	</form> <!-- end form ShutDown -->

</div><!--  end #form-wrapper -->

<?php 
include "inc/footer.php";
?>

<?php 
if (isset($_POST['confirm'])) {
    // Unset all of the session variables.
    $_SESSION = array();
    // If it's desired to kill the session, also delete the session cookie.
    // Note: This will destroy the session, and not just the session data!
    if (ini_get("session.use_cookies")) {
        $params = session_get_cookie_params();
        setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
    }
    // Finally, destroy the session.
    session_destroy();
    suExec("shutdown");
}
Esempio n. 25
0
</span>
				</li>

				<li>
					<span>Number of Active AFP Connections:</span>
					<br>
					<br>
					<span><?php 
echo suExec(afpconns);
?>
</span>
				</li>

				<li>
					<span>Shadow File Usage:</span>
					<br>
					<br>
					<span><?php 
echo suExec(shadowusage);
?>
</span>
				</li>

			</ul>

		</div>
		
	</div>

<?php 
include "inc/footer.php";
Esempio n. 26
0
<?php

include "inc/config.php";
include "inc/auth.php";
include "inc/functions.php";
if ($_GET['restart']) {
    echo suExec("restartafp");
}
$sURL = "admin.php";
header('Location: ' . $sURL);
include "inc/footer.php";
?>