Changeset 4063
- Timestamp:
- 06/14/07 11:57:53 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r4058 r4063 1159 1159 if ($override_xml) { 1160 1160 $fn = $override_xml."modules-".$matches[1].".xml"; 1161 } elseif (isset($amp_conf["AMPMODULEXML"])) {1162 $fn = $amp_conf["AMPMODULEXML"]."modules-".$matches[1].".xml";1163 // echo "(From amportal.conf)"; //debug1164 1161 } else { 1165 1162 $fn = "http://mirror.freepbx.org/modules-".$matches[1].".xml"; … … 1623 1620 if ($override_svn) { 1624 1621 $url = $override_svn.$res['location']; 1625 } elseif (isset($amp_conf['AMPMODULESVN'])) {1626 $url = $amp_conf['AMPMODULESVN'].$res['location'];1627 1622 } else { 1628 1623 $url = "http://mirror.freepbx.org/modules/".$res['location']; … … 2261 2256 // and there is nothing in the array (couldn't find a mac) then we will make it purely random 2262 2257 // 2263 if ($chosen_mac != "") { 2258 if ($type == "vmware") { 2259 //vmware machines will have repeated macs so make random 2260 //echo "generating randomly\n"; 2261 return _module_generate_random_id($type); 2262 } else if ($chosen_mac != "") { 2264 2263 //echo "generating with: $chosen_mac\n"; 2265 2264 return _module_generate_random_id($type, $chosen_mac); … … 2271 2270 return _module_generate_random_id($type); 2272 2271 } 2273 } 2272 } 2274 2273 2275 2274 … … 2340 2339 } 2341 2340 } 2342 if (isset($amp_conf['AMPMODULESVN'])) { 2343 $url = $amp_conf['AMPMODULESVN'].$res['location']; 2344 // echo "(From amportal.conf)"; // debug 2345 } else { 2341 2346 2342 $url = "http://mirror.freepbx.org/modules/".$res['location']; 2347 // echo "(From default)"; // debug 2348 } 2343 2349 2344 $fp = @fopen($filename,"w"); 2350 2345 $filedata = file_get_contents($url); freepbx/trunk/amp_conf/htdocs/admin/page.modules.php
r4058 r4063 226 226 } 227 227 228 /* enable_option($module_name, $option) 229 This function will return false if the particular option, which is a module xml tag, 230 is set to 'no'. It also provides for some hardcoded overrides on critical modules to 231 keep people from editing the xml themselves and then breaking their the system. 232 */ 233 function enable_option($module_name, $option) { 234 global $modules; 235 236 $enable=true; 237 $override = array('core' => array('candisable' => 'no', 238 'canuninstall' => 'no', 239 ), 240 'framework' => array('candisable' => 'no', 241 'canuninstall' => 'no', 242 ), 243 ); 244 245 if (isset($modules[$module_name][$option]) && strtolower(trim($modules[$module_name][$option])) == 'no') { 246 $enable=false; 247 } 248 if (isset($override[$module_name][$option]) && strtolower(trim($override[$module_name][$option])) == 'no') { 249 $enable=false; 250 } 251 252 return $enable; 253 } 254 255 //-------------------------------------------------------------------------------------------------------- 228 256 switch ($extdisplay) { // process, confirm, or nothing 229 257 case 'process': … … 677 705 } 678 706 } 679 echo '<input type="radio" id="disable_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="disable" /> '. 680 '<label for="disable_'.prep_id($name).'">'._('Disable').'</label> <br />'; 681 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 707 if (enable_option($name,'candisable')) { 708 echo '<input type="radio" id="disable_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="disable" /> '. 709 '<label for="disable_'.prep_id($name).'">'._('Disable').'</label> <br />'; 710 } 711 if (!EXTERNAL_PACKAGE_MANAGEMENT && enable_option($name,'canuninstall')) { 682 712 echo '<input type="radio" id="uninstall_'.prep_id($name).'" name="moduleaction['.prep_id($name).']" value="uninstall" /> '. 683 713 '<label for="uninstall_'.prep_id($name).'">'._('Uninstall').'</label> <br />';
