diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index c624f017c42ad2ad4509a102b6aed4ccea985c4f..02e5b7ea0c81668b990c35aacdbff524795c686c 100644 (file)
class workstartup extends plugin
{
class workstartup extends plugin
{
- /* CLI vars */
- var $cli_summary= "Manage terminal startup options";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* Generic terminal attributes */
var $bootmode = "G";
var $goLdapServerList = array();
/* Generic terminal attributes */
var $bootmode = "G";
var $goLdapServerList = array();
var $FAIServRepConfig = array();
var $fai_activated = FALSE;
var $FAIServRepConfig = array();
var $fai_activated = FALSE;
+ var $member_of_ogroup = FALSE;
function workstartup ($config, $dn= NULL, $parent= NULL)
{
function workstartup ($config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
plugin::plugin ($config, $dn, $parent);
+ if(!isset($this->parent->by_object['ogroup'])){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+ $this->member_of_ogroup = $ldap->count() >= 1;
+ }
+
/* Creating a list of valid Mirrors
* none will not be saved to ldap.
*/
/* Creating a list of valid Mirrors
* none will not be saved to ldap.
*/
['PACKAGES'][0] "pkg1";
['PACKAGES'][1] "postfix";
*/
['PACKAGES'][0] "pkg1";
['PACKAGES'][1] "postfix";
*/
-
- $ldap->search("(&(FAIrepository=*)(objectClass=FAIrepositoryServer))",array("FAIrepository"));
+ $filter= "";
+ $ui= get_userinfo();
+ if (isset($config->current['STRICT_UNITS']) && preg_match('/TRUE/i', $config->current['STRICT_UNITS']) && $ui->gosaUnitTag != ""){ $filter= "(gosaUnitTag=".$ui->gosaUnitTag.")";
+ } $ldap->search("(&(FAIrepository=*)(objectClass=FAIrepositoryServer)$filter)",array("FAIrepository"));
$test = array();
while($attr = $ldap->fetch()){
if(isset($attr['FAIrepository'])){
$test = array();
while($attr = $ldap->fetch()){
if(isset($attr['FAIrepository'])){
}
sort ($this->$val);
$this->$val= array_unique($this->$val);
}
sort ($this->$val);
$this->$val= array_unique($this->$val);
+ $this->saved_attributes[$val]= $this->$val;
}
/* Parse Kernel Parameters to decide what boot mode is enabled */
}
/* Parse Kernel Parameters to decide what boot mode is enabled */
/* Load hardware list */
/* Load hardware list */
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
- if ($ldap->count() == 1){
+ if ($this->member_of_ogroup){
+ if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
+ $this->FAIdebianMirror = "inherited";
+ }
if($this->fai_activated){
$map= array("gotoLdapServer","FAIclass","FAIdebianMirror","gotoBootKernel");
if($this->fai_activated){
$map= array("gotoLdapServer","FAIclass","FAIdebianMirror","gotoBootKernel");
$this->gotoBootKernel= "default";
}
$this->gotoBootKernel= "default";
}
- if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
- $this->FAIdebianMirror = "inherited";
- }
}
}
}
/* Add module */
}
/* Add module */
- if (isset ($_POST['add_module'])){
+ if (isset ($_POST['add_module']) ){
if ($_POST['module'] != "" && chkacl ($this->acl, "gotoModule") == ""){
$this->add_list ($this->gotoModules, $_POST['module']);
}
if ($_POST['module'] != "" && chkacl ($this->acl, "gotoModule") == ""){
$this->add_list ($this->gotoModules, $_POST['module']);
}
}
/* FAI class management */
}
/* FAI class management */
- if($this->fai_activated){
+ if($this->fai_activated && chkacl($this->acl,"FAIclass") == ""){
if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){
$found = 0 ;
if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){
$found = 0 ;
/* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
* This entry will be, a combination of mountPoint and sharedefinitions
*/
/* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
* This entry will be, a combination of mountPoint and sharedefinitions
*/
- if(isset($_POST['gotoShareAdd'])){
+ if(isset($_POST['gotoShareAdd']) && chkacl($this->acl,"gotoShare") ==""){
/* We assign a share to this user, if we don't know where to mount the share */
if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
print_red(_("You must specify a valid mount point."));
/* We assign a share to this user, if we don't know where to mount the share */
if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
print_red(_("You must specify a valid mount point."));
/* if the Post gotoShareDel is set, someone asked GOsa to delete the selected entry (if there is one selected)
* If there is no defined share selected, we will abort the deletion without any message
*/
/* if the Post gotoShareDel is set, someone asked GOsa to delete the selected entry (if there is one selected)
* If there is no defined share selected, we will abort the deletion without any message
*/
- if((isset($_POST['gotoShareDel']))&&(isset($_POST['gotoShare']))){
+ if((isset($_POST['gotoShareDel']))&&(isset($_POST['gotoShare'])) && chkacl($this->acl,"gotoShare") ==""){
unset($this->gotoShares[$_POST['gotoShare']]);
}
unset($this->gotoShares[$_POST['gotoShare']]);
}
$use = " checked ";
};
$use = " checked ";
};
+ $use .= chkacl($this->acl,"gotoLdapServer");
+
$display = $server;
$SelectBoxLdapServer->AddEntry(
$display = $server;
$SelectBoxLdapServer->AddEntry(
function getFAIdebianMirrors()
{
$ret = array();
function getFAIdebianMirrors()
{
$ret = array();
- $ret['inherited']="["._("inherited")."]";
+
+ /* Only add inherit option, if we are part in an object group
+ */
+ if($this->member_of_ogroup) {
+ $ret['inherited']="["._("inherited")."]";
+ }
+
$ret['auto']=_("automatic");
$secs = array();
$ret['auto']=_("automatic");
$secs = array();