8000 Merge pull request #14 from miteshashar/master · atake/codebird-php@12217a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12217a7

Browse files
committed
Merge pull request jublo#14 from miteshashar/master
OAuth: force_login, screen_name support
2 parents 7e6ca03 + 032ba5a commit 12217a7

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/codebird.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,25 +280,39 @@ public function __call($fn, $params)
280280
*
281281
* @return string The OAuth authenticate URL
282282
*/
283-
public function oauth_authenticate()
283+
public function oauth_authenticate($force_login = NULL, $screen_name = NULL)
284284
{
285285
if ($this->_oauth_token == null) {
286286
throw new Exception('To get the authenticate URL, the OAuth token must be set.');
287287
}
288-
return self::$_endpoint_oauth . 'oauth/authenticate?oauth_token=' . $this->_url($this->_oauth_token);
288+
$url = self::$_endpoint_oauth . 'oauth/authenticate?oauth_token=' . $this->_url($this->_oauth_token);
289+
if ($force_login) {
290+
$url .= "&force_login=1";
291+
}
292+
if ($screen_name) {
293+
$url .= "&screen_name=" . $screen_name;
294+
}
295+
return $url;
289296
}
290297

291298
/**
292299
* Gets the OAuth authorize URL for the current request token
293300
*
294301
* @return string The OAuth authorize URL
295302
*/
296-
public function oauth_authorize()
303+
public function oauth_authorize($force_login = NULL, $screen_name = NULL)
297304
{
298305
if ($this->_oauth_token == null) {
299306
throw new Exception('To get the authorize URL, the OAuth token must be set.');
300307
}
301-
return self::$_endpoint_oauth . 'oauth/authorize?oauth_token=' . $this->_url($this->_oauth_token);
308+
$url = self::$_endpoint_oauth . 'oauth/authorize?oauth_token=' . $this->_url($this->_oauth_token);
309+
if ($force_login) {
310+
$url .= "&force_login=1";
311+
}
312+
if ($screen_name) {
313+
$url .= "&screen_name=" . $screen_name;
314+
}
315+
return $url;
302316
}
303317

304318
/**

0 commit comments

Comments
 (0)
0