Closed (fixed)
Project:
Subsites
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Aug 2011 at 22:37 UTC
Updated:
23 Dec 2016 at 11:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
francescoq commentedHi, i saw that some of the code of Subsite Access Control was already upgraded, i changed only few lines and now from brief testing it's working, take a look at this.
I don't need this feature in my project atm, so i can't think of problems that may occour.
i changed these lines every time they occur:
to
and so on
Comment #2
francescoq commentedOk, may sounds stupid, but i've never tried to create a content without a subsite associated... and this give three errors:
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'gid' at row 1: INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5), (:db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11), (:db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17), (:db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23), (:db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29), (:db_insert_placeholder_30, :db_insert_placeholder_31, :db_insert_placeholder_32, :db_insert_placeholder_33, :db_insert_placeholder_34, :db_insert_placeholder_35); Array ( [:db_insert_placeholder_0] => 26 [:db_insert_placeholder_1] => subsites_view_page [:db_insert_placeholder_2] => -1 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 26 [:db_insert_placeholder_7] => subsites_update_page [:db_insert_placeholder_8] => -1 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 1 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 26 [:db_insert_placeholder_13] => subsites_delete_page [:db_insert_placeholder_14] => -1 [:db_insert_placeholder_15] => 1 [:db_insert_placeholder_16] => 0 [:db_insert_placeholder_17] => 1 [:db_insert_placeholder_18] => 26 [:db_insert_placeholder_19] => subsites_view_own_page_-1 [:db_insert_placeholder_20] => 1 [:db_insert_placeholder_21] => 1 [:db_insert_placeholder_22] => 0 [:db_insert_placeholder_23] => 0 [:db_insert_placeholder_24] => 26 [:db_insert_placeholder_25] => subsites_update_own_page_-1 [:db_insert_placeholder_26] => 1 [:db_insert_placeholder_27] => 1 [:db_insert_placeholder_28] => 1 [:db_insert_placeholder_29] => 0 [:db_insert_placeholder_30] => 26 [:db_insert_placeholder_31] => subsites_delete_own_page_-1 [:db_insert_placeholder_32] => 1 [:db_insert_placeholder_33] => 1 [:db_insert_placeholder_34] => 0 [:db_insert_placeholder_35] => 1 ) in node_access_write_grants() (line 3440 of [...]\modules\node\node.module).so this have to be fixed.
When I have time I will try to understand the problem.
Comment #3
francescoq commentedSo.. this should fix the problem, in near future i'll try to test to find out other problems, but atm i haven't errors..
One thing: before building the $grants i added those lines
because $sid is used as $gid, and $gid column doesn't accept negative value.. i don't know if this is the right way to do it, but from what i can see it's working.
Comment #4
m4oliveiI added your patches, and found that the anonymous user couldn't see anything after enabling the module.
Going to look into why that is.
Comment #5
m4oliveiOh wait, nevermind. I just needed to give permissions to view the content in each subsite and main site then the anonymous user was allowed to view the content.
Humm, this way of doing the access control is intense. At the least, there should be a warning about content becoming unavailable after enabling the module. Better would be some defaults to allow viewing content in all subsites. Best would be, there must be a better way to present this stuff. I'm thinking something like content access (http://drupal.org/files/images/content_access.png). Where we'd put a tab for "Access Control" on each subsite with an interface like Content Access.
Thoughts?
Thanks,
Matt
Comment #6
francescoq commentedYeah, I also think that there should be a setting to let anonymous users view all the content of the subsites, i used Content Access some times and yes, i also think that it's definitely the right way to do it, but i never took a look at its code, if i have enough time i think at something this weekend... but i'm a newbie, i hope to be helpful in some way!
Comment #7
gislePostponing all Subsites Access Control issues until the main module has been successfully upgraded to Drupal 7.
Comment #8
chunty commentedHere is my version of the subsites access control module after I'd done the same fixes. Basically there are 3 updates I've done to make this work with D7.
subsites_access_control_permtried to treat$subsitesas a class rather than an array which is how the subsites are now returned - this means the names of the subsites are correctly shown on the permissions pages.I don't have the ability to make a patch file right now so I'm just uploading the whole module file.
Comment #9
andrey.troeglazov commentedChecking last comment.
If smn wants to help, it will be good.
Thanks.
Comment #11
andrey.troeglazov commentedHello, I have reviewed patches and archive from #8.
Committed to dev version with changes.
Thanks to all.