hidden vocabularies if groups is private for developer

alb - January 7, 2009 - 17:26
Project:OG Vocabulary
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

I maked some initially test (se attached files) for to make private in the menu a vocabulary and terms when the group that create a vocabulary is a private group.
I take the code from TAC module see that is theonly that hidden vocab and terms also in the advanced search box and also in the view etc.

The code is incomplete; but think is the more fast solution for resolve this problems.
Infact if we can reuse the tac code in og, whe can have same features.

Notice the code isn't ready for hidden automatically categories (Vocab and terms) but is a good point for to do.

At moment I have problems with db_sql_rewrite.
For to test the module, after installation you must hidden manually the categories, using phpmyadmin;go in table ogmy_term_access_default (that is the table in TAc called term_access_default) that hidden vocabularies (and all its terms); the other table is for hidden only the terms, but for we isn't necessary see tht have other problemsprincipal.

Well in this table ogmy_term_access_default if you want hidden all vocabularies exception your first Vocabulary at anonymous you must setting this:
VID RID VIEW UPDATE DELETE CREATE LIST
0 1 2 2 2 0 0
1 1 1 0 0 1 1

For to work with this table you by phpadmin must to read the table vocabulary and table role;
here you can read this:
In vocabulary you can read the vid of your vocabulary name;
In Role you can read the rid and its name.
I maked a scheme on a sheet for to have all clear. I suggest this.

I have maked this first steps and work initially, but how changed settings (I wanted add other
role) I haved page not found and cannot more see the list;
I reload site (maked a copy) and in one other settingsI haved errors of mysql;

So I cannot to go on.
If you are a god programmer perhaps can resolve.
I think is necessary to make a comparision with tac module for to see how it work.

If is possible to resolve this phase after is possible insert in the table a setting based
on the role of the group private.

Notice. YOU MUST TEST THE CODE ONLY ON A COPY OF YOUR SITE BECAUSE
SURE THAT its will be blocked.
Really when i have page not found and not more menu I make so for reload all:
1) remove the folder of og_my in other folder ;
2)go in mysite/upadte.php and at row 18 change write so $access_check = FALSE; remove TRUE;
3) after go in url of your site localhost/site/update.php and write update.php so now you can use update; and make update
and after reinsert folder of the module in original place .
you can also test directly point 2;

when you make test after every settings make a clear cache;
I have menu that is a page with this code

<?php
echo "This page runs a script that clears the main cache.<br>";
db_query("DELETE FROM {cache} WHERE 1");
db_query("DELETE FROM {cache_filter} WHERE 1");
db_query("DELETE FROM {cache_menu} WHERE 1");
db_query("DELETE FROM {cache_page} WHERE 1");
db_query("DELETE FROM {cache_views} WHERE 1");
echo
"It's clear now.<br>";
?>

notice IMPUT FORMAT must to be php; this setting is bottom the body box

AttachmentSize
og_my_install.txt2.52 KB
og_my_info.txt276 bytes
og_my_module.txt5.29 KB
 
 

Drupal is a registered trademark of Dries Buytaert.