Changeset 11748

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

Merged revisions 11747 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.4

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

r11747 | p_lindheimer | 2011-03-08 17:22:57 -0800 (Tue, 08 Mar 2011) | 30 lines


Merged revisions 11746 via svnmerge from
http://www.freepbx.org/v2/svn/freepbx/branches/2.5


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

r11746 | p_lindheimer | 2011-03-08 17:20:03 -0800 (Tue, 08 Mar 2011) | 23 lines


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

    • Property svnmerge-integrated changed from /freepbx/branches/2.4:1-5454,5492,5517,5648,5656,5710,5828,6057,6564,6700,9514,10467,11469 /freepbx/branches/2.2:1-4145,4434,4437 to /freepbx/branches/2.2:1-4145,4434,4437 /freepbx/branches/2.4:1-5454,5492,5517,5648,5656,5710,5828,6057,6564,6700,9514,10467,11469,11747
  • freepbx/branches/2.3/amp_conf/htdocs/admin/functions.inc.php

    r11470 r11748  
    29272927  } 
    29282928  $options .= "&phpver=".urlencode(phpversion()); 
     2929  $distro_info = _module_distro_id(); 
     2930  $options .= "&distro=".urlencode($distro_info['pbx_type']); 
     2931  $options .= "&distrover=".urlencode($distro_info['pbx_version']); 
    29292932 
    29302933  $announcement = @ file_get_contents("http://mirror.freepbx.org/version-".getversion().".html".$options); 
     
    30343037  } 
    30353038}  
     3039 
     3040function _module_distro_id() { 
     3041  static $pbx_type; 
     3042  static $pbx_version; 
     3043 
     3044  if (isset($pbx_type)) { 
     3045    return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3046  } 
     3047 
     3048  // FreePBX Distro 
     3049  if (file_exists('/etc/asterisk/freepbxdistro-version')) { 
     3050    $pbx_type = 'freepbxdistro'; 
     3051    $pbx_version = trim(file_get_contents('/etc/asterisk/freepbxdistro-version')); 
     3052 
     3053  // Trixbox 
     3054  } elseif (file_exists('/etc/trixbox/trixbox-version')) { 
     3055    $pbx_type = 'trixbox'; 
     3056    $pbx_version = trim(file_get_contents('/etc/trixbox/trixbox-version')); 
     3057 
     3058  // AsteriskNOW 
     3059  } elseif (file_exists('/etc/asterisknow-version')) { 
     3060    $pbx_type = 'asterisknow'; 
     3061    $pbx_version = trim(file_get_contents('/etc/asterisknow-version')); 
     3062   
     3063  // Elastix 
     3064  } elseif (is_dir('/usr/share/elastix') || file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3065    $pbx_type = 'elastix'; 
     3066    $pbx_version = ''; 
     3067    if (class_exists('PDO') && file_exists('/var/www/db/settings.db')) { 
     3068      $elastix_db = new PDO('sqlite:/var/www/db/settings.db'); 
     3069      $result = $elastix_db->query("SELECT value FROM settings WHERE key='elastix_version_release'"); 
     3070      if ($result !== false) foreach ($result as $row) { 
     3071        if (isset($row['value'])) { 
     3072          $pbx_version = $row['value']; 
     3073          break; 
     3074        } 
     3075      } 
     3076    } 
     3077    if (!$pbx_version && file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     3078      $pbx_version = trim(file_get_contents('/usr/share/elastix/pre_elastix_version.info')); 
     3079    } 
     3080    if (!$pbx_version) { 
     3081      $pbx_version = '2.X+'; 
     3082    } 
     3083 
     3084  // PIAF 
     3085  } elseif (file_exists('/etc/pbx/.version') || file_exists('/etc/pbx/.color')) { 
     3086    $pbx_type = 'piaf'; 
     3087    $pbx_version = ''; 
     3088    if (file_exists('/etc/pbx/.version')) { 
     3089      $pbx_version = trim(file_get_contents('/etc/pbx/.version')); 
     3090    } 
     3091    if (file_exists('/etc/pbx/.color')) { 
     3092      $pbx_version .= '.' . trim(file_get_contents('/etc/pbx/.color')); 
     3093    } 
     3094    if (!$pbx_version) { 
     3095      if (file_exists('/etc/pbx/ISO-Version')) { 
     3096        $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3097        $pbx_arr = explode('=',$pbx_ver_raw); 
     3098        $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3099      } else { 
     3100        $pbx_version = 'unknown'; 
     3101      } 
     3102    } 
     3103 
     3104  // Old PIAF or Fonica 
     3105  } elseif (file_exists('/etc/pbx/version') || file_exists('/etc/pbx/ISO-Version')) { 
     3106    $pbx_type = 'fonica'; 
     3107    if (file_exists('/etc/pbx/ISO-Version')) { 
     3108      $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     3109      $pbx_arr = explode('=',$pbx_ver_raw); 
     3110      $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     3111      if (stristr($pbx_arr[0],'foncordiax') !== false) { 
     3112        $pbx_version .= '.pro'; 
     3113      } else { 
     3114        $pbx_version = str_replace(' ','.',$pbx_version); 
     3115        if ($pbx_version != '1.0.standard') { 
     3116          $pbx_type = 'piaf'; 
     3117        } 
     3118      } 
     3119    } else { 
     3120      $pbx_version = 'unknown'; 
     3121    } 
     3122  } else { 
     3123    $pbx_type = 'unknown'; 
     3124    $pbx_version = 'unknown'; 
     3125  } 
     3126  return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     3127} 
    30363128 
    30373129function module_run_notification_checks() { 
     
    31983290  return $contexts; 
    31993291} 
    3200  
    3201 ?>