Changeset 5196
- Timestamp:
- 11/03/07 11:33:45 (4 years ago)
- Files:
-
- modules/branches/2.3/core/functions.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3/core/functions.inc.php
r5186 r5196 794 794 //add details to astdb 795 795 if ($astman) { 796 // if adding or editting a fixed device, user property should always be set 797 if ($devicetype == 'fixed' || !$editmode) { 798 $astman->database_put("DEVICE",$id."/user",$user); 799 } 800 // If changing from a fixed to an adhoc, the user property should be intialized 801 // to the new default, not remain as the previous fixed user 802 if ($editmode) { 803 $previous_type = $astman->database_get("DEVICE",$id."/type"); 804 if ($previous_type == 'fixed' && $devicetype == 'adhoc') { 805 $astman->database_put("DEVICE",$id."/user",$user); 806 } 807 } 796 808 $astman->database_put("DEVICE",$id."/dial",$dial); 797 809 $astman->database_put("DEVICE",$id."/type",$devicetype); 798 if (!$editmode) {799 $astman->database_put("DEVICE",$id."/user",$user);800 }801 810 $astman->database_put("DEVICE",$id."/default_user",$user); 802 811 if(!empty($emergency_cid)) … … 878 887 } 879 888 } 880 $astman->database_del("DEVICE",$account."/dial");881 $astman->database_del("DEVICE",$account."/type");882 889 if (! $editmode) { 890 $astman->database_del("DEVICE",$account."/dial"); 891 $astman->database_del("DEVICE",$account."/type"); 883 892 $astman->database_del("DEVICE",$account."/user"); 884 }885 $astman->database_del("DEVICE",$account."/default_user");886 $astman->database_del("DEVICE",$account."/emergency_cid");893 $astman->database_del("DEVICE",$account."/default_user"); 894 $astman->database_del("DEVICE",$account."/emergency_cid"); 895 } 887 896 888 897 //delete from devices table
