Changeset 11816
- Timestamp:
- 03/15/11 03:52:52 (2 years ago)
- Files:
-
- modules/branches/2.9/endpointman/functions.inc.php (modified) (2 diffs)
- modules/branches/2.9/endpointman/includes/advanced.inc (modified) (18 diffs)
- modules/branches/2.9/endpointman/includes/devices_manager.inc (modified) (4 diffs)
- modules/branches/2.9/endpointman/includes/functions.inc (modified) (6 diffs)
- modules/branches/2.9/endpointman/includes/template_manager.inc (modified) (5 diffs)
- modules/branches/2.9/endpointman/install.php (modified) (3 diffs)
- modules/branches/2.9/endpointman/module.xml (modified) (2 diffs)
- modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_oui.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/endpointman/functions.inc.php
r11801 r11816 108 108 if(($lines_list) AND (isset($model)) AND (isset($line)) AND (!isset($delete)) AND (isset($temp))) { 109 109 //Modifying line already in the database 110 $sql = "UPDATE endpointman_line_list SET line = ".$lines_list['line'].", description = '".$name."' WHERE luid =" . $lines_list['luid']; 111 $endpoint->db->query($sql); 112 113 $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id = ".$temp." WHERE id = ".$macid; 114 $endpoint->db->query($sql); 110 $endpoint->update_device($macid, $model, $temp, $lines_list['luid'],$name,$lines_list['line']); 115 111 116 112 $row = $endpoint->get_phone_info($macid); … … 122 118 } elseif((isset($model)) AND (!isset($delete)) AND (isset($line)) AND (isset($temp))) { 123 119 //Add line to the database 124 $sql = "INSERT INTO endpointman_line_list (mac_id, line, ext, description) VALUES (".$macid.", ".$line.", ".$extdisplay.", '".$name."')"; 125 $endpoint->db->query($sql); 126 127 $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id = ".$temp." WHERE id = ".$macid; 128 $endpoint->db->query($sql); 120 121 if(empty($line)) { 122 $endpoint->add_line($macid, NULL, $extdisplay, $name); 123 } else { 124 $endpoint->add_line($macid, $line, $extdisplay, $name); 125 } 126 127 $endpoint->update_device($macid, $model, $temp, NULL, NULL, NULL, FALSE); 129 128 130 129 $row = $endpoint->get_phone_info($macid); modules/branches/2.9/endpointman/includes/advanced.inc
r11618 r11816 7 7 * @package Provisioner 8 8 */ 9 10 //Set the message variable to nothing, however we can set it later and it will show up on the page11 $message = NULL;12 $error_message = NULL;13 $endpoint->tpl->assign("message", $message);14 $endpoint->tpl->assign("web_vars", "?type=$type");15 16 9 echo $endpoint->tpl->draw( 'global_header' ); 17 10 if(!isset($_REQUEST['subpage'])) { … … 34 27 if ($file['tmp_name'] > '') { 35 28 if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { 36 $endpoint-> tpl->assign("message", "We support only CVS and TXT files");29 $endpoint->message['iedl'] = "We support only CVS and TXT files"; 37 30 } else { 38 31 $uploaddir = LOCAL_PATH; … … 71 64 $ext = $ext['extension']; 72 65 73 $sql_mac = "SELECT id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 74 $res_mac =& $endpoint->db->query($sql_mac); 75 if($res_mac->numRows()) { 76 $ext_id = $endpoint->db->getOne($sql_mac); 77 } else { 78 $sql = "INSERT INTO endpointman_mac_list (mac, model) VALUES ('".$mac."','".$model_id."')"; 79 $endpoint->db->query($sql); 80 81 $sql = 'SELECT last_insert_id()'; 82 $ext_id =& $endpoint->db->getOne($sql); 83 } 84 85 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '".$line_id."','".$description."')"; 86 $endpoint->db->query($sql); 87 88 $message .= "Inserted Mac Address: ".$mac." & Line: ".$line_id."<br/>"; 66 $endpoint->add_device($mac,$model_id,$ext,0,$line_id,$description); 89 67 } else { 90 $endpoint->error['csv_upload'] = 'Invalid Extension Specified';68 $endpoint->error['csv_upload'] .= "Invalid Extension Specified on line ". $i. "<br />"; 91 69 } 92 70 } else { 93 $endpoint->error['csv_upload'] = 'Invalid Model Specified';71 $endpoint->error['csv_upload'] .= "Invalid Model Specified on line ". $i. "<br />"; 94 72 } 95 73 } else { 96 $endpoint->error['csv_upload'] = 'Invalid Brand Specified';74 $endpoint->error['csv_upload'] .= "Invalid Brand Specified on line ". $i. "<br />"; 97 75 } 98 76 } else { 99 $endpoint->error['csv_upload'] = "Invalid Mac on line ". $i. "<br />";77 $endpoint->error['csv_upload'] .= "Invalid Mac on line ". $i. "<br />"; 100 78 } 101 79 } … … 104 82 fclose($handle); 105 83 unlink(LOCAL_PATH.$_FILES['import_csv']['name']); 106 $ message .= "Please reboot & rebuild all imported phones<br />";84 $endpoint->message['file_upload'] = "Please reboot & rebuild all imported phones<br />"; 107 85 } else { 108 $ this->error['file_upload'] = "Possible file upload attack!";86 $endpoint->error['file_upload'] = "Possible file upload attack!"; 109 87 110 88 } … … 112 90 } 113 91 } 114 } 115 $error_message = NULL; 116 foreach($endpoint->error as $key => $error) { 117 $error_message .= $error; 118 if($endpoint->global_cfg['debug']) { 119 $error_message .= " Function: [".$key."]"; 120 } 121 $error_message .= "<br />"; 122 } 123 if(isset($message)) { 124 $endpoint->display_message_box($message,$endpoint->tpl,0); 125 } 126 if(isset($error_message)) { 127 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 128 } 92 } elseif(isset($_REQUEST['action'])) { 93 $endpoint->error['iedl'] = "No File uploaded"; 94 } 95 $endpoint->prepare_message_box(); 129 96 echo $endpoint->tpl->draw( 'advanced_settings_iedl' ); 130 97 break; … … 185 152 $endpoint->tpl->assign("package", $files_list[0]); 186 153 $endpoint->tpl->assign("type", "upload_brand"); 187 } else { 188 $message = $error_message; 189 } 190 191 } 192 $error_message = NULL; 193 foreach($endpoint->error as $key => $error) { 194 $error_message .= $error; 195 if($endpoint->global_cfg['debug']) { 196 $error_message .= " Function: [".$key."]"; 197 } 198 $error_message .= "<br />"; 199 } 200 if(isset($message)) { 201 $endpoint->display_message_box($message,$endpoint->tpl,0); 202 } 203 if(isset($error_message)) { 204 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 205 } 206 154 } 155 } 156 $endpoint->prepare_message_box(); 207 157 echo $endpoint->tpl->draw( 'advanced_settings_manual_upload' ); 208 158 break; … … 253 203 } 254 204 $endpoint->tpl->assign("brand2_list", $row_out); 205 $endpoint->prepare_message_box(); 255 206 echo $endpoint->tpl->draw( 'advanced_settings_sh_manager' ); 256 207 break; … … 259 210 $sql = "INSERT INTO endpointman_oui_list (oui, brand, custom) VALUES ('".$_REQUEST['oui']."', '".$_REQUEST['rb_brand']."', '1')"; 260 211 $endpoint->db->query($sql); 212 $endpoint->message['oui_manager'] = "Added!"; 213 } elseif(isset($_REQUEST['oui_sub'])) { 214 $endpoint->error['oui_manager'] = "No OUI Set!"; 261 215 } 262 216 if((isset($_REQUEST['delete'])) AND ($_REQUEST['id'] > 0)) { 263 217 $sql = "DELETE FROM endpointman_oui_list WHERE id = ". $_REQUEST['id']; 264 218 $endpoint->db->query($sql); 219 $endpoint->message['oui_manager'] = "Deleted!"; 265 220 } 266 221 $sql = 'SELECT endpointman_oui_list.id, endpointman_oui_list.oui , endpointman_brand_list.name FROM endpointman_oui_list , endpointman_brand_list WHERE endpointman_oui_list.brand = endpointman_brand_list.id AND endpointman_oui_list.custom = 0'; … … 283 238 $endpoint->tpl->assign("oui_list_custom", $row_out_custom); 284 239 $endpoint->tpl->assign("brand_ava", $endpoint->brands_available()); 285 286 $error_message = NULL; 287 foreach($endpoint->error as $key => $error) { 288 $error_message .= $error; 289 if($endpoint->global_cfg['debug']) { 290 $error_message .= " Function: [".$key."]"; 291 } 292 $error_message .= "<br />"; 293 } 294 if(isset($message)) { 295 $endpoint->display_message_box($message,$endpoint->tpl,0); 296 } 297 if(isset($error_message)) { 298 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 299 } 300 240 $endpoint->prepare_message_box(); 301 241 echo $endpoint->tpl->draw( 'advanced_settings_oui' ); 302 242 break; … … 316 256 $sql = "DELETE FROM endpointman_custom_configs WHERE id =". $_REQUEST['sql']; 317 257 $endpoint->db->query($sql); 318 $ message= "Deleted!";258 $endpoint->message['poce'] = "Deleted!"; 319 259 } 320 260 if(isset($_REQUEST['file'])) { … … 329 269 fwrite($wfh,$_REQUEST['config_text']); 330 270 fclose($wfh); 331 $ message= "Saved to Hard Drive!";271 $endpoint->message['poce'] = "Saved to Hard Drive!"; 332 272 }elseif(isset($_REQUEST['button_save_as'])) { 333 273 $sql = 'INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ("'.addslashes($_REQUEST['save_as_name']).'","'.addslashes($config_files[$_REQUEST['file']]).'","'.$_REQUEST['product_select'].'","'.addslashes($_REQUEST['config_text']).'")'; 334 274 $endpoint->db->query($sql); 335 $ message= "Saved to Database!";275 $endpoint->message['poce'] = "Saved to Database!"; 336 276 } 337 277 } … … 343 283 if(isset($_REQUEST['sendid'])) { 344 284 $error = $endpoint->submit_config($row['directory'],$row['cfg_dir'],$config_files[$_REQUEST['file']],$contents); 345 $ message= 'Sent! Thanks :-)';285 $endpoint->message['poce'] = 'Sent! Thanks :-)'; 346 286 } 347 287 … … 361 301 $sql = "UPDATE endpointman_custom_configs SET data = '".addslashes($_REQUEST['config_text'])."' WHERE id = ".$_REQUEST['sql']; 362 302 $endpoint->db->query($sql); 363 $ message= "Saved to Database!";303 $endpoint->message['poce'] = "Saved to Database!"; 364 304 }elseif(isset($_REQUEST['button_save_as'])) { 365 305 $sql = 'SELECT original_name FROM endpointman_custom_configs WHERE id = '.$_REQUEST['sql']; … … 368 308 $sql = "INSERT INTO endpointman_custom_configs (name, original_name, product_id, data) VALUES ('".addslashes($_REQUEST['save_as_name'])."','".addslashes($file_name)."','".$_REQUEST['product_select']."','".addslashes($_REQUEST['config_text'])."')"; 369 309 $endpoint->db->query($sql); 370 $ message= "Saved to Database!";310 $endpoint->message['poce'] = "Saved to Database!"; 371 311 } 372 312 } … … 378 318 $row22 =& $endpoint->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 379 319 $endpoint->submit_config($row22['directory'],$row22['cfg_dir'],$row['original_name'],$row['data']); 380 $ message= 'Sent! Thanks! :-)';320 $endpoint->message['poce'] = 'Sent! Thanks! :-)'; 381 321 } 382 322 … … 454 394 } 455 395 $endpoint->tpl->assign("product_list", $product_list); 456 457 $error_message = NULL; 458 foreach($endpoint->error as $key => $error) { 459 $error_message .= $error; 460 if($endpoint->global_cfg['debug']) { 461 $error_message .= " Function: [".$key."]"; 462 } 463 $error_message .= "<br />"; 464 } 465 if(isset($message)) { 466 $endpoint->display_message_box($message,$endpoint->tpl,0); 467 } 468 if(isset($error_message)) { 469 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 470 } 471 396 $endpoint->prepare_message_box(); 472 397 echo $endpoint->tpl->draw( 'advanced_settings_poce' ); 473 398 break; … … 554 479 $endpoint->db->query($sql); 555 480 556 $ message .= "Updated!";481 $endpoint->message['advanced_settings'] = "Updated!"; 557 482 } 558 483 //Because we are working with global variables we probably updated them, so lets refresh those variables … … 601 526 $endpoint->tpl->assign("brand_list", $endpoint->brands_available()); 602 527 603 $error_message = NULL; 604 foreach($endpoint->error as $key => $error) { 605 $error_message .= $error; 606 if($endpoint->global_cfg['debug']) { 607 $error_message .= " Function: [".$key."]"; 608 } 609 $error_message .= "<br />"; 610 } 611 if(isset($message)) { 612 $endpoint->display_message_box($message,$endpoint->tpl,0); 613 } 614 if(isset($error_message)) { 615 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 616 } 528 $endpoint->prepare_message_box(); 617 529 618 530 echo $endpoint->tpl->draw( 'advanced_settings_settings' ); modules/branches/2.9/endpointman/includes/devices_manager.inc
r11801 r11816 55 55 case "add_line_x": 56 56 $_REQUEST['id'] = $_REQUEST['edit_id']; 57 $ endpoint->add_line($_REQUEST['id']);57 $mac_id = $endpoint->add_line($_REQUEST['id']); 58 58 break; 59 59 case "button_edit": … … 74 74 $sql = 'SELECT * FROM endpointman_line_list WHERE mac_id = '. $_REQUEST['edit_id']; 75 75 76 $lines_list = &$endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC);76 $lines_list = $endpoint->db->getAll($sql,array(),DB_FETCHMODE_ASSOC); 77 77 78 78 foreach($lines_list as $row) { 79 79 $sql = "SELECT description FROM devices WHERE id = ".$_REQUEST['ext_list_'.$row['luid']]; 80 $name =$endpoint->db->getOne($sql);80 $name = $endpoint->db->getOne($sql); 81 81 82 82 $sql = "UPDATE endpointman_line_list SET line = '".$_REQUEST['line_list_'.$row['luid']]."', ext = ".$_REQUEST['ext_list_'.$row['luid']].", description = '".$name."' WHERE luid = ". $row['luid']; … … 94 94 case "delete": 95 95 $sql = 'SELECT mac_id FROM endpointman_line_list WHERE luid = '.$_REQUEST['edit_id'] ; 96 $mac_id = &$endpoint->db->getOne($sql,array(),DB_FETCHMODE_ASSOC);96 $mac_id = $endpoint->db->getOne($sql,array(),DB_FETCHMODE_ASSOC); 97 97 $row = $endpoint->get_phone_info($mac_id); 98 98 … … 107 107 case "add" : 108 108 $mac_id = $endpoint->add_device($_REQUEST['mac'],$_REQUEST['model_list'],$_REQUEST['ext_list'],$_REQUEST['template_list'],$_REQUEST['line_list']); 109 $phone_info = $endpoint->get_phone_info($mac_id); 110 $endpoint->prepare_configs($phone_info); 109 if($mac_id === TRUE) { 110 $phone_info = $endpoint->get_phone_info($mac_id); 111 $endpoint->prepare_configs($phone_info); 112 } 111 113 break; 112 114 case "edit_template" : modules/branches/2.9/endpointman/includes/functions.inc
r11801 r11816 280 280 function add_device($mac,$model,$ext,$template=NULL,$line=NULL,$displayname=NULL) { 281 281 $mac = $this->mac_check_clean($mac); 282 283 282 if($mac) { 284 $sql = "SELECT id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 285 $dup = $this->db->getOne($sql); 286 287 if($dup) { 288 $this->add_line($dup, $line, $ext); 283 if(empty($model)) { 284 $this->error['add_device'] = _("You Must Select A Model From the Drop Down")."!"; 285 return(FALSE); 286 } elseif(empty($ext)) { 287 $this->error['add_device'] = _("You Must Select an Extension/Device From the Drop Down")."!"; 288 return(FALSE); 289 289 } else { 290 290 if($this->sync_model($model)) { 291 if(empty($model)) { 292 $this->error['add_device'] = _("You Must Select A Model From the Drop Down")."!"; 293 return(FALSE); 294 } elseif(empty($ext)) { 295 $this->error['add_device'] = _("You Must Select an Extension/Device From the Drop Down")."!"; 296 return(FALSE); 291 $sql = "SELECT id,template_id FROM endpointman_mac_list WHERE mac = '".$mac."'"; 292 $dup = $this->db->getRow($sql,array(),DB_FETCHMODE_ASSOC); 293 294 if($dup) { 295 if(!isset($template)) { 296 $template = $dup['template_id']; 297 } 298 $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id = ".$template." WHERE id = ".$dup['id']; 299 $this->db->query($sql); 300 $return = $this->add_line($dup['id'], $line, $ext); 301 if($return) { 302 return($return); 303 } else { 304 return(FALSE); 305 } 297 306 } else { 298 307 if(!isset($template)) { … … 325 334 $ext_id =& $this->db->getOne($sql); 326 335 327 if( $line > 1) {328 $ this->message['add_device'] = "You can't add a phone without the first line set!";336 if(empty($line)) { 337 $line = 1; 329 338 } 330 $line = 1;331 339 332 340 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$ext_id."', '".$ext."', '".$line."', '".$name."')"; 333 341 $this->db->query($sql); 334 342 335 $this->message['add_device'] = "Added !";343 $this->message['add_device'] = "Added ".$name." to line ".$line; 336 344 return($ext_id); 337 345 } … … 342 350 } 343 351 } else { 344 $this-> message['add_device'] = _("Invalid MAC Address")."!";352 $this->error['add_device'] = _("Invalid MAC Address")."!"; 345 353 return(FALSE); 346 354 } … … 369 377 370 378 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$reg[0]['value']."', '".$lines[0]['value']."', '".$name."')"; 379 $this->db->query($sql); 380 381 $this->message['add_line'] = "Added '<i>".$name."</i>' to line '<i>".$lines[0]['value']."</i>' on device '<i>".$reg[0]['value']."</i>' <br/> Configuration Files will not be Generated until you click Save!"; 382 return($mac_id); 383 } else { 384 $this->error['add_line'] = _("No Devices/Extensions Left to Add")."!"; 385 return(FALSE); 386 } 387 } else { 388 $this->error['add_line'] = _("No Lines Left to Add")."!"; 389 return(FALSE); 390 } 391 } elseif((!isset($line)) AND (isset($ext))) { 392 if($this->linesAvailable(NULL,$mac_id)) { 393 if($this->endpoint_data->all_unused_registrations()) { 394 $lines = array_values($this->linesAvailable(NULL,$mac_id)); 395 396 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$ext."', '".$lines[0]['value']."', '".$displayname."')"; 371 397 $this->db->query($sql); 372 398 … … 397 423 $sql = "INSERT INTO `endpointman_line_list` (`mac_id`, `ext`, `line`, `description`) VALUES ('".$mac_id."', '".$ext."', '".$line."', '".$name."')"; 398 424 $this->db->query($sql); 399 $this->message['add_line'] = "Added ".$name." to line ".$line;425 $this->message['add_line'] .= "Added ".$name." to line ".$line . "<br/>"; 400 426 return($mac_id); 401 427 } … … 404 430 } 405 431 406 function update_device($mac _id,$model,$ext,$template,$line=NULL,$name=NULL) {432 function update_device($macid,$model,$template,$luid=NULL,$name=NULL,$line=NULL,$update_lines=TRUE) { 407 433 $sql = "UPDATE endpointman_mac_list SET model = ".$model.", template_id = ".$temp." WHERE id = ".$macid; 408 434 $this->db->query($sql); 409 if(!isset($line)) { 410 return(TRUE); 411 } else { 412 $this->update_line($line, $name,NULL,$macid); 413 return(TRUE); 414 } 415 } 416 417 function update_line($line,$name,$luid=NULL,$macid=NULL) { 435 if($update_lines) { 436 if(!isset($luid)) { 437 $this->update_line($luid,NULL,$name,$line); 438 return(TRUE); 439 } else { 440 $this->update_line(NULL,$macid); 441 return(TRUE); 442 } 443 } 444 } 445 446 function update_line($luid=NULL,$macid=NULL,$name=NULL,$line=NULL) { 418 447 if(isset($luid)) { 419 $sql = "UPDATE endpointman_line_list SET line = ".$line.", description = '".$name."' WHERE luid =" . $luid; 448 $sql = "SELECT * FROM endpointman_line_list WHERE luid = ".$luid; 449 $row = $this->db->getRow($sql, array(), DB_FETCHMODE_ASSOC); 450 451 if(!isset($name)) { 452 $sql = "SELECT description FROM devices WHERE id = ".$row['ext']; 453 $name=$this->db->getOne($sql); 454 } 455 456 if(!isset($line)) { 457 $line = $row['line']; 458 } 459 460 $sql = "UPDATE endpointman_line_list SET line = '".$line."', ext = ".$row['ext'].", description = '".$name."' WHERE luid = ". $row['luid']; 420 461 $this->db->query($sql); 421 462 return(TRUE); 422 463 } else { 423 $sql = "UPDATE endpointman_line_list SET line = ".$line.", description = '".$name."' WHERE luid =" . $luid; 424 $this->db->query($sql); 464 $sql = "SELECT * FROM endpointman_line_list WHERE mac_id = ".$macid; 465 $lines_info = $this->db->getAll($sql, array(), DB_FETCHMODE_ASSOC); 466 foreach($lines_info as $row) { 467 $sql = "SELECT description FROM devices WHERE id = ".$row['ext']; 468 $name=$this->db->getOne($sql); 469 470 $sql = "UPDATE endpointman_line_list SET line = '".$row['line']."', ext = ".$row['ext'].", description = '".$name."' WHERE luid = ". $row['luid']; 471 $this->db->query($sql); 472 } 425 473 return(TRUE); 426 474 } modules/branches/2.9/endpointman/includes/template_manager.inc
r10947 r11816 7 7 * @package Provisioner 8 8 */ 9 $message = NULL;10 $error_message = NULL;11 12 9 $no_add = FALSE; 13 10 $default_display = FALSE; … … 20 17 21 18 if((!$product_list) && (!$mac_list)) { 22 $ message= _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some");19 $endpoint->message['general'] = _("Welcome to Endpoint Manager")."!<br />"._("You have no products (Modules) installed, click")." <a href=\"config.php?display=epm_config&type=$type\">"._("here")."</a> "._("to install some"); 23 20 $no_add = TRUE; 24 21 } elseif(!$product_list) { 25 $ message= "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations";22 $endpoint->message['general'] = "Thanks for upgrading to version 2.0! Please head on over to <a href=\"config.php?display=epm_config&type=$type\">\"Brand Configurations/Setup\"</a> to setup and install phone configurations"; 26 23 $no_add = TRUE; 27 24 } … … 31 28 } elseif(isset($_REQUEST['button_save'])) { 32 29 if(($_REQUEST['model_class'] == 0) OR (empty($_REQUEST['template_name'])) OR ($_REQUEST['model_clone'] == 0)) { 33 $ message= "No Valid Model/Template/Name Selected!";30 $endpoint->error['general'] = "No Valid Model/Template/Name Selected!"; 34 31 $default_display = TRUE; 35 32 } else { … … 46 43 $endpoint->db->query($sql); 47 44 $default_display = TRUE; 48 $ message= _('Deleted');45 $endpoint->message['general'] = _('Deleted'); 49 46 } elseif((isset($_REQUEST['button_save_template'])) AND (isset($_REQUEST['custom']))) { 50 47 $endpoint->save_template($_REQUEST['id'],$_REQUEST['custom'],$_REQUEST); 51 48 $default_display = TRUE; 52 49 if(empty($endpoint->error)) { 53 $ message= _('Saved');50 $endpoint->message['general'] = _('Saved'); 54 51 } 55 52 } else { … … 108 105 $endpoint->tpl->assign("no_add", $no_add); 109 106 $endpoint->tpl->assign("debug", $debug); 110 111 foreach($endpoint->error as $key => $error) { 112 $error_message .= $error; 113 if($endpoint->global_cfg['debug']) { 114 $error_message .= " Function: [".$key."]"; 115 } 116 $error_message .= "<br />"; 117 } 118 if(isset($error_message)) { 119 $endpoint->display_message_box($error_message,$endpoint->tpl,1); 120 } 121 if(isset($message)) { 122 $endpoint->display_message_box($message,$endpoint->tpl,0); 123 } 124 107 108 $endpoint->prepare_message_box(); 125 109 echo $endpoint->tpl->draw( 'template_manager' ); 126 110 } modules/branches/2.9/endpointman/install.php
r11618 r11816 92 92 } 93 93 94 $version = "2.9.0. 6";94 $version = "2.9.0.7"; 95 95 96 96 if(ep_table_exists("endpointman_global_vars")) { … … 180 180 } elseif($global_cfg['version'] == '2.9.0.5') { 181 181 $ver = "2.9.0.5"; 182 } elseif($global_cfg['version'] == '2.9.0.6') { 183 $ver = "2.9.0.6"; 184 } elseif($global_cfg['version'] == '2.9.0.7') { 185 $ver = "2.9.0.7"; 186 } elseif($global_cfg['version'] == '2.9.0.8') { 187 $ver = "2.9.0.8"; 188 } elseif($global_cfg['version'] == '2.9.0.9') { 189 $ver = "2.9.0.9"; 190 } elseif($global_cfg['version'] == '2.9.1.0') { 191 $ver = "2.9.1.0"; 192 } elseif($global_cfg['version'] == '2.9.1.1') { 193 $ver = "2.9.1.1"; 194 } elseif($global_cfg['version'] == '2.9.1.2') { 195 $ver = "2.9.1.2"; 196 } elseif($global_cfg['version'] == '2.9.1.3') { 197 $ver = "2.9.1.3"; 198 } elseif($global_cfg['version'] == '2.9.1.4') { 199 $ver = "2.9.1.4"; 200 } elseif($global_cfg['version'] == '2.9.1.5') { 201 $ver = "2.9.1.5"; 182 202 } else { 183 203 $ver = "1000"; … … 901 921 902 922 if($ver <= "2.9.0.4") { 923 out("Adding 'local' column to brand_list"); 903 924 $sql = 'ALTER TABLE `endpointman_brand_list` ADD `local` INT( 1 ) NOT NULL DEFAULT \'0\' AFTER `cfg_ver`'; 904 925 $db->query($sql); 905 926 } 906 927 907 if($ver <= "2.9.0.5") { 908 $sql = "INSERT INTO `asterisk`.`endpointman_global_vars` (`idnum` ,`var_name` ,`value`)VALUES (NULL , 'show_all_registrations', '0')"; 928 if($ver <= "2.9.0.7") { 929 out("Adding UNIQUE key to table global_vars for var_name"); 930 $sql = "ALTER TABLE `asterisk`.`endpointman_global_vars` ADD UNIQUE `unique` (`var_name`)"; 931 $db->query($sql); 932 933 out("Adding show_all_registrations to global_vars table"); 934 $sql = 'INSERT INTO asterisk.endpointman_global_vars (idnum, var_name, value) VALUES (NULL, "show_all_registrations", "0")'; 909 935 $db->query($sql); 910 936 } modules/branches/2.9/endpointman/module.xml
r11802 r11816 3 3 <repo>standard</repo> 4 4 <name>PBX End Point Manager</name> 5 <version>2.9.0.3RC 7</version>5 <version>2.9.0.3RC9</version> 6 6 <type>tool</type> 7 7 <category>End Point Manager</category> … … 16 16 <description>PBX End Point Manager supports automated deployment of multiple manufacturers IP telephones.</description> 17 17 <changelog> 18 *2.9.0.3RC8* Fixes #4946,#4956, #495018 *2.9.0.3RC9* Fixed #4878, #4956, #4946, #4950 19 19 *2.9.0.3RC6* Fixed Device + User Mode (http://www.freepbx.org/forum/freepbx/users/device-user-mode), #4792 20 *2.9.0.0* bumped for 2.9, removed errors in module.xml causing erors for online xml parsing20 *2.9.0.0* bumped for 2.9, removed errors in module.xml causing erors for online xml parsing 21 21 *2.3.2* Various Bug Fixes 22 22 *2.3.1* Install directory case corrections modules/branches/2.9/endpointman/templates/freepbx/advanced_settings_oui.html
r11804 r11816 1 {if condition="isset($show_error_box)"} 2 {include="message_box"} 3 {/if} 1 4 <table align='center' width='30%'> 2 5 <tr>
