Skip to content

Instantly share code, notes, and snippets.

@PeterJCLaw
Created November 9, 2011 19:29
Show Gist options
  • Save PeterJCLaw/1352651 to your computer and use it in GitHub Desktop.
Save PeterJCLaw/1352651 to your computer and use it in GitHub Desktop.
<?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