diff --git a/gosa-core/plugins/generic/references/class_reference.inc b/gosa-core/plugins/generic/references/class_reference.inc
index afa75fa05043dc6a722dd67efb738500e913f6de..ad390a4c0103f70118c57479fa93a220f1395f9f 100644 (file)
class reference extends plugin
{
- var $attributes= array('uid');
+ var $attributes= array('uid','modifyTimestamp');
var $aclResolver = NULL;
var $referenceFilters = array();
var $objectList ="";
+ var $modifyTimestamp = "";
function reference (&$config, $dn= NULL, $parent = NULL)
{
// Init the plugin
plugin::plugin($config,$dn,$parent);
+ // Try to read the 'modifyTimestamp' - this has to be done separately.
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn, array('modifyTimestamp'));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ if(isset($attrs['modifyTimestamp'][0])){
+ $this->modifyTimestamp = $attrs['modifyTimestamp'][0];
+ }
+ }
+
// Initialize the ACL-resolver
$this->aclResolver = new aclResolver($this->config, $this->dn, $this);
$this->referenceFilters[] = array(
'filter' => "(&(objectClass=posixGroup)(memberUid={$this->uid}))",
'attrs' => array('cn' => _("Name"),'description' => _("Description")),
- 'msg' => _("Group"));
+ 'msg' => _("Group membership"));
// Check for group membership in rfc 2307 bis mode
$this->referenceFilters[] = array(
'filter' => "(&(objectClass=posixGroup)(member=".normalizeLdap($this->dn)."))",
'attrs' => array('cn' => _("Name"),'description' => _("Description")),
- 'msg' => _("Group")." (rfc 2307 bis)");
+ 'msg' => _("Group membership")." (rfc 2307 bis)");
// Check for role membership
$this->referenceFilters[] = array(
'filter' => "(&(objectClass=organizationalRole)(roleOccupant=".normalizeLdap($this->dn)."))",
'attrs' => array('cn' => _("Name"),'description' => _("Description")),
- 'msg' => _("Role"));
+ 'msg' => _("Role membership"));
// Check for objectGroup membership
$this->referenceFilters[] = array(
'filter' => "(&(objectClass=gosaGroupOfNames)(member=".normalizeLdap($this->dn)."))",
'attrs' => array('cn' => _("Name"),'description' => _("Description")),
- 'msg' => _("Object group"));
- }
+ 'msg' => _("Object group membership"));
- function execute()
- {
- // Mark plugin as viewed
- plugin::execute();
+ // Check for department manager
+ $this->referenceFilters[] = array(
+ 'filter' => "(&(objectClass=gosaDepartment)(manager=".normalizeLdap($this->dn)."))",
+ 'attrs' => array('ou' => _("Name"),'description' => _("Description")),
+ 'msg' => _("Department manager"));
+
+ // Check for user manager
+ $this->referenceFilters[] = array(
+ 'filter' => "(&(objectClass=gosaAccount)(manager=".normalizeLdap($this->dn)."))",
+ 'attrs' => array('givenName' => _("Given name"),'sn' => _("Surname"),'uid'=>_("Uid")),
+ 'msg' => _("User manager"));
// Go through filters and detect possible references
$ldap = $this->config->get_ldap_link();
$list->update();
$str .= "<h3>".$filter['msg']."</h3>";
$str .= $list->render();
+ $str .= "<div class='v-spacer'></div>";
}
}
+ $this->objectList = $str;
+ }
+
+ function execute()
+ {
+ // Mark plugin as viewed
+ plugin::execute();
+
+ // Show ldif viewer
+ if(isset($_POST['viewLdif'])){
+ $this->dialog = new ldifViewer($this->config, $this->dn);
+ }
+ if(isset($_POST['cancelLdifViewer'])) $this->dialog = NULL;
+ if($this->dialog instanceOf ldifViewer){
+ return($this->dialog->execute());
+ }
$smarty = get_smarty();
- $smarty->assign('objectList', $str);
+
+ // Assign permissions
+ $tmp = $this->plInfo();
+ $ui = get_userinfo();
+
+ $category = preg_replace("/\/.*$/", "", $this->acl_category);
+ $smarty->assign('aclREAD', preg_match("/r/",$ui->get_category_permissions($this->dn, 'acl')));
+ $smarty->assign('completeACL', $ui->has_complete_category_acls($this->dn, $category));
+ $smarty->assign('someACL', $ui->get_category_permissions($this->dn, $category));
+
+ // Convert the modifyTimestamp to a human readable value
+ $tz = timezone::get_default_timezone();
+ $smarty->assign('modifyTimestamp', date('d.m.Y H:i:s', strtotime($this->modifyTimestamp)));
+
+ $smarty->assign('objectList', $this->objectList);
$smarty->assign("acls",$this->aclResolver->getReadableACL());
+ session::set('autocomplete', $this->aclResolver);
return ($smarty->fetch (get_template_path('contents.tpl', TRUE, dirname(__FILE__))));
}
-
-
}
?>