function genhtmltitle($title)
{
    return system_get_hostname() . " - " . gentitle($title);
}
示例#2
0
}
//if (!isset($config['hast']['hastresource']) || !is_array($config['hast']['hastresource']))
//	$config['hast']['hastresource'] = array();
if (!isset($config['vinterfaces']['carp']) || !is_array($config['vinterfaces']['carp'])) {
    $config['vinterfaces']['carp'] = array();
}
$pconfig['enable'] = isset($config['hast']['enable']);
//$pconfig['role'] = $config['hast']['role'];
$pconfig['auxparam'] = implode("\n", $config['hast']['auxparam']);
$pconfig['alertemail'] = $config['hast']['alertemail'];
$pconfig['alertemailto'] = $config['hast']['alertemailto'];
$nodeid = @exec("/sbin/sysctl -q -n kern.hostuuid");
if (empty($nodeid)) {
    $nodeid = "unknown";
}
$nodename = system_get_hostname();
if (empty($nodename)) {
    $nodename = "unknown";
}
$a_carp =& $config['vinterfaces']['carp'];
array_sort_key($a_carp, "if");
$a_cronjob =& $config['cron']['job'];
$alert_script = '/etc/inc/hast_alerts.php';
$cnid = isset($config['hast']['alertemailcronuuid']) ? array_search_ex($config['hast']['alertemailcronuuid'], $a_cronjob, "uuid") : false;
if (!sizeof($a_carp)) {
    $errormsg = sprintf(gettext("No configured CARP interfaces. Please add new <a href='%s'>CARP interface</a> first."), "interfaces_carp.php");
}
if ($_POST) {
    unset($input_errors);
    unset($errormsg);
    $pconfig = $_POST;
示例#3
0
function show_header($title)
{
    // header for html-page
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Content-Type: text/html; charset=" . $GLOBALS["charset"]);
    /* NAS4FREE & QUIXPLORER CODE*/
    // Html & Page Headers
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"" . system_get_language_code() . "\" lang=\"" . system_get_language_code() . "\" dir=\"" . $GLOBALS["text_dir"] . "\">\n";
    echo "<head>\n";
    echo "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"" . $GLOBALS["charset"] . "\">\n";
    echo "<title>Nas4free.local - File Manager</title>\n";
    if (isset($pgrefresh) && $pgrefresh) {
        echo "<meta http-equiv='refresh' content=\"" . $pgrefresh . "\"/>\n";
    }
    echo "<link href=\"./_style/style.css\" rel=\"stylesheet\"\ttype=\"text/css\">\n";
    echo "<link href=\"../gui.css\" rel=\"stylesheet\" type=\"text/css\">\n";
    echo "<link href=\"../navbar.css\" rel=\"stylesheet\" type=\"text/css\">\n";
    echo "<link href=\"../tabs.css\" rel=\"stylesheet\" type=\"text/css\">\n";
    echo "<script type=\"text/javascript\" src=\"../js/jquery.min.js\"></script>\n";
    echo "<script type=\"text/javascript\" src=\"../js/gui.js\"></script>\n";
    if (isset($pglocalheader) && !empty($pglocalheader)) {
        if (is_array($pglocalheader)) {
            foreach ($pglocalheader as $pglocalheaderv) {
                echo $pglocalheaderv;
                echo "\n";
            }
        } else {
            echo $pglocalheader;
            echo "\n";
        }
    }
    echo "</head>\n";
    // NAS4Free Header
    echo "<body>\n";
    echo "<div id=\"header\">\n";
    echo "<div id=\"headerlogo\">\n";
    echo "<a title=\"www." . get_product_url() . "\" href=\"http://" . get_product_url() . "\" target='_blank'><img src='../header_logo.png' alt='logo' /></a>\n";
    echo "</div>\n";
    echo "<div id=\"headerrlogo\">\n";
    echo "<div class=\"hostname\">\n";
    echo "<span>" . system_get_hostname() . "&nbsp;</span>\n";
    echo "</div>\n";
    echo "</div>\n";
    echo "</div>\n";
    echo "<div id=\"headernavbar\">\n";
    echo "<ul id=\"navbarmenu\">\n";
    echo display_menu("system");
    echo display_menu("network");
    echo display_menu("disks");
    echo display_menu("services");
    //-- Begin extension section --//
    if (Session::isAdmin() && isset($g) && isset($g['www_path']) && is_dir("{$g['www_path']}/ext")) {
        echo "<li>\n";
        echo "<a href=\"index.php\" onmouseover=\"mopen('extensions')\" onmouseout=\"mclosetime()\">" . gettext("Extensions") . "</a>\n";
        echo "<div id=\"extensions\" onmouseover=\"mcancelclosetime()\" onmouseout=\"mclosetime()\">\n";
        $dh = @opendir("{$g['www_path']}/ext");
        if ($dh) {
            while (($extd = readdir($dh)) !== false) {
                if ($extd === "." || $extd === "..") {
                    continue;
                }
                @(include "{$g['www_path']}/ext/" . $extd . "../menu.inc");
            }
            closedir($dh);
        }
        echo "</div>\n";
        echo "</li>\n";
    }
    //-- End extension section --//
    echo display_menu("access");
    echo display_menu("status");
    echo display_menu("diagnostics");
    echo display_menu("advanced");
    echo display_menu("help");
    echo "</ul>\n";
    echo "<div style=\"clear:both\"></div>\n";
    echo "</div>\n";
    echo "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />\n";
    // QuiXplorer Header
    $pgtitle = array(gettext("Advanced"), gettext("File Manager"));
    if (!isset($pgtitle_omit) || !$pgtitle_omit) {
        echo "<div style=\"margin-left: 50px;\"><p class=\"pgtitle\">" . htmlspecialchars(gentitle($pgtitle)) . "</p></div>\n";
    }
    echo "<center>\n";
    echo "<table border=\"0\" width=\"93%\" cellspacing=\"0\" cellpadding=\"5\">\n";
    echo "<tbody>\n";
    echo "<tr>\n";
    echo "<td class=\"title\" aligh=\"left\">\n";
    if ($GLOBALS["require_login"] && isset($GLOBALS['__SESSION']["s_user"])) {
        echo "[" . $GLOBALS['__SESSION']["s_user"] . "] ";
    }
    echo $title;
    echo "</td>\n";
    echo "<td class=\"title_version\" align=\"right\">\n";
    echo "Powered by QuiXplorer";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</tbody>\n";
    echo "</table>\n";
    echo "</center>";
    echo "<div class=\"main_tbl\">";
}
    if ($_POST['password_old'] !== $a_user[$cnid]['password']) {
        $input_errors[] = gettext("The old password is not correct.");
    }
    // Validate new password.
    if ($_POST['password_new'] !== $_POST['password_confirm']) {
        $input_errors[] = gettext("The confimed password does not match. Please ensure the passwords match exactly.");
    }
    if (empty($input_errors)) {
        $a_user[$cnid]['password'] = $_POST['password_new'];
        write_config();
        updatenotify_set("userdb_user", UPDATENOTIFY_MODE_MODIFIED, $a_user[$cnid]['uuid']);
        // Write syslog entry and send an email to the administrator
        $message = sprintf("The user %s has changed his password via user portal.", Session::getUserName());
        write_log($message);
        if (0 == @email_validate_settings()) {
            $subject = sprintf(gettext("Notification email from host: %s"), system_get_hostname());
            @email_send($config['system']['email']['from'], $subject, $message, $error);
        }
        $savemsg = gettext("The administrator has been notified to apply your changes.");
    }
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabcont">
			<form action="<?php 
echo $_SERVER['SCRIPT_NAME'];
?>
" method="post" name="iform" id="iform">
				<?php 
示例#5
0
        $config['system']['email']['authmethod'] = $_POST['authmethod'];
        $config['system']['email']['security'] = $_POST['security'];
        $config['system']['email']['starttls'] = isset($_POST['starttls']) ? true : false;
        $config['system']['email']['username'] = $_POST['username'];
        $config['system']['email']['password'] = $_POST['password'];
        $config['system']['email']['from'] = $_POST['from'];
        write_config();
        $retval = 0;
        if (!file_exists($d_sysrebootreqd_path)) {
            config_lock();
            $retval |= rc_exec_service("msmtp");
            config_unlock();
        }
        // Send test email.
        if (stristr($_POST['Submit'], gettext("Send test email"))) {
            $subject = sprintf(gettext("Test email from host: %s"), system_get_hostname());
            $message = gettext("This email has been sent to validate your email configuration.");
            $retval = @email_send($config['system']['email']['from'], $subject, $message, $error);
            if (0 == $retval) {
                $savemsg = gettext("Test email successfully sent.");
                write_log(sprintf(gettext("Test email successfully sent to: %s."), $config['system']['email']['from']));
            } else {
                $failmsg = sprintf(gettext("Failed to send test email. Please check the <a href='%s'>log</a> files."), "diag_log.php");
                write_log(sprintf(gettext("Failed to send test email to: %s."), $config['system']['email']['from']));
            }
        } else {
            $savemsg = get_std_save_message($retval);
        }
    }
}
include "fbegin.inc";
示例#6
0
文件: index.php 项目: sdoney/nas4free
    <td class="tabcont">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<?php 
