summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-30 10:23:24 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-30 10:23:24 -0400
commitc501b7b9259b6fc8c34655b870ce79f102ada137 (patch)
tree00eaba024ac6c4021262d8f6628977a560df0159 /actions
parent9210f956332d5fcd786dd3ec757e6fd789f9a1ad (diff)
interim commit after pull from server
darcs-hash:20080530142324-84dde-782c9f04f551447514f1557b9e80f8461a17771f.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/accesstoken.php2
-rw-r--r--actions/login.php13
-rw-r--r--actions/requesttoken.php2
-rw-r--r--actions/userauthorization.php13
4 files changed, 22 insertions, 8 deletions
diff --git a/actions/accesstoken.php b/actions/accesstoken.php
index 6bb0e1561..4f683ba24 100644
--- a/actions/accesstoken.php
+++ b/actions/accesstoken.php
@@ -24,7 +24,7 @@ class AccesstokenAction extends Action {
parent::handle($args);
try {
$req = OAuthRequest::from_request();
- $server = common_oauth_server();
+ $server = omb_oauth_server();
$token = $server->fetch_access_token($req);
print $token;
} catch (OAuthException $e) {
diff --git a/actions/login.php b/actions/login.php
index 9f9c473b5..d25d59cf7 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -44,9 +44,16 @@ class LoginAction extends Action {
return;
}
# success!
- common_redirect(common_local_url('all',
- array('nickname' =>
- $nickname)));
+ $url = common_get_returnto();
+ if ($url) {
+ # We don't have to return to it again
+ common_set_returnto(NULL);
+ } else {
+ $url = common_local_url('all',
+ array('nickname' =>
+ $nickname));
+ }
+ common_redirect($url);
} else {
$this->show_form(_t('Incorrect username or password.'));
}
diff --git a/actions/requesttoken.php b/actions/requesttoken.php
index 92b4c4234..0e233ff17 100644
--- a/actions/requesttoken.php
+++ b/actions/requesttoken.php
@@ -26,7 +26,7 @@ class RequesttokenAction extends Action {
parent::handle($args);
try {
$req = OAuthRequest::from_request();
- $server = common_oauth_server();
+ $server = omb_oauth_server();
$token = $server->fetch_request_token($req);
print $token;
} catch (OAuthException $e) {
diff --git a/actions/userauthorization.php b/actions/userauthorization.php
index cc7ec85a5..ee156bd79 100644
--- a/actions/userauthorization.php
+++ b/actions/userauthorization.php
@@ -29,7 +29,10 @@ class UserauthorizationAction extends Action {
try {
$req = $this->get_request();
$server = common_oauth_server();
- list($consumer, $token) = $server->verify_request($req);
+ $server->get_version($req);
+ $consumer = $server->get_consumer($req);
+ $token = $server->get_token($req, $consumer, "request");
+ $server->check_signature($req, $consumer, $token);
} catch (OAuthException $e) {
$this->clear_request();
common_server_error($e->getMessage());
@@ -39,7 +42,8 @@ class UserauthorizationAction extends Action {
if (common_logged_in()) {
$this->show_form($req);
} else {
- common_return_to(common_local_url('userauthorization'));
+ # Go log in, and then come back
+ common_set_returnto(common_local_url('userauthorization'));
common_redirect(common_local_url('login'));
}
}
@@ -56,7 +60,9 @@ class UserauthorizationAction extends Action {
if (!$req) {
# XXX: may have an uncaught exception
$req = OAuthRequest::from_request();
- $this->store_request($req);
+ if ($req) {
+ $this->store_request($req);
+ }
}
return $req;
}
@@ -69,6 +75,7 @@ class UserauthorizationAction extends Action {
function send_authorization() {
$req = $this->get_request();
+
if (!$req) {
common_user_error(_t('No authorization request!'));
return;