mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates to addhost and cleanups. add ability to do colour on console :D :D :D
git-svn-id: http://www.observium.org/svn/observer/trunk@2430 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,6 +2,34 @@
|
||||
|
||||
## Common Functions
|
||||
|
||||
function isCli() {
|
||||
|
||||
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function print_error($text)
|
||||
{
|
||||
if(isCli()) {
|
||||
print Console_Color::convert("%r".$text."%n\n", false);
|
||||
} else {
|
||||
echo('<div class="errorbox"><img src="/images/16/exclamation.png" align="absmiddle"> '.$text.'</div>');
|
||||
}
|
||||
}
|
||||
|
||||
function print_message($text)
|
||||
{
|
||||
if(isCli()) {
|
||||
print Console_Color::convert("%g".$text."%n\n", false);
|
||||
} else {
|
||||
echo('<div class="messagebox"><img src="/images/16/tick.png" align="absmiddle"> '.$text.'</div>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delete_port($int_id)
|
||||
{
|
||||
global $config;
|
||||
|
||||
Reference in New Issue
Block a user