Changeset 12769

Show
Ignore:
Timestamp:
10/05/11 17:39:05 (2 years ago)
Author:
tm1000
Message:

Updating Endpoint Manager 2.9 Branch to newest format.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/endpointman/config.php

    r11804 r12769  
    5353} 
    5454 
    55 if($global_cfg['debug']) { 
     55 
     56if($endpoint->global_cfg['debug']) { 
    5657  $debug .= "Request Variables: \n".print_r($_REQUEST, TRUE); 
    5758} 
  • modules/branches/2.9/endpointman/functions.inc.php

    r12312 r12769  
    180180    $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
    181181    $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
    182  
     182    $tech = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null; 
     183 
     184    dbug($_REQUEST); 
     185     
     186    if((isset($tech)) && ($tech == 'sip_generic')) { 
    183187    // Don't display this stuff it it's on a 'This xtn has been deleted' page. 
    184     if ($action != 'del') { 
    185  
    186         $js = " 
    187                     $.ajaxSetup({ cache: false }); 
    188  
    189                     $.getJSON(\"config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model\",{id: value}, function(j){ 
    190                             var options = ''; 
    191                             for (var i = 0; i < j.length; i++) { 
    192                                     options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
    193                             } 
    194                             $('#epm_model').html(options); 
    195                             $('#epm_model option:first').attr('selected', 'selected'); 
    196                             $('#epm_temps').html('<option></option>'); 
    197                             $('#epm_temps option:first').attr('selected', 'selected'); 
    198                             $('#epm_line').html('<option></option>'); 
    199                             $('#epm_line option:first').attr('selected', 'selected'); 
    200                     }) 
    201                 "; 
    202         $currentcomponent->addjsfunc('brand_change(value)', $js); 
    203  
    204         $section = _('End Point Manager'); 
    205  
    206         $sql = "SELECT mac_id,luid,line FROM endpointman_line_list WHERE ext = '".$extdisplay."' "; 
    207         $line_info =& $db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
    208         if($line_info) { 
     188        if ($action != 'del') { 
    209189 
    210190            $js = " 
    211                     $.ajaxSetup({ cache: false }); 
    212                     $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2',{id: value}, function(j){ 
    213                             var options = ''; 
    214                             for (var i = 0; i < j.length; i++) { 
    215                                     options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
    216                             } 
    217                             $('#epm_temps').html(options); 
    218                             $('#epm_temps option:first').attr('selected', 'selected'); 
    219                     }), 
    220                     $.ajaxSetup({ cache: false }); 
    221                     $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&macid='+ macid +'&atype=lines',{id: value}, function(j){ 
    222                             var options = ''; 
    223                             for (var i = 0; i < j.length; i++) { 
    224                                     options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
    225                             } 
    226                             $('#epm_line').html(options); 
    227                             $('#epm_line option:first').attr('selected', 'selected'); 
    228                     }) 
    229                 "; 
    230             $currentcomponent->addjsfunc('model_change(value,macid)', $js); 
    231  
    232             $info = $endpoint->get_phone_info($line_info['mac_id']); 
    233  
    234             $brand_list = $endpoint->brands_available($info['brand_id'], true); 
    235             if(!empty($info['brand_id'])) { 
    236                 $model_list = $endpoint->models_available(NULL,$info['brand_id']); 
    237                 $line_list = $endpoint->linesAvailable($line_info['luid']); 
    238                 $template_list = $endpoint->display_templates($info['product_id']); 
     191                        $.ajaxSetup({ cache: false }); 
     192 
     193                        $.getJSON(\"config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=model\",{id: value}, function(j){ 
     194                                var options = ''; 
     195                                for (var i = 0; i < j.length; i++) { 
     196                                        options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     197                                } 
     198                                $('#epm_model').html(options); 
     199                                $('#epm_model option:first').attr('selected', 'selected'); 
     200                                $('#epm_temps').html('<option></option>'); 
     201                                $('#epm_temps option:first').attr('selected', 'selected'); 
     202                                $('#epm_line').html('<option></option>'); 
     203                                $('#epm_line option:first').attr('selected', 'selected'); 
     204                        }) 
     205                    "; 
     206            $currentcomponent->addjsfunc('brand_change(value)', $js); 
     207 
     208            $section = _('End Point Manager'); 
     209 
     210            $sql = "SELECT mac_id,luid,line FROM endpointman_line_list WHERE ext = '".$extdisplay."' "; 
     211            $line_info =& $db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
     212            if($line_info) { 
     213 
     214                $js = " 
     215                        $.ajaxSetup({ cache: false }); 
     216                        $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2',{id: value}, function(j){ 
     217                                var options = ''; 
     218                                for (var i = 0; i < j.length; i++) { 
     219                                        options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     220                                } 
     221                                $('#epm_temps').html(options); 
     222                                $('#epm_temps option:first').attr('selected', 'selected'); 
     223                        }), 
     224                        $.ajaxSetup({ cache: false }); 
     225                        $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&macid='+ macid +'&atype=lines',{id: value}, function(j){ 
     226                                var options = ''; 
     227                                for (var i = 0; i < j.length; i++) { 
     228                                        options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     229                                } 
     230                                $('#epm_line').html(options); 
     231                                $('#epm_line option:first').attr('selected', 'selected'); 
     232                        }) 
     233                    "; 
     234                $currentcomponent->addjsfunc('model_change(value,macid)', $js); 
     235 
     236                $info = $endpoint->get_phone_info($line_info['mac_id']); 
     237 
     238                $brand_list = $endpoint->brands_available($info['brand_id'], true); 
     239                if(!empty($info['brand_id'])) { 
     240                    $model_list = $endpoint->models_available(NULL,$info['brand_id']); 
     241                    $line_list = $endpoint->linesAvailable($line_info['luid']); 
     242                    $template_list = $endpoint->display_templates($info['product_id']); 
     243                } else { 
     244                    $model_list = array(); 
     245                    $line_list = array(); 
     246                    $template_list = array(); 
     247                } 
     248 
     249                $checked = false; 
     250 
     251                $currentcomponent->addguielem($section, new gui_checkbox('epm_delete', $checked, 'Delete','Delete this Extension from Endpoint Manager'),9); 
     252                $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
     253                $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 
     254                $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,\''.$line_info['luid'].'\')', false),9); 
     255                $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
     256                $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
     257                $currentcomponent->addguielem($section, new gui_checkbox('epm_reboot', $checked, 'Reboot','Reboot this Phone on Submit'),9); 
     258 
    239259            } else { 
     260 
     261                $js = " 
     262                        $.ajaxSetup({ cache: false }); 
     263                        $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2',{id: value}, function(j){ 
     264                                var options = ''; 
     265                                for (var i = 0; i < j.length; i++) { 
     266                                        options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     267                                } 
     268                                $('#epm_temps').html(options); 
     269                                $('#epm_temps option:first').attr('selected', 'selected'); 
     270                        }), 
     271                        $.ajaxSetup({ cache: false }); 
     272                        $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&mac='+ mac +'&atype=lines',{id: value}, function(j){ 
     273                                var options = ''; 
     274                                for (var i = 0; i < j.length; i++) { 
     275                                        options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
     276                                } 
     277                                $('#epm_line').html(options); 
     278                                $('#epm_line option:first').attr('selected', 'selected'); 
     279                        }) 
     280                    "; 
     281                $currentcomponent->addjsfunc('model_change(value,mac)', $js); 
     282 
     283                $brand_list = $endpoint->brands_available(NULL, true); 
    240284                $model_list = array(); 
    241285                $line_list = array(); 
    242286                $template_list = array(); 
     287 
     288                $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
     289                $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 
     290                $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,document.getElementById(\'epm_mac\').value)', false),9); 
     291                $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
     292                $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
     293                $currentcomponent->addguielem($section, new guitext('epm_note','Note: This might reboot the phone if it\'s already registered to Asterisk')); 
     294 
    243295            } 
    244  
    245             $checked = false; 
    246  
    247             $currentcomponent->addguielem($section, new gui_checkbox('epm_delete', $checked, 'Delete','Delete this Extension from Endpoint Manager'),9); 
    248             $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
    249             $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 
    250             $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,\''.$line_info['luid'].'\')', false),9); 
    251             $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
    252             $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
    253             $currentcomponent->addguielem($section, new gui_checkbox('epm_reboot', $checked, 'Reboot','Reboot this Phone on Submit'),9); 
    254  
    255         } else { 
    256  
    257             $js = " 
    258                     $.ajaxSetup({ cache: false }); 
    259                     $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&atype=template2',{id: value}, function(j){ 
    260                             var options = ''; 
    261                             for (var i = 0; i < j.length; i++) { 
    262                                     options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
    263                             } 
    264                             $('#epm_temps').html(options); 
    265                             $('#epm_temps option:first').attr('selected', 'selected'); 
    266                     }), 
    267                     $.ajaxSetup({ cache: false }); 
    268                     $.getJSON('config.php?type=tool&quietmode=1&handler=file&module=endpointman&file=ajax_select.html.php&mac='+ mac +'&atype=lines',{id: value}, function(j){ 
    269                             var options = ''; 
    270                             for (var i = 0; i < j.length; i++) { 
    271                                     options += '<option value=\"' + j[i].optionValue + '\">' + j[i].optionDisplay + '</option>'; 
    272                             } 
    273                             $('#epm_line').html(options); 
    274                             $('#epm_line option:first').attr('selected', 'selected'); 
    275                     }) 
    276                 "; 
    277             $currentcomponent->addjsfunc('model_change(value,mac)', $js); 
    278  
    279             $brand_list = $endpoint->brands_available(NULL, true); 
    280             $model_list = array(); 
    281             $line_list = array(); 
    282             $template_list = array(); 
    283  
    284             $currentcomponent->addguielem($section, new gui_textbox('epm_mac', $info['mac'], 'MAC Address', 'The MAC Address of the Phone Assigned to this Extension/Device. <br />(Leave Blank to Remove from Endpoint Manager)', '', 'Please enter a valid MAC Address', true, 17, false),9); 
    285             $currentcomponent->addguielem($section, new gui_selectbox('epm_brand', $brand_list, $info['brand_id'], 'Brand', 'The Brand of this Phone.', false, 'frm_'.$display.'_brand_change(this.options[this.selectedIndex].value)', false),9); 
    286             $currentcomponent->addguielem($section, new gui_selectbox('epm_model', $model_list, $info['model_id'], 'Model', 'The Model of this Phone.', false, 'frm_'.$display.'_model_change(this.options[this.selectedIndex].value,document.getElementById(\'epm_mac\').value)', false),9); 
    287             $currentcomponent->addguielem($section, new gui_selectbox('epm_line', $line_list, $line_info['line'], 'Line', 'The Line of this Extension/Device.', false, '', false),9); 
    288             $currentcomponent->addguielem($section, new gui_selectbox('epm_temps', $template_list, $info['template_id'], 'Template', 'The Template of this Phone.', false, '', false),9); 
    289             $currentcomponent->addguielem($section, new guitext('epm_note','Note: This might reboot the phone if it\'s already registered to Asterisk')); 
    290  
    291296        } 
    292297    } 
  • modules/branches/2.9/endpointman/i18n/endpointman.pot

    r11797 r12769  
    4141msgstr "" 
    4242 
    43 msgid "End Point Manager" 
    44 msgstr "" 
    45  
    46 msgid "" 
    47 "PBX End Point Manager supports automated deployment of multiple " 
    48 "manufacturers IP telephones." 
    49 msgstr "" 
    50  
    5143msgid "End Point Device List" 
    5244msgstr "" 
     
    6052msgid "End Point Advanced Settings" 
    6153msgstr "" 
     54 
     55msgid "End Point Manager" 
     56msgstr "" 
     57 
  • modules/branches/2.9/endpointman/i18n/fr_FR/LC_MESSAGES/endpointman.po

    r9963 r12769  
    2121"Project-Id-Version: EndPointManager\n" 
    2222"Report-Msgid-Bugs-To: \n" 
    23 "POT-Creation-Date: 2010-02-27 17:34+0100\n" 
     23"POT-Creation-Date: 2011-09-23 09:52+0000\n" 
    2424"PO-Revision-Date: 2010-06-26 21:40+0100\n" 
    2525"Last-Translator: jouniaux <c.jouniaux@techtelecom.fr>\n" 
     
    3131"X-Poedit-Country: FRANCE\n" 
    3232 
     33# more new new new! 
     34msgid "Turn Off Safe Mode" 
     35msgstr "Arrêt du mode sécurisé" 
     36 
     37msgid "PHP Version MUST be greater than" 
     38msgstr "" 
     39 
     40msgid "Sorry, Only Asterisk is supported currently" 
     41msgstr "Désolé, seul Asterisk est supporté actuellement" 
     42 
     43msgid "PBX End Point Manager" 
     44msgstr "" 
     45 
     46msgid "Admin" 
     47msgstr "" 
     48 
     49msgid "" 
     50"PBX End Point Manager supports automated deployment of multiple " 
     51"manufacturers IP telephones." 
     52msgstr "" 
     53 
     54msgid "End Point Device List" 
     55msgstr "" 
     56 
     57msgid "End Point Template Manager" 
     58msgstr "" 
     59 
     60msgid "End Point Configuration" 
     61msgstr "" 
     62 
     63msgid "End Point Advanced Settings" 
     64msgstr "" 
     65 
     66msgid "End Point Manager" 
     67msgstr "" 
     68 
     69#~ msgid "My Devices List" 
     70#~ msgstr "Ma liste de terminaux" 
     71 
     72#~ msgid "Template Manager" 
     73#~ msgstr "Gestion des gabarits" 
     74 
     75#~ msgid "Brand Configurations/Setup" 
     76#~ msgstr "Configuration/ParamÚtres de la marque" 
     77 
     78#~ msgid "Advanced Settings" 
     79#~ msgstr "ParamÚtres avancés" 
     80 
     81#~ msgid "IP address of phone server" 
     82#~ msgstr "Adresse IP du serveur de téléphonie" 
     83 
     84#~ msgid "Determine for me" 
     85#~ msgstr "Choisir à ma place" 
     86 
     87#~ msgid "Time Zone" 
     88#~ msgstr "Fuseau horaire" 
     89 
     90#~ msgid "Default Final Configuration Directory" 
     91#~ msgstr "Répertoire des configurations par défaut" 
     92 
     93#~ msgid "Enable FreePBX ARI Module" 
     94#~ msgstr "Activer le module ARI de FreePBX" 
     95 
     96#~ msgid "Enable Debug Mode" 
     97#~ msgstr "Activer mode debug" 
     98 
     99#~ msgid "Brand" 
     100#~ msgstr "Marque" 
     101 
     102#~ msgid "Select Product" 
     103#~ msgstr "Choisissez le produit" 
     104 
     105#~ msgid "File Configuration Editor" 
     106#~ msgstr "Editeur du fichier de configuration" 
     107 
     108#~ msgid "Local File Configs" 
     109#~ msgstr "Configuration en local" 
     110 
     111#~ msgid "User File Configs" 
     112#~ msgstr "Configuration utilisateur" 
     113 
     114#~ msgid "Settings" 
     115#~ msgstr "ParamÚtres" 
     116 
     117#~ msgid "OUI Manager" 
     118#~ msgstr "Gestion des OUI" 
     119 
     120#~ msgid "Product Options/Configuration Editor" 
     121#~ msgstr "Editeur de configuration/options du produit" 
     122 
     123#~ msgid "Show/Hide Brands/Models" 
     124#~ msgstr "Montrer/Cacher les marques/modÚles" 
     125 
     126#~ msgid "" 
     127#~ "Please wait for the progress bar to show below (this might take a minute " 
     128#~ "or two)" 
     129#~ msgstr "" 
     130#~ "Merci d'attendre la fin du traitement (Cela peut prendre une à deux " 
     131#~ "minutes)" 
     132 
     133#~ msgid "Version" 
     134#~ msgstr "Version" 
     135 
     136#~ msgid "Use NMAP" 
     137#~ msgstr "Utiliser NMAP" 
     138 
     139#~ msgid "Mac Address" 
     140#~ msgstr "Adresse MAC" 
     141 
     142#~ msgid "Model of Phone" 
     143#~ msgstr "ModÚle de téléphone" 
     144 
     145#~ msgid "Extension Number" 
     146#~ msgstr "Extension" 
     147 
     148#~ msgid "Template" 
     149#~ msgstr "Gabarit" 
     150 
     151#~ msgid "Unmanaged Extensions" 
     152#~ msgstr "Extensions non gérées" 
     153 
     154#~ msgid "Current Managed Extensions" 
     155#~ msgstr "Extensions gérées actuellement" 
     156 
     157#~ msgid "End Point Configuration Manager" 
     158#~ msgstr "Gestion de la configuration des terminaux" 
     159 
     160#~ msgid "You are currently editing" 
     161#~ msgstr "Vous êtes en train d'éditer" 
     162 
     163#~ msgid "a custom config template for extension" 
     164#~ msgstr "un gabarit de configuration personnalisé pour extension" 
     165 
     166#~ msgid "the template named" 
     167#~ msgstr "le gabarit appelé" 
     168 
     169#~ msgid "Select Alternative File Configurations" 
     170#~ msgstr "Choisissez des configurations dans d'autres fichiers" 
     171 
     172#~ msgid "You can also user certain variables in your configs" 
     173#~ msgstr "Vous pouvez aussi utilisez des variables dans vos configurations" 
     174 
     175#~ msgid "Server IP" 
     176#~ msgstr "IP du serveur" 
     177 
     178#~ msgid "Device's Mac Address" 
     179#~ msgstr "Adresse MAC du téléphone" 
     180 
     181#~ msgid "Device's Default Extension (Line 1 or Master)" 
     182#~ msgstr "Extension par défaut du téléphone (Ligne 1 ou maître)" 
     183 
     184#~ msgid "Device's Description in FreePBX (Usually the Full Name)" 
     185#~ msgstr "Description du téléphone dans FreePBX (en général le nom complet)" 
     186 
     187#~ msgid "for Model" 
     188#~ msgstr "pour modÚle" 
     189 
     190#~ msgid "Model" 
     191#~ msgstr "ModÚle" 
     192 
     193#~ msgid "Add New Template" 
     194#~ msgstr "Ajout d'un nouveau gabarit" 
     195 
     196#~ msgid "Template Name" 
     197#~ msgstr "Nom du gabarit" 
     198 
     199#~ msgid "Product Select" 
     200#~ msgstr "Choisir un produit" 
     201 
     202#~ msgid "Model Classification" 
     203#~ msgstr "Classification des modÚles" 
     204 
     205#~ msgid "Edit" 
     206#~ msgstr "Editer" 
     207 
     208#~ msgid "Delete" 
     209#~ msgstr "Supprimer" 
     210 
     211#~ msgid "Welcome to Endpoint Manager" 
     212#~ msgstr "Bienvenue dans Endpoint Manager" 
     213 
     214#~ msgid "here" 
     215#~ msgstr "ici" 
     216 
     217#~ msgid "to install some" 
     218#~ msgstr "pour installer quelques" 
     219 
     220#~ msgid "Saved" 
     221#~ msgstr "Enregistré" 
     222 
     223#~ msgid "Invalid MAC Address" 
     224#~ msgstr "Adresse MAC invalide" 
     225 
     226#~ msgid "" 
     227#~ "One or more selected phones had the same extension as a phone already " 
     228#~ "added, these devices were not added" 
     229#~ msgstr "" 
     230#~ "Un ou plusieurs téléphones sélectionnés ont la même extension qu'un " 
     231#~ "téléphone déjà ajouté. Ces terminaux ne seront pas ajoutés." 
     232 
     233#~ msgid "Please select a Brand and/or Model" 
     234#~ msgstr "Veuillez sélectionner une marque et/ou un modÚle" 
     235 
     236#~ msgid "No Phones Selected" 
     237#~ msgstr "Aucun téléphone sélectionné" 
     238 
     239#~ msgid "No Devices Found" 
     240#~ msgstr "Aucun terminal trouvé" 
     241 
     242#~ msgid "Please select a product" 
     243#~ msgstr "Veuillez choisir un produit" 
     244 
     245#~ msgid "Please select a template" 
     246#~ msgstr "Veuillez choisir un gabarit" 
     247 
     248#~ msgid "No Brand Selected for Reboot" 
     249#~ msgstr "Aucune marque sélectionnée pour la réinitialisation" 
     250 
     251#~ msgid "Unknown" 
     252#~ msgstr "Inconnu" 
     253 
     254#~ msgid "" 
     255#~ "You have disabled/removed all models that correspond to this brand. " 
     256#~ "Please enable them in 'Brand Configurations/Setup' before trying to edit " 
     257#~ "this phone" 
     258#~ msgstr "" 
     259#~ "Voys avez désactivé/retiré tous les modÚles correspondant à cette marque. " 
     260#~ "Veuillez les activer dans 'Configurations/ParamÚtres ded la marque' avant " 
     261#~ "d'éditer ce téléphone" 
     262 
     263#~ msgid "Go" 
     264#~ msgstr "Allez" 
     265 
     266#~ msgid "Save" 
     267#~ msgstr "Enregistrer" 
     268 
     269#~ msgid "Add" 
     270#~ msgstr "Ajouter" 
     271 
     272#~ msgid "Reset" 
     273#~ msgstr "Réinitialiser" 
     274 
     275#~ msgid "Add Selected Phones" 
     276#~ msgstr "Ajouter les téléphones sélectionnés" 
     277 
     278#~ msgid "Selected Phone(s) Options" 
     279#~ msgstr "Options pour les téléphones sélectionnés" 
     280 
     281#~ msgid "Change Selected Phones to" 
     282#~ msgstr "Changer les téléphones sélectionnés pour" 
     283 
     284#~ msgid "Global Phone Options" 
     285#~ msgstr "Options générales des téléphones" 
     286 
     287#~ msgid "Update Phones" 
     288#~ msgstr "Mis à jour des téléphones" 
     289 
     290#~ msgid "Delete Selected Phones" 
     291#~ msgstr "Suppression des téléphones sélectionnés" 
     292 
     293#~ msgid "Rebuild Configs for Selected Phones" 
     294#~ msgstr "Reconstruction des configurations des téléphones sélectionnés" 
     295 
     296#~ msgid "Rebuild Configs for All Phones" 
     297#~ msgstr "Reconstruction des configurations de tous les téléphones" 
     298 
     299#~ msgid "Rebuild & Reboot" 
     300#~ msgstr "Reconstruction et réinitialisation" 
     301 
     302#~ msgid "Reconfigure all" 
     303#~ msgstr "Tout reconfigurer" 
     304 
     305#~ msgid "with" 
     306#~ msgstr "avec" 
     307 
     308#~ msgid "Deleted" 
     309#~ msgstr "Supprimé" 
     310 
     311#~ msgid "Save Template" 
     312#~ msgstr "Sauvegarde du gabarit" 
     313 
     314#~ msgid "Check for Updates" 
     315#~ msgstr "Vérification des mises à jour" 
     316 
     317#~ msgid "Disable" 
     318#~ msgstr "Désactivé" 
     319 
     320#~ msgid "Enable" 
     321#~ msgstr "Activé" 
     322 
     323#~ msgid "Install" 
     324#~ msgstr "Installer" 
     325 
     326#~ msgid "Uninstall" 
     327#~ msgstr "Désinstaller" 
     328 
     329#~ msgid "Update" 
     330#~ msgstr "Mise à jour" 
     331 
     332#~ msgid "Install Firmware" 
     333#~ msgstr "Installation du firmware" 
     334 
     335#~ msgid "Remove Firmware" 
     336#~ msgstr "Retirer le firmware" 
     337 
     338#~ msgid "Update Firmware" 
     339#~ msgstr "Mettre à jour le firmware" 
     340 
     341#~ msgid "Import/Export Devices My Devices List" 
     342#~ msgstr "Importation/Exportation des terminaux Ma liste de terminaux" 
     343 
     344#~ msgid "Update Globals" 
     345#~ msgstr "Mise à jour des paramÚtres généraux" 
     346 
     347#~ msgid "like" 
     348#~ msgstr "comme" 
     349 
     350#~ msgid "Add Custom" 
     351#~ msgstr "Ajout d'une configuration personalisée" 
     352 
     353#~ msgid "Select" 
     354#~ msgstr "Sélectionner" 
     355 
     356#~ msgid "Save As" 
     357#~ msgstr "Enregistrer sous" 
     358 
     359#~ msgid "Export CSV file of devices" 
     360#~ msgstr "Exportation du fichier des terminaux au format CSV" 
     361 
     362#~ msgid "Export CSV" 
     363#~ msgstr "Exportation format CSV" 
     364 
     365#~ msgid "Import CSV file of devices" 
     366#~ msgstr "Importation du fichier des terminaux au format CSV" 
     367 
     368#~ msgid "Note: CSV file should look like this" 
     369#~ msgstr "Remarque : le fichier CSV doit ressembler à " 
     370 
     371#~ msgid "Extension" 
     372#~ msgstr "Extension" 
     373 
     374#~ msgid "Extension can be blank" 
     375#~ msgstr "Une extension ne peut être vide" 
     376 
     377#~ msgid "Show" 
     378#~ msgstr "Montrer" 
     379 
     380#~ msgid "Hide" 
     381#~ msgstr "Cacher" 
     382 
     383# more new 
     384#~ msgid "executable path" 
     385#~ msgstr "répertoire" 
     386 
     387#~ msgid "Search for new devices in netmask" 
     388#~ msgstr "Recherche de nouveaux terminaux dans le masque réseau" 
     389 
     390#~ msgid "Delete Selected phones" 
     391#~ msgstr "Supprime les téléphones sélectionnés" 
     392 
     393#~ msgid "Reboot This Brand" 
     394#~ msgstr "Redémarrer cette marque" 
     395 
     396#~ msgid "Import" 
     397#~ msgstr "Importation" 
     398 
     399#~ msgid "Enable Nightly Phone Module Updates Check" 
     400#~ msgstr "Activer la vérification du module téléphone la nuit" 
     401 
     402#~ msgid "" 
     403#~ "Note: This will show or hide Brands/Products/Models on the Brand " 
     404#~ "Configurations/Setup page ONLY!" 
     405#~ msgstr "" 
     406#~ "Note: ceci montrera ou cachera les Marques/Produits/ModÚles sur la page " 
     407#~ "Configurations/ParamÚtres SEULEMENT" 
     408 
     409#~ msgid "Welcome to Enpoint Manager!" 
     410#~ msgstr "Bienvenue dans Endpoint Manager!" 
     411 
     412#~ msgid "You have no products (Modules) installed, click" 
     413#~ msgstr "Vous n'avez aucun produit (Modules) installé, cliquez" 
     414 
     415#~ msgid "/tftpboot is not writable" 
     416#~ msgstr "Impossible d'écrire sur /tftpboot" 
     417 
     418#~ msgid "Please create /tftpboot, even if you won't use it" 
     419#~ msgstr "Veuillez créer /tftpboot même si vous ne l'utilisez pas" 
     420 
     421#~ msgid "End User Editable (Through ARI Module)" 
     422#~ msgstr "Modifiable par l'utilisateur(En utilisant le module ARI)" 
     423 
     424#~ msgid "Disable .htaccess (Might fix 'Internal Server Errors')" 
     425#~ msgstr "Désactivez .htaccess (Peut corriger 'Erreurs du serveur interne')" 
     426 
     427#~ msgid "The Endpoint Configuration Manager was written by" 
     428#~ msgstr "Endpoint Configuration Manager a été écrit par" 
     429 
     430#~ msgid "The project is maintained at" 
     431#~ msgstr "Le projet est maintenu par" 
     432 
     433#~ msgid "Debug Log" 
     434#~ msgstr "Log Debug" 
     435 
     436#~ msgid "Delete selected phone" 
     437#~ msgstr "Suppression des téléphones sélectionnés" 
     438======= 
    33439msgid "My Devices List" 
    34440msgstr "Ma liste de terminaux" 
  • modules/branches/2.9/endpointman/includes/advanced.inc

    r12366 r12769  
    418418        echo $endpoint->tpl->draw( 'advanced_settings_poce' ); 
    419419        break; 
    420     case "timezone_manager": 
    421         break; 
    422420    case "settings": 
    423421    default: 
     
    480478                $_POST['allow_hdfiles'] = 0; 
    481479            } 
     480             
     481            $sql="UPDATE endpointman_global_vars SET value='" . $_POST['package_server'] . "' WHERE var_name='update_server'"; 
     482            $endpoint->db->query($sql); 
     483             
    482484            $sql="UPDATE endpointman_global_vars SET value='" . $_POST['allow_hdfiles'] . "' WHERE var_name='allow_hdfiles'"; 
    483485            $endpoint->db->query($sql); 
     
    554556            $debug_selected = ""; 
    555557        } 
     558         
     559         
     560        $endpoint->tpl->assign("package_server", $endpoint->global_cfg['update_server']); 
     561 
    556562        $endpoint->tpl->assign("help_selected", $help_selected); 
    557563        $endpoint->tpl->assign("dupext_selected", $dupext_selected); 
  • modules/branches/2.9/endpointman/includes/brand_model_manager.inc

    r11618 r12769  
    77 * @package Provisioner 
    88 */ 
    9  
    109$check_for_updates = FALSE; 
    1110global $type; 
     
    4443  } 
    4544} elseif(isset($_REQUEST['button_check_for_updates'])) { 
     45    //die('hi'); 
    4646  $brand_up = $endpoint->update_check(); 
    4747        $endpoint->tpl->assign("update_check", 1); 
     
    146146} 
    147147 
    148 //draw the template  
     148//draw the template 
     149//echo "test";   
    149150echo $endpoint->tpl->draw( 'brand_model_manager' ); 
  • modules/branches/2.9/endpointman/includes/functions.inc

    r12433 r12769  
    127127 
    128128        $sql = 'SELECT value FROM `admin` WHERE `variable` LIKE CONVERT(_utf8 \'version\' USING latin1) COLLATE latin1_swedish_ci'; 
    129         $this->global_cfg['amp_ver'] = $this->db->getOne($sql); 
    130         $this->tpl->assign("amp_ver", (float)$this->global_cfg['amp_ver']); 
     129        $this->global_cfg['amp_ver'] = (int)substr(preg_replace('/[^0-9]*/i', '', $this->db->getOne($sql)),0,3); 
     130        $this->tpl->assign("amp_ver", $this->global_cfg['amp_ver']); 
    131131 
    132132    } 
     
    13141314 
    13151315                //Timezone 
    1316                 $timezone_array = $this->timezone_array(); 
    1317                 $tz = explode(".", $settings['tz']); 
    1318                 $tz_key = $tz[0]; 
    1319                 $tz_subkey = $tz[1]; 
    1320                 $provisioner_lib->timezone = $timezone_array[$tz_key]['offset']; 
     1316                require('timezone.php'); 
     1317                $provisioner_lib->DateTimeZone = new DateTimeZone($settings['tz']); 
    13211318 
    13221319                //Network Time Server 
     
    14071404                foreach($phone_info['line'] as $line) { 
    14081405                    $provisioner_lib->lines[$line['line']] = array('ext' => $line['ext'], 'secret' => $line['secret'], 'displayname' => $line['description']); 
    1409           /*** 
    1410                     if(isset($line_ops[$line['line']])) { 
    1411                         $provisioner_lib->lines[$line['line']]['options'] = $line_ops[$line['line']]; 
    1412                     } 
    1413           */ 
    14141406                } 
    14151407 
    14161408        //testing this out 
    1417        foreach($line_ops as $key => $data) { 
    1418          if(isset($line_ops[$key])) { 
    1419            $provisioner_lib->lines[$key]['options'] = $line_ops[$key]; 
    1420          
    1421        
    1422  
    1423        if(!$write) { 
    1424          $provisioner_lib->server_type = 'dynamic'; 
    1425          $provisioner_lib->provisioning_type = 'http'; 
    1426          $new_template_data['provisioning_path'] = "provisioning"; 
    1427        
     1409                foreach ($line_ops as $key => $data) { 
     1410                    if (isset($line_ops[$key])) { 
     1411                        $provisioner_lib->lines[$key]['options'] = $line_ops[$key]; 
     1412                   
     1413               
     1414 
     1415                if (!$write) { 
     1416                    $provisioner_lib->server_type = 'dynamic'; 
     1417                    $provisioner_lib->provisioning_type = 'http'; 
     1418                    $new_template_data['provisioning_path'] = $_SERVER["SERVER_ADDR"]."/provisioning/"; 
     1419               
    14281420 
    14291421                //Set Variables according to the template_data files included. We can include different template.xml files within family_data.xml also one can create 
     
    17131705        } 
    17141706        $temp_file = PHONE_MODULES_PATH.'temp/'.$directory.'.xml'; 
    1715         @mkdir(dirname($temp_file)); 
     1707        file_exists(dirname($temp_file)) ? '' : mkdir(dirname($temp_file)); 
     1708                 
    17161709        if($this->download_xml_file($location, $temp_file)) { 
    17171710            $handle = fopen($temp_file, "rb"); 
    17181711            $contents = fread($handle, filesize($temp_file)); 
    17191712            fclose($handle); 
     1713             
    17201714            @$a = simplexml_load_string($contents); 
    17211715            if($a===FALSE) { 
     
    17401734    function update_check() { 
    17411735        $master_result = $this->download_xml(UPDATE_PATH . "master.xml"); 
    1742  
    1743  
     1736         
     1737         
    17441738        if(!$master_result) { 
    17451739            $this->error['brand_update_check_master'] = "Not able to connect to repository. Using local master file instead."; 
    17461740        } 
    1747  
     1741         
    17481742        $temp = $this->xml2array(PHONE_MODULES_PATH.'master.xml'); 
    1749  
    17501743        $endpoint_package = $temp['data']['package']; 
    17511744        $endpoint_last_mod = $temp['data']['last_modified']; 
     
    17531746        $sql = "SELECT value FROM endpointman_global_vars WHERE var_name LIKE 'endpoint_vers'"; 
    17541747        $data = $this->db->getOne($sql); 
    1755  
    1756         $handle = fopen(UPDATE_PATH."/update_status", "rb"); 
    1757         $contents = stream_get_contents($handle); 
    1758         fclose($handle); 
    1759  
     1748         
     1749        $contents = file_get_contents(UPDATE_PATH."/update_status"); 
     1750 
     1751         
    17601752        if($contents != '1') { 
    17611753            if(($data == "") OR ($data <= $endpoint_last_mod)) { 
     
    22032195 
    22042196            if($product_row['cfg_ver'] <= $family_line_xml['data']['version']) { 
    2205                 $key = $this->arraysearchrecursive($model_row['model'], $family_line_xml['data']['model_list'], 'model'); 
    2206  
    2207                 if($key === FALSE) { 
    2208                     $this->error['sync_model'] = "Can't locate model in family XML file"; 
    2209                     return(FALSE); 
     2197                if(array_key_exists('template_data', $family_line_xml['data']['model_list'])) { 
     2198                    if (is_array($family_line_xml['data']['model_list']['template_data']['files'])) { 
     2199                        $template_list = implode(",", $family_line_xml['data']['model_list']['template_data']['files']); 
     2200                        $template_list_array = $family_line_xml['data']['model_list']['template_data']['files']; 
     2201                    } else { 
     2202                        $template_list = $family_line_xml['data']['model_list']['template_data']['files']; 
     2203                        $template_list_array[0] = $family_line_xml['data']['model_list']['template_data']['files']; 
     2204                    } 
     2205                    $maxlines = $family_line_xml['data']['model_list']['lines']; 
    22102206                } else { 
    2211                     if(is_array($family_line_xml['data']['model_list'][$key[0]]['template_data']['files'])) { 
    2212                         $template_list = implode(",",$family_line_xml['data']['model_list'][$key[0]]['template_data']['files']); 
    2213                         $template_list_array = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
     2207                    $key = $this->arraysearchrecursive($model_row['model'], $family_line_xml['data']['model_list'], 'model'); 
     2208                    if($key === FALSE) { 
     2209                        $this->error['sync_model'] = "Can't locate model in family XML file"; 
     2210                        return(FALSE); 
    22142211                    } else { 
    2215                         $template_list = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
    2216                         $template_list_array[0] = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
    2217                     } 
    2218                 } 
    2219  
    2220                 $sql = "UPDATE endpointman_model_list SET max_lines = '".$family_line_xml['data']['model_list'][$key[0]]['lines']."', template_list = '".$template_list."' WHERE id = '".$model."'"; 
     2212                        if(is_array($family_line_xml['data']['model_list'][$key[0]]['template_data']['files'])) { 
     2213                            $template_list = implode(",",$family_line_xml['data']['model_list'][$key[0]]['template_data']['files']); 
     2214                            $template_list_array = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
     2215                        } else { 
     2216                            $template_list = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
     2217                            $template_list_array[0] = $family_line_xml['data']['model_list'][$key[0]]['template_data']['files']; 
     2218                        } 
     2219                    } 
     2220                    $maxlines = $family_line_xml['data']['model_list'][$key[0]]['lines']; 
     2221                } 
     2222 
     2223                $sql = "UPDATE endpointman_model_list SET max_lines = '".$maxlines."', template_list = '".$template_list."' WHERE id = '".$model."'"; 
    22212224                $this->db->query($sql); 
    22222225 
     
    23002303        return false; 
    23012304    } 
    2302  
    2303     /** 
    2304      * cURL function to download files with a progress bar and echo output while downloading to the screen 
    2305      * @global <type> $ch 
    2306      * @global <type> $fout 
    2307      * @global <type> $file_size 
    2308      * @global <type> $downloaded 
    2309      * @global <type> $pkg_interface 
    2310      * @global <type> $progress_bar 
    2311      * @param <type> $url_file 
    2312      * @param <type> $destination_file 
    2313      * @return <type> 
    2314      */ 
     2305     
     2306    function run_in_background($Command, $Priority = 0) { 
     2307        if ($Priority) 
     2308            $PID = shell_exec("nohup nice -n $Priority $Command 2> /dev/null & echo $!"); 
     2309        else 
     2310            $PID = shell_exec("nohup $Command > /dev/null 2> /dev/null & echo $!"); 
     2311        return($PID); 
     2312    } 
     2313 
     2314    function is_process_running($PID) { 
     2315        exec("ps $PID", $ProcessState); 
     2316        return(count($ProcessState) >= 2); 
     2317    } 
     2318 
    23152319    function download_file_with_progress_bar($url_file, $destination_file) { 
    2316         global $ch, $fout, $file_size, $downloaded, $pkg_interface, $progress_bar; 
    23172320        set_time_limit(0); 
    2318         $progress_bar = 1; 
    2319         $file_size  = 1; 
    2320         $downloaded = 1; 
    2321         echo "&nbsp;"; 
    2322         /* open destination file */ 
    2323         $fout = fopen($destination_file, "wb"); 
    2324  
    2325         /* 
    2326      *  Originally by Author: Keyvan Minoukadeh 
    2327      *  Modified by Scott Ullrich to return Content-Length size 
    2328         */ 
    2329  
    2330         $ch = curl_init(); 
    2331         curl_setopt($ch, CURLOPT_URL, $url_file); 
    2332         curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'endpointmanager_read_header'); 
    2333         curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'endpointmanager_read_body'); 
    2334         curl_setopt($ch, CURLOPT_NOPROGRESS, '1'); 
    2335         curl_setopt($ch, CURLOPT_TIMEOUT, 120); 
    2336  
    2337         curl_exec($ch); 
    2338         $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    2339         if($fout) 
    2340             fclose($fout); 
    2341         curl_close($ch); 
    2342         return ($http_code == 200) ? true : $http_code; 
     2321        $headers = get_headers($url_file, 1);  
     2322        $size = $headers['Content-Length'];  
     2323 
     2324        if(preg_match('/200/', $headers[0])) { 
     2325            $pid = $this->run_in_background("wget ". $url_file . " -O " . $destination_file); 
     2326 
     2327            while($this->is_process_running($pid)) {  
     2328 
     2329                $out = 100 * round(filesize($destination_file) / $size,2); 
     2330                echo '<script type="text/javascript">document.getElementById(\'DivExample\').innerHTML="%'.$out.'";</script>'; 
     2331 
     2332                usleep('500'); 
     2333                endpointman_flush_buffers(); 
     2334 
     2335                clearstatcache(); // make sure PHP actually checks dest. file size  
     2336            } 
     2337            return true; 
     2338        } else { 
     2339            return false; 
     2340        } 
    23432341    } 
    23442342 
    23452343    function download_file_no_progress_bar($url_file, $destination_file) { 
    2346         global $ch, $fout, $file_size, $downloaded, $pkg_interface, $progress_bar; 
    2347         set_time_limit(0); 
    2348         $progress_bar = 0; 
    2349         $file_size  = 1; 
    2350         $downloaded = 1; 
    2351         /* open destination file */ 
    2352         $fout = fopen($destination_file, "wb"); 
    2353  
    2354         /* 
    2355      *  Originally by Author: Keyvan Minoukadeh 
    2356      *  Modified by Scott Ullrich to return Content-Length size 
    2357         */ 
    2358  
    2359         $ch = curl_init(); 
    2360         curl_setopt($ch, CURLOPT_URL, $url_file); 
    2361         curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'endpointmanager_read_header'); 
    2362         curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'endpointmanager_read_body'); 
    2363         curl_setopt($ch, CURLOPT_NOPROGRESS, '1'); 
    2364         curl_setopt($ch, CURLOPT_TIMEOUT, 120); 
    2365  
    2366         curl_exec($ch); 
    2367         $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    2368         if($fout) 
    2369             fclose($fout); 
    2370         curl_close($ch); 
    2371         return ($http_code == 200) ? true : $http_code; 
     2344        $contents = file_get_contents($url_file); 
     2345        if(preg_match('/200/', $http_response_header[0])) { 
     2346            file_put_contents($destination_file,$contents); 
     2347            //check file placement 
     2348            if(!file_exists($destination_file)) { 
     2349                return false; 
     2350            } 
     2351            return true; 
     2352        } else { 
     2353            return false; 
     2354        } 
    23722355    } 
    23732356 
    23742357    function download_xml_file($url_file, $destination_file) { 
    2375         global $ch, $fout, $file_size, $downloaded, $pkg_interface, $progress_bar; 
    2376         set_time_limit(0); 
    2377         $progress_bar = 0; 
    2378         $file_size  = 1; 
    2379         $downloaded = 1; 
    2380         /* open destination file */ 
    2381         $fout = fopen($destination_file, "wb"); 
    2382  
    2383         /* 
    2384      *  Originally by Author: Keyvan Minoukadeh 
    2385      *  Modified by Scott Ullrich to return Content-Length size 
    2386         */ 
    2387  
    2388         $ch = curl_init(); 
    2389         curl_setopt($ch, CURLOPT_URL, $url_file); 
    2390         curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'endpointmanager_read_header'); 
    2391         curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'endpointmanager_read_body'); 
    2392         curl_setopt($ch, CURLOPT_NOPROGRESS, '1'); 
    2393         curl_setopt($ch, CURLOPT_TIMEOUT, 20); 
    2394  
    2395         curl_exec($ch); 
    2396         $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    2397         if($fout) 
    2398             fclose($fout); 
    2399         curl_close($ch); 
    2400         return ($http_code == 200) ? true : $http_code; 
     2358        $contents = file_get_contents($url_file); 
     2359        if(preg_match('/200/', $http_response_header[0])) { 
     2360            file_put_contents($destination_file,$contents); 
     2361            //check file placement 
     2362            if(!file_exists($destination_file)) { 
     2363                return false; 
     2364            } 
     2365            return true; 
     2366        } else { 
     2367            return false; 
     2368        } 
    24012369    } 
    24022370 
     
    24642432    /** 
    24652433     * xml2array() will convert the given XML text to an array in the XML structure. 
    2466      * @author http://www.php.net/manual/en/function.xml-parse.php#87920 
    2467      * @param sting $url the XML url (usually a local file) 
    2468      * @param boolean $get_attributes 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value. 
    2469      * @param string $priority Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance. 
    2470      * @return array The parsed XML in an array form. 
    2471      */ 
    2472     function xml2array($url, $get_attributes = 1, $priority = 'tag') { 
     2434     * @author http://www.bin-co.com/php/scripts/xml2array/ 
     2435     * @param <type> $url The XML file 
     2436     * @param <type> $get_attributes 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value. 
     2437     * @param <type> $priority Can be 'tag' or 'attribute'. This will change the way the resulting array structure. For 'tag', the tags are given more importance. 
     2438     * @param <type> $array_tags - any tag names listed here will allways be returned as an array, even if there is only one of them. 
     2439     * @return <type> The parsed XML in an array form. Use print_r() to see the resulting array structure. 
     2440     */ 
     2441    function xml2array($url, $get_attributes = 1, $priority = 'tag', $array_tags=array()) { 
    24732442        $contents = ""; 
    24742443        if (!function_exists('xml_parser_create')) { 
    2475             return array (); 
     2444            return array(); 
    24762445        } 
    24772446        $parser = xml_parser_create(''); 
    2478         if(!($fp = @ fopen($url, 'rb'))) { 
    2479             return array (); 
    2480         } 
    2481         while(!feof($fp)) { 
     2447        if (!($fp = @ fopen($url, 'rb'))) { 
     2448            return array(); 
     2449        } 
     2450        while (!feof($fp)) { 
    24822451            $contents .= fread($fp, 8192); 
    24832452        } 
     
    24882457        xml_parse_into_struct($parser, trim($contents), $xml_values); 
    24892458        xml_parser_free($parser); 
    2490         if(!$xml_values) { 
     2459        if (!$xml_values) { 
    24912460            return; //Hmm... 
    24922461        } 
    2493         $xml_array = array (); 
    2494         $parents = array (); 
    2495         $opened_tags = array (); 
    2496         $arr = array (); 
     2462        $xml_array = array(); 
     2463        $parents = array(); 
     2464        $opened_tags = array(); 
     2465        $arr = array(); 
    24972466        $current = & $xml_array; 
    2498         $repeated_tag_index = array (); 
     2467        $repeated_tag_index = array(); 
    24992468        foreach ($xml_values as $data) { 
    2500             unset ($attributes, $value); 
     2469            unset($attributes, $value); 
    25012470            extract($data); 
    2502             $result = array (); 
    2503             $attributes_data = array (); 
    2504             if (isset ($value)) { 
    2505                 if($priority == 'tag') { 
     2471            $result = array(); 
     2472            $attributes_data = array(); 
     2473            if (isset($value)) { 
     2474                if ($priority == 'tag') { 
    25062475                    $result = $value; 
    2507                 } 
    2508                 else { 
     2476                } else { 
    25092477                    $result['value'] = $value; 
    25102478                } 
    25112479            } 
    2512             if(isset($attributes) and $get_attributes) { 
    2513                 foreach($attributes as $attr => $val) { 
    2514                     if($priority == 'tag') { 
     2480            if (isset($attributes) and $get_attributes) { 
     2481                foreach ($attributes as $attr => $val) { 
     2482                    if ($priority == 'tag') { 
    25152483                        $attributes_data[$attr] = $val; 
    2516                     } 
    2517                     else { 
     2484                    } else { 
    25182485                        $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' 
    25192486                    } 
     
    25212488            } 
    25222489            if ($type == "open") { 
    2523                 $parent[$level -1] = & $current; 
    2524                 if(!is_array($current) or (!in_array($tag, array_keys($current)))) { 
    2525                     $current[$tag] = $result; 
    2526                     if($attributes_data) { 
    2527                         $current[$tag . '_attr'] = $attributes_data; 
    2528                     } 
    2529                     $repeated_tag_index[$tag . '_' . $level] = 1; 
    2530                     $current = & $current[$tag]; 
    2531                 } 
    2532                 else { 
    2533                     if (isset ($current[$tag][0])) { 
     2490                $parent[$level - 1] = & $current; 
     2491    if (!is_array($current) or (!in_array($tag, array_keys($current)))) { 
     2492        if (in_array($tag,$array_tags)) { 
     2493                        $current[$tag][0] = $result; 
     2494                        $repeated_tag_index[$tag . '_' . $level]=1; 
     2495                      $current = & $current[$tag][0]; 
     2496        } else { 
     2497      $current[$tag] = $result; 
     2498      if ($attributes_data) { 
     2499        $current[$tag . '_attr'] = $attributes_data; 
     2500      } 
     2501      $repeated_tag_index[$tag . '_' . $level] = 1; 
     2502      $current = & $current[$tag]; 
     2503       } 
     2504                } else { 
     2505                    if (isset($current[$tag][0])) { 
    25342506                        $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; 
    25352507                        $repeated_tag_index[$tag . '_' . $level]++; 
    2536                     } 
    2537                     else { 
    2538                         $current[$tag] = array($current[$tag],$result); 
     2508                    } else { 
     2509                        $current[$tag] = array($current[$tag], $result); 
    25392510                        $repeated_tag_index[$tag . '_' . $level] = 2; 
    2540                         if(isset($current[$tag . '_attr'])) { 
     2511                        if (isset($current[$tag . '_attr'])) { 
    25412512                            $current[$tag]['0_attr'] = $current[$tag . '_attr']; 
    2542                             unset ($current[$tag . '_attr']); 
     2513                            unset($current[$tag . '_attr']); 
    25432514                        } 
    25442515                    } 
     
    25462517                    $current = & $current[$tag][$last_item_index]; 
    25472518                } 
    2548             } 
    2549             else if($type == "complete") { 
    2550                 if(!isset ($current[$tag])) { 
     2519            } else if ($type == "complete") { 
     2520                if (!isset($current[$tag])) { 
    25512521                    $current[$tag] = $result; 
    25522522                    $repeated_tag_index[$tag . '_' . $level] = 1; 
    2553                     if($priority == 'tag' and $attributes_data) { 
     2523                    if ($priority == 'tag' and $attributes_data) { 
    25542524                        $current[$tag . '_attr'] = $attributes_data; 
    25552525                    } 
    2556                 } 
    2557                 else { 
    2558                     if (isset ($current[$tag][0]) and is_array($current[$tag])) { 
     2526                } else { 
     2527                    if (isset($current[$tag][0]) and is_array($current[$tag])) { 
    25592528                        $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; 
    25602529                        if ($priority == 'tag' and $get_attributes and $attributes_data) { 
     
    25622531                        } 
    25632532                        $repeated_tag_index[$tag . '_' . $level]++; 
    2564                     } 
    2565                     else { 
    2566                         $current[$tag] = array($current[$tag],$result); 
     2533                    } else { 
     2534                        $current[$tag] = array($current[$tag], $result); 
    25672535                        $repeated_tag_index[$tag . '_' . $level] = 1; 
    25682536                        if ($priority == 'tag' and $get_attributes) { 
    2569                             if (isset ($current[$tag . '_attr'])) { 
     2537                            if (isset($current[$tag . '_attr'])) { 
    25702538                                $current[$tag]['0_attr'] = $current[$tag . '_attr']; 
    2571                                 unset ($current[$tag . '_attr']); 
     2539                                unset($current[$tag . '_attr']); 
    25722540                            } 
    25732541                            if ($attributes_data) { 
     
    25782546                    } 
    25792547                } 
    2580             } 
    2581             else if($type == 'close') { 
    2582                 $current = & $parent[$level -1]; 
     2548            } else if ($type == 'close') { 
     2549                $current = & $parent[$level - 1]; 
    25832550            } 
    25842551        } 
     
    29552922         * 
    29562923         */ 
    2957         $data = $this->timezone_array(); 
     2924         
     2925        require('timezone.php');         
     2926        $data = DateTimeZone::listIdentifiers(); 
    29582927        $i = 0; 
    29592928        foreach($data as $key => $row) { 
    2960             foreach($row['info'] as $subkey => $subdata) { 
    2961                 $temp[$i]['value'] = $key.".".$subkey; 
    2962                 $temp[$i]['text'] = $row['gmt'] . " (".$subdata['name'].") [".$subdata['description']."]"; 
    2963                 if ($temp[$i]['value'] == $selected) { 
    2964                     $temp[$i]['selected'] = 1; 
    2965                 }else { 
    2966                     $temp[$i]['selected'] = 0; 
    2967                 } 
    2968                 $i++; 
    2969             } 
     2929            $temp[$i]['value'] = $row; 
     2930            $temp[$i]['text'] = $row; 
     2931            if ($temp[$i]['value'] == $selected) { 
     2932                $temp[$i]['selected'] = 1; 
     2933            }else { 
     2934                $temp[$i]['selected'] = 0; 
     2935            } 
     2936            $i++; 
    29702937        } 
    29712938 
    29722939        return($temp); 
    29732940    } 
    2974  
    2975     function timezone_array() { 
    2976         $sql = "SELECT * FROM endpointman_time_zones_desc, endpointman_time_zones_new WHERE endpointman_time_zones_desc.tid = endpointman_time_zones_new.id"; 
    2977         $tz_list = $this->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 
    2978  
    2979         $tz_list2 = array(); 
    2980         foreach($tz_list as $key => $data) { 
    2981             if(array_key_exists($data['tid'], $tz_list2)) { 
    2982                 $c++; 
    2983                 $tz_list2[$data['tid']]['info'][$c]['name'] = $data['name']; 
    2984                 $tz_list2[$data['tid']]['info'][$c]['description'] = $data['description']; 
    2985             } else { 
    2986                 $c=0; 
    2987                 $tz_list2[$data['tid']]['gmt'] = $data['gmt']; 
    2988                 $tz_list2[$data['tid']]['offset'] = $data['offset']; 
    2989                 $tz_list2[$data['tid']]['info'][$c]['name'] = $data['name']; 
    2990                 $tz_list2[$data['tid']]['info'][$c]['description'] = $data['description']; 
    2991             } 
    2992         } 
    2993         return($tz_list2); 
    2994     } 
    2995  
    29962941} 
    29972942 
     
    30022947    ob_start(); 
    30032948} 
    3004  
    3005 function endpointman_update_progress_bar($out) { 
    3006     echo '<script type="text/javascript">document.getElementById(\'DivExample\').innerHTML="%'.$out.'";</script>'; 
    3007 } 
    3008  
    3009 function endpointmanager_read_header($ch, $string) { 
    3010     global $file_size, $fout; 
    3011     $length = strlen($string); 
    3012     $regs = ""; 
    3013     preg_match("/(Content-Length:) (.*)/i", $string, $regs); 
    3014     if((isset($regs[2])) AND ($regs[2] <> "")) { 
    3015         $file_size = intval($regs[2]); 
    3016     } 
    3017     //ob_flush(); 
    3018     endpointman_flush_buffers(); 
    3019     return $length; 
    3020 } 
    3021  
    3022 function endpointmanager_read_body($ch, $string) { 
    3023     global $fout, $file_size, $downloaded, $lastseen, $progress_bar; 
    3024     $length = strlen($string); 
    3025     $downloaded += intval($length); 
    3026     $downloadProgress = round(100 * (1 - $downloaded / $file_size), 0); 
    3027     $downloadProgress = 100 - $downloadProgress; 
    3028     if($lastseen <> $downloadProgress and $downloadProgress < 101) { 
    3029         if($progress_bar) { 
    3030             endpointman_update_progress_bar($downloadProgress); 
    3031         } 
    3032         $lastseen = $downloadProgress; 
    3033     } 
    3034     if($fout) 
    3035         fwrite($fout, $string); 
    3036     //ob_flush(); 
    3037     endpointman_flush_buffers(); 
    3038     return $length; 
    3039 } 
  • modules/branches/2.9/endpointman/includes/rain.tpl.class.php

    r10792 r12769  
    141141   
    142142  function draw( $tpl_name, $return_string = false ){ 
    143  
    144143    if( count( $a = explode('/', $tpl_name) ) > 1 ){ 
    145144      $temp = $tpl_name; 
     
    182181      $contents = ob_get_contents(); 
    183182      ob_end_clean(); 
    184       return $contents;     
     183      return $contents; 
    185184    } 
    186185    else 
     
    188187     
    189188  } 
    190  
    191189} 
    192  
    193  
    194  
    195 ?> 
  • modules/branches/2.9/endpointman/install.php

    r12427 r12769  
    9898$sql = 'SELECT `version` FROM `modules` WHERE `modulename` = CONVERT(_utf8 \'endpointman\' USING latin1) COLLATE latin1_swedish_ci'; 
    9999 
    100 $db_version = $db->getOne($sql); 
    101  
    102 if($db_version) { 
     100$full_vers = $db->getOne($sql); 
     101 
     102$db_version = (float)preg_replace('/[^0-9]*/i', '', $full_vers); 
     103 
     104if($db->getOne($sql)) { 
    103105    $global_cfg =& $db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); 
    104106    $global_cfg['version'] = $db_version; 
     
    117119    out('New Installation Detected!'); 
    118120} else { 
    119     out('Version Identified as '. $ver); 
     121    out('Version Identified as '. $full_vers); 
    120122} 
    121123if(!$new_install) { 
    122124 
    123     if(($ver < "1.9.0") AND ($ver > 0)) { 
     125    if(($ver < "190") AND ($ver > 0)) { 
    124126        out("Please Wait While we upgrade your old setup"); 
    125127        //Expand the value option 
     
    296298    } 
    297299 
    298     if ($ver <= "1.9.0") { 
     300    if ($ver <= "190") { 
    299301        out("Locating NMAP + ARP + ASTERISK Executables"); 
    300302 
     
    366368        $db->query($sql); 
    367369    } 
    368     if ($ver <= "1.9.1") { 
     370    if ($ver <= "191") { 
    369371        out("Create Custom Configs Table"); 
    370372        $sql = "CREATE TABLE IF NOT EXISTS `endpointman_custom_configs` ( 
     
    421423        $db->query($sql); 
    422424    } 
    423     if ($ver <= "1.9.2") { 
     425    if ($ver <= "192") { 
    424426        out('Updating Global Variables'); 
    425427    } 
    426428 
    427     if ($ver <= "1.9.9") { 
     429    if ($ver <= "199") { 
    428430        out("Adding Custom Field to OUI List"); 
    429431        $sql = 'ALTER TABLE `endpointman_oui_list` ADD `custom` INT(1) NOT NULL DEFAULT \'0\''; 
     
    469471        $db->query($sql); 
    470472    } 
    471     if($ver <= "2.0.0") { 
     473    if($ver <= "200") { 
    472474        out("Locating NMAP + ARP + ASTERISK Executables"); 
    473475        $nmap = find_exec("nmap"); 
     
    659661        } 
    660662    } 
    661     if ($ver <= "2.2.1") { 
    662     } 
    663  
    664     if ($ver <= "2.2.2") { 
     663    if ($ver <= "221") { 
     664    } 
     665 
     666    if ($ver <= "222") { 
    665667 
    666668        out("Remove all Dashes in IDs"); 
     
    706708        } 
    707709    } 
    708     if ($ver <= "2.2.3") { 
     710    if ($ver <= "223") { 
    709711        $sql = "UPDATE endpointman_global_vars SET value = 'http://www.provisioner.net/release/' WHERE var_name = 'update_server'"; 
    710712        $db->query($sql); 
    711713    } 
    712714 
    713     if ($ver <= "2.2.4") { 
    714  
    715     } 
    716  
    717     if ($ver <= "2.2.5") { 
     715    if ($ver <= "224") { 
     716 
     717    } 
     718 
     719    if ($ver <= "225") { 
    718720        out("Fixing Permissions of Phone Modules Directory"); 
    719721        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PHONE_MODULES_PATH), RecursiveIteratorIterator::SELF_FIRST); 
     
    727729    } 
    728730 
    729     if ($ver <= "2.2.6") { 
     731    if ($ver <= "226") { 
    730732        $sql = "CREATE TABLE IF NOT EXISTS `endpointman_line_list` ( 
    731733              `luid` int(11) NOT NULL AUTO_INCREMENT, 
     
    779781    } 
    780782 
    781     if ($ver <= "2.2.7") { 
    782  
    783     } 
    784  
    785     if ($ver <= "2.2.8") { 
     783    if ($ver <= "227") { 
     784 
     785    } 
     786 
     787    if ($ver <= "228") { 
    786788        out("Fix Debug Left on Error, this turns off debug."); 
    787789        $sql = "UPDATE endpointman_global_vars SET value = '0' WHERE var_name = 'debug'"; 
     
    792794    } 
    793795 
    794     if ($ver <= "2.4.0") { 
     796    if ($ver <= "240") { 
    795797        out("Uninstalling All Installed Brands (You'll just simply have to update again, no loss of data)"); 
    796798        $db->query("UPDATE endpointman_brand_list SET  installed =  '0'"); 
     
    819821    } 
    820822 
    821     if ($ver <= "2.9.0.2") { 
     823    if ($ver <= "2902") { 
    822824        $sql = 'INSERT INTO `endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, \'disable_help\', \'0\');'; 
    823825        $db->query($sql); 
    824826    } 
    825827 
    826     if($ver <= "2.9.0.3") { 
     828    if($ver <= "2903") { 
    827829        $sql = 'ALTER TABLE  `endpointman_custom_configs` CHANGE  `data`  `data` LONGBLOB NOT NULL'; 
    828830        $db->query($sql); 
    829831    } 
    830832 
    831     if($ver <= "2.9.0.4") { 
     833    if($ver <= "2904") { 
    832834        out("Adding 'local' column to brand_list"); 
    833835        $sql = 'ALTER TABLE  `endpointman_brand_list` ADD  `local` INT( 1 ) NOT NULL DEFAULT  \'0\' AFTER  `cfg_ver`'; 
     
    835837    } 
    836838 
    837     if($ver <= "2.9.0.7") { 
     839    if($ver <= "2907") { 
    838840        out("Adding UNIQUE key to table global_vars for var_name"); 
    839841        $sql = "ALTER TABLE `endpointman_global_vars` ADD UNIQUE `unique` (`var_name`)"; 
     
    845847    } 
    846848 
    847     if($ver <= "2.9.0.9") { 
     849    if($ver <= "2909") { 
    848850        out("Successfully  Migrated to the new Installer!"); 
    849851        $sql = "UPDATE endpointman_global_vars SET value = 'http://mirror.freepbx.org/provisioner/' WHERE var_name ='update_server'"; 
     
    852854    } 
    853855 
    854     if($ver <= "2.9.1.0") { 
     856    if($ver <= "2910") { 
    855857        out("Fix again to the 'Allow Duplicate Extensions' Error"); 
    856858        $sql = 'ALTER TABLE `endpointman_global_vars` ADD UNIQUE `var_name` (`var_name`)'; 
     
    860862    } 
    861863 
    862     if($ver <= "2.9.2.0") { 
     864    if ($ver <= "2920") { 
    863865        out("Adding new Network Time Protocol Setting"); 
    864         $sql = "INSERT INTO `endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, 'ntp', '".$_SERVER["SERVER_ADDR"]."')"; 
     866        $sql = "INSERT INTO `endpointman_global_vars` (`idnum`, `var_name`, `value`) VALUES (NULL, 'ntp', '" . $_SERVER["SERVER_ADDR"] . "')"; 
    865867        $db->query($sql); 
    866868        out("Upgrading all timezone data to new improved simplified system"); 
     
    956958 
    957959        out('Creating symlink to web provisioner'); 
    958         if(!symlink(LOCAL_PATH."provisioning",$amp_conf['AMPWEBROOT']."/provisioning")) { 
    959             out("<strong>Your permissions are wrong on ".$amp_conf['AMPWEBROOT'].", web provisioning link not created!</strong>"); 
     960        if (!symlink(LOCAL_PATH . "provisioning", $amp_conf['AMPWEBROOT'] . "/provisioning")) { 
     961            out("<strong>Your permissions are wrong on " . $amp_conf['AMPWEBROOT'] . ", web provisioning link not created!</strong>"); 
    960962        } 
    961963 
     
    963965        $old_tz_gmt = $db->getOne($sql); 
    964966 
    965         $sql = "SELECT id FROM `endpointman_time_zones_new` WHERE `gmt` LIKE '".$old_tz_gmt."'"; 
     967        $sql = "SELECT id FROM `endpointman_time_zones_new` WHERE `gmt` LIKE '" . $old_tz_gmt . "'"; 
    966968        $new_tz_id = $db->getOne($sql); 
    967969 
    968         $sql = "UPDATE endpointman_global_vars SET value = '".$new_tz_id.".0' WHERE var_name = 'tz'"; 
     970        $sql = "UPDATE endpointman_global_vars SET value = '" . $new_tz_id . ".0' WHERE var_name = 'tz'"; 
    969971        $db->query($sql); 
    970972 
     
    972974        $db->query($sql); 
    973975 
    974   $sql = 'ALTER TABLE `endpointman_mac_list` ADD `specific_settings` LONGBLOB NULL;'; 
    975   $db->query($sql); 
     976        $sql = 'ALTER TABLE `endpointman_mac_list` ADD `specific_settings` LONGBLOB NULL;'; 
     977        $db->query($sql); 
     978    } 
     979     
     980    if ($ver <= "21002") { 
     981        out('Updating Mirror Location...again'); 
     982        $sql = "UPDATE endpointman_global_vars SET value = 'http://mirror.freepbx.org/provisioner/v2.5/' WHERE var_name ='update_server'"; 
     983        $db->query($sql); 
    976984    } 
    977985 
     
    10301038            (4, 'gmthr', ''), 
    10311039            (5, 'config_location', '/tftpboot/'), 
    1032             (6, 'update_server', 'http://mirror.freepbx.org/provisioner/'), 
     1040            (6, 'update_server', 'http://mirror.freepbx.org/provisioner/v2.5/'), 
    10331041            (7, 'version', '".$version."'), 
    10341042            (8, 'enable_ari', '0'), 
     
    12221230$db->query($sql); 
    12231231 
    1224 $sql = "UPDATE endpointman_global_vars SET value = 'http://mirror.freepbx.org/provisioner/' WHERE var_name = 'update_server'"; 
     1232$sql = "UPDATE endpointman_global_vars SET value = 'http://mirror.freepbx.org/provisioner/v2.5/' WHERE var_name = 'update_server'"; 
    12251233$db->query($sql); 
    12261234 
  • modules/branches/2.9/endpointman/module.xml

    r12430 r12769  
    33  <repo>standard</repo> 
    44  <name>PBX End Point Manager</name> 
    5   <version>2.9.2.4</version> 
     5  <version>2.9.2.9</version> 
    66  <type>tool</type> 
    77  <category>End Point Manager</category> 
  • modules/branches/2.9/endpointman/provisioning/index.php

    r12313 r12769  
    33require('/etc/freepbx.conf'); 
    44require('/var/www/html/admin/modules/endpointman/includes/functions.inc'); 
     5require('/var/www/html/admin/modules/endpointman/includes/timezone.php'); 
     6define("PHONE_MODULES_DIR", "/var/www/html/admin/modules/_ep_phone_modules/"); 
     7require(PHONE_MODULES_DIR . 'endpoint/base.php'); 
    58 
    69$endpoint = new endpointmanager(); 
    710 
    8 if((!isset($endpoint->global_cfg['server_type'])) OR ($endpoint->global_cfg['server_type'] != 'http')) { 
     11if ((!isset($endpoint->global_cfg['server_type'])) OR ($endpoint->global_cfg['server_type'] != 'http')) { 
    912    header('HTTP/1.1 403 Forbidden'); 
    1013    die(); 
    1114} 
    1215 
    13 if((isset($_SERVER["PATH_INFO"])) && ($_SERVER["PATH_INFO"] != '/') && (!empty($_SERVER["PATH_INFO"]))) { 
    14  $requested_file = substr($_SERVER["PATH_INFO"], 1); 
    15 } elseif(isset($_REQUEST['request'])) { 
    16  $requested_file = $_REQUEST['request']; 
     16if ((isset($_SERVER["PATH_INFO"])) && ($_SERVER["PATH_INFO"] != '/') && (!empty($_SERVER["PATH_INFO"]))) { 
     17    $requested_file = substr($_SERVER["PATH_INFO"], 1); 
     18} elseif (isset($_REQUEST['request'])) { 
     19    $requested_file = $_REQUEST['request']; 
    1720} 
    1821 
     
    2326 
    2427 
    25  
    26 define("PHONE_MODULES_DIR", "/var/www/html/admin/modules/_ep_phone_modules/"); 
    27  
    28 require(PHONE_MODULES_DIR."servers/http_server.php"); 
    29  
    30 $http_provisioner = new provisioner_http(); 
    31  
    32 $http_provisioner->get($requested_file); 
    33 $http_provisioner->provisioner_path = PHONE_MODULES_DIR; 
    34  
    35 if(isset($http_provisioner->mac_address)) { 
    36   $sql = 'SELECT id FROM `endpointman_mac_list` WHERE `mac` LIKE CONVERT(_utf8 \'%'.$http_provisioner->mac_address.'%\' USING latin1) COLLATE latin1_swedish_ci'; 
    37  
    38   $mac_id = $endpoint->db->getOne($sql); 
    39   $phone_info = $endpoint->get_phone_info($mac_id); 
    40  
    41         if($http_provisioner->load_provisioner($phone_info['directory'],$phone_info['cfg_dir'])) { 
    42             //Determine if global settings have been overridden 
    43             $settings = ''; 
    44             if($phone_info['template_id'] > 0) { 
    45                 if(isset($phone_info['template_data_info']['global_settings_override'])) { 
    46                     $settings = unserialize($phone_info['template_data_info']['global_settings_override']); 
    47                 } else { 
    48                     $settings['srvip'] = $endpoint->global_cfg['srvip']; 
    49                     $settings['ntp'] = $endpoint->global_cfg['ntp']; 
    50                     $settings['config_location'] = $endpoint->global_cfg['config_location']; 
    51                     $settings['tz'] = $endpoint->global_cfg['tz']; 
    52                 } 
    53             } else { 
    54                 if(isset($phone_info['global_settings_override'])) { 
    55                     $settings = unserialize($phone_info['global_settings_override']); 
    56                 } else { 
    57                     $settings['srvip'] = $endpoint->global_cfg['srvip']; 
    58                     $settings['ntp'] = $endpoint->global_cfg['ntp']; 
    59                     $settings['config_location'] = $endpoint->global_cfg['config_location']; 
    60                     $settings['tz'] = $endpoint->global_cfg['tz']; 
     28$webpath = 'http://'.$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/"; 
     29 
     30$tmp_requested_file = str_replace('spa', '', $requested_file); 
     31 
     32if (preg_match('/[0-9a-f]{12}/i', $tmp_requested_file, $matches)) { 
     33    if (preg_match('/0000000/', $requested_file)) { 
     34        $data = Provisioner_Globals::dynamic_global_files($requested_file,$webpath); 
     35        if ($data === FALSE) { 
     36            header("HTTP/1.0 404 Not Found"); 
     37        } else { 
     38            echo $data; 
     39        } 
     40    } else { 
     41        $mac_address = $matches[0]; 
     42    } 
     43} else { 
     44    $data = Provisioner_Globals::dynamic_global_files($requested_file,$webpath); 
     45    if ($data === FALSE) { 
     46        header("HTTP/1.0 404 Not Found"); 
     47    } else { 
     48        echo $data; 
     49    } 
     50
     51 
     52 
     53if (isset($mac_address)) { 
     54    $sql = 'SELECT id FROM `endpointman_mac_list` WHERE `mac` LIKE CONVERT(_utf8 \'%' . $mac_address . '%\' USING latin1) COLLATE latin1_swedish_ci'; 
     55 
     56    $mac_id = $endpoint->db->getOne($sql); 
     57    $phone_info = $endpoint->get_phone_info($mac_id); 
     58 
     59    if (file_exists(PHONE_MODULES_DIR . 'setup.php')) { 
     60        if (!class_exists('ProvisionerConfig')) { 
     61            require(PHONE_MODULES_DIR . 'setup.php'); 
     62        } 
     63 
     64 
     65        //Load Provisioner 
     66        $class = "endpoint_" . $phone_info['directory'] . "_" . $phone_info['cfg_dir'] . '_phone'; 
     67        $base_class = "endpoint_" . $phone_info['directory'] . '_base'; 
     68        $master_class = "endpoint_base"; 
     69 
     70        if (!class_exists($master_class)) { 
     71            ProvisionerConfig::endpointsAutoload($master_class); 
     72        } 
     73        if (!class_exists($base_class)) { 
     74            ProvisionerConfig::endpointsAutoload($base_class); 
     75        } 
     76        if (!class_exists($class)) { 
     77            ProvisionerConfig::endpointsAutoload($class); 
     78        } 
     79        //end quick fix 
     80 
     81 
     82 
     83        if (class_exists($class)) { 
     84            $provisioner_libary = new $class(); 
     85        } else { 
     86            header("HTTP/1.0 500 Internal Server Error"); 
     87            die(); 
     88        } 
     89    } else { 
     90        header("HTTP/1.0 500 Internal Server Error"); 
     91        die(); 
     92    } 
     93 
     94 
     95    //Determine if global settings have been overridden 
     96    $settings = ''; 
     97    if ($phone_info['template_id'] > 0) { 
     98        if (isset($phone_info['template_data_info']['global_settings_override'])) { 
     99            $settings = unserialize($phone_info['template_data_info']['global_settings_override']); 
     100        } else { 
     101            $settings['srvip'] = $endpoint->global_cfg['srvip']; 
     102            $settings['ntp'] = $endpoint->global_cfg['ntp']; 
     103            $settings['config_location'] = $endpoint->global_cfg['config_location']; 
     104            $settings['tz'] = $endpoint->global_cfg['tz']; 
     105        } 
     106    } else { 
     107        if (isset($phone_info['global_settings_override'])) { 
     108            $settings = unserialize($phone_info['global_settings_override']); 
     109        } else { 
     110            $settings['srvip'] = $endpoint->global_cfg['srvip']; 
     111            $settings['ntp'] = $endpoint->global_cfg['ntp']; 
     112            $settings['config_location'] = $endpoint->global_cfg['config_location']; 
     113            $settings['tz'] = $endpoint->global_cfg['tz']; 
     114        } 
     115    } 
     116 
     117    //Tell the system who we are and were to find the data. 
     118    $provisioner_libary->root_dir = PHONE_MODULES_PATH; 
     119    $provisioner_libary->engine = 'asterisk'; 
     120    $provisioner_libary->engine_location = $endpoint->global_cfg['asterisk_location']; 
     121    $provisioner_libary->system = 'unix'; 
     122 
     123    //have to because of versions less than php5.3 
     124    $provisioner_libary->brand_name = $phone_info['directory']; 
     125    $provisioner_libary->family_line = $phone_info['cfg_dir']; 
     126 
     127    //Mac Address 
     128    $provisioner_libary->mac = $phone_info['mac']; 
     129 
     130    //Phone Model (Please reference family_data.xml in the family directory for a list of recognized models) 
     131    //This has to match word for word. I really need to fix this.... 
     132    $provisioner_libary->model = $phone_info['model']; 
     133 
     134    //Timezone 
     135    $http_provisioner->DateTimeZone = new DateTimeZone($settings['tz']); 
     136 
     137 
     138    //Network Time Server 
     139    $provisioner_libary->ntp = $settings['ntp']; 
     140 
     141    //Server IP 
     142    $provisioner_libary->server[1]['ip'] = $settings['srvip']; 
     143    $provisioner_libary->server[1]['port'] = 5060; 
     144 
     145    $temp = ""; 
     146    $template_data = unserialize($phone_info['template_data']); 
     147    $global_user_cfg_data = unserialize($phone_info['global_user_cfg_data']); 
     148    if ($phone_info['template_id'] > 0) { 
     149        $global_custom_cfg_data = unserialize($phone_info['template_data_info']['global_custom_cfg_data']); 
     150        //Provide alternate Configuration file instead of the one from the hard drive 
     151        if (!empty($phone_info['template_data_info']['config_files_override'])) { 
     152            $temp = unserialize($phone_info['template_data_info']['config_files_override']); 
     153            foreach ($temp as $list) { 
     154                $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = " . $list; 
     155                $res = $endpoint->db->query($sql); 
     156                if ($res->numRows()) { 
     157                    $data = $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
     158                    $provisioner_libary->config_files_override[$data['original_name']] = $data['data']; 
    61159                } 
    62160            } 
    63  
    64             //Tell the system who we are and were to find the data. 
    65             $http_provisioner->provisioner_libary->root_dir = PHONE_MODULES_PATH; 
    66             $http_provisioner->provisioner_libary->engine = 'asterisk'; 
    67             $http_provisioner->provisioner_libary->engine_location = $endpoint->global_cfg['asterisk_location']; 
    68             $http_provisioner->provisioner_libary->system = 'unix'; 
    69  
    70             //have to because of versions less than php5.3 
    71             $http_provisioner->provisioner_libary->brand_name = $phone_info['directory']; 
    72             $http_provisioner->provisioner_libary->family_line = $phone_info['cfg_dir']; 
    73  
    74             //Mac Address 
    75             $http_provisioner->provisioner_libary->mac = $phone_info['mac']; 
    76  
    77             //Phone Model (Please reference family_data.xml in the family directory for a list of recognized models) 
    78             //This has to match word for word. I really need to fix this.... 
    79             $http_provisioner->provisioner_libary->model = $phone_info['model']; 
    80  
    81             //Timezone 
    82             $timezone_array = $endpoint->timezone_array(); 
    83             $tz = explode(".", $settings['tz']); 
    84             $tz_key = $tz[0]; 
    85             $tz_subkey = $tz[1]; 
    86             $http_provisioner->provisioner_libary->timezone = $timezone_array[$tz_key]['offset']; 
    87  
    88             //Network Time Server 
    89             $http_provisioner->provisioner_libary->ntp = $settings['ntp']; 
    90  
    91             //Server IP 
    92             $http_provisioner->provisioner_libary->server[1]['ip'] = $settings['srvip']; 
    93             $http_provisioner->provisioner_libary->server[1]['port'] = 5060; 
    94  
    95             $temp = ""; 
    96             $template_data = unserialize($phone_info['template_data']); 
    97             $global_user_cfg_data = unserialize($phone_info['global_user_cfg_data']); 
    98             if($phone_info['template_id'] > 0) { 
    99                 $global_custom_cfg_data = unserialize($phone_info['template_data_info']['global_custom_cfg_data']); 
    100                 //Provide alternate Configuration file instead of the one from the hard drive 
    101                 if(!empty($phone_info['template_data_info']['config_files_override'])) { 
    102                     $temp = unserialize($phone_info['template_data_info']['config_files_override']); 
    103                     foreach($temp as $list) { 
    104                         $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = ".$list; 
    105                         $res = $endpoint->db->query($sql); 
    106                         if($res->numRows()) { 
    107                             $data = $endpoint->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); 
    108                             $http_provisioner->provisioner_libary->config_files_override[$data['original_name']] = $data['data']; 
    109                         } 
    110                     } 
    111                 } 
    112             } else { 
    113                 $global_custom_cfg_data = unserialize($phone_info['global_custom_cfg_data']); 
    114                 //Provide alternate Configuration file instead of the one from the hard drive 
    115                 if(!empty($phone_info['config_files_override'])) { 
    116                     $temp = unserialize($phone_info['config_files_override']); 
    117                     foreach($temp as $list) { 
    118                         $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = ".$list; 
    119                         $res = $endpoint->db->query($sql); 
    120                         if($res->numRows()) { 
    121                             $data = $endpoint->db->getRow($sql, array(),DB_FETCHMODE_ASSOC); 
    122                             $http_provisioner->provisioner_libary->config_files_override[$data['original_name']] = $data['data']; 
    123                         } 
    124                     } 
     161        } 
     162    } else { 
     163        $global_custom_cfg_data = unserialize($phone_info['global_custom_cfg_data']); 
     164        //Provide alternate Configuration file instead of the one from the hard drive 
     165        if (!empty($phone_info['config_files_override'])) { 
     166            $temp = unserialize($phone_info['config_files_override']); 
     167            foreach ($temp as $list) { 
     168                $sql = "SELECT original_name,data FROM endpointman_custom_configs WHERE id = " . $list; 
     169                $res = $endpoint->db->query($sql); 
     170                if ($res->numRows()) { 
     171                    $data = $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 
     172                    $provisioner_libary->config_files_override[$data['original_name']] = $data['data']; 
    125173                } 
    126174            } 
    127  
    128             if (!empty($global_custom_cfg_data)) { 
    129                 if(array_key_exists('data', $global_custom_cfg_data)) { 
    130                     $global_custom_cfg_ari = $global_custom_cfg_data['ari']; 
    131                     $global_custom_cfg_data = $global_custom_cfg_data['data']; 
    132                 } else { 
    133                     $global_custom_cfg_data = array(); 
    134                     $global_custom_cfg_ari = array(); 
    135                 } 
     175        } 
     176    } 
     177 
     178    if (!empty($global_custom_cfg_data)) { 
     179        if (array_key_exists('data', $global_custom_cfg_data)) { 
     180            $global_custom_cfg_ari = $global_custom_cfg_data['ari']; 
     181            $global_custom_cfg_data = $global_custom_cfg_data['data']; 
     182        } else { 
     183            $global_custom_cfg_data = array(); 
     184            $global_custom_cfg_ari = array(); 
     185        } 
     186    } 
     187 
     188    $new_template_data = array(); 
     189    $line_ops = array(); 
     190    if (is_array($global_custom_cfg_data)) { 
     191        foreach ($global_custom_cfg_data as $key => $data) { 
     192            $full_key = $key; 
     193            $key = explode('|', $key); 
     194            $count = count($key); 
     195            switch ($count) { 
     196                case 1: 
     197                    if (($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
     198                        $new_template_data[$full_key] = $global_user_cfg_data[$full_key]; 
     199                    } else { 
     200                        $new_template_data[$full_key] = $global_custom_cfg_data[$full_key]; 
     201                    } 
     202                    break; 
     203                case 2: 
     204                    $breaks = explode('_', $key[1]); 
     205                    if (($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
     206                        $new_template_data[$breaks[0]][$breaks[2]][$breaks[1]] = $global_user_cfg_data[$full_key]; 
     207                    } else { 
     208                        $new_template_data[$breaks[0]][$breaks[2]][$breaks[1]] = $global_custom_cfg_data[$full_key]; 
     209                    } 
     210                    break; 
     211                case 3: 
     212                    if (($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
     213                        $line_ops[$key[1]][$key[2]] = $global_user_cfg_data[$full_key]; 
     214                    } else { 
     215                        $line_ops[$key[1]][$key[2]] = $global_custom_cfg_data[$full_key]; 
     216                    } 
     217                    break; 
    136218            } 
    137  
    138             $new_template_data = array(); 
    139             $line_ops = array(); 
    140             if(is_array($global_custom_cfg_data)) { 
    141                 foreach($global_custom_cfg_data as $key => $data) { 
    142                     $full_key = $key; 
    143                     $key = explode('|',$key); 
    144                     $count = count($key); 
    145                     switch($count) { 
    146                         case 1: 
    147                             if(($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
    148                                 $new_template_data[$full_key] = $global_user_cfg_data[$full_key]; 
    149                             } else { 
    150                                 $new_template_data[$full_key] = $global_custom_cfg_data[$full_key]; 
    151                             } 
    152                             break; 
    153                         case 2: 
    154                             $breaks = explode('_',$key[1]); 
    155                             if(($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
    156                                 $new_template_data[$breaks[0]][$breaks[2]][$breaks[1]] = $global_user_cfg_data[$full_key]; 
    157                             } else { 
    158                                 $new_template_data[$breaks[0]][$breaks[2]][$breaks[1]] = $global_custom_cfg_data[$full_key]; 
    159                             } 
    160                             break; 
    161                         case 3: 
    162                             if(($endpoint->global_cfg['enable_ari'] == 1) AND (isset($global_custom_cfg_ari[$full_key])) AND (isset($global_user_cfg_data[$full_key]))) { 
    163                                 $line_ops[$key[1]][$key[2]] = $global_user_cfg_data[$full_key]; 
    164                             } else { 
    165                                 $line_ops[$key[1]][$key[2]] = $global_custom_cfg_data[$full_key]; 
    166                             } 
    167                             break; 
    168                     } 
    169                 } 
    170             } 
    171  
    172             //Loop through Lines! 
    173             foreach($phone_info['line'] as $line) { 
    174                 $http_provisioner->provisioner_libary->lines[$line['line']] = array('ext' => $line['ext'], 'secret' => $line['secret'], 'displayname' => $line['description']); 
    175             } 
    176  
    177             //testing this out 
    178             foreach($line_ops as $key => $data) { 
    179                 if(isset($line_ops[$key])) { 
    180                     $http_provisioner->provisioner_libary->lines[$key]['options'] = $line_ops[$key]; 
    181                 } 
    182             } 
    183  
    184             $http_provisioner->provisioner_libary->server_type = 'dynamic'; 
    185             $http_provisioner->provisioner_libary->provisioning_type = 'http'; 
    186             $new_template_data['provisioning_path'] = "provisioning"; 
    187  
    188             //Set Variables according to the template_data files included. We can include different template.xml files within family_data.xml also one can create 
    189             //template_data_custom.xml which will get included or template_data_<model_name>_custom.xml which will also get included 
    190             //line 'global' will set variables that aren't line dependant 
    191             $http_provisioner->provisioner_libary->options = $new_template_data; 
    192  
    193             //Setting a line variable here...these aren't defined in the template_data.xml file yet. however they will still be parsed 
    194             //and if they have defaults assigned in a future template_data.xml or in the config file using pipes (|) those will be used, pipes take precedence 
    195             $http_provisioner->provisioner_libary->processor_info = "EndPoint Manager Version ".$endpoint->global_cfg['version']; 
    196  
    197             if(!$http_provisioner->generate_config_data($requested_file)) { 
    198                 header("HTTP/1.0 404 Not Found"); 
    199             } 
    200         } 
    201 
    202  
    203 if(isset($http_provisioner->final_data)) { 
    204   echo $http_provisioner->final_data; 
    205 } else { 
    206     if(file_exists($endpoint->global_cfg['config_location'].$requested_file)) { 
    207         $handle = fopen($endpoint->global_cfg['config_location'].$requested_file, "rb"); 
    208         echo stream_get_contents($handle); 
    209         fclose($handle); 
     219        } 
     220    } 
     221 
     222    //Loop through Lines! 
     223    foreach ($phone_info['line'] as $line) { 
     224        $provisioner_libary->lines[$line['line']] = array('ext' => $line['ext'], 'secret' => $line['secret'], 'displayname' => $line['description']); 
     225    } 
     226 
     227    //testing this out 
     228    foreach ($line_ops as $key => $data) { 
     229        if (isset($line_ops[$key])) { 
     230            $provisioner_libary->lines[$key]['options'] = $line_ops[$key]; 
     231        } 
     232    } 
     233 
     234    $provisioner_libary->server_type = 'dynamic'; 
     235    $provisioner_libary->provisioning_type = 'http'; 
     236    $new_template_data['provisioning_path'] = "provisioning"; 
     237 
     238    //Set Variables according to the template_data files included. We can include different template.xml files within family_data.xml also one can create 
     239    //template_data_custom.xml which will get included or template_data_<model_name>_custom.xml which will also get included 
     240    //line 'global' will set variables that aren't line dependant 
     241    $provisioner_libary->options = $new_template_data; 
     242 
     243    //Setting a line variable here...these aren't defined in the template_data.xml file yet. however they will still be parsed 
     244    //and if they have defaults assigned in a future template_data.xml or in the config file using pipes (|) those will be used, pipes take precedence 
     245    $provisioner_libary->processor_info = "EndPoint Manager Version " . $endpoint->global_cfg['version']; 
     246     
     247    $files = $provisioner_libary->generate_config(); 
     248     
     249    if(array_key_exists($requested_file, $files)) { 
     250        echo $files[$requested_file]; 
    210251    } else { 
    211252        header("HTTP/1.0 404 Not Found"); 
    212     } 
    213 
     253        die(); 
     254    } 
     255
  • modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_settings.html

    r12430 r12769  
    6969</tr> 
    7070<tr> 
     71  <td align='right'>Package Server:</td> 
     72  <td align='left'><label> 
     73    <input type="text" name="package_server" value="{$package_server}" size="50"> 
     74  </label></td> 
     75</tr> 
     76<tr> 
     77  <td align='right'><br/></td> 
     78  <td align='left'></td> 
     79</tr> 
     80<tr> 
    7181  <td align='right'><?php echo _("Enable FreePBX ARI Module")?> (<a href="http://projects.colsolgrp.net/documents/29" target="_blank">What?</a>)</td> 
    7282  <td align='left'><label> 
  • modules/branches/2.9/endpointman/templates/freepbx/advanced_subheader.html

    r12430 r12769  
    22<tr> 
    33    <td align='center'>{if condition="$subhead_area == 'settings'"}<h4 style="color:#ff9933;"><?php echo _('Settings')?></h4>{else}<h4><a href='config.php?type=tool&amp;display=epm_advanced&amp;subpage=settings'><?php echo _('Settings')?></a></h4>{/if}</td> 
    4     <td align='center'>{if condition="$subhead_area == 'timezone_manager'"}<h4 style="color:#ff9933;"><?php echo _('Timezone Manager')?></h4>{else}<h4><a href='config.php?type=tool&amp;display=epm_advanced&amp;subpage=timezone_manager'><?php echo _('Timezone Manager')?></a></h4>{/if}</td> 
    54    <td align='center'>{if condition="$subhead_area == 'oui_manager'"}<h4 style="color:#ff9933;"><?php echo _('OUI Manager')?></h4>{else}<h4><a href='config.php?type=tool&amp;display=epm_advanced&amp;subpage=oui_manager'><?php echo _('OUI Manager')?></a></h4>{/if}</td> 
    65    <td align='center'>{if condition="$subhead_area == 'poce'"}<h4 style="color:#ff9933;"><?php echo _('Product Options/Configuration Editor')?></h4>{else}<h4><a href='config.php?type=tool&amp;display=epm_advanced&amp;subpage=poce'><?php echo _('Product Options/Configuration Editor')?></a></h4>{/if}</td> 
  • modules/branches/2.9/endpointman/templates/freepbx/brand_model_manager.html

    r12430 r12769  
    115115{if condition="isset($installer)"} 
    116116<script> 
    117  
     117{if condition="$amp_ver <= 29"} 
    118118function process_module_actions(actions) { 
    119119        if ($.browser.msie) { 
     
    153153} 
    154154process_module_actions(); 
     155{elseif condition="$amp_ver >= 210"} 
     156var box; 
     157function process_module_actions(actions) { 
     158    $(document).ready(function() { 
     159  urlStr = "config.php?display=epm_config&amp;quietmode=1&amp;handler=file&amp;file=installer.html.php&amp;module=endpointman&amp;type={$installer.type}&amp;id={$installer.id}"; 
     160  urlStr += "&amp;rand="+Math.random ( ); 
     161        for (var i in actions) { 
     162            urlStr += "&amp;moduleaction["+i+"]="+actions[i]; 
     163        } 
     164        box = $('<div></div>') 
     165        .html('<iframe height="100%" frameBorder="0" src="'+urlStr+'"></iframe>') 
     166        .dialog({ 
     167            title: 'Status - Please Wait', 
     168            resizable: false, 
     169            modal: true, 
     170            position: ['center', 50], 
     171            width: '400px', 
     172            height: 230, 
     173            close: function (e) { 
     174                close_module_actions(true); 
     175                $(e.target).dialog("destroy").remove(); 
     176            } 
     177        }); 
     178    }); 
     179} 
     180function close_module_actions(goback) { 
     181        box.dialog("destroy").remove(); 
     182        if (goback) { 
     183            location.href = 'config.php?display=epm_config'; 
     184        } 
     185} 
     186process_module_actions(); 
     187{/if} 
    155188</script> 
    156189<div id="moduleBox" style="display:none;"></div>  
     
    185218    {/loop} 
    186219{/if} 
    187  
     220<hr> 
     221<h6 align='center'>Want to participate? Add new phones? Join us at <a href="http://provisioner.net" target="_blank">http://www.provisioner.net</a></h6> 
    188222{include="global_footer"} 
    189223 
  • modules/branches/2.9/endpointman/templates/freepbx/devices_manager.html

    r12430 r12769  
    308308        <td align='center'><h3>Extension Number</h3></td> 
    309309        <td align='center'><h3>Template</h3></td> 
    310         <td align='center'><h3>Specific</h3></td
     310        <!--<td align='center'><h3>Specific</h3></td>--
    311311        <td align='center'><h3>Edit</h3></td> 
    312312        <td align='center'><h3>Delete</h3></td> 
     
    322322            <td width="19%" align='center'><div id="demo"><a><img src="assets/endpointman/images/expand.png" id="img3rowGroup{$value.master_id}" onclick="toggleDisplay(document.getElementById('devList'),'headerRow','rowGroup{$value.master_id}')" title="Click to Expand Line Information"></a></div></td> 
    323323            <td align='center' width='15%'>{$value.template_name}</td> 
    324             <td align='center'><div id="demo"><a href="#" onclick="submit_stype('edit',{$value.id});"><img src='assets/endpointman/images/edit.png' ALT='<?php echo _('Edit')?>' title='Edit Device' border='0'></a></div></td
     324            <!--<td align='center'><div id="demo"><a href="#" onclick="submit_stype('edit',{$value.id});"><img src='assets/endpointman/images/edit.png' ALT='<?php echo _('Edit')?>' title='Edit Device' border='0'></a></div></td>--
    325325            <td align='center' width='9%'><div id="demo"><a href="#" onclick="submit_wtype('edit',{$value.id});"><img src='assets/endpointman/images/edit.png' ALT='<?php echo _('Edit')?>' title='Edit Device' border='0'></a></div></td> 
    326326            <td align='center' width='7%'><div id="demo"><a href="#" onclick="delete_device({$value.id});"><img src='assets/endpointman/images/delete.png' ALT='<?php echo _('Delete')?>' title='Delete Device' border='0'></a></div></td> 
     
    352352    <tr> 
    353353        <td width="26%" align='center'><input type="submit" name="button_delete_selected_phones" onclick="submit_managed('delete_selected_phones');" value="<?php echo ('Delete Selected Phones')?>"></td> 
    354         <td width="26%" align='center'><input type="submit" name="button_rebuild_selected" onclick="submit_managed('rebuild_selected_phones');" value="<?php echo _('Rebuild Configs for Selected Phones')?>"><br /><input type="checkbox" name="reboot" checked>Reboot Phones</td> 
     354        <td width="26%" align='center'><input type="submit" name="button_rebuild_selected" onclick="submit_managed('rebuild_selected_phones');" value="<?php echo _('Rebuild Configs for Selected Phones')?>"><br /><input type="checkbox" name="reboot">Reboot Phones</td> 
    355355        <td width="32%" align='center'><?php echo _('Change Selected Phones to')?>: <br /><?php echo _('Brand')?>:<select name="brand_list_selected" id="brand_list_selected"> 
    356356                {loop name="brand_ava"} 
    357357                <option value="{$value.value}" {if condition="isset($value.selected)"}selected{/if}>{$value.text}</option> 
    358358                {/loop} 
    359             </select> <?php echo _('Model')?>: <select name="model_list_selected" id="model_list_selected"><option></option></select><br /><input type="submit" name="button_update_phones" onclick="submit_managed('change_brand');" value="<?php echo _('Update Phones')?>"><br /><input type="checkbox" name="reboot_change" checked>Reboot Phones</td> 
     359            </select> <?php echo _('Model')?>: <select name="model_list_selected" id="model_list_selected"><option></option></select><br /><input type="submit" name="button_update_phones" onclick="submit_managed('change_brand');" value="<?php echo _('Update Phones')?>"><br /><input type="checkbox" name="reboot_change">Reboot Phones</td> 
    360360    </tr> 
    361361</table> 
     
    367367<table width='90%' align='center'> 
    368368    <tr> 
    369         <td width="26%" align='center'><form action='' name='globalmanaged' id='globalmanaged' method='POST'><input type='Submit' name='button_rebuild_configs_for_all_phones' onclick="submit_global('rebuild_configs_for_all_phones');" value='<?php echo _('Rebuild Configs for All Phones')?>'><br /><input type="checkbox" name="reboot" checked>Reboot Phones</form></td> 
     369        <td width="26%" align='center'><form action='' name='globalmanaged' id='globalmanaged' method='POST'><input type='Submit' name='button_rebuild_configs_for_all_phones' onclick="submit_global('rebuild_configs_for_all_phones');" value='<?php echo _('Rebuild Configs for All Phones')?>'><br /><input type="checkbox" name="reboot">Reboot Phones</form></td> 
    370370        <td width="32%" align='center'><form action='' name='globalmanaged2' id='globalmanaged2' method='POST'><select name="rb_brand"> 
    371371  {loop name="brand_ava"} 
     
    383383                        <option></option> 
    384384                    </select> 
    385                     <input type="submit" name="button_rebuild_reboot" onclick="submit_global3('rebuild_reboot');" value="<?php echo _('Rebuild')?>"><br /><input type="checkbox" name="reboot" checked>Reboot Phones 
     385                    <input type="submit" name="button_rebuild_reboot" onclick="submit_global3('rebuild_reboot');" value="<?php echo _('Rebuild')?>"><br /><input type="checkbox" name="reboot">Reboot Phones 
    386386                </label></td> 
    387387    </tr> 
  • modules/branches/2.9/endpointman/templates/freepbx/global_header.html

    r12430 r12769  
    99        <link href="common/mainstyle.css" rel="stylesheet" type="text/css" /> 
    1010        {/if} 
    11         {if condition="$amp_ver < 2.9"} 
     11        {if condition="$amp_ver < 29"} 
    1212        <script type="text/javascript" src="assets/endpointman/js/jquery.tools.min.js"></script> 
    1313        <script type="text/javascript" src="assets/endpointman/js/jquery.easing.1.3.js"></script>