mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
import of users does not issue an error if a group column isn't set
This commit is contained in:
parent
84a849a28f
commit
3945ae54b9
|
@ -4,6 +4,7 @@
|
|||
- fix import of users
|
||||
- major rework of scripts in utils, unify reading of settings, use PHP_EOL
|
||||
- allow inline editing of document name
|
||||
- import of users does not issue an error if a group column isn't set
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.19
|
||||
|
|
|
@ -70,6 +70,10 @@ function renderFolderData($colname, $objdata) { /* {{{ */
|
|||
|
||||
function getGroupData($colname, $coldata, $objdata) { /* {{{ */
|
||||
global $dms;
|
||||
/* explode column name to extract index of group. Actually, the whole column
|
||||
* name could be used as well, as it is just a unique index in the array
|
||||
* of groups.
|
||||
*/
|
||||
$kk = explode('_', $colname);
|
||||
if(count($kk) == 2)
|
||||
$gn = $kk[1];
|
||||
|
@ -77,11 +81,15 @@ function getGroupData($colname, $coldata, $objdata) { /* {{{ */
|
|||
$gn = '1';
|
||||
if(!isset($objdata['groups']))
|
||||
$objdata['groups'] = [];
|
||||
if($group = $dms->getGroupByName($coldata)) {
|
||||
$objdata['groups'][$gn] = $group;
|
||||
} else {
|
||||
// $objdata['groups'][$gn] = null;
|
||||
$objdata['__logs__'][] = array('type'=>'error', 'msg'=> "No such group with name '".$coldata."'");
|
||||
/* $coldata can be empty, if an imported users is assigned to less groups
|
||||
* than group columns exists.
|
||||
*/
|
||||
if($coldata) {
|
||||
if($group = $dms->getGroupByName($coldata)) {
|
||||
$objdata['groups'][$gn] = $group;
|
||||
} else {
|
||||
$objdata['__logs__'][] = array('type'=>'error', 'msg'=> "No such group with name '".$coldata."'");
|
||||
}
|
||||
}
|
||||
return $objdata;
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user