diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apibareauth.php | 8 | ||||
-rw-r--r-- | lib/apioauth.php | 6 | ||||
-rw-r--r-- | lib/apioauthstore.php | 13 | ||||
-rw-r--r-- | lib/apiprivateauth.php | 7 | ||||
-rw-r--r-- | lib/applicationeditform.php | 18 | ||||
-rw-r--r-- | lib/applicationlist.php | 3 |
6 files changed, 10 insertions, 45 deletions
diff --git a/lib/apibareauth.php b/lib/apibareauth.php index da7af1261..00e0f205b 100644 --- a/lib/apibareauth.php +++ b/lib/apibareauth.php @@ -30,7 +30,7 @@ * @author Evan Prodromou <evan@status.net> * @author mEDI <medi@milaro.net> * @author Sarven Capadisli <csarven@status.net> - * @author Zach Copley <zach@status.net> + * @author Zach Copley <zach@status.net> * @copyright 2009 StatusNet, Inc. * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -60,7 +60,6 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApiBareAuthAction extends ApiAuthAction { @@ -72,7 +71,6 @@ class ApiBareAuthAction extends ApiAuthAction * @return boolean success flag * */ - function prepare($args) { parent::prepare($args); @@ -84,18 +82,15 @@ class ApiBareAuthAction extends ApiAuthAction * * @return boolean true or false */ - function requiresAuth() { // If the site is "private", all API methods except statusnet/config // need authentication - if (common_config('site', 'private')) { return true; } // check whether a user has been specified somehow - $id = $this->arg('id'); $user_id = $this->arg('user_id'); $screen_name = $this->arg('screen_name'); @@ -106,5 +101,4 @@ class ApiBareAuthAction extends ApiAuthAction return false; } - } diff --git a/lib/apioauth.php b/lib/apioauth.php index 4cb8a6775..1c87e4232 100644 --- a/lib/apioauth.php +++ b/lib/apioauth.php @@ -44,7 +44,6 @@ require_once INSTALLDIR . '/lib/apioauthstore.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApiOauthAction extends Action { /** @@ -52,7 +51,6 @@ class ApiOauthAction extends Action * * @return boolean false */ - function isReadOnly($args) { return false; @@ -73,7 +71,6 @@ class ApiOauthAction extends Action * * @return void */ - function handle($args) { parent::handle($args); @@ -83,7 +80,6 @@ class ApiOauthAction extends Action static function cleanRequest() { // kill evil effects of magical slashing - if (get_magic_quotes_gpc() == 1) { $_POST = array_map('stripslashes', $_POST); $_GET = array_map('stripslashes', $_GET); @@ -93,7 +89,6 @@ class ApiOauthAction extends Action // XXX: should we strip anything else? Or alternatively // only allow a known list of params? - unset($_GET['p']); unset($_POST['p']); } @@ -118,5 +113,4 @@ class ApiOauthAction extends Action return ($url . '&' . $k . '=' . $v); } } - } diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php index 1bb11cbca..84c4c78e5 100644 --- a/lib/apioauthstore.php +++ b/lib/apioauthstore.php @@ -23,7 +23,6 @@ require_once INSTALLDIR . '/lib/oauthstore.php'; class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore { - function lookup_consumer($consumer_key) { $con = Consumer::staticGet('consumer_key', $consumer_key); @@ -39,7 +38,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore function getAppByRequestToken($token_key) { // Look up the full req tokenx - $req_token = $this->lookup_token(null, 'request', $token_key); @@ -50,7 +48,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore } // Look up the full Token - $token = new Token(); $token->tok = $req_token->key; $result = $token->find(true); @@ -150,7 +147,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore } // Okay, good - return new OAuthToken($at->tok, $at->secret); } @@ -172,19 +168,18 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore * * @return void */ - public function revoke_token($token_key, $type = 0) { $rt = new Token(); $rt->tok = $token_key; $rt->type = $type; $rt->state = 0; if (!$rt->find(true)) { - throw new Exception('Tried to revoke unknown token'); + // TRANS: Exception thrown when an attempt is made to revoke an unknown token. + throw new Exception(_('Tried to revoke unknown token')); } if (!$rt->delete()) { - throw new Exception('Failed to delete revoked token'); + // TRANS: Exception thrown when an attempt is made to remove a revoked token. + throw new Exception(_('Failed to delete revoked token')); } } - } - diff --git a/lib/apiprivateauth.php b/lib/apiprivateauth.php index 5e78c65a1..df401c382 100644 --- a/lib/apiprivateauth.php +++ b/lib/apiprivateauth.php @@ -29,7 +29,7 @@ * @author Evan Prodromou <evan@status.net> * @author mEDI <medi@milaro.net> * @author Sarven Capadisli <csarven@status.net> - * @author Zach Copley <zach@status.net> + * @author Zach Copley <zach@status.net> * @copyright 2009 StatusNet, Inc. * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -58,26 +58,21 @@ require_once INSTALLDIR.'/lib/apiauth.php'; * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApiPrivateAuthAction extends ApiAuthAction { - /** * Does this API resource require authentication? * * @return boolean true or false */ - function requiresAuth() { // If the site is "private", all API methods except statusnet/config // need authentication - if (common_config('site', 'private')) { return true; } return false; } - } diff --git a/lib/applicationeditform.php b/lib/applicationeditform.php index 81c8fb018..f126b84ae 100644 --- a/lib/applicationeditform.php +++ b/lib/applicationeditform.php @@ -43,13 +43,11 @@ require_once INSTALLDIR . '/lib/form.php'; * @link http://status.net/ * */ - class ApplicationEditForm extends Form { /** * group for user to join */ - var $application = null; /** @@ -58,7 +56,6 @@ class ApplicationEditForm extends Form * @param Action $out output channel * @param User_group $group group to join */ - function __construct($out=null, $application=null) { parent::__construct($out); @@ -71,7 +68,6 @@ class ApplicationEditForm extends Form * * @return string ID of the form */ - function id() { if ($this->application) { @@ -89,7 +85,6 @@ class ApplicationEditForm extends Form * * @return string the method to use for submitting */ - function method() { $this->enctype = 'multipart/form-data'; @@ -101,7 +96,6 @@ class ApplicationEditForm extends Form * * @return string of the form class */ - function formClass() { return 'form_settings'; @@ -112,7 +106,6 @@ class ApplicationEditForm extends Form * * @return string URL of the action */ - function action() { $cur = common_current_user(); @@ -130,7 +123,6 @@ class ApplicationEditForm extends Form * * @return void */ - function formLegend() { // TRANS: Form legend. @@ -142,7 +134,6 @@ class ApplicationEditForm extends Form * * @return void */ - function formData() { if ($this->application) { @@ -350,16 +341,15 @@ class ApplicationEditForm extends Form * * @return void */ - function formActions() { - // TRANS: Button label + // TRANS: Button label in the "Edit application" form. $this->out->submit('cancel', _m('BUTTON','Cancel'), 'submit form_action-primary', - // TRANS: Submit button title + // TRANS: Submit button title. 'cancel', _('Cancel')); - // TRANS: Button label + // TRANS: Button label in the "Edit application" form. $this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary', - // TRANS: Submit button title + // TRANS: Submit button title. 'save', _('Save')); } } diff --git a/lib/applicationlist.php b/lib/applicationlist.php index 904f8981d..1974d2103 100644 --- a/lib/applicationlist.php +++ b/lib/applicationlist.php @@ -45,7 +45,6 @@ define('APPS_PER_PAGE', 20); * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class ApplicationList extends Widget { /** Current application, application query */ @@ -164,10 +163,8 @@ class ApplicationList extends Widget } /* Override this in subclasses. */ - function showOwnerControls() { return; } - } |