Changeset 10677

Show
Ignore:
Timestamp:
12/09/10 15:54:31 (2 years ago)
Author:
pnlarsson
Message:

Adds hostname to title if SERVERINTITLE is set. Closes #4299

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/config.php

    r10528 r10677  
    400400  $template['module_page'] = $module_page; 
    401401  if ($amp_conf['SERVERINTITLE']) { 
    402     $template['title'] = $_SERVER['SERVER_NAME']._(" FreePBX administration"); 
     402    // set the servername 
     403    $server_hostname = ''; 
     404    if (isset($_SESSION['session_hostname'])){ 
     405      $server_hostname = $_SESSION['session_hostname']; 
     406    }else{ 
     407      if (function_exists(gethostname)){ 
     408        $server_hostname = trim(gethostname()); 
     409      }else{ 
     410        $server_hostname = trim(php_uname('n')); 
     411      } 
     412      if ($server_hostname != ''){ 
     413        $server_hostname = ' (' . substr($server_hostname, 0, 30) . ')'; 
     414      } 
     415      $_SESSION['session_hostname'] = $server_hostname; 
     416    } 
     417 
     418    $template['title'] = $_SERVER['SERVER_NAME'] . $server_hostname . ' - ' . _('FreePBX administration'); 
    403419  } else { 
    404     $template['title'] = _("FreePBX administration"); 
     420    $template['title'] = _('FreePBX administration'); 
    405421  } 
    406422  $template['amp_conf'] = &$amp_conf;