public function getCreator() : User { if (!$this->_creator) { $this->_creator = User::find($this->_pdo, $this->creator_id); } return $this->_creator; }
public function getUser() : User { if (!$this->_user) { $this->_user = User::find($this->_pdo, $this->user_id); } return $this->_user; }
private function resizeProfileImage(FilesystemInterface $_filesystem, \int $user_id) { $_user = User::find($this->_pdo, $user_id); $_file = $_user->getImageFile($_filesystem); $_img = GDImageManipulator::read($_file); $_img->resize(User::PROFILE_IMAGE_WIDTH, User::PROFILE_IMAGE_HEIGHT); $_file->write($_img->getStream($_file->getExtension())); unset($_user, $_file, $_img); }
} return \FMA\User\User::findAllForChapterAsArray($_pdo, $chapter); }); $router->map("GET", "/organization/[i:id]/chapter/[i:cid]/user/[i:uid]/", function ($id, $cid, $uid) use($_pdo) { $org = \FMA\Organization\GreekOrganization::find($_pdo, $id); if (is_null($org)) { return ["err" => true, "msg" => "No organization by that id."]; } $chapter = \FMA\Organization\Chapter::find($_pdo, $cid); if (is_null($chapter)) { return ["err" => true, "msg" => "No chapter by that id."]; } if ($chapter->getGreekOrganizationId() != $org->getId()) { return ["err" => true, "msg" => "Organization has no chapter by that id."]; } $user = \FMA\User\User::find($_pdo, $uid); if (is_null($user)) { return ["err" => true, "msg" => "No user by that id."]; } if ($user->getChapterId() != $chapter->getId()) { return ["err" => true, "msg" => "Chapter has no user by that id."]; } return $user->toArray(); }); } $match = $router->match(); if ($match && !is_callable($match["target"])) { throw new TypeError("Target is not callable."); } else { if ($match && is_callable($match["target"])) { $page_title = $match["name"];
/** * @return User */ public function getBigBrother() { if (!$this->big_brother_id) { return null; } if (!$this->_big) { $this->_big = User::find($this->_pdo, $this->big_brother_id); } return $this->_big; }
/** * @return User */ public function getRemovedByUser() { if ($this->removed_by_user_id && !$this->_removed_by_user) { $this->_removed_by_user = User::find($this->_pdo, $this->removed_by_user_id); } return $this->_removed_by_user; }
<?php require_once __DIR__ . "/../../FMA/autoload.php"; $_pdo = new \FMA\PDO\MySQL_PDO(); $_auth = new \FMA\Auth\SessionAuth($_pdo); $_auth->validate(); $_user = \FMA\User\User::find($_pdo, $_GET["id"]); if (is_null($_user)) { header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); exit; } $vCard = new \JeroenDesloovere\VCard\VCard(); $vCard->addName($_user->getNameLast(), $_user->getNameFirst()); $vCard->addPhoneNumber($_user->getPhoneNumber()); $vCard->addEmail($_user->getEmailUniversity()); $vCard->addCompany($_user->isBrother() ? "" : "Associate"); $vCard->addPhoto("http://" . \FMA\Config::getBaseUrl() . "/image/profile/large/" . $_user->getId()); $vCard->download();
private function sendUserPasswordResetEmail(\int $user_id) { $_user = User::find($this->_pdo, $user_id); $this->_mailer->sendUserPasswordResetEmail($_user); }