From 038f762bce95323ac929b0635cceb7f9425527ec Mon Sep 17 00:00:00 2001 From: zach Date: Tue, 22 Jul 2008 13:15:01 -0400 Subject: [PATCH] Added is_readonly() method to all Actions darcs-hash:20080722171501-ca946-160bad6c4f80be2b3b105ea9b913f1c0f9edb0ef.gz --- actions/avatar.php | 4 ++++ actions/confirmaddress.php | 4 ++++ actions/finishaddopenid.php | 4 ++++ actions/finishremotesubscribe.php | 4 ++++ actions/newnotice.php | 4 ++++ actions/postnotice.php | 4 ++++ actions/recoverpassword.php | 4 ++++ actions/register.php | 4 ++++ actions/subscribe.php | 5 +++++ actions/twitapiaccount.php | 4 ++++ actions/twitapistatuses.php | 4 ++++ actions/unsubscribe.php | 5 +++++ actions/updateprofile.php | 5 +++++ actions/userauthorization.php | 5 +++++ lib/action.php | 6 +++++- lib/settingsaction.php | 4 ++++ 16 files changed, 69 insertions(+), 1 deletion(-) diff --git a/actions/avatar.php b/actions/avatar.php index ebfbd72952..b1697f97bb 100644 --- a/actions/avatar.php +++ b/actions/avatar.php @@ -23,6 +23,10 @@ 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 3cffda8710..66a41d9d7d 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -21,6 +21,10 @@ 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 028dc82e5a..af96635d62 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -32,6 +32,10 @@ class FinishaddopenidAction extends Action { } } + function is_readonly() { + return false; + } + function try_login() { $consumer =& oid_consumer(); diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index ba5156a204..bce2447ac7 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -23,6 +23,10 @@ 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/newnotice.php b/actions/newnotice.php index bf5fd5bcc0..487396e4e1 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -21,6 +21,10 @@ 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 ab12277bbd..3b5a4ee153 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -21,6 +21,10 @@ 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/recoverpassword.php b/actions/recoverpassword.php index 9c34ff3d84..0d85163d74 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -25,6 +25,10 @@ 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 6ac2830595..0d6338797c 100644 --- a/actions/register.php +++ b/actions/register.php @@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); } class RegisterAction extends Action { + function is_readonly() { + return false; + } + function handle($args) { parent::handle($args); diff --git a/actions/subscribe.php b/actions/subscribe.php index f37095c1c6..7ce50dac8c 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -20,6 +20,11 @@ if (!defined('LACONICA')) { exit(1); } class SubscribeAction extends Action { + + function is_readonly() { + return false; + } + function handle($args) { parent::handle($args); diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index f337a54506..a43d1edbad 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -23,6 +23,10 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); class TwitapiaccountAction extends TwitterapiAction { + function is_readonly() { + return false; + } + function verify_credentials($args, $apidata) { if ($apidata['content-type'] == 'xml') { diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index ffe6aed51e..3a06d146c7 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -27,6 +27,10 @@ require_once(INSTALLDIR.'/lib/twitterapi.php'); */ class TwitapistatusesAction extends TwitterapiAction { + function is_readonly() { + return false; + } + function public_timeline($args, $apidata) { parent::handle($args); diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 0c66946b2c..69d5139073 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -18,6 +18,11 @@ */ 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 0889ad0828..72246dab88 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -22,6 +22,11 @@ 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); try { diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 19fe693139..b02fe96cee 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -23,6 +23,11 @@ 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/lib/action.php b/lib/action.php index 5f45261661..1dca596eb8 100644 --- a/lib/action.php +++ b/lib/action.php @@ -26,6 +26,10 @@ class Action { // lawsuit function Action() { } + function is_readonly() { + return true; + } + function arg($key, $def=NULL) { if (array_key_exists($key, $this->args)) { return $this->args[$key]; @@ -55,7 +59,7 @@ class Action { // lawsuit } else { return $def; } - } + } function server_error($msg, $code=500) { $action = $this->trimmed('action'); diff --git a/lib/settingsaction.php b/lib/settingsaction.php index a71c9e9bc3..0e39a74597 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); } class SettingsAction extends Action { + function is_readonly() { + return false; + } + function handle($args) { parent::handle($args); if (!common_logged_in()) {