summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc9d5f9)
raw | patch | inline | side by side (parent: cc9d5f9)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 24 Jul 2006 18:30:04 +0000 (18:30 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 24 Jul 2006 18:30:04 +0000 (18:30 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4277 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_acl.inc b/include/class_acl.inc
index 7ea80a7448be39cfe98d780dc147cbaf6612677b..8870d1a2cc2b6da8e1aeba76c907a83677fff2af 100644 (file)
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
$ldap->modify ($this->attrs);
show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
+
+ /* Refresh users ACLs */
+ $ui= get_userinfo();
+ $ui->loadACL();
+ $_SESSION['ui']= $ui;
}
index a4182cfd8773ba680b67ae5fa1a2a2dc39a14306..a83cb1cea7635d4c1d774db435fadc04323287d4 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
/* attribute list for save action */
var $attributes= array();
var $objectclasses= array();
- var $new= TRUE;
+ var $is_new= TRUE;
var $saved_attributes= array();
+ var $acl_base= "";
+
/* Plugin identifier */
var $plHeadline= "";
var $plDescription= "";
return;
}
+ /* Save current dn as acl_base */
+ $this->acl_base= $dn;
+
/* Get LDAP descriptor */
$ldap= $this->config->get_ldap_link();
if ($dn != NULL){
*/
function execute()
{
- # This one is empty currently. Fabian - please fill in the docu code
+ /* This one is empty currently. Fabian - please fill in the docu code */
$_SESSION['current_class_for_help'] = get_class($this);
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
$_SESSION['LOCK_VARS_TO_USE'] =array();
if (isset($tmp['objectClass'])){
$oc= $tmp["objectClass"];
- $this->new= FALSE;
+ $this->is_new= FALSE;
} else {
$oc= array("count" => 0);
- $this->new= TRUE;
+ $this->is_new= TRUE;
}
/* Load (minimum) attributes, add missing ones */
foreach ($this->attributes as $val){
if ($this->$val != ""){
$this->attrs["$val"]= $this->$val;
- } elseif (!$this->new) {
+ } elseif (!$this->is_new) {
$this->attrs["$val"]= array();
}
}
}
+ function set_acl_base($base)
+ {
+ $this->acl_base= $base;
+ }
+
+
function acl_is_writeable($attribute,$skip_write = FALSE)
{
$ui= get_userinfo();
- return preg_match('/w/', $ui->get_permissions($this->dn, get_class($this), $attribute,$skip_write));
+ return preg_match('/w/', $ui->get_permissions($this->acl_base, get_class($this), $attribute,$skip_write));
}
function acl_is_readable($attribute)
{
$ui= get_userinfo();
- return preg_match('/r/', $ui->get_permissions($this->dn, get_class($this), $attribute));
+ return preg_match('/r/', $ui->get_permissions($this->acl_base, get_class($this), $attribute));
}
function acl_is_createable()
{
$ui= get_userinfo();
- return preg_match('/c/', $ui->get_permissions($this->dn, get_class($this), '0'));
+ return preg_match('/c/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
}
function acl_is_removeable()
{
$ui= get_userinfo();
- return preg_match('/d/', $ui->get_permissions($this->dn, get_class($this), '0'));
+ return preg_match('/d/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
}
function acl_is_moveable()
{
$ui= get_userinfo();
- return preg_match('/m/', $ui->get_permissions($this->dn, get_class($this), '0'));
+ return preg_match('/m/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
+ }
+
+
+ function acl_have_any_permissions()
+ {
}
function getacl($attribute,$skip_write= FALSE)
{
$ui= get_userinfo();
- return $ui->get_permissions($this->dn, get_class($this), $attribute,$skip_write);
+ return $ui->get_permissions($this->acl_base, get_class($this), $attribute,$skip_write);
}
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index fc1af5227fff3637bc355cc45634c6d7ab86c5bd..72068da0016c6764971745c4a0584673e9cd0e50 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
var $config;
var $acl;
var $is_template;
+ var $is_new= FALSE;
var $last= "";
var $current= "";
}
+ function set_acl_base($base= "")
+ {
+ /* Update reference, transfer variables */
+ $first= ($base == "");
+ foreach ($this->by_object as $name => $obj){
+ if ($first){
+ $first= FALSE;
+echo "Setting base to ".$obj->acl_base."<br>";
+ $base= $obj->acl_base;
+ } else {
+echo "Transfering $base to $name<br>";
+ $obj->set_acl_base($base);
+ $this->by_object[$name]= $obj;
+ }
+ }
+ }
+
}
?>
index 6c5fa14307f1bea76ba8bef40ccfe0858261188e..737bde73f22221a1750de0b1f5180b2571a73e13 100644 (file)
$aclc[$attrs['dn']]= array();
$ol= array();
for($i= 0; $i<$attrs['gosaAclEntry']['count']; $i++){
- $ol= array_merge($ol, acl::explodeAcl($attrs['gosaAclEntry'][$i]));
+ $ol= array_merge($ol, @acl::explodeAcl($attrs['gosaAclEntry'][$i]));
}
$aclc[$attrs['dn']]= $ol;
}
index 4b85ff9bf3f49a1496f6fabc25b3637482db9790..a7c7215ddeba1e775373beb4f571f603e6b97f18 100644 (file)
not needed in this class. */
function remove_from_parent() { }
function check() { }
- function save() { }
+
+ function save() {
+ echo "SAVE ACL";
+ }
+
function adapt_from_template($dn) { }
function password_change_needed() { }
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 361586706b5f5fb1b723c28d83effe1e38f87ebc..e8540af7f827888c8fc33fa6c916c2f96b7d763f 100644 (file)
$this->usertab->current = $s_tab;
/* Set ACL and move DN to the headline */
- $this->usertab->set_acl($acl);
+# $this->usertab->set_acl_base();
$_SESSION['objectinfo']= $this->dn;
}
/* By default we set 'dn' to 'new', all relevant plugins will
react on this. */
$this->dn= "new";
+
if (isset($this->config->current['IDGEN'])){
$this->got_uid= false;
} else {
/* Create new usertab object */
$this->usertab= new usertabs($this->config,$this->config->data['TABS']['USERTABS'], $this->dn);
- $this->usertab->set_acl(array(':all'));
$this->usertab->by_object['user']->base= $this->DivListUsers->selectedBase;
+ $this->usertab->set_acl_base('dummy,'.$this->DivListUsers->selectedBase);
/* Take care about templates */
if ($s_action=="new_tpl"){
$acl= get_permissions ($dn, $this->ui->subtreeACL);
$obj = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
$objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new");
- $obj-> set_acl($acl);
- $objNew-> set_acl($acl);
+ $obj->set_acl($acl);
+ $objNew->set_acl($acl);
$this->CopyPasteHandler->Copy($obj,$objNew);
}
index c5bcba3d7d8a3dbf7c364ad9c339a179af133b34..4e97558f5654a6d48b1f88717dd1fcdaf80ff1cd 100644 (file)
/* Add references/acls/snapshots */
$this->addSpecialTabs();
+ $this->set_acl_base();
}
function save_object($save_current= FALSE)
$number= key($this->by_object['phoneAccount']->phoneNumbers);
$this->by_object['user']->telephoneNumber= $number;
}
+
+ /* Possibly change acl base */
+ $this->set_acl_base();
}
function save()
index 1800a0722547ba18987ff7879f957dd86f92ed83..a5f18a3e57ce2c968dc95bdb77ea58b05c5f931a 100644 (file)
}
}
}
+ $this->set_acl_base('dummy,'.$this->base);
}
}
foreach ($this->govattrs as $val){
if ($this->$val != ""){
$this->attrs["$val"]= $this->$val;
- } elseif (!$this->new) {
+ } elseif (!$this->is_new) {
$this->attrs["$val"]= array();
}
}
/* Remove attribute if set to "nein" */
if ($this->publicVisible == "nein"){
$this->attrs['publicVisible']= array();
- if($this->new){
+ if($this->is_new){
unset($this->attrs['publicVisible']);
}else{
$this->attrs['publicVisible']=array();
/* Special handling for dateOfBirth value */
if ($this->use_dob != "1"){
- if ($this->new) {
+ if ($this->is_new) {
unset($this->attrs["dateOfBirth"]);
} else {
$this->attrs["dateOfBirth"]= array();
}
}
if (!$this->gender){
- if ($this->new) {
+ if ($this->is_new) {
unset($this->attrs["gender"]);
} else {
$this->attrs["gender"]= array();
}
}
if (!$this->preferredLanguage){
- if ($this->new) {
+ if ($this->is_new) {
unset($this->attrs["preferredLanguage"]);
} else {
$this->attrs["preferredLanguage"]= array();
$this->attrs["jpegPhoto"] = $output;
}
- } elseif(!$this->new) {
+ } elseif(!$this->is_new) {
$this->attrs["jpegPhoto"] = array();
}
/* Remove cert?
For some reason, the 'ldap' class doesn't want to remove binary entries, so I need
to work around myself. */
- if ($remove_userCertificate == true && !$this->new && $this->had_userCertificate){
+ if ($remove_userCertificate == true && !$this->is_new && $this->had_userCertificate){
/* Reset array, assemble new, this should be reworked */
$this->attrs= array();
}
/* must: sn, givenName, uid */
- if ($this->sn == "" && ($this->acl_is_writeable("sn",(!is_object($this->parent) && !isset($_SESSION['edit'])) || ($this->new)))){
+ if ($this->sn == "" && ($this->acl_is_writeable("sn",(!is_object($this->parent) && !isset($_SESSION['edit'])) || ($this->is_new)))){
$message[]= _("The required field 'Name' is not set.");
}
index d27930c6b12c0ea2e9f1a8ed8c591f95c157c3b3..1dbec3ea9bb13452cb97630e0d61d8b036f57525 100644 (file)
<td>
<div style="height:10px;"></div>
{render acl=$baseACL}
- <select id="base" size="1" name="base" title="{t}Choose subtree to place user in{/t}">
+ <select id="base" size="1" name="base" title="{t}Choose subtree to place user in{/t}" onchange="document.mainform.submit()">
{html_options options=$bases selected=$base_select}
</select>
{/render}