function ldapUsersPopup() { $T = ""; try { $AD = new LoginAD(); $AD->getUsers(); $T = new HTMLTable(2); $T->setColWidth(1, 20); $T->maxHeight(400); $T->useForSelection(false); $B = new Button("Eintrag bearbeiten", "./images/i2/edit.png", "icon"); while ($U = $AD->n()) { $T->addRow(array($B, $U->A("name"))); $T->addRowEvent("click", OnEvent::frame("contentLeft", "User", $U->getID())); } } catch (Exception $e) { } echo $T; }
public function getUser($username, $password, $isSHA = false) { if ($password == ";;;-1;;;") { return null; } $user = $this->getAppServerUser($username, !$isSHA ? sha1($password) : $password); if ($user != null) { return $user; } $user = LoginAD::getUser($username, $password); if ($user != null) { return $user; } $this->addAssocV3("username", "=", $username); if (!$isSHA) { $this->addAssocV3("SHApassword", "=", sha1($password), "AND", "1"); } else { $this->addAssocV3("SHApassword", "=", $password, "AND", "1"); } $this->addAssocV3("password", "=", $password, "OR", "1"); $this->addAssocV3("UserType", "=", "0"); $user = $this->getNextEntry(); if ($user != null) { return $user; } try { if (isset($_SESSION["viaInterface"]) and $_SESSION["viaInterface"] and !class_exists("mphynxAltLogin")) { throw new Exception(); } $AL = new mphynxAltLogin(); $AL->addAssocV3("username", "=", $username); if (!$isSHA) { $AL->addAssocV3("SHApassword", "=", sha1($password), "AND", "1"); } else { $AL->addAssocV3("SHApassword", "=", $password, "AND", "1"); } $user = $AL->getNextEntry(); if ($user != null) { return $user; } } catch (Exception $e) { return null; } return null; }
function loadMe($empty = true) { if ($this->getID() > 20000) { if (mUserdata::getGlobalSettingValue("AppServer", "") != "") { $S = Util::getAppServerClient(); $this->setA($S->getUserById($this->ID, $empty)); return; } $LD = LoginData::get("ADServerUserPass"); if ($LD != null and $LD->A("server") != "") { $this->setA(LoginAD::getUserById($this->ID)); return; } } parent::loadMe(); if ($empty and $this->A != null) { $this->A->SHApassword = ""; } }
public static function getUserById($userID) { $U = new LoginAD(); $U->getUsers(); while ($User = $U->n()) { if ($User->getID() == $userID) { return $User->getA(); } } return null; }