Changeset 10031
- Timestamp:
- 07/05/10 04:22:34 (3 years ago)
- Files:
-
- contributed_modules/modules/endpointman/includes/advanced.inc (modified) (3 diffs)
- contributed_modules/modules/endpointman/includes/brand_model_manager.inc (modified) (1 diff)
- contributed_modules/modules/endpointman/includes/devices_manager.inc (modified) (1 diff)
- contributed_modules/modules/endpointman/includes/functions.inc (modified) (1 diff)
- contributed_modules/modules/endpointman/install.php (modified) (8 diffs)
- contributed_modules/modules/endpointman/module.xml (modified) (2 diffs)
- contributed_modules/modules/endpointman/page.endpointman.php (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/devices_manager.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/global_header.html (modified) (5 diffs)
- contributed_modules/modules/endpointman/templates/template_editor.html (modified) (1 diff)
- contributed_modules/modules/endpointman/templates/template_manager.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/endpointman/includes/advanced.inc
r9907 r10031 45 45 fwrite($wfh, $temp_amp); 46 46 fclose($wfh); 47 $tpl->assign("exporter_address", $_SERVER["HTTP_HOST"]. "/admin/modules/endpointman/includes/export.php");47 $tpl->assign("exporter_address", $_SERVER["HTTP_HOST"].WEB_PATH."includes/export.php"); 48 48 //Dave B's Q&D file upload security code (http://us2.php.net/manual/en/features.file-upload.php) 49 49 if((isset($_REQUEST['action'])) AND (isset($_REQUEST['button_import'])) AND ($_REQUEST['action'] == "import")) { … … 320 320 $htaccess = "allow from all"; 321 321 322 $outfile = $amp_conf['AMPWEBROOT']. "/admin/modules/endpointman/.htaccess";322 $outfile = $amp_conf['AMPWEBROOT'].WEB_PATH.".htaccess"; 323 323 $wfh=fopen($outfile,'w'); 324 324 fwrite($wfh,$htaccess); … … 347 347 "; 348 348 349 $outfile = $amp_conf['AMPWEBROOT']. "/admin/modules/endpointman/.htaccess";349 $outfile = $amp_conf['AMPWEBROOT'].WEB_PATH.".htaccess"; 350 350 $wfh=fopen($outfile,'w'); 351 351 fwrite($wfh,$htaccess); contributed_modules/modules/endpointman/includes/brand_model_manager.inc
r9907 r10031 150 150 fwrite($wfh, $temp_amp); 151 151 fclose($wfh); 152 $tpl->assign("installer_address", $_SERVER["HTTP_HOST"]. "/admin/modules/endpointman/includes/installer.php");152 $tpl->assign("installer_address", $_SERVER["HTTP_HOST"].WEB_PATH."includes/installer.php"); 153 153 } 154 154 contributed_modules/modules/endpointman/includes/devices_manager.inc
r9907 r10031 351 351 $tpl->assign("models_ava", $ma); 352 352 } 353 $tpl->assign("web_path", WEB_PATH); 353 354 $tpl->assign("product_list", $product_list); 354 355 $tpl->assign("display_ext", $endpoint->displayExtension()); contributed_modules/modules/endpointman/includes/functions.inc
r9963 r10031 62 62 define("WEB_VARS", "?type=tool&display=endpointman"); 63 63 //This is really hacky but I have to do it when people have different directories instead of admin 64 if( !array_key_exists('PHONE_MODULES_PATH',$amp_conf)) {64 if((!array_key_exists('PHONE_MODULES_PATH',$amp_conf)) AND (dirname($_SERVER['SCRIPT_NAME']) != "/recordings")) { 65 65 //Define the location of phone modules, keeping it outside of the module directory so that when the user updates endpointmanager they don't lose all of their phones 66 66 define("PHONE_MODULES_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/_ep_phone_modules/"); 67 67 68 68 //Get local path information 69 define("LOCAL_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/endpointman/"); 70 69 define("WEB_PATH", dirname($_SERVER['SCRIPT_NAME'])."/modules/endpointman/"); 70 define("LOCAL_PATH", dirname($_SERVER["SCRIPT_FILENAME"])."/modules/endpointman/"); 71 71 72 //have to hack around freepbx.... 72 73 $amp_conf['PHONE_MODULES_PATH'] = PHONE_MODULES_PATH; 73 74 $amp_conf['LOCAL_ENDPOINT_PATH'] = LOCAL_PATH; 75 } elseif(dirname($_SERVER['SCRIPT_NAME']) == "/recordings") { 76 //Define the location of phone modules, keeping it outside of the module directory so that when the user updates endpointmanager they don't lose all of their phones 77 define("PHONE_MODULES_PATH", $amp_conf['AMPWEBROOT']."/admin/modules/_ep_phone_modules/"); 74 78 79 //Get local path information 80 define("WEB_PATH", "/admin/modules/endpointman/"); 81 define("LOCAL_PATH", $amp_conf['AMPWEBROOT']."/admin/modules/endpointman/"); 82 83 //have to hack around freepbx.... 84 $amp_conf['PHONE_MODULES_PATH'] = PHONE_MODULES_PATH; 85 $amp_conf['LOCAL_ENDPOINT_PATH'] = LOCAL_PATH; 75 86 } else { 76 87 define("PHONE_MODULES_PATH", $amp_conf['PHONE_MODULES_PATH']); contributed_modules/modules/endpointman/install.php
r9912 r10031 109 109 (5, 'config_location', '/tftpboot/'), 110 110 (6, 'update_server', 'http://www.the159.com/endpoint/'), 111 (7, 'version', ' 1.9.9'),111 (7, 'version', '2.0.0'), 112 112 (8, 'enable_ari', '0'), 113 113 (9, 'debug', '0'), … … 118 118 119 119 define("UPDATE_PATH", 'http://www.the159.com/endpoint/'); 120 define("VER", ' 1.9.9');120 define("VER", '2.0.0'); 121 121 122 122 out("Updating Mac List table"); … … 320 320 321 321 out("Updating Version Number"); 322 $sql = "UPDATE endpointman_global_vars SET value = ' 1.9.9' WHERE var_name = 'version'";322 $sql = "UPDATE endpointman_global_vars SET value = '2.0.0' WHERE var_name = 'version'"; 323 323 324 324 out("Creating Custom Configs Table"); … … 385 385 386 386 out("Update Version Number"); 387 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';387 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 388 388 $db->query($sql); 389 389 … … 416 416 417 417 out("Update Version Number"); 418 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';418 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 419 419 $db->query($sql); 420 420 421 421 } elseif($ver == "1.9.3") { 422 422 out("Update Version Number"); 423 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';423 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 424 424 $db->query($sql); 425 425 } elseif($ver == "1.9.4") { 426 426 out("Your Database is already up to date!"); 427 427 out("Update Version Number"); 428 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';428 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 429 429 $db->query($sql); 430 430 } elseif($ver == "1.9.5") { 431 431 out("Your Database is already up to date!"); 432 432 out("Update Version Number"); 433 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';433 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 434 434 $db->query($sql); 435 435 } elseif($ver == "1.9.6") { 436 436 out("Your Database is already up to date!"); 437 437 out("Update Version Number"); 438 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';438 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 439 439 $db->query($sql); 440 440 } elseif($ver == "1.9.7") { 441 441 out("Your Database is already up to date!"); 442 442 out("Update Version Number"); 443 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';443 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 444 444 $db->query($sql); 445 445 } elseif($ver == "1.9.8") { 446 446 out("Your Database is already up to date!"); 447 447 out("Update Version Number"); 448 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';448 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 449 449 $db->query($sql); 450 450 } elseif($ver == "1.9.9") { 451 out("Your Database is already up to date!"); 452 out("Update Version Number"); 453 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 454 $db->query($sql); 455 } elseif($ver == "2.0.0") { 451 456 out("Your Database is already up to date!"); 452 457 } else { … … 485 490 (5, 'config_location', '/tftpboot/'), 486 491 (6, 'update_server', 'http://www.the159.com/endpoint/'), 487 (7, 'version', ' 1.9.9'),492 (7, 'version', '2.0.0'), 488 493 (8, 'enable_ari', '0'), 489 494 (9, 'debug', '0'), … … 704 709 } 705 710 706 out("Fixing .htaccess issues (#288)"); 707 $htaccess = "allow from all 708 AuthName FreePBX-Admin-only 709 Require valid-user 710 AuthType Basic 711 AuthMySQLEnable\tOn 712 AuthMySQLHost\tlocalhost 713 AuthMySQLDB\tasterisk 714 AuthMySQLUserTable\tampusers 715 AuthMySQLUser\t".$amp_conf['AMPDBUSER']." 716 AuthMySQLPassword\t".$amp_conf['AMPDBPASS']." 717 AuthMySQLNameField\tusername 718 AuthMySQLPasswordField\tpassword 719 AuthMySQLAuthoritative\tOn 720 AuthMySQLPwEncryption\tnone 721 AuthMySQLUserCondition\t\"username = 'admin'\" 722 723 <Files .*> 724 deny from all 725 </Files> 726 "; 727 728 $outfile =LOCAL_PATH. ".htaccess"; 729 $wfh=fopen($outfile,'w'); 730 fwrite($wfh,$htaccess); 731 fclose($wfh); 732 733 out("Installing ARI Module"); 734 rename(LOCAL_PATH. "Install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 735 736 out("Fixing permissions on ARI module"); 737 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 711 if(file_exists($amp_conf['AMPWEBROOT']."/recordings")) { 712 out("Installing ARI Module"); 713 copy(LOCAL_PATH. "Install/phonesettings.module", $amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module"); 714 715 copy(LOCAL_PATH. "templates/javascript/jquery.coda-slider-2.0.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.coda-slider-2.0.js"); 716 717 copy(LOCAL_PATH. "templates/javascript/jquery.easing.1.3.js", $amp_conf['AMPWEBROOT']."/recordings/theme/js/jquery.easing.1.3.js"); 718 719 copy(LOCAL_PATH. "templates/stylesheets/coda-slider-2.0a.css", $amp_conf['AMPWEBROOT']."/recordings/theme/coda-slider-2.0a.css"); 720 721 722 out("Fixing permissions on ARI module"); 723 chmod($amp_conf['AMPWEBROOT']."/recordings/modules/phonesettings.module", 0664); 724 } 738 725 739 726 out("Adding Custom Field to OUI List"); … … 787 774 788 775 out("Update Version Number [Yes again, just in case]"); 789 $sql = 'UPDATE endpointman_global_vars SET value = \' 1.9.9\' WHERE var_name = "version"';776 $sql = 'UPDATE endpointman_global_vars SET value = \'2.0.0\' WHERE var_name = "version"'; 790 777 $db->query($sql); 791 778 contributed_modules/modules/endpointman/module.xml
r9916 r10031 2 2 <rawname>endpointman</rawname> 3 3 <name>PBX End Point Manager</name> 4 <version> 1.9.9</version>4 <version>2.0.0</version> 5 5 <type>tool</type> 6 6 <category>System Administration</category> … … 19 19 <location>contributed_modules/release/endpointman-1.9.9.tgz</location> 20 20 21 <md5sum> b99f3ddc7e9e51692d7a0208401a2ad7</md5sum>21 <md5sum>c202f25d0979f47204c97058b4a9cd56</md5sum> 22 22 </module> contributed_modules/modules/endpointman/page.endpointman.php
r9907 r10031 52 52 } 53 53 54 if(!file_exists(LOCAL_PATH.".htaccess")) {55 $htaccess = "allow from all56 AuthName FreePBX-Admin-only57 Require valid-user58 AuthType Basic59 AuthMySQLEnable\tOn60 AuthMySQLHost\tlocalhost61 AuthMySQLDB\tasterisk62 AuthMySQLUserTable\tampusers63 AuthMySQLUser\t".$amp_conf['AMPDBUSER']."64 AuthMySQLPassword\t".$amp_conf['AMPDBPASS']."65 AuthMySQLNameField\tusername66 AuthMySQLPasswordField\tpassword67 AuthMySQLAuthoritative\tOn68 AuthMySQLPwEncryption\tnone69 AuthMySQLUserCondition\t\"username = 'admin'\"70 71 <Files .*>72 deny from all73 </Files>74 ";75 76 $outfile = LOCAL_PATH.".htaccess";77 $wfh=fopen($outfile,'w');78 fwrite($wfh,$htaccess);79 fclose($wfh);80 }81 82 54 if($amp_conf['AMPENGINE'] != 'asterisk') { 83 55 die(_("Sorry, Only Asterisk is supported currently")); contributed_modules/modules/endpointman/templates/devices_manager.html
r9907 r10031 180 180 <td width="19%" align='center'>{$value.ext} - {$value.description}</td> 181 181 <td align='center' width='18%'>{$value.template_name}</td> 182 <td align='center' width='9%'><a href={$web_vars}&editready=true&page=devices_manager&id={$value.id}><img src=' /admin/modules/endpointman/templates/images/edit.gif' ALT='<?=_('Edit')?>' border='0'></a></td>183 <td align='center' width='5%'><a href={$web_vars}&deleteready=true&page=devices_manager&id={$value.id}><img src=' /admin/modules/endpointman/templates/images/delete.gif' ALT='<?=_('Delete')?>' border='0'></a></td>182 <td align='center' width='9%'><a href={$web_vars}&editready=true&page=devices_manager&id={$value.id}><img src='{$web_path}templates/images/edit.gif' ALT='<?=_('Edit')?>' border='0'></a></td> 183 <td align='center' width='5%'><a href={$web_vars}&deleteready=true&page=devices_manager&id={$value.id}><img src='{$web_path}templates/images/delete.gif' ALT='<?=_('Delete')?>' border='0'></a></td> 184 184 </tr> 185 185 {/loop} contributed_modules/modules/endpointman/templates/global_header.html
r9907 r10031 7 7 8 8 <!-- Begin JavaScript --> 9 <script type="text/javascript" src=" /admin/modules/endpointman/templates/javascript/jquery.easing.1.3.js"></script>10 <script type="text/javascript" src=" /admin/modules/endpointman/templates/javascript/jquery.coda-slider-2.0.js"></script>9 <script type="text/javascript" src="<?=WEB_PATH?>templates/javascript/jquery.easing.1.3.js"></script> 10 <script type="text/javascript" src="<?=WEB_PATH?>templates/javascript/jquery.coda-slider-2.0.js"></script> 11 11 <script type="text/javascript"> 12 12 $().ready(function() { … … 22 22 $(function(){ 23 23 $("select#brand_edit").change(function(){ 24 $.getJSON(" /admin/modules/endpointman/includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=model",{id: $(this).val()}, function(j){24 $.getJSON("<?=WEB_PATH?>includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=model",{id: $(this).val()}, function(j){ 25 25 var options = ''; 26 26 for (var i = 0; i < j.length; i++) { … … 36 36 $(function(){ 37 37 $("select#product_select").change(function(){ 38 $.getJSON(" /admin/modules/endpointman/includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=template",{id: $(this).val()}, function(j){38 $.getJSON("<?=WEB_PATH?>includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=template",{id: $(this).val()}, function(j){ 39 39 var options = ''; 40 40 for (var i = 0; i < j.length; i++) { … … 48 48 $(function(){ 49 49 $("select#model_new").change(function(){ 50 $.getJSON(" /admin/modules/endpointman/includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=template2",{id: $(this).val()}, function(j){50 $.getJSON("<?=WEB_PATH?>includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=template2",{id: $(this).val()}, function(j){ 51 51 var options = ''; 52 52 for (var i = 0; i < j.length; i++) { … … 60 60 $(function(){ 61 61 $("select#brand_list_selected").change(function(){ 62 $.getJSON(" /admin/modules/endpointman/includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=model",{id: $(this).val()}, function(j){62 $.getJSON("<?=WEB_PATH?>includes/ajax_select.php?amp_conf={$amp_conf_serial}&type=model",{id: $(this).val()}, function(j){ 63 63 var options = ''; 64 64 for (var i = 0; i < j.length; i++) { contributed_modules/modules/endpointman/templates/template_editor.html
r9907 r10031 2 2 <html> 3 3 <head> 4 <link href="/ admin/modules/endpointman/templates/stylesheets/coda-slider-2.0a.css" rel="stylesheet" type="text/css" />4 <link href="/recordings/theme/coda-slider-2.0a.css" rel="stylesheet" type="text/css" /> 5 5 6 6 7 7 <!-- Begin JavaScript --> 8 <script type="text/javascript" src="/ admin/modules/endpointman/templates/javascript/jquery.easing.1.3.js"></script>9 <script type="text/javascript" src="/ admin/modules/endpointman/templates/javascript/jquery.coda-slider-2.0.js"></script>8 <script type="text/javascript" src="/recordings/theme/js/jquery.easing.1.3.js"></script> 9 <script type="text/javascript" src="/recordings/theme/js/jquery.coda-slider-2.0.js"></script> 10 10 <script type="text/javascript"> 11 11 $().ready(function() { contributed_modules/modules/endpointman/templates/template_manager.html
r9907 r10031 33 33 <td>{$value.name}</td> 34 34 <td>{$value.model_class}</td> 35 <td align='center' width='9%'><a href={$web_vars}&edit_template=true&page=template_manager&custom={$value.custom}&id={$value.id}><img src=' /admin/modules/endpointman/templates/images/edit.gif' ALT='<?=_('Edit')?>' border='0'></a></td>35 <td align='center' width='9%'><a href={$web_vars}&edit_template=true&page=template_manager&custom={$value.custom}&id={$value.id}><img src='<?=WEB_PATH?>templates/images/edit.gif' ALT='<?=_('Edit')?>' border='0'></a></td> 36 36 <td align='center' width='5%'>{if condition="$value.custom == 0"} 37 <a href={$web_vars}&delete_template=true&page=template_manager&id={$value.id}><img src=' /admin/modules/endpointman/templates/images/delete.gif' ALT='<?=_('Delete')?>' border='0'></a>{/if}</td>37 <a href={$web_vars}&delete_template=true&page=template_manager&id={$value.id}><img src='<?=WEB_PATH?>templates/images/delete.gif' ALT='<?=_('Delete')?>' border='0'></a>{/if}</td> 38 38 </tr> 39 39 {/loop}
