- First step toward multi-tenancy (multi branding in 1 instance)

- Created branding config.
    - Adjusted some defaults.


git-svn-id: http://www.observium.org/svn/observer/trunk@1050 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Geert Hauwaerts
2010-03-27 22:20:57 +00:00
parent 307bd6d13a
commit 371e394d86
3 changed files with 66 additions and 20 deletions
+37 -15
View File
@@ -18,8 +18,6 @@ $config['observer_log'] = $config['install_dir'] . "/observer.log";
### Default community
$config['community'] = "public";
$config['base_url'] = "http://observer2.as8681.net";
### Authentication model
$config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
#$config['http_auth_guest'] = "guest"; # remember to configure this user if you use http-auth
@@ -42,25 +40,49 @@ $config['snmpget'] = "/usr/bin/snmpget";
$config['snmpbulkwalk'] = "/usr/bin/snmpbulkwalk";
$config['snmpset'] = "/usr/bin/snmpset";
### Application information. Multi-Tenant aware.
$config['branding'] = array(
# The default branding.
'default' => array(
'base_url' => "http://observer.example.com",
'mydomain' => "example.com",
'page_title' => "ObserverNMS",
'title_image' => "images/observer-logo.gif",
'stylesheet' => "css/styles.css",
'mono_font' => "DejaVuSansMono",
'header_color' => "#133A7B",
'favicon' => "images/observer-icon.png",
'page_gen' => 1,
'footer' => "",
),
# Example branding for a specifc URL.
'observer.branding.com' => array(
'base_url' => "http://observer.branding.com",
'mydomain' => "branding.com",
'page_title' => "ObserverNMS",
'title_image' => "images/observer-logo.gif",
'stylesheet' => "css/styles.css",
'mono_font' => "DejaVuSansMono",
'header_color' => "#133A7B",
'favicon' => "images/observer-icon.png",
'page_gen' => 0,
'footer' => "<a href='http://www.branding.com' target='_blank'>My Branding Company</a> - Slogan!",
),
);
### E-Mail information.
$config['email_default'] = "observer@example.com";
$config['email_from'] = "Observer <observer@example.com>";
$config['email_headers'] = "From: " . $config['email_from'] . "\r\n";
### List of networks to allow scanning-based discovery
$config['nets'] = array ("89.21.224.0/19", "212.9.12.0/24", "212.9.13.0/24");
### Your company domain name and specifics
$config['mydomain'] = "jerseytelecom.com";
$config['page_title'] = "JT Observer";
$config['title_image'] = "images/observer-logo.gif";
$config['stylesheet'] = "css/styles.css";
$config['mono_font'] = "DejaVuSansMono";
$config['header_color'] = "#133A7B";
$config['favicon'] = "images/observer-icon.png";
$config['page_refresh'] = "0"; ## Refresh the page every xx seconds
$config['front_page'] = "pages/front/default.php";
$config['email_default'] = "adama@as8681.net";
$config['email_from'] = "Observer <observer@" . $config['mydomain'] . ">";
$config['email_headers'] = "From: " . $config['email_from'] . "\r\n";
$config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution.";
### What should we warn about?
+27 -4
View File
@@ -25,6 +25,22 @@ if($debug) {
$week = time() - (7 * 24 * 60 * 60);
$month = time() - (31 * 24 * 60 * 60);
$year = time() - (365 * 24 * 60 * 60);
# Load the settings for Multi-Tenancy.
if (is_array($config['branding'])) {
if ($config['branding'][$_SERVER['SERVER_NAME']]) {
foreach ($config['branding'][$_SERVER['SERVER_NAME']] as $confitem => $confval) {
eval("\$config['" . $confitem . "'] = \$confval;");
}
} else {
foreach ($config['branding']['default'] as $confitem => $confval) {
eval("\$config['" . $confitem . "'] = \$confval;");
}
}
} else {
echo "Please check config.php.default and adjust your settings to reflect the new Multi-Tenancy configuration.";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
@@ -142,17 +158,24 @@ function popUp(URL) {
<?php
$end = utime(); $run = $end - $start;
$gentime = substr($run, 0, 5);
echo('<br /> <div id="footer">Generated in ' . $gentime . ' seconds
<br /> <a href="http://www.observernms.org">Observer ' . $config['version']);
echo '<br /> <div id="footer">' . $config['footer'];
echo '<br />Powered by <a href="http://www.observernms.org" target="_blank">Observer ' . $config['version'];
if (file_exists('.svn/entries'))
{
$svn = File('.svn/entries');
echo '-SVN r' . trim($svn[3]);
unset($svn);
}
echo ('</a> &copy; 2006-2010 Adam Armstrong
<br />This work is licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GPL, version 3</a>.</div>');
echo '</a>. Copyright &copy; 2006-'. date("Y"). '. All rights reserved.';
if ($config['page_gen']) {
echo '<br />Generated in ' . $gentime . ' seconds.';
}
echo '</div>';
?>
</body>
</html>
+1
View File
@@ -31,6 +31,7 @@ $config['frong_page'] = "default.php";
$config['page_title'] = "ObserverNMS";
$config['syslog_age'] = "1 month";
$config['timestamp_format'] = 'd-m-Y H:i:s';
$config['page_gen'] = 1;
### Cosmetics