Skip to content

Commit

Permalink
* 네이버 모듈에 실명(realname), 닉네임 정보(nickname) 추가.
Browse files Browse the repository at this point in the history
 * 기존의 name은 nickname 정보에서 실명이 있을 경우 realname을 사용하도록 변경
  • Loading branch information
Joungkyun committed Jan 21, 2018
1 parent 6835eb5 commit b18b7d7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 26 deletions.
38 changes: 26 additions & 12 deletions OAUTH2/NAVER.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,20 @@ private function redirectSelf () {
* 로그인 과정이 완료되면 발급받은 NAVER::$sess->oauth 에 등록된
* 키를 이용하여 로그인 사용자의 정보를 가져온다.
*
* 2018-01-30 이후, 사용자 UID 만 기본 값이고, 나머지는 옵션으로 변경이 되어,
* 값이 없을 수 있다.
*
* @access public
* @return stdClass 다음의 object를 반환
* - id 사용자 UID
* - name 사용자 별칭
* - email 이메일
* - img 프로필 사진 URL 정보
* - r DAUM profile 원본 값
* - id 사용자 UID
* - nickname 사용자 별칠
* - realname 사용자 실명
* - name 사용자 이름 (또는 사용자 별칭)
* - email 이메일
* - gender 성별
* - age 나이대
* - birth 출생년을 제외한 생일
* - img 프로필 사진 URL 정보
*/
public function Profile () {
$sess = &$this->sess;
Expand All @@ -306,14 +313,21 @@ public function Profile () {
$this->error ($r->result->message);

$xmlr = &$xml->response;

$rname = (string) $xmlr->name->{0};
$nname = (string) $xmlr->nickname->{0};
$name = $rname ? $rname : $nname;

$r = array (
'id' => (string) $xmlr->enc_id->{0},
'name' => (string) $xmlr->nickname->{0},
'email' => (string) $xmlr->email->{0},
'gender' => (string) $xmlr->gender->{0},
'age' => (string) $xmlr->age->{0},
'birth' => (string) $xmlr->birthday,
'img' => (string) $xmlr->profile_image
'id' => (string) $xmlr->enc_id->{0},
'realname' => $rname,
'nickname' => $nname,
'name' => $name,
'email' => (string) $xmlr->email->{0},
'gender' => (string) $xmlr->gender->{0},
'age' => (string) $xmlr->age->{0},
'birth' => (string) $xmlr->birthday,
'img' => (string) $xmlr->profile_image
);

return (object) $r;
Expand Down
35 changes: 26 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2017-12-15</date>
<time>03:08:59</time>
<date>2018-01-21</date>
<time>22:27:46</time>
<version>
<release>1.0.5</release>
<release>1.0.6</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
<notes>* 네이버 모듈에 실명(realname), 닉네임 정보(nickname) 추가.
* 기존의 name은 nickname 정보에서 실명이 있을 경우 realname을 사용하도록 변경
</notes>
<contents>
<dir name="/">
Expand All @@ -33,7 +33,7 @@
<file role="php" md5sum="4b8bb4b1dca0b035c3b227cf27fd2789" name="OAUTH2/GITHUB.php" />
<file role="php" md5sum="7d281b94946a5fc126af005b70029700" name="OAUTH2/GOOGLE.php" />
<file role="php" md5sum="56109b4d592ae9bc335e2f7329768185" name="OAUTH2/KAKAO.php" />
<file role="php" md5sum="de0c55563dd16a286d6c6b078404d7d6" name="OAUTH2/NAVER.php" />
<file role="php" md5sum="836982151516eb3f80fbaa305855b17b" name="OAUTH2/NAVER.php" />
<file role="php" md5sum="224ea170ad68506ba9f0805a49be2b0d" name="OAUTH2/logout-agree.template" />
<file role="php" md5sum="318f0bc144dd8ad28be690f6e9ff2af3" name="OAUTH2/logout-no-auto.template" />
<file role="php" md5sum="3f38dd2c30e3a33dca52a253908c96a6" name="OAUTH2/logout.template" />
Expand Down Expand Up @@ -61,6 +61,22 @@
</dependencies>
<phprelease />
<changelog>
<release>
<version>
<release>1.0.6</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2018-01-21</date>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>
* 네이버 모듈에 실명(realname), 닉네임 정보(nickname) 추가.
* 기존의 name은 nickname 정보에서 실명이 있을 경우 realname을 사용하도록 변경
</notes>
</release>
<release>
<version>
<release>1.0.5</release>
Expand All @@ -70,10 +86,11 @@
<release>stable</release>
<api>stable</api>
</stability>
<date>2017-12-15</date>
<date>2018-01-21</date>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
<notes>
* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
</notes>
</release>
<release>
Expand Down
27 changes: 22 additions & 5 deletions package.xml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
<date>@curdate@</date>
<time>@curtime@</time>
<version>
<release>1.0.5</release>
<release>1.0.6</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
<notes>* 네이버 모듈에 실명(realname), 닉네임 정보(nickname) 추가.
* 기존의 name은 nickname 정보에서 실명이 있을 경우 realname을 사용하도록 변경
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -61,6 +61,22 @@
</dependencies>
<phprelease />
<changelog>
<release>
<version>
<release>1.0.6</release>
<api>1.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>@curdate@</date>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>
* 네이버 모듈에 실명(realname), 닉네임 정보(nickname) 추가.
* 기존의 name은 nickname 정보에서 실명이 있을 경우 realname을 사용하도록 변경
</notes>
</release>
<release>
<version>
<release>1.0.5</release>
Expand All @@ -72,8 +88,9 @@
</stability>
<date>@curdate@</date>
<license uri="https://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
<notes>
* fixed #2 can't find duam login page
* Support new OAUTH vendor KAKAO
</notes>
</release>
<release>
Expand Down

0 comments on commit b18b7d7

Please sign in to comment.