diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc
index eff161899b0b1e94d1072b7a4a76e9811f61dff2..9c7fccefae5762a32e3b32960a267f8b11d09f4a 100644 (file)
/* attribute list for save action */
var $ignore_account = FALSE;
var $plHeadline = "Desktop";
- var $plDescription = "This does something";
+ var $plDescription = "Manage desktop settings";
var $dialog = false; // Indicates that we are currently editing in an seperate dialog
var $in_dialog = false;
"1280x768" => "1280x768",
"1280x1024" => "1280x1024");
- if($this->config->get_cfg_value("resolutions") != ""){
- $file = $this->config->get_cfg_value("resolutions");
+ if($this->config->get_cfg_value("environment","resolutions") != ""){
+ $file = $this->config->get_cfg_value("environment","resolutions");
if(is_readable($file)){
$str = file_get_contents($file);
}
}
- if($cnt && $this->config->search("environment","kioskpath",array('menu','tabs'))){
+ $tmp = $this->config->get_cfg_value("environment","kioskPath");
+ if($cnt && !empty($tmp)){
$this->kiosk_enabled = TRUE;
}
$error = false;
if(!isset($this->gotoKioskProfiles['SERVERS'][$this->gotoKioskProfile_Server])){
$error = true;
- }elseif(!in_array($this->gotoKioskProfile_Profile, $this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+ }elseif(!in_array_strict($this->gotoKioskProfile_Profile, $this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
$error = true;
}
if($error && !empty($this->gotoKioskProfile)){
/* Log view */
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
- if(isset($this->parent->by_object['user']) || (isset($this->attrs['objectClass']) &&in_array("gosaAccount",$this->attrs['objectClass']))){
+ if(isset($this->parent->by_object['user']) || (isset($this->attrs['objectClass']) &&in_array_strict("gosaAccount",$this->attrs['objectClass']))){
new log("view","users/".get_class($this),$this->dn);
}else{
new log("view","groups/".get_class($this),$this->dn);
/* Prepare all variables for smarty */
foreach($this->attributes as $s_attr){
/* Set value*/
- $smarty->assign($s_attr,$this->$s_attr);
+ $smarty->assign($s_attr,set_post($this->$s_attr));
/* Set checkbox state*/
if(empty($this->$s_attr)){
}
/* Group Dialog with enabled environment options */
if ($this->is_account){
- $display= $this->show_enable_header(msgPool::removeFeaturesButton(_("Desktop")),
+ $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("Desktop")),
msgPool::featuresEnabled(_("Desktop")));
} else {
If theres is no posixAccount enabled, you won't be able to enable
environment extensions
*/
- if((isset($this->parent->by_object['group']))||(isset($this->attrs['objectClass']))&&((in_array("posixAccount",$this->attrs['objectClass'])))){
+ if((isset($this->parent->by_object['group']))||(isset($this->attrs['objectClass']))&&((in_array_strict("posixAccount",$this->attrs['objectClass'])))){
$display= $this->show_enable_header(msgPool::addFeaturesButton(_("Desktop")),
msgPool::featuresDisabled(_("Desktop")));
return $display;
// 3. Account enabled . Editing from adminmenu
if ($this->is_account){
- $display= $this->show_enable_header(msgPool::removeFeaturesButton(_("Desktop")),
+ $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("Desktop")),
msgPool::featuresEnabled(_("Desktop")));
} else {
/* Prepare all variables for smarty */
foreach($this->attributes as $s_attr){
/* Set value*/
- $smarty->assign($s_attr,$this->$s_attr);
+ $smarty->assign($s_attr,set_post($this->$s_attr));
/* Set checkbox state*/
if(empty($this->$s_attr)){
}
- $smarty->assign("gotoXResolutions" , $this->gotoXResolutions);
- $smarty->assign("gotoXResolutionKeys" , array_flip($this->gotoXResolutions));
+ $smarty->assign("gotoXResolutions" , set_post($this->gotoXResolutions));
+ $smarty->assign("gotoXResolutionKeys" , set_post(array_flip($this->gotoXResolutions)));
- $smarty->assign("gotoProfileServers",$this->gotoProfileServers);
+ $smarty->assign("gotoProfileServers", set_post($this->gotoProfileServers));
if(!is_array($this->gotoProfileServers)){
$this->gotoProfileServers =array();
}
/* Handle kiosk profiles*/
- $smarty->assign("kiosk_servers" , $this->gotoKioskProfiles['SERVERS']);
- $smarty->assign("kiosk_server" , $this->gotoKioskProfile_Server);
- $smarty->assign("kiosk_profiles" , $this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server]);
- $smarty->assign("kiosk_profile" , $this->gotoKioskProfile_Profile);
+ $smarty->assign("kiosk_servers" , set_post($this->gotoKioskProfiles['SERVERS']));
+ $smarty->assign("kiosk_server" , set_post($this->gotoKioskProfile_Server));
+ $smarty->assign("kiosk_profiles", set_post($this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server]));
+ $smarty->assign("kiosk_profile" , set_post($this->gotoKioskProfile_Profile));
/* Logonscript Management
if(isset($_POST['LogonSave'])){
if(!$this->acl_is_writeable("gotoLogonScript")){
- msg_dialog::display(_("Permission error"), msgPool::permModify(_("Logon scripts")), ERROR_DIALOG);
+ msg_dialog::display(_("Permission error"), msgPool::permModify(_("Log on scripts")), ERROR_DIALOG);
unset($this->dialog);
$this->dialog=FALSE;
$this->is_dialog=false;
* There must be an entry selected to perform edit request.
*/
if((isset($_POST['gotoLogonScriptEdit']))&&(isset($_POST['gotoLogonScript']))){
- $is_entry = $this->gotoLogonScripts[$_POST['gotoLogonScript']];
+ $is_entry = $this->gotoLogonScripts[get_post('gotoLogonScript')];
$this->is_dialog = true;
$this->dialog = new logonManagementDialog($this->config,$this->dn,$is_entry);
}
/* Append List to smarty*/
if($this->multiple_support_active){
- $smarty->assign("gotoLogonScripts", $this->gotoLogonScripts);
- $smarty->assign("gotoLogonScriptKeysCnt",count($this->gotoLogonScripts));
+ $smarty->assign("gotoLogonScripts", set_post($this->gotoLogonScripts));
+ $smarty->assign("gotoLogonScriptKeysCnt", count($this->gotoLogonScripts));
}else{
$ls = $this->printOutLogonScripts();
- $smarty->assign("gotoLogonScripts", $ls);
- $smarty->assign("gotoLogonScriptKeys",array_flip($ls));
+ $smarty->assign("gotoLogonScripts", set_post($ls));
+ $smarty->assign("gotoLogonScriptKeys",set_post(array_flip($ls)));
$smarty->assign("gotoLogonScriptKeysCnt",count($ls));
}
* and attach this combination to his setup.
*/
- $smarty->assign("gotoShareSelections", $this->gotoShareSelections);
+ $smarty->assign("gotoShareSelections", set_post($this->gotoShareSelections));
if(!is_array($this->gotoShareSelections)){
$this->gotoShareSelections = array();
}
- $smarty->assign("gotoShareSelectionKeys", array_flip($this->gotoShareSelections));
+ $smarty->assign("gotoShareSelectionKeys", set_post(array_flip($this->gotoShareSelections)));
/* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
* This entry will be, a combination of mountPoint and sharedefinitions
){
msg_dialog::display(_("Error"), msgPool::invalid(_("Mount point")), ERROR_DIALOG);
}else{
- $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
- $s_mount = $_POST['gotoShareMountPoint'];
- $s_user = $_POST['ShareUser'];
+ $a_share = $this->gotoAvailableShares[get_post('gotoShareSelection')];
+ $s_mount = get_post('gotoShareMountPoint');
+ $s_user = get_post('ShareUser');
/* Preparing the new assignment */
$this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share;
$this->gotoShares[$a_share['name']."|".$a_share['server']]['Username']=$s_user;
}
if($this->multiple_support_active){
- $smarty->assign("gotoHotplugDevices",$this->gotoHotplugDevices);
+ $smarty->assign("gotoHotplugDevices", set_post($this->gotoHotplugDevices));
}else{
- $smarty->assign("gotoHotplugDevices",$this->printOutHotPlugDevices());
- $smarty->assign("gotoHotplugDeviceKeys",array_flip($this->printOutHotPlugDevices()));
+ $smarty->assign("gotoHotplugDevices", set_post($this->printOutHotPlugDevices()));
+ $smarty->assign("gotoHotplugDeviceKeys",set_post(array_flip($this->printOutHotPlugDevices())));
}
/* Printer Assignment will managed below
if((isset($_POST['gotoPrinterDel']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
- $printer = $_POST['gotoPrinterSel'];
+ $printer = get_post('gotoPrinterSel');
foreach($printer as $pname){
$printerObj = new printtabs($this->config,$this->config->data['TABS']['PRINTTABS'],$this->gotoPrinter[$pname]['dn'],"printer");
}
if((isset($_POST['gotoPrinterEdit']))&&(isset($_POST['gotoPrinterSel']))&&(!empty($_POST['gotoPrinterSel']))){
- $printers = $_POST['gotoPrinterSel'];
+ $printers = get_post('gotoPrinterSel');
$this->add_del_printer_member_was_called = true;
foreach($printers as $printer){
if($this->gotoPrinter[$printer]['mode']=="user"){
}
}
- $smarty->assign("gotoPrinter",$this->printOutPrinterDevices());
+ $smarty->assign("gotoPrinter", set_post($this->printOutPrinterDevices()));
/* General behavior */
if(is_object($this->dialog)){
foreach(array("gotoPrinter","kiosk_server","gotoProfileFlagL","gotoXResolution",
"useProfile","gotoProfileServer","gotoProfileQuota","gotoProfileFlagC") as $box){
$ubox ="use_".$box;
- if(in_array($box,$this->multi_boxes)){
+ if(in_array_strict($box,$this->multi_boxes)){
$smarty->assign($ubox,TRUE);
}else{
$smarty->assign($ubox,FALSE);
$PACL = $this->getacl("gotoProfileServer").$this->getacl("gotoProfileQuota");
if(isset($_POST['kiosk_server'])){
- $tmp = $_POST['kiosk_server'];
+ $tmp = get_post('kiosk_server');
if(isset($this->gotoKioskProfiles['SERVERS'][$tmp])){
- $this->gotoKioskProfile_Server = $_POST['kiosk_server'];
+ $this->gotoKioskProfile_Server = get_post('kiosk_server');
}
}
if(isset($_POST['kiosk_profile'])){
- $tmp = $_POST['kiosk_profile'];
- if(in_array($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
- $this->gotoKioskProfile_Profile = $_POST['kiosk_profile'];
+ $tmp = get_post('kiosk_profile');
+ if(in_array_strict($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+ $this->gotoKioskProfile_Profile = get_post('kiosk_profile');
}
}
if($this->acl_is_writeable("gotoProfileFlagC")){
if(isset($_POST['gotoProfileFlagC'])){
- $this->gotoProfileFlagC = $_POST['gotoProfileFlagC'];
+ $this->gotoProfileFlagC = get_post('gotoProfileFlagC');
}else{
$this->gotoProfileFlagC = false;
}
if($this->acl_is_writeable("gotoProfileFlagL")){
if(isset($_POST['gotoProfileFlagL'])){
- $this->gotoProfileFlagL = $_POST['gotoProfileFlagL'];
+ $this->gotoProfileFlagL = get_post('gotoProfileFlagL');
}else{
$this->gotoProfileFlagL = false;
}
plugin::save_object();
foreach($this->attributes as $s_attr){
if((!isset($_POST[$s_attr])) ||
- in_array($s_attr,array("gosaDefaultPrinter","gotoShare","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
+ in_array_strict($s_attr,array("gosaDefaultPrinter","gotoShare","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
if(!$this->acl_is_writeable($s_attr)){
continue;
}else{
if(isset($_POST[$s_attr])){
- $this->$s_attr = $_POST[$s_attr];
+ $this->$s_attr = get_post($s_attr);
}else{
$this->$s_attr = false;
}
$this->attrs['objectClass']=array();
}
if(!$this->is_group){
- if((!((in_array("posixAccount",$this->attrs['objectClass']))||($this->parent->by_object['posixAccount']->is_account==true)))&&(!$this->is_group)){
+ if((!((in_array_strict("posixAccount",$this->attrs['objectClass']))||($this->parent->by_object['posixAccount']->is_account==true)))&&(!$this->is_group)){
$message[]= msgPool::featuresDisabled(_("environment"),_("POSIX"));
}
}
function saveCopyDialog()
{
if(isset($_POST['cn'])){
- $this->cn = $_POST['cn'];
- $this->uid = $_POST['cn'];
+ $this->cn = get_post('cn');
+ $this->uid = get_post('cn');
}
}
$ret['gotoLogonScripts'] = $this->gotoLogonScripts;
$ret['gotoHotplugDevices'] = $this->gotoHotplugDevices;
- if(in_array("gotoPrinter",$this->multi_boxes)){
+ if(in_array_strict("gotoPrinter",$this->multi_boxes)){
$ret['gotoPrinter'] = $this->gotoPrinter;
$ret['gotoPrinterSel'] = $this->gotoPrinterSel;
$ret['gosaDefaultPrinter'] = $this->gosaDefaultPrinter;
$ret['add_del_printer_member_was_called'] = TRUE;
}
- if(in_array("gotoProfileFlagL",$this->multi_boxes)){
+ if(in_array_strict("gotoProfileFlagL",$this->multi_boxes)){
$ret['gotoProfileFlagL'] = $this->gotoProfileFlagL;
}
- if(in_array("useProfile",$this->multi_boxes)){
+ if(in_array_strict("useProfile",$this->multi_boxes)){
$ret['useProfile']=$this->useProfile;
- if(in_array("gotoProfileServer",$this->multi_boxes)){
+ if(in_array_strict("gotoProfileServer",$this->multi_boxes)){
$ret['gotoProfileServer']=$this->gotoProfileServer;
}
- if(in_array("gotoProfileQuota",$this->multi_boxes)){
+ if(in_array_strict("gotoProfileQuota",$this->multi_boxes)){
$ret['gotoProfileQuota']=$this->gotoProfileQuota;
}
- if(in_array("gotoProfileFlagC",$this->multi_boxes)){
+ if(in_array_strict("gotoProfileFlagC",$this->multi_boxes)){
$ret['gotoProfileFlagC'] = $this->gotoProfileFlagC;
}
}
- if(in_array("gotoXResolution",$this->multi_boxes)){
+ if(in_array_strict("gotoXResolution",$this->multi_boxes)){
$ret['gotoXResolution'] = $this->gotoXResolution;
}
- if(in_array("kiosk_server",$this->multi_boxes)){
+ if(in_array_strict("kiosk_server",$this->multi_boxes)){
$ret['gotoKioskProfile_Server'] = $this->gotoKioskProfile_Server;
$ret['gotoKioskProfile_Profile'] = $this->gotoKioskProfile_Profile;
}
$message = plugin::multiple_check();
$this->detect_grouptype();
- if(preg_match("/[^0-9]/",$this->gotoProfileQuota) && in_array("gotoProfileQuota",$this->multi_boxes)) {
+ if(preg_match("/[^0-9]/",$this->gotoProfileQuota) && in_array_strict("gotoProfileQuota",$this->multi_boxes)) {
$message[] = msgPool::invalid(_("Profile quota"),$this->gotoProfileQuota,"/[0-9]/") ;
}
return($message);
$this->useProfile = false;
}
if(isset($_POST['gotoProfileFlagC'])){
- $this->gotoProfileFlagC = $_POST['gotoProfileFlagC'];
+ $this->gotoProfileFlagC = get_post('gotoProfileFlagC');
}else{
$this->gotoProfileFlagC = false;
}
if(isset($_POST['gotoProfileFlagL'])){
- $this->gotoProfileFlagL = $_POST['gotoProfileFlagL'];
+ $this->gotoProfileFlagL = get_post('gotoProfileFlagL');
}else{
$this->gotoProfileFlagL = false;
}
}
}
if(isset($_POST['kiosk_server'])){
- $tmp = $_POST['kiosk_server'];
+ $tmp = get_post('kiosk_server');
if(isset($this->gotoKioskProfiles['SERVERS'][$tmp])){
- $this->gotoKioskProfile_Server = $_POST['kiosk_server'];
+ $this->gotoKioskProfile_Server = get_post('kiosk_server');
}
}
if(isset($_POST['kiosk_profile'])){
- $tmp = $_POST['kiosk_profile'];
- if(in_array($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
- $this->gotoKioskProfile_Profile = $_POST['kiosk_profile'];
+ $tmp = get_post('kiosk_profile');
+ if(in_array_strict($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+ $this->gotoKioskProfile_Profile = get_post('kiosk_profile');
}
}
#FIXME these ACLs should work for groups too */
static function plInfo()
{
- return (array("plShortName" => _("Desktop"),
- "plDescription" => _("Desktop settings"), // Description
- "plSelfModify" => TRUE,
- "plDepends" => array("user", "posixAccount"), // This plugin depends on
- "plPriority" => 3, // Position in tabs
- "plSection" => array("personal" => _("My account")),
- "plCategory" => array("users",
- "groups"),
- "plOptions" => array("resolution_hook" => array("type" => "string",
- "description" => _("Command to extend the list of possible screen resolutions"))),
-
- "plProvidedAcls" => array(
-
- "gotoPrinter" => _("Printer") ,
- "gotoProfileServer" => _("Profile server") ,
- "gosaDefaultPrinter" => _("Default printer"),
- "gotoProfileQuota" => _("Profile quota") ,
- "gotoProfileFlagC" => _("Cache profile localy") ,
- "gotoShare" => _("Shares"),
- "gotoHotplugDeviceDN" => _("Hotplug devices"),
- "gotoKioskProfile" => _("Kiosk profile") ,
- "gotoProfileFlagL" => _("Resolution changeable during session") ,
- "gotoXResolution" => _("Resolution") ,
- "gotoLogonScript" => _("Logon script"))
- ));
+ return (array("plShortName" => _("Desktop"),
+ "plDescription" => _("Desktop settings"), // Description
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user", "posixAccount"), // This plugin depends on
+ "plPriority" => 3, // Position in tabs
+ "plSection" => array("personal" => _("My account")),
+ "plCategory" => array("users",
+ "groups","ogroups"),
+ "plOptions" => array("resolution_hook" => array("type" => "string",
+ "description" => _("Command to extend the list of possible screen resolutions"))),
+ "plRequirements"=> array(
+ 'ldapSchema' => array('gotoEnvironment' => '>=2.7'),
+ 'onFailureDisablePlugin' => array(get_class())
+ ),
+ "plProperties" => array(
+
+ array(
+ "name" => "resolutions",
+ "type" => "file",
+ "default" => "",
+ "description" => _("File containing additional resolutions for workstations and thin clients."),
+ "check" => "gosaProperty::isReadableFile",
+ "migrate" => "",
+ "group" => "environment",
+ "mandatory" => FALSE
+ ),
+ array(
+ "name" => "kioskPath",
+ "type" => "path",
+ "default" => "/var/spool/kiosk",
+ "description" => _("Directory to store KDE kiosk profiles."),
+ "check" => "gosaProperty::isWriteablePath",
+ "migrate" => "",
+ "group" => "environment",
+ "mandatory" => FALSE
+ )
+ ),
+
+
+ "plProvidedAcls" => array(
+
+ "gotoPrinter" => _("Printer") ,
+ "gotoProfileServer" => _("Profile server") ,
+ "gosaDefaultPrinter" => _("Default printer"),
+ "gotoProfileQuota" => _("Profile quota") ,
+ "gotoProfileFlagC" => _("Cache profile locally") ,
+ "gotoShare" => _("Shares"),
+ "gotoHotplugDeviceDN" => _("Hot-plug devices"),
+ "gotoKioskProfile" => _("Kiosk profile") ,
+ "gotoProfileFlagL" => _("Resolution changeable during session") ,
+ "gotoXResolution" => _("Resolution") ,
+ "gotoLogonScript" => _("Log on script"))
+ ));
}
}