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 {
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.');
}

View File

@ -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()) {

View File

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

View File

@ -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);

View File

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

View File

@ -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()) {

View File

@ -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()) {

View File

@ -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!

View File

@ -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);

View File

@ -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);

View File

@ -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()) {

View File

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

View File

@ -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 {

View File

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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

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

View File

@ -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);

View File

@ -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);

View File

@ -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');

View File

@ -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');

View File

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

View File

@ -25,6 +25,10 @@ define('AVATARS_PER_PAGE', 80);
class GalleryAction extends Action {
function is_readonly() {
return true;
}
function handle($args) {
parent::handle($args);
$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.
var $creators = array();
function is_readonly() {
return true;
}
function handle($args) {
parent::handle($args);

View File

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

View File

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

View File

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