base class is_readonly() now returns false by default

darcs-hash:20080722212056-ca946-e4bd9eef8e3d8991414932e9fc7b8c9a31f818c0.gz
This commit is contained in:
zach 2008-07-22 17:20:56 -04:00
parent 877eb138c4
commit 7e6870db91
29 changed files with 81 additions and 55 deletions

View File

@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
class AvatarAction extends SettingsAction { class AvatarAction extends SettingsAction {
function is_readonly() {
return false;
}
function get_instructions() { 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.'); 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.');
} }

View File

@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class ConfirmaddressAction extends Action { class ConfirmaddressAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {

View File

@ -31,10 +31,6 @@ class FinishaddopenidAction extends Action {
$this->try_login(); $this->try_login();
} }
} }
function is_readonly() {
return false;
}
function try_login() { function try_login() {

View File

@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/omb.php');
class FinishremotesubscribeAction extends Action { class FinishremotesubscribeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -25,6 +25,10 @@ define('BOTH', 0);
class FoafAction extends Action { class FoafAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
class LoginAction extends Action { class LoginAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (common_is_real_login()) { if (common_is_real_login()) {

View File

@ -22,6 +22,11 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/openid.php'); require_once(INSTALLDIR.'/lib/openid.php');
class LogoutAction extends Action { class LogoutAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {

View File

@ -20,11 +20,7 @@
if (!defined('LACONICA')) { exit(1); } if (!defined('LACONICA')) { exit(1); }
class NewnoticeAction extends Action { class NewnoticeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
# XXX: Ajax! # XXX: Ajax!

View File

@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php'); require_once(INSTALLDIR.'/lib/omb.php');
function is_readonly() {
return false;
}
class PostnoticeAction extends Action { class PostnoticeAction extends Action {
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -25,6 +25,10 @@ require_once(INSTALLDIR.'/lib/openid.php');
class PublicxrdsAction extends Action { class PublicxrdsAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -25,10 +25,6 @@ define(MAX_RECOVERY_TIME, 24 * 60 * 60);
class RecoverpasswordAction extends Action { class RecoverpasswordAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (common_logged_in()) { if (common_logged_in()) {

View File

@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class RegisterAction extends Action { class RegisterAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -22,6 +22,11 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php'); require_once(INSTALLDIR.'/lib/omb.php');
class RequesttokenAction extends Action { class RequesttokenAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
try { try {

View File

@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class SubscribeAction extends Action { class SubscribeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -23,6 +23,21 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class Twitapidirect_messagesAction extends TwitterapiAction { 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) { function direct_messages($args, $apidata) {
parent::handle($args); parent::handle($args);
common_server_error("API method under construction.", $code=501); common_server_error("API method under construction.", $code=501);

View File

@ -23,6 +23,19 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class TwitapifavoritesAction extends TwitterapiAction { 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) { function favorites($args, $apidata) {
parent::handle($args); parent::handle($args);
common_server_error("API method under construction.", $code=501); common_server_error("API method under construction.", $code=501);

View File

@ -23,6 +23,10 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
class TwitapihelpAction extends TwitterapiAction { class TwitapihelpAction extends TwitterapiAction {
function is_readonly() {
return true;
}
/* Returns the string "ok" in the requested format with a 200 OK HTTP status code. /* Returns the string "ok" in the requested format with a 200 OK HTTP status code.
* URL:http://identi.ca/api/help/test.format * URL:http://identi.ca/api/help/test.format
* Formats: xml, json * Formats: xml, json

View File

@ -24,7 +24,6 @@ require_once(INSTALLDIR.'/lib/twitterapi.php');
# This naming convention looks real sick # This naming convention looks real sick
class TwitapinotificationsAction extends TwitterapiAction { class TwitapinotificationsAction extends TwitterapiAction {
function follow($args, $apidata) { function follow($args, $apidata) {
parent::handle($args); parent::handle($args);
common_server_error("API method under construction.", $code=501); common_server_error("API method under construction.", $code=501);

View File

@ -19,10 +19,6 @@
class UnsubscribeAction extends Action { class UnsubscribeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {

View File

@ -22,10 +22,6 @@ if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/omb.php'); require_once(INSTALLDIR.'/lib/omb.php');
class UpdateprofileAction extends Action { class UpdateprofileAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -23,10 +23,6 @@ require_once(INSTALLDIR.'/lib/omb.php');
define('TIMESTAMP_THRESHOLD', 300); define('TIMESTAMP_THRESHOLD', 300);
class UserauthorizationAction extends Action { class UserauthorizationAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -20,6 +20,11 @@
if (!defined('LACONICA')) { exit(1); } if (!defined('LACONICA')) { exit(1); }
class UserbyidAction extends Action { class UserbyidAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
$id = $this->trimmed('id'); $id = $this->trimmed('id');

View File

@ -23,6 +23,10 @@ require_once(INSTALLDIR.'/lib/omb.php');
class XrdsAction extends Action { class XrdsAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
$nickname = $this->trimmed('nickname'); $nickname = $this->trimmed('nickname');

View File

@ -27,7 +27,7 @@ class Action { // lawsuit
} }
function is_readonly() { function is_readonly() {
return true; return false;
} }
function arg($key, $def=NULL) { function arg($key, $def=NULL) {

View File

@ -25,6 +25,10 @@ define('AVATARS_PER_PAGE', 80);
class GalleryAction extends Action { class GalleryAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
$nickname = $this->arg('nickname'); $nickname = $this->arg('nickname');

View File

@ -25,6 +25,10 @@ class Rss10Action extends Action {
# This will contain the details of each feed item's author and be used to generate SIOC data. # This will contain the details of each feed item's author and be used to generate SIOC data.
var $creators = array(); var $creators = array();
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);

View File

@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
class SearchAction extends Action { class SearchAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
$this->show_form(); $this->show_form();

View File

@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class SettingsAction extends Action { class SettingsAction extends Action {
function is_readonly() {
return false;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
if (!common_logged_in()) { if (!common_logged_in()) {

View File

@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
class StreamAction extends Action { class StreamAction extends Action {
function is_readonly() {
return true;
}
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
} }