Skip to content

Commit 7c633d2

Browse files
authored
Merge pull request #100 from ribsey/master
Refactor user info retrieval methods
2 parents 4075d34 + 19993fa commit 7c633d2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

action/editcommit.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,19 @@ private function commitFile($filePath, $message)
117117
}
118118
}
119119

120-
private function getAuthor()
121-
{
122-
return $GLOBALS['USERINFO']['name'];
120+
private function getUserInfo($key) {
121+
if (isset($GLOBALS['USERINFO'][$key])) {
122+
return $GLOBALS['USERINFO'][$key];
123+
}
124+
return '';
123125
}
124-
125-
private function getAuthorMail()
126-
{
127-
return $GLOBALS['USERINFO']['mail'];
126+
127+
private function getAuthor() {
128+
return $this->getUserInfo('name');
129+
}
130+
131+
private function getAuthorMail() {
132+
return $this->getUserInfo('mail');
128133
}
129134

130135
private function computeLocalPath()

0 commit comments

Comments
 (0)