24 "FUSERS:FUSERS_IGROUP"
27 "USERCARD:CHOOSEGROUP"
31 "gidNumber" =>
"GRP_GIDNUMBER",
33 "description" =>
"GRP_DESC"
40 $this->AddParamRefresh(
"US_WHATID",
"GRP_MAIL,US_LOGIN");
44 $user = $this->getAccount();
45 if (!
$user)
return sprintf(_(
"group #%d does not exist") , $iduser);
47 return _(
"group has not identificator");
50 if ($this->
getRawValue(
"grp_isrefreshed") ==
"0")
$err.= _(
"this groups must be refreshed");
55 return _(
"group cannot be revived");
69 return sprintf(_(
"%s group") , $this->title);
77 $g = $this->getAccount();
78 $members = $g->getAllMembers();
80 foreach ($members as $k => $v) {
81 $du =
getTDoc($this->dbaccess, $v[
"fid"]);
82 $tdnu = explode(
"\n", $du[
"ldapdn"]);
83 if (
count($tdnu) > 0) {
85 if ($dnu) $tdn[] = $dnu;
101 include_once (
"FDL/Lib.Usercard.php");
103 $err = $this->RefreshDocUser();
107 $err.= $this->Modify();
121 function refreshParentGroup()
124 foreach (
$tgid as $gid) {
128 $gdoc =
new_Doc($this->dbaccess, $gid);
129 if ($gdoc->isAlive()) {
130 $gdoc->insertGroups();
136 return $this->synchronizeSystemGroup();
145 return self::postStore();
147 public function synchronizeSystemGroup()
157 $user = $this->getAccount();
159 $user = new \Account(
"");
160 $this->wuser = &
$user;
163 $roleIds = $this->getSystemIds($roles);
167 $this->
setValue(MyAttributes::us_meid, $this->
id);
168 $this->
modify(
false, array(
169 MyAttributes::us_whatid,
170 MyAttributes::us_meid
179 if ($wrg) AddWarningMsg($wrg);
183 $dfldid = $fdoc->dfldid;
188 $dfld = new_doc($this->dbaccess, $dfldid);
189 if ($dfld->isAlive()) {
190 if (
count(
$tgid) == 0) $dfld->insertDocument($this->initid);
191 else $dfld->removeDocument($this->initid);
210 if (!$nomail) $nomail = ($this->
getRawValue(
"grp_hasmail") ==
"no");
224 $wu = $this->getAccount();
225 if ($wu->isAffected()) {
226 return $wu->getMail($rawmail);
246 if ($multiple ==
false) {
253 $uid = $du->getRawValue(
"us_whatid");
255 $g = new \Group(
"", $uid);
261 $du->disableEditControl();
262 $du->RefreshDocUser();
263 $du->enableEditControl();
285 foreach ($tdocid as $k =>
$docid) {
290 $uid = $du->getRawValue(
"us_whatid");
296 $du->disableEditControl();
297 $du->RefreshDocUser();
298 $du->enableEditControl();
323 $uid = $du->getRawValue(
"us_whatid");
325 $g = new \Group(
"", $gid);
327 $err = $g->SuppressUser($uid);
329 $du->disableEditControl();
330 $du->RefreshDocUser();
331 $du->enableEditControl();
341 $gAccount = $this->getAccount();
342 if ($gAccount) $gAccount->Delete();
351 $gAccount = $this->getAccount();
354 $tu = $gAccount->GetUsersGroupList($gAccount->id);
359 foreach ($tu as $k => $v) {
361 if ($v[
"fid"] > 0) $tfid[] = $v[
"fid"];
379 $this->
setValue(
"grp_isrefreshed",
"0");
380 $this->
modify(
true, array(
397 $this->
setValue(
"grp_isrefreshed",
"0");
398 $this->
modify(
true, array(
412 $wuser = $this->getAccount(
true);
413 if (
$wuser->isAffected()) {
419 $this->
setValue(
"US_MEID", $this->
id);
421 $g = new \Group(
"",
$wid);
422 $tglogin =
$tgid = array();
423 if (
count($g->groups) > 0) {
424 foreach ($g->groups as $gid) {
425 $gt = new \Account(
"", $gid);
426 $tgid[$gid] = $gt->fid;
427 $tglogin[$gid] = $this->
getTitle($gt->fid);
431 $this->
setValue(
"GRP_IDPGROUP",
" ");
443 $err = sprintf(_(
"group %d does not exist") ,
$wid);
457 $u = $this->getAccount(
true);
459 $tu = $u->GetUsersGroupList(
$wid,
true);
461 if (
count($tu) > 0) {
463 foreach ($tu as $uid => $tvu) {
465 $tgid[$uid] = $tvu[
"fid"];
467 $tglogin[$tvu[
"fid"]] = $tvu[
"lastname"];
472 if (is_array($tglogin)) {
473 uasort($tglogin,
"strcasecmp");
474 $this->
setValue(
"GRP_IDGROUP", array_keys($tglogin));
490 if (is_array($content)) {
491 foreach ($content as
$tdoc) {
getTDoc($dbaccess, $id, $sqlfilters=array(), $result=array())
setGroupMail($nomail=false)
postInsertDocument($docid, $multiple=false)
count($onlyprimary=false)
refreshGroups($groupIdList, $refresh=false, &$currentPath=array(), &$groupDepth=array())
QuickInsertMSDocId($tdocids)
getContent($controlview=true, array $filter=array(), $famid="", $qtype="TABLE", $trash="")
modify($nopost=false, $sfields="", $nopre=false)
removeDocument($docid, $noprepost=false, $nocontrol=false)
setValue($attrid, $value, $index=-1, &$kvalue=null)
getMultipleRawValues($idAttr, $def="", $index=-1)
refreshMailMembersOnChange()
getTitle($id="-1", $def="", $latest=false)
deprecatedFunction($msg= '')
new_Doc($dbaccess, $id= '', $latest=false)
postInsertMultipleDocuments($tdocid)
insertDocument($docid, $mode="latest", $noprepost=false, $forcerestrict=false, $nocontrol=false)
if($file) if($subject==""&&$file) if($subject=="") $err
getRawValue($idAttr, $def="")
postRemoveDocument($docid, $multiple=false)