46 global $refreshedGrpId;
48 if (!isset($refreshedGrpId[$this->
id])) {
108 if (!$nomail) $nomail = ($this->
getValue(
"grp_hasmail") ==
"no");
111 $tiduser = $this->
getTValue(
"GRP_IDUSER");
113 if (
count($tiduser) > 0) {
115 foreach ($tiduser as $k => $v) {
117 $udoc =
getTDoc($this->dbaccess, $v);
120 $mail =
getv($udoc,
"us_mail");
122 if ($mail !=
"") $tmail[] = $mail;
124 if ($tuser[$k] !=
"")
$err.= sprintf(
"%s does not exist", $tuser[$k]);
127 $gmail = implode(
", ", array_unique($tmail));
130 $nodetectmembers = ($this->
getValue(
"grp_hasmembers") ==
"no");
134 $tgmemberid = $tiduser;
136 $tiduser = $this->
getTValue(
"GRP_IDGROUP");
137 if (
count($tiduser) > 0) {
138 while (list($k, $v) = each($tiduser)) {
139 $udoc =
new_Doc($this->dbaccess, $v);
140 if ($udoc && $udoc->isAlive()) {
142 $mail = $udoc->getValue(
"GRP_MAIL");
144 $tmail1 = explode(
",", str_replace(
" ",
"", $mail));
145 $tmail = array_merge($tmail, $tmail1);
148 if (!$nodetectmembers) {
149 $tgmemberid = array_merge($tgmemberid, $udoc->getTValue(
"GRP_IDRUSER"));
150 $tgmember = array_merge($tgmember, $udoc->getTValue(
"GRP_RUSER"));
155 $gmail = implode(
", ", array_unique($tmail));
157 $tgmembers = array();
159 while (list($k, $v) = each($tgmemberid)) {
160 $tgmembers[$v] = $tgmember[$k];
163 if ($nodetectmembers) {
167 if (
count($tgmembers) > 0) {
168 $this->
SetValue(
"GRP_IDRUSER", array_keys($tgmembers));
169 $this->
SetValue(
"GRP_RUSER", $tgmembers);
176 if (!$nomail) $this->
SetValue(
"GRP_MAIL", $gmail);
177 else if ($this->
getValue(
"grp_hasmail") ==
"no") $this->deleteValue(
"GRP_MAIL");
189 include_once (
"FDL/freedom_util.php");
190 include_once (
"FDL/Lib.Dir.php");
192 $sqlfilters[] =
"in_textlist(grp_idgroup,{$this->id})";
197 $tidpgroup = array();
198 while (list($k, $v) = each($tgroup)) {
200 $tpgroup[] = $v->title;
201 $tidpgroup[] = $v->id;
204 $this->
SetValue(
"GRP_PGROUP", implode(
"\n", $tpgroup));
205 $this->
SetValue(
"GRP_IDPGROUP", implode(
"\n", $tidpgroup));
213 include_once (
"FDL/Lib.Dir.php");
215 $tu =
getChildDoc($this->dbaccess, $this->initid,
"0",
"ALL", array() , 1,
"TABLE",
"USER");
217 if (
count($tu) > 0) {
218 foreach ($tu as $k => $v) {
219 $tmemid[] = $v[
"id"];
220 $tmem[] = $v[
"title"];
223 $this->
SetValue(
"GRP_IDUSER", $tmemid);
231 $tu =
getChildDoc($this->dbaccess, $this->initid,
"0",
"ALL", array() , 1,
"TABLE",
"GROUP");
234 if (
count($tu) > 0) {
235 foreach ($tu as $k => $v) {
236 $tmemid[] = $v[
"id"];
237 $tmem[] = $v[
"title"];
239 $this->
SetValue(
"GRP_GROUP", $tmem);
240 $this->
SetValue(
"GRP_IDGROUP", $tmemid);
252 $err = $this->refreshGroup();