mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
remove duplicate code
This commit is contained in:
parent
4f44241850
commit
f230cd6918
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user