summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f797e6)
raw | patch | inline | side by side (parent: 7f797e6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 1 Dec 2008 09:30:27 +0000 (09:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 1 Dec 2008 09:30:27 +0000 (09:30 +0000) |
-Added read-only to user management
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13090 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13090 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/ihtml/themes/default/islocked.tpl b/gosa-core/ihtml/themes/default/islocked.tpl
index 2845fa2ea66af08349d66cec82529114ddc86969..75de1c40e464e272042d68d9a8c84b15e1bf2589 100644 (file)
<p class="plugbottom">
<input type="submit" name="delete_lock" value="{$action}">
+ {if $allow_readonly}
<input type="submit" name="open_readonly" value="{t}Read only{/t}">
+ {/if}
<input type="submit" name="cancel_lock" value="{t}Cancel{/t}">
</p>
index 7d3a6dd4e8d0de40cc6ee65193835bc383619c5d..f834f454ac70c79219cd82a9a1920fca61ffc6dd 100644 (file)
return;
}
+ /* Check if this entry was opened in read only mode */
if(isset($_POST['open_readonly'])){
- $this->read_only = TRUE;
+ if(session::is_set("LOCK_CACHE")){
+ $cache = &session::get("LOCK_CACHE");
+ if(isset($cache['READ_ONLY'][$this->dn])){
+ $this->read_only = TRUE;
+ }
+ }
}
/* Save current dn as acl_base */
index 38567747c6439b9c4128f76d60b30e297116e3f4..b4e72f9e0725a588da414843763ec1b85a35b34e 100644 (file)
var $acl_category;
var $multiple_support_active = FALSE;
+ var $read_only = FALSE; // Used when the entry is opened as "readonly" due to locks.
+
function tabs(&$config, $data, $dn, $acl_category= "")
{
/* Save dn */
$this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject);
}
+ $this->read_only |= $this->by_object[$tab['CLASS']]->read_only;
$this->by_object[$tab['CLASS']]->parent= &$this;
$this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category);
index 66c22e9ae7b3f27585e6c72bee67a3d80619d788..e022dcd4e2c42a6102aaed4add8e867e31203242 100644 (file)
$cache = &session::get("LOCK_CACHE");
if(isset($_POST['open_readonly'])){
$cache['READ_ONLY'][$object] = TRUE;
- echo "ADDED : {$user}:{$object}<br>";
return;
}
if(isset($cache['READ_ONLY'][$object])){
- echo "Removed lock entry $object <br>";
unset($cache['READ_ONLY'][$object]);
}
-
if(is_array($object)){
foreach($object as $obj){
add_lock($obj,$user);
if(session::is_set("LOCK_CACHE")){
$cache = &session::get("LOCK_CACHE");
if(isset($cache['READ_ONLY'][$object])){
- if(isset($_POST['delete_lock'])){
- unset($cache['READ_ONLY'][$object]);
- }else{
- echo "Skipped: $object <br>";
- return;
- }
+ unset($cache['READ_ONLY'][$object]);
+ //echo "Remove ".$object."<b> Skipped!</b>";
+ return;
}
}
+ //echo "Remove ".$object."<b> Done!</b>";
+
/* Check for existance and remove the entry */
$ldap= $config->get_ldap_link();
$ldap->cd ($config->get_cfg_value("config"));
}
-function gen_locked_message($user, $dn)
+function gen_locked_message($user, $dn, $allow_readonly = FALSE)
{
global $plug, $config;
/* Prepare and show template */
$smarty= get_smarty();
-
+ $smarty->assign("allow_readonly",$allow_readonly);
if(is_array($dn)){
$msg = "<pre>";
foreach($dn as $sub_dn){
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 945f60ebd1ef8bba055d45eac173d675bbf5cd11..1171849cc1d3a269292e117d3f5e5937dcfd27da 100644 (file)
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
if (($user= get_lock($this->dn)) != ""){
- return(gen_locked_message ($user, $this->dn));
+ return(gen_locked_message ($user, $this->dn,TRUE));
}
/* Lock the current entry, so everyone will get the
}
if(!is_object($dia) && $dia != TRUE){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
- $display.= " \n";
- if ($this->dn != "new"){
- $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
+ if(($this->usertab instanceOf tabs || $this->usertab instanceOf plugin) && $this->usertab->read_only == TRUE){
+ $display.= "<p style=\"text-align:right\">
+ <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
+ </p>";
+ }else{
+ $display.= "<p style=\"text-align:right\">\n";
+ $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
$display.= " \n";
+ if ($this->dn != "new"){
+ $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
+ $display.= " \n";
+ }
+ $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
+ $display.= "</p>";
}
- $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
- $display.= "</p>";
}
return ($display);
}
/* Remove user lock if a DN is marked as "currently edited" */
if (isset($this->usertab->dn)){
del_lock ($this->usertab->dn);
- }
- if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
+ }elseif(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
del_lock($this->dn);
}
if(isset($this->dns) && is_array($this->dns) && count($this->dns)){