Changeset 11744

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

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.7

    • Property svnmerge-integrated changed from /freepbx/branches/2.8:1-9715,9728,9961,9977,10010,10038,10050,10453,11465,11623,11673 /freepbx/branches/2.6:1-8598,8646-8647,8828 to /freepbx/branches/2.6:1-8598,8646-8647,8828 /freepbx/branches/2.8:1-9715,9728,9961,9977,10010,10038,10050,10453,11465,11623,11673,11743
  • freepbx/branches/2.7/amp_conf/htdocs/admin/functions.inc.php

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