Example #1
0
<td>&nbsp;</td>
</table>
<?php 
// make sure normal user such as www can write to temporary
$perms = fileperms("/tmp");
if (($perms & 01777) != 01777) {
    $errormsg .= sprintf(gettext("Wrong permission on %s."), "/tmp");
    $errormsg .= "<br />\n";
}
$perms = fileperms("/var/tmp");
if (($perms & 01777) != 01777) {
    $errormsg .= sprintf(gettext("Wrong permission on %s."), "/var/tmp");
    $errormsg .= "<br />\n";
}
// check DNS
list($v4dns1, $v4dns2) = get_ipv4dnsserver();
list($v6dns1, $v6dns2) = get_ipv6dnsserver();
if (empty($v4dns1) && empty($v4dns2) && empty($v6dns1) && empty($v6dns2)) {
    // need by service/firmware check?
    if (!isset($config['system']['disablefirmwarecheck']) || isset($config['ftpd']['enable'])) {
        $errormsg .= gettext("No DNS setting found.");
        $errormsg .= "<br />\n";
    }
}
if (!empty($errormsg)) {
    print_error_box($errormsg);
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="tabcont">
Example #2
0
            $retval |= rc_update_service("cron");
            config_unlock();
        }
        if ($pconfig['systime'] !== "Not Set" && !empty($pconfig['systime'])) {
            $timestamp = strtotime($pconfig['systime']);
            if (FALSE !== $timestamp) {
                $timestamp = strftime("%g%m%d%H%M", $timestamp);
                // The date utility exits 0 on success, 1 if unable to set the date,
                // and 2 if able to set the local date, but unable to set it globally.
                $retval |= mwexec("/bin/date -n {$timestamp}");
                $pconfig['systime'] = "Not Set";
            }
        }
        $savemsg = get_std_save_message($retval);
        // Update DNS server controls.
        list($pconfig['dns1'], $pconfig['dns2']) = get_ipv4dnsserver();
        list($pconfig['ipv6dns1'], $pconfig['ipv6dns2']) = get_ipv6dnsserver();
        // Reload page if language has been changed, otherwise page is displayed
        // in previous selected language.
        if ($oldlanguage !== $config['system']['language']) {
            header("Location: system.php");
            exit;
        }
    }
}
$pglocalheader = <<<EOD
<link rel="stylesheet" type="text/css" href="datechooser.css" />
<script type="text/javascript" src="datechooser.js"></script>
EOD;
include "fbegin.inc";
?>
	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Services"), gettext("Samba AD"), gettext("Initialize"));
$errormsg = "";
$do_init = false;
list($pconfig['dns_forwarder']) = get_ipv4dnsserver();
if ($pconfig['dns_forwarder'] == "127.0.0.1") {
    $pconfig['dns_forwarder'] = "";
}
$pconfig['dns_domain'] = strtolower($config['system']['domain']);
if (preg_match('/^([^\\.]+)\\./', $pconfig['dns_domain'], $m)) {
    $pconfig['netbios_domain'] = strtoupper($m[1]);
} else {
    $pconfig['netbios_domain'] = strtoupper($pconfig['dns_domain']);
    $errormsg .= gettext("Domain have no 2nd level name.");
    $errormsg .= "<br/>";
}
$pconfig['path'] = "";
$pconfig['fstype'] = "s3fs";
$pconfig['user_shares'] = false;
$realm = strtoupper($pconfig['dns_domain']);