Changeset 11704

Show
Ignore:
Timestamp:
03/05/11 11:15:00 (2 years ago)
Author:
p_lindheimer
Message:

remove more leftover extended repo code, add distro info

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php

    r11464 r11704  
    14041404  $options .= "&phpver=".urlencode(phpversion()); 
    14051405 
     1406  $distro_info = _module_distro_id(); 
     1407  $options .= "&distro=".urlencode($distro_info['pbx_type']); 
     1408  $options .= "&distrover=".urlencode($distro_info['pbx_version']); 
     1409 
    14061410  $fn = "http://mirror.freepbx.org/version-".getversion().".html".$options; 
    14071411  $announcement = file_get_contents_url($fn); 
     
    15511555  return str_replace($target, $replace, $string); 
    15521556} 
    1553 ?> 
     1557 
     1558function _module_distro_id() { 
     1559  static $pbx_type; 
     1560  static $pbx_version; 
     1561 
     1562  if (isset($pbx_type)) { 
     1563    return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     1564  } 
     1565 
     1566  // FreePBX Distro 
     1567  if (file_exists('/etc/asterisk/freepbxdistro-version')) { 
     1568    $pbx_type = 'freepbxdistro'; 
     1569    $pbx_version = trim(file_get_contents('/etc/asterisk/freepbxdistro-version')); 
     1570 
     1571  // Trixbox 
     1572  } elseif (file_exists('/etc/trixbox/trixbox-version')) { 
     1573    $pbx_type = 'trixbox'; 
     1574    $pbx_version = trim(file_get_contents('/etc/trixbox/trixbox-version')); 
     1575 
     1576  // AsteriskNOW 
     1577  } elseif (file_exists('/etc/asterisknow-version')) { 
     1578    $pbx_type = 'asterisknow'; 
     1579    $pbx_version = trim(file_get_contents('/etc/asterisknow-version')); 
     1580   
     1581  // Elastix 
     1582  } elseif (file_exists('/usr/share/elastix/pre_elastix_version.info')) { 
     1583    $pbx_type = 'elastix'; 
     1584    $pbx_version = trim(file_get_contents('/usr/share/elastix/pre_elastix_version.info')); 
     1585 
     1586  // Elastix 2.X+ - kept in db, unless there is a simple query to get to the db 
     1587  } elseif (is_dir('/usr/share/elastix')) { 
     1588    $pbx_type = 'elastix'; 
     1589    $pbx_version = '2.X+'; 
     1590 
     1591  // PIAF 
     1592  } elseif (file_exists('/etc/pbx/.version') || file_exists('/etc/pbx/.color')) { 
     1593    $pbx_type = 'piaf'; 
     1594    $pbx_version = ''; 
     1595    if (file_exists('/etc/pbx/.version')) { 
     1596      $pbx_version = trim(file_get_contents('/etc/pbx/.version')); 
     1597    } 
     1598    if (file_exists('/etc/pbx/.color')) { 
     1599      $pbx_version .= '.' . trim(file_get_contents('/etc/pbx/.color')); 
     1600    } 
     1601    if (!$pbx_version) { 
     1602      if (file_exists('/etc/pbx/ISO-Version')) { 
     1603        $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     1604        $pbx_arr = explode('=',$pbx_ver_raw); 
     1605        $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     1606      } else { 
     1607        $pbx_version = 'unknown'; 
     1608      } 
     1609    } 
     1610 
     1611  // Fonicordiax 
     1612  } elseif (file_exists('/etc/pbx/version') || file_exists('/etc/pbx/ISO-Version')) { 
     1613    $pbx_type = 'fonica'; 
     1614    if (file_exists('/etc/pbx/ISO-Version')) { 
     1615      $pbx_ver_raw = trim(file_get_contents('/etc/pbx/ISO-Version')); 
     1616      $pbx_arr = explode('=',$pbx_ver_raw); 
     1617      $pbx_version = $pbx_arr[count($pbx_arr)-1]; 
     1618      if (stristr($pbx_arr[0],'foncordiax') !== false) { 
     1619        $pbx_version .= '.pro'; 
     1620      } 
     1621      $pbx_version = str_replace(' ','.',$pbx_version); 
     1622    } else { 
     1623      $pbx_version = 'unknown'; 
     1624    } 
     1625  } else { 
     1626    $pbx_type = 'unknown'; 
     1627    $pbx_version = 'unknown'; 
     1628  } 
     1629  return array('pbx_type' => $pbx_type, 'pbx_version' => $pbx_version); 
     1630
  • freepbx/branches/2.9/amp_conf/htdocs/admin/page.modules.php

    r11652 r11704  
    1414 
    1515$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''; 
    16 $module_repo = isset($_REQUEST['module_repo'])?htmlentities($_REQUEST['module_repo']):'supported'; 
    1716$repo = "http://mirror.freepbx.org/"; 
    1817 
     
    119118  function process_module_actions(actions) { 
    120119    freepbx_modal_show('moduleBox'); 
    121     urlStr = "config.php?type=<?php echo $type ?>&amp;display=modules&amp;extdisplay=process&amp;quietmode=1&amp;module_repo=<?php echo $module_repo ?>"; 
     120    urlStr = "config.php?type=<?php echo $type ?>&amp;display=modules&amp;extdisplay=process&amp;quietmode=1"; 
    122121    for (var i in actions) { 
    123122      urlStr += "&amp;moduleaction["+i+"]="+actions[i]; 
     
    137136  echo "<h2>" . _("Module Administration") . "</h2>"; 
    138137  //TODO: decide if warnings of any sort need to be given, or just list of repos active? 
    139   if ($module_repo == "extended") { 
    140     echo "<h4 align='center'>"._("NOTICE")."<br />"._("You have accessed the extended repository which includes un-supported and third party modules")."</h4>"; 
    141   } 
    142138} else { 
    143139  // $quietmode==true 
     
    528524    echo "<input type=\"hidden\" name=\"online\" value=\"".$online."\" />"; 
    529525    echo "<input type=\"hidden\" name=\"extdisplay\" value=\"confirm\" />"; 
    530     echo "<input type=\"hidden\" name=\"module_repo\" value=\"".$module_repo."\" />"; 
    531526     
    532527    echo "<div class=\"modulebuttons\">"; 
     
    574569 
    575570      // If versionupgrade module is present then allow it to skip modules that should not be presented 
    576       // because and upgrade is in process. This can help assure only safe modules are present and 
     571      // because an upgrade is in process. This can help assure only safe modules are present and 
    577572      // force the user to upgrade in the proper order. 
    578573      // 
    579       if (function_exists('versionupgrade_allowed_modules') && !versionupgrade_allowed_modules(&$modules[$name])) { 
     574      if (function_exists('versionupgrade_allowed_modules') && !versionupgrade_allowed_modules($modules[$name])) { 
    580575        continue; 
    581576      } 
     
    996991  $tooltip .= _(" The modules in the Extended repository are less common and may receive lower levels of support. The Unsupported repository has modules that are not supported by the FreePBX team but may receive some level of support by the authors.").' '; 
    997992  $tooltip .= _("The Commercial repository is reserved for modules that are available for purchase and commercially supported.").' '; 
    998   $tooltip .= '<br /><br /><small><i>('._("Checking for updates will transmit your FreePBX, Asterisk and PHP version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.").')</i></small>'; 
     993  $tooltip .= '<br /><br /><small><i>('._("Checking for updates will transmit your FreePBX, Distro, Asterisk and PHP version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.").')</i></small>'; 
    999994?> 
    1000995  <form name="onlineRepo" action="config.php" method="post">