Created
November 9, 2011 19:29
-
-
Save PeterJCLaw/1352651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* Get information about the user | |
*/ | |
public function getInfo() | |
{ | |
$output = Output::getInstance(); | |
$auth = $this->ensureAuthed(); | |
$teamNumbers = $auth->getCurrentUserTeams(); | |
$teams = array(); | |
foreach ($teamNumbers as $id) | |
{ | |
$teams[$id] = $auth->displayNameForTeam($id); | |
} | |
$output->setOutput('display-name', $auth->displayNameForUser($this->username)); | |
$output->setOutput('email', $auth->emailForUser($this->username)); | |
$output->setOutput('teams', $teams); | |
$output->setOutput('is-admin', $auth->isCurrentUserAdmin()); | |
$settingsManager = Settings::getInstance(); | |
$settings = $settingsManager->getSettings($this->username); | |
$output->setOutput('settings', $settings); | |
return true; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment