@@ -150,7 +150,7 @@ private function _createFolderForItem($collectionId, $parentFolderid)
150
150
$ policyquery = pg_query ("SELECT policy_id FROM resourcepolicy WHERE resource_type_id= " .MIDAS2_RESOURCE_ITEM .
151
151
" AND resource_id= " .$ item_id ." AND epersongroup_id=0 " );
152
152
$ privacy = MIDAS_COMMUNITY_PRIVATE ;
153
- if (pg_num_rows ($ policyquery )> 0 )
153
+ if (pg_num_rows ($ policyquery ) > 0 )
154
154
{
155
155
$ anonymousGroup = $ Group ->load (MIDAS_GROUP_ANONYMOUS_KEY );
156
156
$ Itempolicygroup ->createPolicy ($ anonymousGroup , $ itemdao , MIDAS_POLICY_READ );
@@ -402,33 +402,33 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
402
402
$ Folderpolicyuser ->createPolicy ($ user , $ folderDao , $ policyValue );
403
403
}
404
404
405
- // Add specific MIDAS policies for users (not dealing with groups)
406
- $ policyquery = pg_query ("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
405
+ // Add specific MIDAS policies for users (not dealing with groups)
406
+ $ policyquery = pg_query ("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
407
407
FROM resourcepolicy
408
408
LEFT JOIN eperson ON (eperson.eperson_id=resourcepolicy.eperson_id)
409
409
WHERE epersongroup_id IS NULL AND resource_type_id= " .MIDAS2_RESOURCE_COMMUNITY .
410
410
" AND resource_id= " .$ community_id ." GROUP BY eperson.eperson_id, email " );
411
411
412
- while ($ policyquery_array = pg_fetch_array ($ policyquery ))
413
- {
414
- $ actionid = $ policyquery_array ['actionid ' ];
415
- $ email = $ policyquery_array ['email ' ];
416
- if ($ actionid > 1 )
417
- {
418
- $ policyValue = MIDAS_POLICY_ADMIN ;
419
- }
420
- else if ($ actionid == 1 )
421
- {
422
- $ policyValue = MIDAS_POLICY_WRITE ;
423
- }
424
- else
425
- {
426
- $ policyValue = MIDAS_POLICY_READ ;
427
- }
428
- $ userDao = $ User ->getByEmail ($ email );
429
-
430
- $ Folderpolicyuser ->createPolicy ($ user , $ folderDao , $ policyValue );
431
- }
412
+ while ($ policyquery_array = pg_fetch_array ($ policyquery ))
413
+ {
414
+ $ actionid = $ policyquery_array ['actionid ' ];
415
+ $ email = $ policyquery_array ['email ' ];
416
+ if ($ actionid > 1 )
417
+ {
418
+ $ policyValue = MIDAS_POLICY_ADMIN ;
419
+ }
420
+ else if ($ actionid == 1 )
421
+ {
422
+ $ policyValue = MIDAS_POLICY_WRITE ;
423
+ }
424
+ else
425
+ {
426
+ $ policyValue = MIDAS_POLICY_READ ;
427
+ }
428
+ $ userDao = $ User ->getByEmail ($ email );
429
+
430
+ $ Folderpolicyuser ->createPolicy ($ user , $ folderDao , $ policyValue );
431
+ }
432
432
}
433
433
catch (Zend_Exception $ e )
434
434
{
@@ -437,12 +437,12 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
437
437
//we continue
438
438
}
439
439
440
- if ($ folderDao ) // The folder has been created for the community
440
+ if ($ folderDao ) // The folder has been created for the community
441
441
{
442
442
// Find the subcommunities
443
443
$ this ->_createFolderForCommunity ($ community_id , $ folderDao ->getFolderId ());
444
444
}
445
- else
445
+ else
446
446
{
447
447
echo "Cannot create Folder for community: " .$ name ."<br> " ;
448
448
} // end cannot create folder
0 commit comments