1 <?php
3 class workservice extends plugin
4 {
5 var $gotoScannerEnable;
7 /* Generic terminal attributes */
8 var $gotoXMonitor= "";
9 var $gotoXDriver= "";
10 var $gotoXResolution= "";
11 var $gotoXColordepth= "";
12 var $gotoXHsync= "";
13 var $gotoXVsync= "";
14 var $AutoSync = false;
15 var $gotoXKbModel= "";
16 var $gotoXKbLayout= "";
17 var $gotoXKbVariant= "";
18 var $gotoXMouseType= "";
19 var $gotoXMouseport= "";
20 var $gotoScannerClients= "";
21 var $gotoScannerBackend= "";
22 var $goFonHardware= "automatic";
23 var $view_logged = FALSE;
25 /* Needed values and lists */
26 var $ignore_account= TRUE;
27 var $base= "";
28 var $cn= "";
29 var $orig_dn= "";
30 var $XDrivers= array();
31 var $XResolutions = array();
32 var $MouseTypes= array();
33 var $MousePorts= array();
34 var $hardware_list= array();
35 var $used_hardware= array();
36 var $ogroup = FALSE;
37 var $member_of_ogroup = FALSE;
39 /* attribute list for save action */
40 var $attributes= array("gotoXMonitor", "gotoXDriver", "gotoXResolution", "gotoXColordepth",
41 "gotoXHsync", "gotoXVsync",
42 "gotoScannerEnable", "gotoScannerClients",
43 "gotoScannerBackend", "gotoXKbModel", "gotoXKbLayout", "gotoXKbVariant",
44 "gotoXMouseType", "gotoXMouseport", "goFonHardware");
45 var $objectclasses= array("GOhard");
47 var $XColordepths =array();
48 var $XKbModels =array();
49 var $XKbLayouts =array();
50 var $XKbVariants =array();
52 var $InheritXYSync = FALSE;
54 function workservice (&$config, $dn= NULL, $parent= NULL)
55 {
56 plugin::plugin ($config, $dn, $parent);
58 $this->XResolutions= array(
59 "640x480" => "640x480",
60 "800x600" => "800x600",
61 "1024x768" => "1024x768",
62 "1152x864" => "1152x864",
63 "1280x1024" => "1280x1024",
64 "1400x1050" => "1400x1050",
65 "1600x1200" => "1600x1200");
67 if($this->config->get_cfg_value("resolutions") != ""){
68 $file = $this->config->get_cfg_value("resolutions");
70 if(is_readable($file)){
71 $str = file_get_contents($file);
72 $lines = split("\n",$str);
73 foreach($lines as $line){
74 $line = trim($line);
75 if(!empty($line)){
76 $this->XResolutions[$line]=$line;
77 }
78 }
79 //natcasesort($this->gotoXResolutions);
80 }else{
81 msg_dialog::display(_("Configuration error"), msgPool::cannotReadFile($file), WARNING_DIALOG);
82 }
83 }
85 /* Get list of available xdrivers */
86 foreach($this->getListOfXDrivers() as $xdriver) {
87 $this->XDrivers[$xdriver] = $xdriver;
88 }
90 if (isset($this->attrs['gosaGroupObjects'])) {
91 array_unshift($this->XDrivers, "["._("manual/auto")."]");
92 }
93 else {
94 array_unshift($this->XDrivers, "["._("unknown")."]");
95 }
97 $this->XColordepths= array(
98 "8" => "8 " ._("bit"),
99 "15" => "15 "._("bit"),
100 "16" => "16 "._("bit"),
101 "24" => "24 "._("bit"));
103 foreach(array ("btc9000", "chicony", "compaq", "dell", "dell101", "everex",
104 "flexpro", "geniuscomfy", "hp", "itouch", "jp106", "logicordless",
105 "logiinetnav", "logiinternet", "macintosh", "microsoft",
106 "microsoftpro", "omnikey101", "pc101", "pc102", "pc104",
107 "pc105", "rapidaccess", "rapidaccess2", "winbook") as $type){
108 $this->XKbModels[$type] = $type;
109 }
111 $this->MouseTypes= array("auto" => "auto",
112 "explorerps/2" => "explorerps/2",
113 "ImPS/2" => "ImPS/2",
114 "PS/2" => "PS/2",
115 "Microsoft" => "Microsoft",
116 "Logitech" => "Logitech",);
118 $this->MousePorts= array("/dev/input/mice" => "/dev/input/mice",
119 "/dev/mouse" => "/dev/mouse",
120 "/dev/psaux" => "/dev/psaux",
121 "/dev/ttyS0" => "/dev/ttyS0",
122 "/dev/ttyS1" => "/dev/ttyS1",);
124 /* Additional values will be extracted from CONFIG_DIR./keyboardLayouts */
125 $this->XKbLayouts = array("de"=> "de","en" =>"en", "es" => "es", "us" =>"us", "fr" => "fr");
126 $this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic");
128 /* try to read additional keyboard layouts
129 */
130 if(file_exists(CONFIG_DIR."/keyboardLayouts")){
131 if(is_readable(CONFIG_DIR."/keyboardLayouts")){
132 $str = file_get_contents(CONFIG_DIR."/keyboardLayouts");
133 $tmp = split("\n",$str);
134 foreach($tmp as $entry){
135 if((!empty($entry)) && (!preg_match("/^#/",$entry))){
136 $entry = trim($entry);
137 $tmp2 = split ("\:",$entry);
138 $la = trim($tmp2[0]); // What would be saved to ldap
139 $da = trim($tmp2[1]); // This wis displayed in the listbox
140 $this->XKbLayouts [ $la] = $da;
141 }
142 }
143 }
144 }
146 $this->orig_dn= $this->dn;
148 /* Load phone hardware list
149 */
150 $tmp = get_sub_list("(objectClass=goFonHardware)","",array(get_ou("phoneRDN")),
151 $this->config->current['BASE'],array("cn","description"), GL_NO_ACL_CHECK);
152 foreach($tmp as $attrs){
153 $cn= $attrs['cn'][0];
154 $description= "";
155 if (isset($attrs['description'])){
156 $description= " - ".$attrs['description'][0];
157 }
158 $this->hardware_list[$cn]= "$cn$description";
159 }
160 $this->hardware_list["automatic"]= _("automatic");
161 ksort($this->hardware_list);
163 /* These departments may contain objects that have
164 goFonHardware set.
165 */
166 $deps_a = array(
167 get_people_ou(),
168 get_ou("ogroupRDN"),
169 get_ou("serverRDN"),
170 get_ou("terminalRDN"),
171 get_ou("workstationRDN"),
172 get_ou("printerRDN"),
173 get_ou("componentRDN"),
174 get_ou("phoneRDN"));
176 $tmp = get_sub_list("(goFonHardware=*)","",$deps_a,$this->config->current['BASE'],
177 array('cn','dn','goFonHardware'),GL_NO_ACL_CHECK);
178 foreach($tmp as $attrs){
179 $cn = $attrs['goFonHardware'][0];
180 if(isset($this->hardware_list[$cn])){
181 $this->used_hardware[$cn]= $cn;
182 }
183 }
185 if(isset($this->attrs['gotoXHsync']) && isset($this->attrs['gotoXYsync'])) {
186 $this->InheritXYSync = FALSE;
187 }
189 /* Workaround to fill in inherited values if we've specified an objectclass */
190 $SelectedSystemType = session::get("SelectedSystemType");
191 if (isset($SelectedSystemType['ogroup']) && $SelectedSystemType['ogroup'] != 'none'){
192 $this->XDrivers=array('default' => _("inherited"));
193 $this->XResolutions= array('default' => _("inherited"));
194 $this->XColordepths= array('default' => _("inherited"));
195 $this->XKbModels= array('default' => _("inherited"));
196 $this->XKbLayouts= array('default' => _("inherited"));
197 $this->XKbVariants= array('default' => _("inherited"));
198 $this->MouseTypes= array('default' => _("inherited"));
199 $this->MousePorts= array('default' => _("inherited"));
200 $this->member_of_ogroup = TRUE;
201 }
203 }
205 function execute()
206 {
207 /* Call parent execute */
208 plugin::execute();
210 /* Load hardware list */
211 $this->loadHardwareList();
213 if(preg_match("/\+/",$this->gotoXHsync)){
214 $this->AutoSync = true;
215 $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync);
216 $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync);
217 }
219 if($this->is_account && !$this->view_logged){
220 $this->view_logged = TRUE;
221 new log("view","workstation/".get_class($this),$this->dn);
222 }
224 /* Do we need to flip is_account state? */
225 if (isset($_POST['modify_state'])){
226 $this->is_account= !$this->is_account;
227 }
229 /* Do we need to flip is_account state? */
230 if(isset($_POST['modify_state'])){
231 if($this->is_account && $this->acl_is_removeable()){
232 $this->is_account= FALSE;
233 }elseif(!$this->is_account && $this->acl_is_createable()){
234 $this->is_account= TRUE;
235 }
236 }
238 /* Show main page */
239 $smarty= get_smarty();
241 /* Assign ACLs */
242 $tmp = $this->plInfo();
243 foreach($tmp['plProvidedAcls'] as $name => $translated){
244 $smarty->assign($name."ACL",$this->getacl($name));
245 }
247 $smarty->assign("member_of_ogroup", $this->member_of_ogroup);
249 /* Arrays */
250 foreach(array("XDrivers", "XResolutions", "XColordepths",
251 "XKbModels", "XKbVariants",
252 "MouseTypes", "MousePorts") as $val){
253 $smarty->assign("$val", $this->$val);
254 }
255 $smarty->assign("XKbLayouts" ,$this->XKbLayouts);
256 $smarty->assign("XKbLayoutKeys" ,array_flip($this->XKbLayouts));
258 $smarty->assign("xdmcpservers", $this->config->data['SERVERS']['TERMINAL']);
259 $smarty->assign("nfsservers", $this->config->data['SERVERS']['NFS']);
260 $smarty->assign("nfsservers", $this->config->data['SERVERS']['NFS']);
262 /* Variables - select */
263 foreach(array(
264 "gotoXDriver", "gotoXResolution", "gotoXColordepth",
265 "gotoXKbModel", "gotoXKbLayout","gotoScannerEnable",
266 "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport") as $val){
268 $smarty->assign($val."_select", $this->$val);
269 }
271 /* Variables */
272 foreach(array("gotoXHsync", "gotoXVsync") as $val){
273 $smarty->assign($val, $this->$val);
274 }
275 $smarty->assign("staticAddress", "");
277 /* Checkboxes */
278 foreach(array("gotoScannerEnable") as $val){
279 if ($this->$val == TRUE) {
280 $smarty->assign("$val", "checked");
281 } else {
282 $smarty->assign("$val", "");
283 }
284 }
286 /* Phone stuff */
287 $smarty->assign ("goFonHardware", $this->goFonHardware);
289 $perms = "";
290 if(!$this->acl_is_writeable("goFonHardware")){
291 $perms = " disabled ";
292 }
294 $hl= "<select size=\"1\" name=\"goFonHardware\" ".$perms." title=\"".
295 _("Choose the phone located at the current terminal")."\" >";
296 foreach ($this->hardware_list as $cn => $description){
297 if ($cn == $this->goFonHardware){
298 $selected= "selected";
299 } else {
300 $selected= "";
301 }
302 if (isset($this->used_hardware[$cn])){
303 $color= "style=\"color:#A0A0A0\"";
304 } else {
305 $color= "";
306 }
307 $hl.= " <option $color label=\"$cn\" value=\"$cn\" $selected>$description</option>\n";
308 }
309 $hl.= "</select>\n";
310 $smarty->assign ("hardware_list", $hl);
311 $smarty->assign ("gotoXMonitor", $this->gotoXMonitor);
313 if($this->AutoSync){
314 $smarty->assign("AutoSyncCHK"," checked ");
315 $smarty->assign("hiddenState"," disabled ");
316 }else{
317 $smarty->assign("AutoSyncCHK"," ");
318 $smarty->assign("hiddenState","");
319 }
320 if($this->InheritXYSync) {
321 $smarty->assign("InheritXYSync", " checked ");
322 $smarty->assign("hiddenState", " disabled ");
323 $smarty->assign("AutoSynchiddenState", " disabled ");
324 } else {
325 $smarty->assign("InheritXYSync", "");
326 $smarty->assign("AutoSynchiddenState", "");
327 }
329 /* Show main page */
330 return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__))));
331 }
333 function remove_from_parent()
334 {
335 /* Cancel if there's nothing to do here */
336 if ((!$this->acl_is_removeable())){
337 return;
338 }
340 /* Remove and write to LDAP */
341 plugin::remove_from_parent();
342 $ldap = $this->config->get_ldap_link();
343 $ldap->cd($this->dn);
344 $this->cleanup();
345 $ldap->modify($this->attrs);
346 $this->handle_post_events("remove");
347 new log("remove","workstation/".get_class($this),$this->dn);
348 }
350 /* Save data to object */
351 function save_object()
352 {
353 plugin::save_object();
355 if((isset($_POST['workservicePosted'])) && $this->acl_is_writeable("AutoSync")) {
356 if(isset($_POST['AutoSync'])){
357 $this->AutoSync = true;
358 }else{
359 $this->AutoSync = false;
360 }
361 }
362 if(isset($_POST['workservicePosted'])) {
363 if(isset($_POST['InheritXYSync'])) {
364 $this->InheritXYSync = TRUE;
365 }else {
366 $this->InheritXYSync = FALSE;
367 }
368 }
369 }
371 /* Check supplied data */
372 function check()
373 {
374 /* Call common method to give check the hook */
375 $message= plugin::check();
377 /* Default entries can use blank hsync/vsync entries */
378 if ($this->dn != "" && $this->cn != "default" && $this->cn != "wdefault"){
380 /* But only if no auto sync is enabled... */
381 if (!$this->AutoSync && !$this->InheritXYSync){
384 $vsync_empty = FALSE;
385 $hsync_empty = FALSE;
387 /* Check vsync for correct usage */
388 $val= preg_replace ("/\s/", "", $this->gotoXVsync);
390 if($this->acl_is_writeable("gotoXVsync")){
391 if(empty($val)){
392 $vsync_empty = TRUE;
393 }elseif (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){
394 $message[]= msgPool::invalid(_("VSync"));
395 } else{
396 list($v1,$v2)= preg_split ("/[-+]/", $val);
397 if ($v2 != ""){
398 if ($v1 > $v2){
399 $message[]= msgPool::invalid(_("VSync"));
400 }
401 }
402 }
403 }
405 /* Check hsync for correct usage */
406 $val= preg_replace ("/\s/", "", $this->gotoXHsync);
407 if($this->acl_is_writeable("gotoXHsync")){
408 if(empty($val)){
409 $hsync_empty = TRUE;
410 }elseif (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){
411 $message[]= msgPool::invalid(_("HSync"));
412 } else{
413 list($v1,$v2)= preg_split ("/[-+]/", $val);
414 if ($v2 != ""){
415 if ($v1 > $v2){
416 $message[]= msgPool::invalid(_("HSync"));
417 }
418 }
419 }
420 }
422 /* Decide weither show empty value errors, if this is not an object group it
423 * will always be shown... */
424 $show_errors = TRUE;
425 if ($vsync_empty || $hsync_empty) {
427 if (isset($this->attrs['gosaGroupObjects'])) {
428 /* ... but an object group can contain empty values if both values are empty */
429 if ($vsync_empty != $hsync_empty) {
430 $show_errors = TRUE;
431 } else {
432 $show_errors = FALSE;
433 }
434 }
435 if ($show_errors && $vsync_empty) {
436 $message[]= msgPool::required(_("VSync"));
437 }
438 if ($show_errors && $hsync_empty) {
439 $message[] = msgPool::required(_("HSync"));
440 }
441 }
442 }
443 }
445 return ($message);
446 }
449 /* Save to LDAP */
450 function save()
451 {
452 /* remove objectclass GOhard if this is an ogroup tab */
453 if(isset($this->parent->by_object['ogroup'])){
454 $this->objectclasses = array();
455 }
457 plugin::save();
459 /* Strip out 'default' values */
460 foreach(array(
461 "gotoXDriver", "gotoXResolution", "gotoXColordepth",
462 "gotoXKbModel", "gotoXKbLayout", "gotoXDriver",
463 "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport") as $val){
465 if ($this->attrs[$val] == "default"){
466 $this->attrs[$val]= array();
467 }
468 }
470 if($this->InheritXYSync) {
471 $this->attrs['gotoXHsync'] = array();
472 $this->attrs['gotoXVsync'] = array();
473 }
475 if($this->AutoSync){
476 $this->attrs['gotoXHsync'] = "30+55";
477 $this->attrs['gotoXVsync'] = "50+70";
478 }
480 /* Write back to ldap */
481 $ldap= $this->config->get_ldap_link();
482 $ldap->cd($this->dn);
483 $this->cleanup();
486 $ldap->modify ($this->attrs);
487 new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
488 if (!$ldap->success()){
489 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
490 }
491 $this->handle_post_events("modify");
493 /* Send goto reload event to gosaSupportDaemon */
494 if(count($this->attrs)){
495 $this->send_goto_reload();
496 }
498 }
500 function loadHardwareList()
501 {
502 $ldap= $this->config->get_ldap_link();
504 if ($this->ogroup) {
505 $ldap->cat($this->ogroup);
506 } else {
507 $ldap->cd($this->config->current['BASE']);
508 $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))");
509 }
510 if ($ldap->count() == 1){
511 $this->member_of_ogroup = TRUE;
512 $attrs= $ldap->fetch();
513 $map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout",
514 "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport", "gotoXDriver",
515 "gotoXVsync", "gotoXHsync"
516 );
518 foreach ($map as $name){
519 if (!isset($attrs[$name][0])){
520 continue;
521 }
523 switch ($name){
524 case 'gotoXHsync':
525 if (empty($this->$name) && !empty($attrs[$name])) {
526 $this->$name = $attrs[$name][0];
527 $this->InheritXYSync = TRUE;
528 }
529 break;
530 case 'gotoXVsync':
531 if (empty($this->$name) && !empty($attrs[$name])) {
532 $this->$name = $attrs[$name][0];
533 $this->InheritXYSync = TRUE;
534 }
535 break;
536 case 'gotoXDriver':
537 $ogroup_driver = $attrs['gotoXDriver'][0];
538 if (in_array($ogroup_driver, $this->XDrivers) && (empty($this->attrs['gotoXDriver']))) {
539 $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
540 }
541 break;
542 case 'gotoXResolution':
543 $this->XResolutions= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XResolutions;
544 break;
545 case 'gotoXColordepth':
546 $this->XColordepths= array('default' => _("inherited").' ['.$attrs[$name][0].' '._('Bit').']') + $this->XColordepths;
547 break;
548 case 'gotoXKbModel':
549 $this->XKbModels= array('default' => _("inherited").' ['.$attrs[$name][0].']') + $this->XKbModels;
550 break;
551 case 'gotoXKbLayout':
552 $this->XKbLayouts= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbLayouts;
553 break;
554 case 'gotoXKbVariant':
555 $this->XKbVariants= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbVariants;
556 break;
557 case 'gotoXMouseType':
558 $this->MouseTypes= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MouseTypes;
559 break;
560 case 'gotoXMouseport':
561 $this->MousePorts= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MousePorts;
562 break;
563 }
565 }
567 }
570 }
572 function getListOfXDrivers()
573 {
574 /* Generate a list of xdrivers from CONFIG_DIR./xdrivers */
575 $drivers = array();
576 if (file_exists(CONFIG_DIR.'/xdrivers')){
577 $xdrivers = file (CONFIG_DIR.'/xdrivers');
578 foreach ($xdrivers as $line){
579 if (!preg_match ("/^#/", $line)){
580 $drivers[]= trim($line);
581 }
582 }
583 } else {
584 $drivers = array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev", "fglrx",
585 "i128", "i740", "i810", "intel", "imstt", "mga", "neomagic", "newport", "nsc", "nv", "nvidia",
586 "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
587 "sis", "tdfx", "tga", "trident", "tseng", "vboxvideo", "vesa", "vga", "vmware");
588 }
589 return($drivers);
590 }
593 /* Return plugin informations for acl handling */
594 static function plInfo()
595 {
596 return (array(
597 "plShortName" => _("Service"),
598 "plDescription" => _("Workstation service"),
599 "plSelfModify" => FALSE,
600 "plDepends" => array(),
601 "plPriority" => 10,
602 "plSection" => array("administration"),
603 "plCategory" => array("workstation","ogroups"),
605 "plProvidedAcls"=> array(
606 "gotoXMonitor" => _("Monitor"),
607 "gotoXDriver" => _("Gfx driver"),
608 "gotoXResolution" => _("Gfx resolution"),
609 "gotoXColordepth" => _("Gfx color depth"),
610 "gotoXHsync" => _("HSync"),
611 "gotoXVsync" => _("VSync"),
612 "AutoSync" => _("Use DDC"),
613 "gotoScannerEnable" => _("Scanner enabled"),
614 "gotoXKbModel" => _("Keyboard model"),
615 "gotoXKbLayout" => _("Keyboard layout"),
616 "gotoXKbVariant" => _("Keyboard variant"),
617 "gotoXMouseType" => _("Mouse type"),
618 "gotoXMouseport" => _("Mouse port"),
619 "goFonHardware" => _("Telephone hardware"))
620 ));
621 }
624 /*! \brief Send goto_reload event to support daemon
625 */
626 function send_goto_reload()
627 {
628 if(count($this->attrs) && class_available("DaemonEvent")){
629 $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
630 $o_queue = new gosaSupportDaemon();
631 if(isset($events['TRIGGERED']['DaemonEvent_goto_reload'])){
632 $evt = $events['TRIGGERED']['DaemonEvent_goto_reload'];
633 $macs = array();
635 /* Get list of macAddresses
636 */
637 if(isset($this->parent->by_object['ogroup'])){
639 /* If we are an object group, add all member macs
640 */
641 $p = $this->parent->by_object['ogroup'];
642 foreach($p->memberList as $dn => $obj){
643 if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$dn)) continue;
644 if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
645 $macs[] = $p->objcache[$dn]['macAddress'];
646 }
647 }
648 }elseif(isset($this->parent->by_object['workgeneric']->netConfigDNS->macAddress)){
650 /* We are a workstation. Add current mac.
651 */
652 $mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
653 if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){
654 $macs[] = $mac;
655 }
656 }
658 /* Trigger event for all member objects
659 */
660 if(count($macs)){
661 $tmp = new $evt['CLASS_NAME']($this->config);
662 $tmp->set_type(TRIGGERED_EVENT);
663 $target = $o_queue->get_host().":".$o_queue->get_port();
664 $tmp->add_targets(array($target));
665 $tmp->set_macs($macs);
666 if(!$o_queue->append($tmp,TRUE)){
667 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
668 }
669 }
670 }
671 }
672 }
675 function PrepareForCopyPaste($source)
676 {
677 plugin::PrepareForCopyPaste($source);
679 if(preg_match("/\+/",$this->gotoXHsync)){
680 $this->AutoSync = true;
681 $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync);
682 $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync);
683 }
684 }
685 }
687 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
688 ?>