Changeset 11704
- Timestamp:
- 03/05/11 11:15:00 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.9/amp_conf/htdocs/admin/libraries/module.functions.php
r11464 r11704 1404 1404 $options .= "&phpver=".urlencode(phpversion()); 1405 1405 1406 $distro_info = _module_distro_id(); 1407 $options .= "&distro=".urlencode($distro_info['pbx_type']); 1408 $options .= "&distrover=".urlencode($distro_info['pbx_version']); 1409 1406 1410 $fn = "http://mirror.freepbx.org/version-".getversion().".html".$options; 1407 1411 $announcement = file_get_contents_url($fn); … … 1551 1555 return str_replace($target, $replace, $string); 1552 1556 } 1553 ?> 1557 1558 function _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 14 14 15 15 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''; 16 $module_repo = isset($_REQUEST['module_repo'])?htmlentities($_REQUEST['module_repo']):'supported';17 16 $repo = "http://mirror.freepbx.org/"; 18 17 … … 119 118 function process_module_actions(actions) { 120 119 freepbx_modal_show('moduleBox'); 121 urlStr = "config.php?type=<?php echo $type ?>&display=modules&extdisplay=process&quietmode=1 &module_repo=<?php echo $module_repo ?>";120 urlStr = "config.php?type=<?php echo $type ?>&display=modules&extdisplay=process&quietmode=1"; 122 121 for (var i in actions) { 123 122 urlStr += "&moduleaction["+i+"]="+actions[i]; … … 137 136 echo "<h2>" . _("Module Administration") . "</h2>"; 138 137 //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 }142 138 } else { 143 139 // $quietmode==true … … 528 524 echo "<input type=\"hidden\" name=\"online\" value=\"".$online."\" />"; 529 525 echo "<input type=\"hidden\" name=\"extdisplay\" value=\"confirm\" />"; 530 echo "<input type=\"hidden\" name=\"module_repo\" value=\"".$module_repo."\" />";531 526 532 527 echo "<div class=\"modulebuttons\">"; … … 574 569 575 570 // If versionupgrade module is present then allow it to skip modules that should not be presented 576 // because an dupgrade is in process. This can help assure only safe modules are present and571 // because an upgrade is in process. This can help assure only safe modules are present and 577 572 // force the user to upgrade in the proper order. 578 573 // 579 if (function_exists('versionupgrade_allowed_modules') && !versionupgrade_allowed_modules( &$modules[$name])) {574 if (function_exists('versionupgrade_allowed_modules') && !versionupgrade_allowed_modules($modules[$name])) { 580 575 continue; 581 576 } … … 996 991 $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.").' '; 997 992 $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>'; 999 994 ?> 1000 995 <form name="onlineRepo" action="config.php" method="post">