html_titleline(gettext("System information"));
?>
	<?php 
if (!empty($config['vinterfaces']['carp'])) {
    ?>
	<?php 
    html_textinfo("vipstatus", gettext("Virtual IP address"), htmlspecialchars(get_vip_status()));
    ?>
	<?php 
}
?>
	<?php 
html_textinfo("hostname", gettext("Hostname"), system_get_hostname());
?>
	<?php 
html_textinfo("version", gettext("Version"), sprintf("<strong>%s %s</strong> (%s %s)", get_product_version(), get_product_versionname(), gettext("revision"), get_product_revision()));
?>
	<?php 
html_textinfo("builddate", gettext("Build date"), get_product_buildtime());
?>
	<?php 
exec("/sbin/sysctl -n kern.osrevision", $osrevision);
exec("/sbin/sysctl -n kern.version", $osversion);
?>
	<?php 
html_textinfo("platform_os", gettext("Platform OS"), sprintf("FreeBSD Revision: %s<br/>%s", $osrevision[0], $osversion[0]));
?>
	<?php 
示例#7
0
  <tr>
    <td class="tabcont">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
 			  <tr>
			    <td colspan="2" class="listtopic"><?php 
echo gettext("System information");
?>
</td>
			  </tr>
			  <tr>
			    <td width="25%" class="vncellt"><?php 
echo gettext("Hostname");
?>
</td>
			    <td width="75%" class="listr"><?php 
echo system_get_hostname();
?>
</td>
			  </tr>
			  <tr>
			    <td width="25%" valign="top" class="vncellt"><?php 
echo gettext("Version");
?>
</td>
			    <td width="75%" class="listr"><strong><?php 
echo get_product_version();
?>
 <?php 
echo get_product_versionname();
?>
</strong> (<?php