summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 484ca4c)
raw | patch | inline | side by side (parent: 484ca4c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Aug 2006 11:12:44 +0000 (11:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Aug 2006 11:12:44 +0000 (11:12 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4415 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/samba/class_sambaAccount.inc | patch | blob | history | |
plugins/personal/samba/main.inc | patch | blob | history |
diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc
index 1516071113e15679b60e2e90d45c3b3817e52ff5..edc286e0ea0fd5666f6987f75cf596110d8a9963 100644 (file)
}
}
+ $SkipWrite = (!isset($this->parent) || !$this->parent) && !isset($_SESSION['edit']);
+
/* Prepare templating */
$smarty= get_smarty();
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $var => $rest){
- $smarty->assign($var."ACL",$this->getacl($var));
+ $smarty->assign($var."ACL",$this->getacl($var,$SkipWrite));
}
if ($this->sambaPwdMustChange=="0"){
/* Remove user workstations? */
if (isset($_POST["delete_ws"]) && isset($_POST['workstation_list'])){
- if($this->acl_is_writeable("sambaUserWorkstations")){
+ if($this->acl_is_writeable("sambaUserWorkstations",$SkipWrite)){
$tmp= $this->sambaUserWorkstations;
foreach($_POST['workstation_list'] as $name){
/* Add user workstation? */
if (isset($_POST["add_ws"])){
- if($this->acl_is_writeable("sambaUserWorkstations")){
+ if($this->acl_is_writeable("sambaUserWorkstations",$SkipWrite)){
$this->show_ws_dialog= TRUE;
$this->dialog= TRUE;
}
$smarty->assign("tsloginstate", $this->mungedObject->getTsLogin()?"":"disabled");
$smarty->assign("inheritstate", "");
- if($this->acl_is_writeable("AllowLoginOnTerminalServer")){
+ if($this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite)){
$smarty->assign("inheritstate", $this->mungedObject->getInheritMode()?"disabled":"");
}
function save_object()
{
+ $SkipWrite = (!isset($this->parent) || !$this->parent) && !isset($_SESSION['edit']);
/* We only care if we are on the sambaTab... */
if (isset($_POST['sambaTab'])){
plugin::save_object();
/* Take care about access options */
- if ($this->acl_is_writeable("sambaAcctFlagsL") || ($this->acl_is_writeable("sambaAcctFlagsN"))){
+ if ($this->acl_is_writeable("sambaAcctFlagsL",$SkipWrite) || ($this->acl_is_writeable("sambaAcctFlagsN",$SkipWrite))){
if ($this->samba3){
$attrname= "sambaPwdCanChange";
} else {
$tmp= "[$tmp$fill]";
/* Only save if acl's are set */
- if ($this->acl_is_writeable("sambaAcctFlagsL") || ($this->acl_is_writeable("sambaAcctFlagsN"))){
+ if ($this->acl_is_writeable("sambaAcctFlagsL",$SkipWrite) || ($this->acl_is_writeable("sambaAcctFlagsN",$SkipWrite))){
if ($this->samba3){
$attrname= "sambaAcctFlags";
} else {
}
/* Save sambaDomain attribute */
- if ($this->acl_is_writeable("sambaDomainName") && $this->samba3 && isset ($_POST['sambaDomainName'])){
+ if ($this->acl_is_writeable("sambaDomainName",$SkipWrite) && $this->samba3 && isset ($_POST['sambaDomainName'],$SkipWrite)){
$this->sambaDomainName= validate($_POST['sambaDomainName']);
}
/* Save obvious values */
foreach($this->ctxattributes as $val){
- if (isset($_POST[$val]) && $this->acl_is_writeable("AllowLoginOnTerminalServer")){
+ if (isset($_POST[$val]) && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite)){
if (get_magic_quotes_gpc()) {
$this->mungedObject->ctx[$val]= stripcslashes(validate($_POST[$val]));
} else {
/* Save checkbox states. */
$this->mungedObject->setTsLogin(!isset($_POST['tslogin'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
// Need to do some index checking to avoid messages like "index ... not found"
if(isset($_POST['brokenconn'])) {
$this->mungedObject->setBrokenConn($_POST['brokenconn'] == '1'
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
}
if(isset($_POST['reconn'])) {
$this->mungedObject->setReConn($_POST['reconn'] == '1'
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
}
$this->mungedObject->setInheritMode(isset($_POST['inherit'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setCtxMaxConnectionTimeF(!isset($_POST['CtxMaxConnectionTimeF'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setCtxMaxDisconnectionTimeF(
!isset($_POST['CtxMaxDisconnectionTimeF'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setCtxMaxIdleTimeF(!isset($_POST['CtxMaxIdleTimeF'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setConnectClientDrives(isset($_POST['connectclientdrives'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setConnectClientPrinters(isset($_POST['connectclientprinters'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
$this->mungedObject->setDefaultPrinter(isset($_POST['defaultprinter'])
- && $this->acl_is_writeable("AllowLoginOnTerminalServer"));
+ && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite));
/* Save combo boxes. Takes two values */
if(isset($_POST['reconn'])) {
- $this->mungedObject->setShadow(isset($_POST['shadow']) && $this->acl_is_writeable("AllowLoginOnTerminalServer"),$_POST['shadow']);
+ $this->mungedObject->setShadow(isset($_POST['shadow']) && $this->acl_is_writeable("AllowLoginOnTerminalServer",$SkipWrite),$_POST['shadow']);
}
/* Check for changes */
index 564dc3cd6e02deec992a290fe22f0cc75b634a82..a9ede299b9fc635806cd04763526216bb41dccfc 100644 (file)
/* Create sambaAccount object on demand */
if (!isset($_SESSION['sambaAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
$_SESSION['sambaAccount']= new sambaAccount ($config, $ui->dn);
+ $_SESSION['sambaAccount']->set_acl_base($ui->dn);
+ $_SESSION['sambaAccount']->set_acl_category("users");
}
$sambaAccount= $_SESSION['sambaAccount'];
if (count ($message) == 0){
$sambaAccount->save ();
gosa_log ("User/samba object'".$ui->dn."' has been saved");
- $sambaAccount->acl= "#none#";
del_lock ($ui->dn);
sess_del ('edit');
} else {
$info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
"\"> ".$ui->dn." ";
- if (isset($editacl) && $editacl != "#none#"){
+
+ if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/sambaAccount"))){
+
$info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
_("Click the 'Edit' button below to change informations in this dialog");
$display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";