Show
Ignore:
Timestamp:
03/08/11 19:17:27 (1 year ago)
Author:
p_lindheimer
Message:

Merged revisions 11744 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.7

................

r11744 | p_lindheimer | 2011-03-08 17:16:29 -0800 (Tue, 08 Mar 2011) | 9 lines


Merged revisions 11743 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.8


........

r11743 | p_lindheimer | 2011-03-08 17:15:03 -0800 (Tue, 08 Mar 2011) | 1 line


distro info from 2.9

........

................

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.6

    • Property svnmerge-integrated changed from /freepbx/branches/2.7:1-9517,10464,11466 /freepbx/branches/2.5:1-7770,8119,8161 to /freepbx/branches/2.5:1-7770,8119,8161 /freepbx/branches/2.7:1-9517,10464,11466,11744
  • freepbx/branches/2.6/amp_conf/htdocs/admin/functions.inc.php

    r11467 r11745  
    35183518  $options .= "&phpver=".urlencode(phpversion()); 
    35193519 
     3520  $distro_info = _module_distro_id(); 
     3521  $options .= "&distro=".urlencode($distro_info['pbx_type']); 
     3522  $options .= "&distrover=".urlencode($distro_info['pbx_version']); 
     3523 
    35203524  $fn = "http://mirror.freepbx.org/version-".getversion().".html".$options; 
    35213525  if (!$amp_conf['MODULEADMINWGET']) { 
     
    36333637  } 
    36343638}  
     3639 
     3640function _module_distro_id() { 
     3641  static $pbx_type; 
     3642  static $pbx_version; 
     3643 
     3644  if (isset($pbx_type)) { 
     3645    return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3646  } 
     3647 
     3648  // FreePBX Distro 
     3649  if (file_exists('/etc/asterisk/freepbxdistro-version')) { 
     3650    $pbx_type = 'freepbxdistro'; 
     3651    $pbx_version = trim(file_get_contents('/etc/asterisk/freepbxdistro-version')); 
     3652 
     3653  // Trixbox 
     3654  } elseif (file_exists('/etc/trixbox/trixbox-version')) { 
     3655    $pbx_type = 'trixbox'; 
     3656    $pbx_version = trim(file_get_contents('/etc/trixbox/trixbox-version')); 
     3657 
     3658  // AsteriskNOW 
     3659  } elseif (file_exists('/etc/asterisknow-version')) { 
     3660    $pbx_type = 'asterisknow'; 
     3661    $pbx_version = trim(file_get_contents('/etc/asterisknow-version')); 
     3662   
     3663  // Elastix 
     3664  } elseif (is_dir('/usr/share/elastix') || file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3665    $pbx_type = 'elastix'; 
     3666    $pbx_version = ''; 
     3667    if (class_exists('PDO') && file_exists('/var/www/db/settings.db')) { 
     3668      $elastix_db = new PDO('sqlite:/var/www/db/settings.db'); 
     3669      $result = $elastix_db->query("SELECT value FROM settings WHERE key='elastix_version_release'"); 
     3670      if ($result !== false) foreach ($result as $row) { 
     3671        if (isset($row['value'])) { 
     3672          $pbx_version = $row['value']; 
     3673          break; 
     3674        } 
     3675      } 
     3676    } 
     3677    if (!$pbx_version && file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3678      $pbx_version = trim(file_get_contents('/usr/share/elastix/pre_elastix_version.info')); 
     3679    } 
     3680    if (!$pbx_version) { 
     3681      $pbx_version = '2.X+'; 
     3682    } 
     3683 
     3684  // PIAF 
     3685  } elseif (file_exists('/etc/pbx/.version') || file_exists('/etc/pbx/.color')) { 
     3686    $pbx_type = 'piaf'; 
     3687    $pbx_version = ''; 
     3688    if (file_exists('/etc/pbx/.version')) { 
     3689      $pbx_version = trim(file_get_contents('/etc/pbx/.version')); 
     3690    } 
     3691    if (file_exists('/etc/pbx/.color')) { 
     3692      $pbx_version .= '.' . trim(file_get_contents('/etc/pbx/.color')); 
     3693    } 
     3694    if (!$pbx_version) { 
     3695      if (file_exists('/etc/pbx/ISO-Version')) { 
     3696        $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3697        $pbx_arr = explode('=',$pbx_ver_raw); 
     3698        $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3699      } else { 
     3700        $pbx_version = 'unknown'; 
     3701      } 
     3702    } 
     3703 
     3704  // Old PIAF or Fonica 
     3705  } elseif (file_exists('/etc/pbx/version') || file_exists('/etc/pbx/ISO-Version')) { 
     3706    $pbx_type = 'fonica'; 
     3707    if (file_exists('/etc/pbx/ISO-Version')) { 
     3708      $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3709      $pbx_arr = explode('=',$pbx_ver_raw); 
     3710      $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3711      if (stristr($pbx_arr[0],'foncordiax') !== false) { 
     3712        $pbx_version .= '.pro'; 
     3713      } else { 
     3714        $pbx_version = str_replace(' ','.',$pbx_version); 
     3715        if ($pbx_version != '1.0.standard') { 
     3716          $pbx_type = 'piaf'; 
     3717        } 
     3718      } 
     3719    } else { 
     3720      $pbx_version = 'unknown'; 
     3721    } 
     3722  } else { 
     3723    $pbx_type = 'unknown'; 
     3724    $pbx_version = 'unknown'; 
     3725  } 
     3726  return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3727} 
    36353728 
    36363729function module_run_notification_checks() { 
     
    38483941  return $contexts; 
    38493942} 
    3850  
    3851 ?>