remove duplicate code

This commit is contained in:
Uwe Steinmann 2024-04-27 20:07:21 +02:00
parent 4f44241850
commit f230cd6918

View File

@ -187,36 +187,6 @@ function set_homefolders() { /* {{{ */
}
} /* }}} */
function insert_role($role) { /* {{{ */
global $logger, $dms, $debug, $sections, $defaultUser, $objmap;
if($debug) print_r($role);
if ($newRole = $dms->getRoleByName($role['attributes']['name'])) {
$logger->warning("Role '".$role['attributes']['name']."' already exists");
} else {
if(in_array('roles', $sections)) {
$newRole = $dms->addRole(
$role['attributes']['name'],
$role['role']);
if(!$newRole) {
$logger->err("Could not add role");
$logger->debug($dms->getDB()->getErrorMsg());
return false;
} else {
$logger->info("Added role '".$role['attributes']['name']."'");
if(isset($role['attributes']['noaccess'])) {
$noaccess = explode(',', $role['attributes']['noaccess']);
$role->setNoAccess($noaccess);
}
}
}
}
if($newRole)
$objmap['roles'][$role['id']] = $newRole->getID();
return $newRole;
} /* }}} */
function insert_group($group) { /* {{{ */
global $logger, $dms, $debug, $objmap, $sections, $users;