summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/avatar.php4
-rw-r--r--actions/confirmaddress.php4
-rw-r--r--actions/finishaddopenid.php4
-rw-r--r--actions/finishremotesubscribe.php4
-rw-r--r--actions/foaf.php4
-rw-r--r--actions/login.php4
-rw-r--r--actions/logout.php5
-rw-r--r--actions/newnotice.php6
-rw-r--r--actions/postnotice.php4
-rw-r--r--actions/publicxrds.php4
-rw-r--r--actions/recoverpassword.php4
-rw-r--r--actions/register.php4
-rw-r--r--actions/requesttoken.php5
-rw-r--r--actions/subscribe.php4
-rw-r--r--actions/twitapidirect_messages.php15
-rw-r--r--actions/twitapifavorites.php13
-rw-r--r--actions/twitapihelp.php4
-rw-r--r--actions/twitapinotifications.php1
-rw-r--r--actions/unsubscribe.php4
-rw-r--r--actions/updateprofile.php4
-rw-r--r--actions/userauthorization.php4
-rw-r--r--actions/userbyid.php5
-rw-r--r--actions/xrds.php4
23 files changed, 64 insertions, 50 deletions
diff --git a/actions/avatar.php b/actions/avatar.php
index b1697f97b..ebfbd7295 100644
--- a/actions/avatar.php
+++ b/actions/avatar.php
@@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
class AvatarAction extends SettingsAction {
- function is_readonly() {
- return false;
- }
-
function get_instructions() {
return _('Upload a new "avatar" (user image) here. You can\'t edit the picture after you upload it, so make sure it\'s more or less square. It must be under the site license, also. Use a picture that belongs to you and that you want to share.');
}
diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php
index 66a41d9d7..3cffda871 100644
--- a/actions/confirmaddress.php
+++ b/actions/confirmaddress.php
@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class ConfirmaddressAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
if (!common_logged_in()) {
diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php
index af96635d6..54d81b0b4 100644
--- a/actions/finishaddopenid.php
+++ b/actions/finishaddopenid.php
@@ -31,10 +31,6 @@ class FinishaddopenidAction extends Action {
$this->try_login();
}
}
-
- function is_readonly() {
- return false;
- }
function try_login() {
diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php
index bce2447ac..ba5156a20 100644
--- a/actions/finishremotesubscribe.php
+++ b/actions/finishremotesubscribe.php
@@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/omb.php');
class FinishremotesubscribeAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
diff --git a/actions/foaf.php b/actions/foaf.php
index 8de4c7502..c64617e5f 100644
--- a/actions/foaf.php
+++ b/actions/foaf.php
@@ -25,6 +25,10 @@ define('BOTH', 0);
class FoafAction extends Action {
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
diff --git a/actions/login.php b/actions/login.php
index 0f2dec1a4..aa25a0cec 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
class LoginAction extends Action {
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
if (common_is_real_login()) {
diff --git a/actions/logout.php b/actions/logout.php
index fb61689ee..f00fa0ba7 100644
--- a/actions/logout.php
+++ b/actions/logout.php
@@ -22,6 +22,11 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/openid.php');
class LogoutAction extends Action {
+
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
if (!common_logged_in()) {
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 487396e4e..711b77e0a 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -20,11 +20,7 @@
if (!defined('LACONICA')) { exit(1); }
class NewnoticeAction extends Action {
-
- function is_readonly() {
- return false;
- }
-
+
function handle($args) {
parent::handle($args);
# XXX: Ajax!
diff --git a/actions/postnotice.php b/actions/postnotice.php
index 3b5a4ee15..ab12277bb 100644
--- a/actions/postnotice.php
+++ b/actions/postnotice.php
@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php');
-function is_readonly() {
- return false;
-}
-
class PostnoticeAction extends Action {
function handle($args) {
parent::handle($args);
diff --git a/actions/publicxrds.php b/actions/publicxrds.php
index 29c8e1314..951434c87 100644
--- a/actions/publicxrds.php
+++ b/actions/publicxrds.php
@@ -25,6 +25,10 @@ require_once(INSTALLDIR.'/lib/openid.php');
class PublicxrdsAction extends Action {
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php
index 0d85163d7..9c34ff3d8 100644
--- a/actions/recoverpassword.php
+++ b/actions/recoverpassword.php
@@ -25,10 +25,6 @@ define(MAX_RECOVERY_TIME, 24 * 60 * 60);
class RecoverpasswordAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
if (common_logged_in()) {
diff --git a/actions/register.php b/actions/register.php
index 0d6338797..6ac283059 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class RegisterAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
diff --git a/actions/requesttoken.php b/actions/requesttoken.php
index 0e233ff17..09ce5a642 100644
--- a/actions/requesttoken.php
+++ b/actions/requesttoken.php
@@ -22,6 +22,11 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php');
class RequesttokenAction extends Action {
+
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
try {
diff --git a/actions/subscribe.php b/actions/subscribe.php
index 7ce50dac8..e292fdd6b 100644
--- a/actions/subscribe.php
+++ b/actions/subscribe.php
@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class SubscribeAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php
index e7f3e1266..9a84082e6 100644
--- a/actions/twitapidirect_messages.php
+++ b/actions/twitapidirect_messages.php
@@ -23,6 +23,21 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class Twitapidirect_messagesAction extends TwitterapiAction {
+
+ function is_readonly() {
+
+ static $write_methods = array( 'direct_messages',
+ 'sent');
+
+ $cmdtext = explode('.', $this->arg('method'));
+
+ if (in_array($cmdtext[0], $write_methods)) {
+ return false;
+ }
+
+ return true;
+ }
+
function direct_messages($args, $apidata) {
parent::handle($args);
common_server_error("API method under construction.", $code=501);
diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php
index a4afa732a..4de567603 100644
--- a/actions/twitapifavorites.php
+++ b/actions/twitapifavorites.php
@@ -23,6 +23,19 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class TwitapifavoritesAction extends TwitterapiAction {
+ function is_readonly() {
+
+ static $write_methods = array('favorites');
+
+ $cmdtext = explode('.', $this->arg('method'));
+
+ if (in_array($cmdtext[0], $write_methods)) {
+ return false;
+ }
+
+ return true;
+ }
+
function favorites($args, $apidata) {
parent::handle($args);
common_server_error("API method under construction.", $code=501);
diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php
index e07c9b667..7695190fc 100644
--- a/actions/twitapihelp.php
+++ b/actions/twitapihelp.php
@@ -23,6 +23,10 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class TwitapihelpAction extends TwitterapiAction {
+ function is_readonly() {
+ return true;
+ }
+
/* Returns the string "ok" in the requested format with a 200 OK HTTP status code.
* URL:http://identi.ca/api/help/test.format
* Formats: xml, json
diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php
index 45a33427b..95fe550b1 100644
--- a/actions/twitapinotifications.php
+++ b/actions/twitapinotifications.php
@@ -24,7 +24,6 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
# This naming convention looks real sick
class TwitapinotificationsAction extends TwitterapiAction {
-
function follow($args, $apidata) {
parent::handle($args);
common_server_error("API method under construction.", $code=501);
diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php
index 69d513907..3863a3a5e 100644
--- a/actions/unsubscribe.php
+++ b/actions/unsubscribe.php
@@ -19,10 +19,6 @@
class UnsubscribeAction extends Action {
- function is_readonly() {
- return false;
- }
-
function handle($args) {
parent::handle($args);
if (!common_logged_in()) {
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index 72246dab8..7e604f6b1 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -22,10 +22,6 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php');
class UpdateprofileAction extends Action {
-
- function is_readonly() {
- return false;
- }
function handle($args) {
parent::handle($args);
diff --git a/actions/userauthorization.php b/actions/userauthorization.php
index b02fe96ce..6ae3434a6 100644
--- a/actions/userauthorization.php
+++ b/actions/userauthorization.php
@@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/omb.php');
define('TIMESTAMP_THRESHOLD', 300);
class UserauthorizationAction extends Action {
-
- function is_readonly() {
- return false;
- }
function handle($args) {
parent::handle($args);
diff --git a/actions/userbyid.php b/actions/userbyid.php
index 7b95d0725..c42cad083 100644
--- a/actions/userbyid.php
+++ b/actions/userbyid.php
@@ -20,6 +20,11 @@
if (!defined('LACONICA')) { exit(1); }
class UserbyidAction extends Action {
+
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
$id = $this->trimmed('id');
diff --git a/actions/xrds.php b/actions/xrds.php
index 70a18a6b9..1d516aab7 100644
--- a/actions/xrds.php
+++ b/actions/xrds.php
@@ -23,6 +23,10 @@ require_once(INSTALLDIR.'/lib/omb.php');
class XrdsAction extends Action {
+ function is_readonly() {
+ return true;
+ }
+
function handle($args) {
parent::handle($args);
$nickname = $this->trimmed('nickname');