[gosa.git] / gosa-plugins / goto / admin / systems / services / terminal / class_goTerminalServer.inc
diff --git a/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc b/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc
index e832de04cc36ff4603bcc9f2962ee5ce657617c2..c276164ca718be196c413fb813bd7c8b01b0ac62 100644 (file)
/* This plugin only writes its objectClass */
var $objectclasses = array("goTerminalServer");
- var $attributes = array("goXdmcpIsEnabled", "goFontPath");
+ var $attributes = array("goXdmcpIsEnabled","gotoSessionType");
var $StatusFlag = "goTerminalServerStatus";
-
+
/* This class can't be assigned twice so it conflicts with itsself */
var $conflicts = array("goTerminalServer");
var $cn = "";
var $goTerminalServerStatus = "";
var $goXdmcpIsEnabled = false;
- var $goFontPath = "";
- var $view_logged =FALSE;
+ var $view_logged = FALSE;
+ var $gotoSessionType = array();
function goTerminalServer(&$config,$dn)
{
goService::goService($config,$dn);
$this->DisplayName = _("Terminal service");
+
+ $tmp = array();
+ if(isset($this->attrs['gotoSessionType'])){
+ for($i =0; $i < $this->attrs['gotoSessionType']['count'] ; $i++){
+ $tmp[] = $this->attrs['gotoSessionType'][$i];
+ }
+ }
+ $this->gotoSessionType = $tmp;
+ $this->gotoSessionTypes= array("LDM","XDCMP","RDP","CITRIX");
}
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
}
+
+ $tmp = array();
+ foreach($this->gotoSessionTypes as $type){
+ if(in_array($type,$this->gotoSessionType)){
+ $tmp[$type] = TRUE;
+ }else{
+ $tmp[$type] = FALSE;
+ }
+ }
+ $smarty->assign("gotoSessionTypes",$tmp);
+
return($smarty->fetch(get_template_path("goTerminalServer.tpl",TRUE,dirname(__FILE__))));
}
{
$fields = goService::getListEntry();
$fields['Message'] = _("Terminal service");
- $fields['AllowEdit'] = true;
+ #$fields['AllowEdit'] = true;
return($fields);
}
$this->attrs['goXdmcpIsEnabled'] = "0";
}
+ $this->attrs['gotoSessionType'] = array_values($this->gotoSessionType);
+
/* Check if this is a new entry ... add/modify */
$ldap = $this->config->get_ldap_link();
$ldap->cat($this->dn,array("objectClass"));
$ldap->cd($this->dn);
$ldap->add($this->attrs);
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/terminalServer with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+ }
if($this->initially_was_account){
$this->handle_post_events("modify");
new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
function check()
{
$message = plugin::check();
- if(empty($this->goFontPath)){
- $message[]=_("Terminal server, must have fontpath specified.");
- }
-
return($message);
}
{
if(isset($_POST['goTerminalServerPosted'])){
plugin::save_object();
+
+ $this->gotoSessionType = array();
+ foreach($this->gotoSessionTypes as $attr){
+ if(isset($_POST['gotoSessionType_'.$attr])){
+ $this->gotoSessionType[] = $attr;
+ }
+ }
+
if($this->acl_is_writeable("goXdmcpIsEnabled")){
if(isset($_POST['goXdmcpIsEnabled'])){
$this->goXdmcpIsEnabled = true;
}
+ function PrepareForCopyPaste($obj)
+ {
+ plugin::PrepareForCopyPaste($obj);
+ $tmp = array();
+ if(isset($obj['gotoSessionType'])){
+ for($i =0; $i < $obj['gotoSessionType']['count'] ; $i++){
+ $tmp[] = $obj['gotoSessionType'][$i];
+ }
+ }
+ $this->gotoSessionType = $tmp;
+ $this->gotoSessionTypes= array("LDM","XDCMP","RDP","CITRIX");
+ }
+
+
/* Return plugin informations for acl handling */
static function plInfo()
{
"plCategory" => array("server"),
"plProvidedAcls"=> array(
- "goXdmcpIsEnabled" => _("Temporary disable login"),
- "goFontPath" => _("Font path"))
+ "goXdmcpIsEnabled" => _("Temporary disable login"))
));
}