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

Merged revisions 11745 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.6

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

r11745 | p_lindheimer | 2011-03-08 17:17:27 -0800 (Tue, 08 Mar 2011) | 16 lines


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

    • Property svnmerge-integrated changed from /freepbx/branches/2.4:1-5944 /freepbx/branches/2.6:1-7913,9512,10465,11467 to /freepbx/branches/2.4:1-5944 /freepbx/branches/2.6:1-7913,9512,10465,11467,11745
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r11468 r11746  
    34503450  $options .= "&phpver=".urlencode(phpversion()); 
    34513451 
     3452  $distro_info = _module_distro_id(); 
     3453  $options .= "&distro=".urlencode($distro_info['pbx_type']); 
     3454  $options .= "&distrover=".urlencode($distro_info['pbx_version']); 
     3455 
    34523456  $fn = "http://mirror.freepbx.org/version-".getversion().".html".$options; 
    34533457  if (!$amp_conf['MODULEADMINWGET']) { 
     
    35653569  } 
    35663570}  
     3571 
     3572function _module_distro_id() { 
     3573  static $pbx_type; 
     3574  static $pbx_version; 
     3575 
     3576  if (isset($pbx_type)) { 
     3577    return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3578  } 
     3579 
     3580  // FreePBX Distro 
     3581  if (file_exists('/etc/asterisk/freepbxdistro-version')) { 
     3582    $pbx_type = 'freepbxdistro'; 
     3583    $pbx_version = trim(file_get_contents('/etc/asterisk/freepbxdistro-version')); 
     3584 
     3585  // Trixbox 
     3586  } elseif (file_exists('/etc/trixbox/trixbox-version')) { 
     3587    $pbx_type = 'trixbox'; 
     3588    $pbx_version = trim(file_get_contents('/etc/trixbox/trixbox-version')); 
     3589 
     3590  // AsteriskNOW 
     3591  } elseif (file_exists('/etc/asterisknow-version')) { 
     3592    $pbx_type = 'asterisknow'; 
     3593    $pbx_version = trim(file_get_contents('/etc/asterisknow-version')); 
     3594   
     3595  // Elastix 
     3596  } elseif (is_dir('/usr/share/elastix') || file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3597    $pbx_type = 'elastix'; 
     3598    $pbx_version = ''; 
     3599    if (class_exists('PDO') && file_exists('/var/www/db/settings.db')) { 
     3600      $elastix_db = new PDO('sqlite:/var/www/db/settings.db'); 
     3601      $result = $elastix_db->query("SELECT value FROM settings WHERE key='elastix_version_release'"); 
     3602      if ($result !== false) foreach ($result as $row) { 
     3603        if (isset($row['value'])) { 
     3604          $pbx_version = $row['value']; 
     3605          break; 
     3606        } 
     3607      } 
     3608    } 
     3609    if (!$pbx_version && file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3610      $pbx_version = trim(file_get_contents('/usr/share/elastix/pre_elastix_version.info')); 
     3611    } 
     3612    if (!$pbx_version) { 
     3613      $pbx_version = '2.X+'; 
     3614    } 
     3615 
     3616  // PIAF 
     3617  } elseif (file_exists('/etc/pbx/.version') || file_exists('/etc/pbx/.color')) { 
     3618    $pbx_type = 'piaf'; 
     3619    $pbx_version = ''; 
     3620    if (file_exists('/etc/pbx/.version')) { 
     3621      $pbx_version = trim(file_get_contents('/etc/pbx/.version')); 
     3622    } 
     3623    if (file_exists('/etc/pbx/.color')) { 
     3624      $pbx_version .= '.' . trim(file_get_contents('/etc/pbx/.color')); 
     3625    } 
     3626    if (!$pbx_version) { 
     3627      if (file_exists('/etc/pbx/ISO-Version')) { 
     3628        $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3629        $pbx_arr = explode('=',$pbx_ver_raw); 
     3630        $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3631      } else { 
     3632        $pbx_version = 'unknown'; 
     3633      } 
     3634    } 
     3635 
     3636  // Old PIAF or Fonica 
     3637  } elseif (file_exists('/etc/pbx/version') || file_exists('/etc/pbx/ISO-Version')) { 
     3638    $pbx_type = 'fonica'; 
     3639    if (file_exists('/etc/pbx/ISO-Version')) { 
     3640      $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3641      $pbx_arr = explode('=',$pbx_ver_raw); 
     3642      $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3643      if (stristr($pbx_arr[0],'foncordiax') !== false) { 
     3644        $pbx_version .= '.pro'; 
     3645      } else { 
     3646        $pbx_version = str_replace(' ','.',$pbx_version); 
     3647        if ($pbx_version != '1.0.standard') { 
     3648          $pbx_type = 'piaf'; 
     3649        } 
     3650      } 
     3651    } else { 
     3652      $pbx_version = 'unknown'; 
     3653    } 
     3654  } else { 
     3655    $pbx_type = 'unknown'; 
     3656    $pbx_version = 'unknown'; 
     3657  } 
     3658  return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3659} 
    35673660 
    35683661function module_run_notification_checks() { 
     
    37803873  return $contexts; 
    37813874} 
    3782  
    3783 ?>