GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 7e6870db authored by zach's avatar zach

base class is_readonly() now returns false by default

darcs-hash:20080722212056-ca946-e4bd9eef8e3d8991414932e9fc7b8c9a31f818c0.gz
parent 877eb138
......@@ -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.');
}
......
......@@ -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()) {
......
......@@ -31,10 +31,6 @@ class FinishaddopenidAction extends Action {
$this->try_login();
}
}
function is_readonly() {
return false;
}
function try_login() {
......
......@@ -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);
......
......@@ -25,6 +25,10 @@ define('BOTH', 0);
class FoafAction extends Action {
function is_readonly() {
return true;
}
function handle($args) {
parent::handle($args);
......
......@@ -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()) {
......
......@@ -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()) {
......
......@@ -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!
......
......@@ -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);
......
......@@ -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);
......
......@@ -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()) {
......
......@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class RegisterAction extends Action {
function is_readonly() {
return false;
}
function handle($args) {
parent::handle($args);
......
......@@ -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 {
......
......@@ -21,10 +21,6 @@ if (!defined('LACONICA')) { exit(1); }
class SubscribeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) {
parent::handle($args);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -19,10 +19,6 @@
class UnsubscribeAction extends Action {
function is_readonly() {
return false;
}
function handle($args) {
parent::handle($args);
if (!common_logged_in()) {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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');
......
......@@ -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');
......
......@@ -27,7 +27,7 @@ class Action { // lawsuit
}
function is_readonly() {
return true;
return false;
}
function arg($key, $def=NULL) {
......
......@@ -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');
......
......@@ -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);
......
......@@ -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();
......
......@@ -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()) {
......
......@@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
class StreamAction extends Action {
function is_readonly() {
return true;
}
function handle($args) {
parent::handle($args);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment