예제 #1
0
 /**
  * Override parent method to keep a reference to the child users
  * @param $parentId
  */
 public function setParent($parentId)
 {
     $u = ConfService::getConfStorageImpl()->createUserObject($parentId);
     $p = $u->getChildrenPointer();
     if ($p == null) {
         $p = array();
     }
     $p[$this->getId()] = $this->getId();
     $u->setChildrenPointer($p);
     $u->save("superuser");
     if (AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getId() == $parentId) {
         AuthService::updateUser($u);
     }
     parent::setParent($parentId);
 }