本文整理汇总了PHP中suExec函数的典型用法代码示例。如果您正苦于以下问题:PHP suExec函数的具体用法?PHP suExec怎么用?PHP suExec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了suExec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSyncStatus
function getSyncStatus()
{
if (trim(suExec("getsyncstatus")) == "true") {
return true;
} else {
return false;
}
}
示例2: getNetBootStatus
$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);
}
}
}
示例3: getFirewallstatus
function getFirewallstatus()
{
if (trim(suExec("getFirewallstatus")) == "true") {
return true;
} else {
return false;
}
}
示例4: suExec
<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">
示例5: suExec
?>
>
<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");
}
示例6: trim
<?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";
?>
示例7: suExec
}
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;
示例8: suExec
?>
>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";
示例9: suExec
$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 = "shelluser";
$conf->setSetting("shelluser", $shelluser);
示例10: suExec
} 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;
示例11: suExec
<?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()
示例12: suExec
<?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";
?>
示例13: foreach
$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";}
示例14: suExec
</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>
示例15: suExec
<?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";
?>