summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9b0cc72)
raw | patch | inline | side by side (parent: 9b0cc72)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Oct 2006 07:04:11 +0000 (07:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Oct 2006 07:04:11 +0000 (07:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4966 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/addons/ldapmanager/class_csvimport.inc b/plugins/addons/ldapmanager/class_csvimport.inc
index 86fee5fc4d16573451760383b7f13ba69e040f6c..c1bc331e49fd3be14aa7585d76d89baeab7ac66a 100644 (file)
{
/* Include config object */
$this->config= $config;
-
- /* set permissions */
- $ui= get_userinfo();
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $this->acl= get_module_permission($acl, "ldapmanager", $ui->dn);
-
-
}
function execute()
/* Show main page */
return ($smarty->fetch (get_template_path('contentcsv.tpl', TRUE)));
}
+
+
+ /* Return plugin informations for acl handling
+ #FIXME You can only read attributes within this report plugin */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("CSV import"),
+ "plDescription" => _("CSV import"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 4,
+ "plSection" => array("addon"),
+ "plCategory" => array("ldapmanager"),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/addons/ldapmanager/class_export.inc b/plugins/addons/ldapmanager/class_export.inc
index 8f7dd4d394785ebdf6dec732dfe7a53b26b4cbab..82984e6e87438e69d5c4868059345f8e40e3cc66 100644 (file)
{
/* Include config object */
$this->config= $config;
-
- /* set permissions */
- $ui= get_userinfo();
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $this->acl= get_module_permission($acl, "ldapmanager", $ui->dn);
-
+ $this->ui = get_userinfo();
}
function execute()
$smarty->assign("type",FALSE);
$smarty->assign("depselectivbb","");
- /* Check permissions for export */
- if (chkacl($this->acl,"export")!=""){
- print_red(_("You've no permission to do LDAP exports."));
+ // fill in old vars in the Export form
+ if((isset($_POST['single']))&&(isset($_POST['sfrmgetsingle']))){
+ $smarty->assign("single",$_POST['single']);
+ $smarty->assign("type","single");
+ $dn = $_POST['single'];
+ }
+ if((isset($_POST['selfull']))&&(isset($_POST['sfrmgetfull']))){
+ $smarty->assign("depselectfull",$_POST['selfull']);
+ $smarty->assign("type","full");
+ $dn = $_POST['selfull'];
} else {
- // fill in old vars in the Export form
- if((isset($_POST['single']))&&(isset($_POST['sfrmgetsingle']))){
- $smarty->assign("single",$_POST['single']);
- $smarty->assign("type","single");
- $dn = $_POST['single'];
- }
- if((isset($_POST['selfull']))&&(isset($_POST['sfrmgetfull']))){
- $smarty->assign("depselectfull",$_POST['selfull']);
- $smarty->assign("type","full");
- $dn = $_POST['selfull'];
- } else {
- $smarty->assign("depselectfull", "");
- }
- if((isset($_POST['selivbb']))&&(isset($_POST['sfrmgetivbb']))){
- $smarty->assign("depselectivbb",$_POST['selivbb']);
- $smarty->assign("type","ivbb");
- $dn = $_POST['selivbb'];
- } else {
- $smarty->assign("depselectivbb", "");
- }
+ $smarty->assign("depselectfull", "");
+ }
+ if((isset($_POST['selivbb']))&&(isset($_POST['sfrmgetivbb']))){
+ $smarty->assign("depselectivbb",$_POST['selivbb']);
+ $smarty->assign("type","ivbb");
+ $dn = $_POST['selivbb'];
+ } else {
+ $smarty->assign("depselectivbb", "");
}
// Set values for optionlist in form
- $smarty->assign("deplist", $this->config->idepartments);
+ $bases = array();
+ $acl_bases = $this->ui->get_module_departments("ldapmanager");
+ foreach($this->config->idepartments as $base_dn => $name){
+ if(in_array_ics($base_dn,$acl_bases)){
+ $bases[$base_dn] = $name;
+ }
+ }
+ $smarty->assign("deplist", $bases);
// Get the LDAP link, to generate the Export
$ldap = $this->config->get_ldap_link();
if(isset($dn))
{
- if($ldap->dn_exists($dn) && $dn != ""){
- ;
- }
- else {
+ if(!($ldap->dn_exists($dn) && $dn != "")){
$smarty->assign("LDIFError",TRUE);
print_red (_("Error while exporting the requested entries!"));
}
}
- // Export a single LDAP entry
- if(isset($_POST['sfrmgetsingle']))
- {
- $smarty->assign("para","?ivbb=2&dn=".base64_encode($_POST['single']));
- }
- elseif(isset($_POST['sfrmgetfull']))
- {
- $smarty->assign("para","?ivbb=3&dn=".base64_encode($_POST['selfull']));
- }
- elseif(isset($_POST['sfrmgetivbb']))
- {
- $smarty->assign("para","?ivbb=4&dn=".base64_encode($_POST['selivbb']));
+ /* check alcs for given dn */
+ $acls ="";
+ if(isset($dn)){
+ $acls = $this->ui->get_permissions($dn,"ldapmanager/ldifexport");
}
+ if(!preg_match("/r/",$acls)){
+
+ /* Show error msg */
+ print_red(sprintf(_("You are not allowed to export the given ldap entry (%s)"),@LDAP::fix($dn)));
+ /* Show main page */
+ $smarty->assign("LDIFError",TRUE);
+ $smarty->assign("para","");
+ }else{
+
+ // Export a single LDAP entry
+ if(isset($_POST['sfrmgetsingle']))
+ {
+ $smarty->assign("para","?ivbb=2&dn=".base64_encode($_POST['single']));
+ }
+ elseif(isset($_POST['sfrmgetfull']))
+ {
+ $smarty->assign("para","?ivbb=3&dn=".base64_encode($_POST['selfull']));
+ }
+ elseif(isset($_POST['sfrmgetivbb']))
+ {
+ $smarty->assign("para","?ivbb=4&dn=".base64_encode($_POST['selivbb']));
+ }
+ }
/* Show main page */
return ($smarty->fetch (get_template_path('contentexport.tpl', TRUE)));
}
+
+ /* Return plugin informations for acl handling
+ #FIXME You can only read attributes within this report plugin */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Export"),
+ "plDescription" => _("Export"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 1,
+ "plSection" => array("addon"),
+ "plCategory" => array("ldapmanager" => array("objectClass" => "none", "description" => _("Ldap manager addon"))),
+
+ "plProvidedAcls" => array()
+ ));
+ }
+
}
diff --git a/plugins/addons/ldapmanager/class_exportxls.inc b/plugins/addons/ldapmanager/class_exportxls.inc
index ea03de074160914cb75db43b669ecf92e254c541..69fb99c3b0a228c99f78933e4165e1af401bf17d 100644 (file)
/* Show main page */
return ($smarty->fetch (get_template_path('contentexportxls.tpl', TRUE)));
}
+
+ /* Return plugin informations for acl handling
+ #FIXME You can only read attributes within this report plugin */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Export XLS"),
+ "plDescription" => _("Export XLS"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 2,
+ "plSection" => array("addon"),
+ "plCategory" => array("ldapmanager"),
+
+ "plProvidedAcls" => array()
+ ));
+ }
}
diff --git a/plugins/addons/ldapmanager/class_import.inc b/plugins/addons/ldapmanager/class_import.inc
index ec5662c8a2dfa7ccc56c6580d188225f74a87241..5421ec364c7d1164fc42e14ef6334321a9df9221 100644 (file)
}
+ /* Return plugin informations for acl handling
+ #FIXME You can only read attributes within this report plugin */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Import"),
+ "plDescription" => _("Import"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 3,
+ "plSection" => array("addon"),
+ "plCategory" => array("ldapmanager"),
+
+ "plProvidedAcls" => array()
+ ));
+ }
}
index 9c529f2a286dab711dd6e0f20e12786d77eac9a8..696c14add98996662b90b6368c40cb02a6de1fe7 100644 (file)
/* Create phonelist object on demand */
if (!isset($_SESSION['ldif']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
$_SESSION['ldif']= new ldif ($config);
+ $_SESSION['ldif']->set_acl_category("logview");
}
$ldif= $_SESSION['ldif'];
- #print_red(_("Warning: Please check the SIZELIMIT option set on your LDAP server. You may not get all entries, if this value is to low!"));
-
- /* set permissions */
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $ldif->acl= get_module_permission($acl, "ldapmanager", $ui->dn);
-
/* Execute formular */
$display= $ldif->execute ();
-
$display.= "<input type=\"hidden\" name=\"ignore\">\n";
/* Page header*/