Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_groups.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: freedom_groups.php,v 1.16 2009/01/16 08:51:42 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 // refreah for a classname
19 // use this only if you have changed title attributes
20 include_once ("FDL/Class.Doc.php");
21 include_once ("Lib.Common.php");
22 
24 $appl->Set("FDL", $core);
25 
26 $dbaccess = $appl->GetParam("FREEDOM_DB");
27 if ($dbaccess == "") {
28  print "Database not found : param FREEDOM_DB";
29  exit;
30 }
31 
33 
36 
37 $big = false; // need to set to true when table group count > 20000
39  system(sprintf("PGSERVICE=%s psql -c 'delete from docperm where upacl=0 and unacl=0;update docperm set cacl=0 where cacl != 0;'", escapeshellarg($pgservice_freedom)));
40 } else {
41  if ($big) system(sprintf("PGSERVICE=%s psql -c 'DROP INDEX groups_idx2;DROP INDEX groups_idx1;'", escapeshellarg($pgservice_freedom)));
42  system(sprintf("PGSERVICE=%s psql -c 'delete from groups;delete from docperm where upacl=0 and unacl=0;update docperm set cacl=0 where cacl != 0;'", escapeshellarg($pgservice_freedom)));
43  system(sprintf("PGSERVICE=%s pg_dump -a --disable-triggers -t groups | PGSERVICE=%s psql", escapeshellarg($pgservice_core) , escapeshellarg($pgservice_freedom)));
44 
45  if ($big) system(sprintf("PGSERVICE=%s psql -c 'CREATE unique INDEX groups_idx2 on groups(iduser,idgroup);CREATE INDEX groups_idx1 on groups(iduser);'", escapeshellarg($pgservice_freedom)));
46 }
47 
48 system("PGSERVICE=\"$pgservice_core\" psql -c 'DELETE FROM permission WHERE computed = TRUE;'");
49 //system("echo 'vacuum docperm;vacuum groups' | psql $dbfree");
50 //system("echo 'select getuperm(userid, docid) from docperm' | psql freedom anakeen");
51 
52 ?>
← centre documentaire © anakeen - published under CC License - Dynacase