summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6d041e)
raw | patch | inline | side by side (parent: e6d041e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Oct 2006 10:57:23 +0000 (10:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 31 Oct 2006 10:57:23 +0000 (10:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4973 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/addons/ldapmanager/class_import.inc | patch | blob | history |
diff --git a/plugins/addons/ldapmanager/class_import.inc b/plugins/addons/ldapmanager/class_import.inc
index 5421ec364c7d1164fc42e14ef6334321a9df9221..d1d2983a8d213036d087bee0460dc7b91869ece2 100644 (file)
/* attribute list for save action */
var $attributes= array();
var $objectclasses= array();
+ var $ui;
function ldifimport ($config, $dn= NULL)
{
/* 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("LDIFError",FALSE);
$smarty->assign("type",FALSE);
- /* Check permissions for export */
- if (chkacl($this->acl,"import")!=""){
- print_red(_("You've no permission to do LDAP imports."));
- } else {
- if((isset($_FILES['userfile']['name']))&&(isset($_POST['fileup'])))
- {
+ /* Get acls */
+ $acl = $this->ui->get_permissions($this->config->current['BASE'],"all/all");
+
+ /* Import requested check file and acls */
+ if((isset($_FILES['userfile']['name']))&&(isset($_POST['fileup']))){
+ /* Check acls */
+ if(!preg_match("/r/",$acl)){
+ print_red(_("You need full access to all objects, to execute the import command."));
+ }else{
$smarty->assign("type","importfile");
-
$handle = NULL;
// Check if there is a file submitted
-
if(!$_FILES['userfile']['size'] > 0 )
{
print_red(_("The specified file is empty."));
}
@fclose($handle);
- // Try to Import the Data
-
-
-
// Should we use Overwrite ?
if(!empty($_POST['overwrite'])) $overwrite = true; else $overwrite = false;;
if(!empty($_POST['cleanup'])) $cleanup = true; else $cleanup = false;
- //
$ErrorStr="";
$check = $ldap->import_complete_ldif($str,$ErrorStr,$overwrite,$cleanup);
}
}
return ($smarty->fetch (get_template_path('contentimport.tpl', TRUE)));
-
}
/* Return plugin informations for acl handling