public function getHTML($id) { try { $U = new mUserdata(); $U->addAssocV3("typ", "=", $_SESSION["applications"]->getActiveApplication() . "DesktopLink"); $U->addAssocV3("UserID", "=", $_SESSION["S"]->getCurrentUser()->getID()); $U->addOrderV3("wert"); $U->addOrderV3("UserdataID"); $U->lCV3(); } catch (Exception $e) { return ""; } $html = ""; while ($t = $U->getNextEntry()) { $e = explode(";", $t->A("name")); $v = explode(";", $t->A("wert")); $B = new Button($v[2], $v[1]); $B->type("icon"); $B->onclick("DesktopLink.hide(); contentManager.loadFrame('{$e['2']}', '{$e['0']}', '{$e['1']}')"); $BS = new Button("Einstellungen", "./images/i2/settings.png"); $BS->type("icon"); $BS->className("DesktopLinkSettings"); $BS->rmePCR("DesktopLink", "", "editInWindow", $t->getID(), "Popup.displayNamed('DesktopLinkPopup','Desktop-Link bearbeiten', transport);"); $BM = new Button("Verschieben", "./images/i2/moveLeftRight.png"); $BM->type("icon"); $BM->className("DesktopLinkHandler"); $html .= "<li id=\"DesktopLink_" . $t->getID() . "\" class=\"DesktopLinkIcon\">{$BS}{$BM}{$B}" . "<p>" . $v[2] . "</p></li>"; } if ($html != "") { echo "<ul id=\"DesktopLinkElements\">{$html}</ul><div style=\"clear:both;\"></div>"; } }
public function copyUserRestrictions($fromUserId) { $mUD = new mUserdata(); $mUD->addAssocV3("UserID", "=", $fromUserId); $mUD->lCV3(); $cUD = new mUserdata(); $cUD->addAssocV3("UserID", "=", $this->ID); $cUD->addAssocV3("typ", "=", "uRest", "AND", "1"); $cUD->addAssocV3("typ", "=", "relab", "OR", "1"); $cUD->addAssocV3("typ", "=", "hideF", "OR", "1"); $cUD->addAssocV3("typ", "=", "pSpec", "OR", "1"); $cUD->addAssocV3("typ", "=", "pHide", "OR", "1"); $cUD->lCV3(); if ($cUD->getNextEntry() != null) { die("Target userdata not empty!"); } while ($t = $mUD->getNextEntry()) { $A = $t->getA(); $A->UserID = $this->ID; $nU = new Userdata(-1); $nU->setA($A); $nU->newMe(); } }
public static function isDisallowedTo($restriction) { $UD = new mUserdata(); $UD->addAssocV3("wert", "=", $restriction); $UD->addAssocV3("UserID", "=", $_SESSION["S"]->getCurrentUser()->getID()); try { $sUD = $UD->getNextEntry(); } catch (StorageException $e) { return true; } if ($sUD != null) { return false; } else { return true; } }
/** * Get login data for current user * * @param string $name * @return LoginData */ public static function getU($name, $userID = null) { if ($userID == null) { $userID = Session::currentUser()->getID(); } $UD = new mUserdata(); $UD->addAssocV3("UserID", "=", $userID); $UD->addAssocV3("name", "=", $name); $e = $UD->getNextEntry(); if ($e == null) { return null; } $LD = new LoginData($e->getID()); $LD->loadMe(); return $LD; }