Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
refreshGroups.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Refresh groups to recompute members and mail attributes
8  * @subpackage
9  */
10 /**
11  */
12 // refreah for a classname
13 // use this only if you have changed title attributes
14 include_once ("FDL/Class.Doc.php");
15 include_once ("FDL/Lib.Dir.php");
16 include_once ("FDL/Lib.Usercard.php");
17 
18 $usage = new ApiUsage();
19 
20 $usage->setDefinitionText("Refresh groups to recompute members and mail attributes");
21 $force = $usage->addOptionalParameter("force", "force a refresh", array(
22  "yes",
23  "no"
24 )); // force a refresh if set to 'yes'
25 $fbar = $usage->addOptionalParameter("bar", "for progress bar"); // for progress bar
26 $usage->verify();
27 
29 $appl->Set("FDL", $core);
30 
31 $dbaccess = $appl->dbaccess;
32 if ($dbaccess == "") {
33  print "Database not found : appl->dbaccess";
34  return;
35 }
36 $filter = array();
37 if ($force != 'yes') $filter[] = "grp_isrefreshed = '0'";
38 $tdoc = internalGetDocCollection($dbaccess, 0, 0, "ALL", $filter, 1, "TABLE", "IGROUP");
39 
40 $tgid = array();
41 $nd = count($tdoc);
42 print sprintf(_("%d group(s) to update\n") , $nd);
43 
44 foreach ($tdoc as $k => $v) {
45  $tgid[] = getv($v, "us_whatid");
46  print "\t" . $v["title"] . "\n";
47 }
48 
49 wbar($nd, $nd, "processing");
50 if ($nd > 0) {
51  print _("processing...\n");
52  refreshGroups($tgid, true);
53  print _("done\n");
54 }
55 wbar(0, $nd, "done");
$tdoc
getv(&$t, $k, $d="")
refreshGroups($groupIdList, $refresh=false, &$currentPath=array(), &$groupDepth=array())
$usage
wbar($reste, $total, $text="", $fbar=false)
Definition: Lib.Common.php:642
if($dbaccess=="") $filter
$tgid
internalGetDocCollection($dbaccess, $dirid, $start="0", $slice="ALL", $sqlfilters=array(), $userid=1, $qtype="LIST", $fromid="", $distinct=false, $orderby="title", $latest=true, $trash="", &$debug=null, $folderRecursiveLevel=2, $join= '',\SearchDoc &$searchDoc=null)
Definition: Lib.Dir.php:428
print
Definition: checklist.php:49
$force
$fbar
$appl
$dbaccess
Verify arguments for wsh programs.
$core
Definition: chgpasswd.php:33
← centre documentaire © anakeen