From: Roland Haeder Date: Wed, 13 Jan 2016 15:58:08 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4160a3fb730113f3d712bd777884c4b0482f6df1;p=quix0rs-gnu-social.git Merge remote-tracking branch 'upstream/master' Preserved some type-hints Signed-off-by: Roland Haeder --- 4160a3fb730113f3d712bd777884c4b0482f6df1 diff --cc actions/apilists.php index 129691a3b4,0b241638ad..42672e6191 --- a/actions/apilists.php +++ b/actions/apilists.php @@@ -185,10 -185,10 +185,10 @@@ class ApiListsAction extends ApiBareAut list($this->lists, $this->next_cursor, - $this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->auth_user), $cursor, $count); + $this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->scoped), $cursor, $count); } - function isReadOnly($args) + function isReadOnly(array $args=array()) { return false; } diff --cc actions/foaf.php index a17962b97e,260388ba44..4420c2d503 --- a/actions/foaf.php +++ b/actions/foaf.php @@@ -24,9 -24,9 +24,9 @@@ define('LISTENEE', -1) define('BOTH', 0); // @todo XXX: Documentation missing. - class FoafAction extends Action + class FoafAction extends ManagedAction { - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc actions/groupbyid.php index befd526de1,de87ec5c67..448924bf47 --- a/actions/groupbyid.php +++ b/actions/groupbyid.php @@@ -47,17 -42,12 +42,12 @@@ if (!defined('GNUSOCIAL')) { exit(1); * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class GroupbyidAction extends Action + class GroupbyidAction extends ManagedAction { /** group we're viewing. */ - var $group = null; + protected $group = null; - /** - * Is this page read-only? - * - * @return boolean true - */ - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc actions/redirecturl.php index 62418df217,826ab66a67..724f46e909 --- a/actions/redirecturl.php +++ b/actions/redirecturl.php @@@ -83,28 -54,12 +54,12 @@@ class RedirecturlAction extends Managed return true; } - /** - * Handler method - * - * @param array $argarray is ignored since it's now passed in in prepare() - * - * @return void - */ - function handle($argarray=null) + public function showPage() { - common_redirect($this->file->url, 307); + common_redirect($this->file->getUrl(false), 301); } - /** - * Return true if read only. - * - * MAY override - * - * @param array $args other arguments - * - * @return boolean is read only action? - */ - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc actions/repliesrss.php index df632fb4ce,54f83592c0..e3f04b53a4 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@@ -75,13 -45,7 +45,7 @@@ class RepliesrssAction extends Targeted return $c; } - function getImage() - { - $profile = $this->user->getProfile(); - return $profile->avatarUrl(AVATAR_PROFILE_SIZE); - } - - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc actions/userrss.php index 1ae94ee93f,7bed1dd256..147d98cc26 --- a/actions/userrss.php +++ b/actions/userrss.php @@@ -98,22 -58,16 +58,16 @@@ class UserrssAction extends TargetedRss return $c; } - function getImage() - { - $profile = $this->user->getProfile(); - return $profile->avatarUrl(AVATAR_PROFILE_SIZE); - } - // override parent to add X-SUP-ID URL - function initRss($limit=0) + function initRss() { - $url = common_local_url('sup', null, null, $this->user->id); + $url = common_local_url('sup', null, null, $this->target->getID()); header('X-SUP-ID: '.$url); - parent::initRss($limit); + parent::initRss(); } - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc classes/Notice.php index 269b846f24,60c821ae5d..cc00cd1dd6 --- a/classes/Notice.php +++ b/classes/Notice.php @@@ -1670,35 -1730,42 +1730,42 @@@ class Notice extends Managed_DataObjec return $reply; } - protected $_replies = array(); + protected $_attentionids = array(); /** - * Pull the complete list of @-reply targets for this notice. + * Pull the complete list of known activity context attentions for this notice. * - * @return array of integer profile ids + * @return array of integer profile ids (also group profiles) */ - function getReplies() + function getAttentionProfileIDs() { - if (isset($this->_replies[$this->id])) { - return $this->_replies[$this->id]; + if (!isset($this->_attentionids[$this->getID()])) { + $atts = Attention::multiGet('notice_id', array($this->getID())); + // (array)null means empty array + $this->_attentionids[$this->getID()] = (array)$atts->fetchAll('profile_id'); } + return $this->_attentionids[$this->getID()]; + } - $replyMap = Reply::listGet('notice_id', array($this->id)); - - $ids = array(); + protected $_replies = array(); - foreach ($replyMap[$this->id] as $reply) { - $ids[] = $reply->profile_id; + /** + * Pull the complete list of @-mentioned profile IDs for this notice. + * + * @return array of integer profile ids + */ + function getReplies() + { + if (!isset($this->_replies[$this->getID()])) { + $mentions = Reply::multiGet('notice_id', array($this->getID())); + $this->_replies[$this->getID()] = $mentions->fetchAll('profile_id'); } - - $this->_setReplies($ids); - - return $ids; + return $this->_replies[$this->getID()]; } - function _setReplies($replies) + function _setReplies(array $replies) { - $this->_replies[$this->id] = $replies; + $this->_replies[$this->getID()] = $replies; } /** @@@ -2668,15 -2753,11 +2753,11 @@@ return ($result == 1) ? true : false; } - protected function _inScope($profile) + protected function _inScope(Profile $profile=null) { - if (!is_null($this->scope)) { - $scope = $this->scope; - } else { - $scope = self::defaultScope(); - } + $scope = is_null($this->scope) ? self::defaultScope() : $this->getScope(); - if ($scope == 0 && !$this->getProfile()->isPrivateStream()) { // Not scoping, so it is public. + if ($scope === 0 && !$this->getProfile()->isPrivateStream()) { // Not scoping, so it is public. return !$this->isHiddenSpam($profile); } diff --cc htaccess.sample index 3670c8d3d3,af6e19784d..8a689858c7 --- a/htaccess.sample +++ b/htaccess.sample @@@ -39,24 -39,17 +39,8 @@@ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php?p=$1 [L,QSA] - <<<<<<< HEAD -- -- ## You can also use PATHINFO by using this RewriteRule instead: -- # RewriteRule (.*) index.php/$1 [L,QSA] - - - - # For mod_access_compat in Apache <2.4 - #Order allow,deny - - # Use this instead for Apache >2.4 (mod_authz_host) - # Require all denied - - ======= - - Order allow,deny - Deny from all - - = 2.3> - Require all denied - + Order allow,deny - - >>>>>>> Adding htaccess.sample back*shame* diff --cc lib/activityutils.php index a0fc487232,8a2be35022..76e4777deb --- a/lib/activityutils.php +++ b/lib/activityutils.php @@@ -347,10 -348,10 +348,10 @@@ class ActivityUtil return null; } - static function compareTypes($type, array $objects) // this does verbs too! - static function compareTypes($type, $objects) ++ static function compareTypes($type, array $objects) { $type = self::resolveUri($type); - foreach ((array)$objects as $object) { + foreach ($objects as $object) { if ($type === self::resolveUri($object)) { return true; } diff --cc lib/schemaupdater.php index 03892970c5,38b5b93865..575080a7bc --- a/lib/schemaupdater.php +++ b/lib/schemaupdater.php @@@ -109,9 -108,8 +108,8 @@@ class SchemaUpdate return $checksums; } catch (Exception $e) { // no dice! - common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet."); + common_debug("Possibly schema_version table doesn't exist yet."); } - PEAR::popErrorHandling(); return $checksums; } @@@ -137,9 -134,8 +134,8 @@@ } } catch (Exception $e) { // no dice! - common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet."); + common_debug("Possibly schema_version table doesn't exist yet."); } - PEAR::popErrorHandling(); $this->checksums[$table] = $checksum; } } diff --cc plugins/DomainStatusNetwork/scripts/installforemail.php index 1815b97759,f773094a74..1815b97759 mode 100644,100755..100755 --- a/plugins/DomainStatusNetwork/scripts/installforemail.php +++ b/plugins/DomainStatusNetwork/scripts/installforemail.php diff --cc plugins/DomainStatusNetwork/scripts/proposesite.php index 28741a5d4f,96a722fdab..28741a5d4f mode 100644,100755..100755 --- a/plugins/DomainStatusNetwork/scripts/proposesite.php +++ b/plugins/DomainStatusNetwork/scripts/proposesite.php diff --cc plugins/DomainStatusNetwork/scripts/sitefordomain.php index 2eaa600d25,59412cceba..2eaa600d25 mode 100644,100755..100755 --- a/plugins/DomainStatusNetwork/scripts/sitefordomain.php +++ b/plugins/DomainStatusNetwork/scripts/sitefordomain.php diff --cc plugins/EmailRegistration/scripts/cancelemailregistration.php index 7ae81f7ccf,d834aade60..7ae81f7ccf mode 100644,100755..100755 --- a/plugins/EmailRegistration/scripts/cancelemailregistration.php +++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php diff --cc plugins/EmailRegistration/scripts/registeremailuser.php index a785a76a66,02915240d3..a785a76a66 mode 100644,100755..100755 --- a/plugins/EmailRegistration/scripts/registeremailuser.php +++ b/plugins/EmailRegistration/scripts/registeremailuser.php diff --cc plugins/EmailReminder/scripts/sendemailreminder.php index b126f9e049,5b5b26dde3..b126f9e049 mode 100644,100755..100755 --- a/plugins/EmailReminder/scripts/sendemailreminder.php +++ b/plugins/EmailReminder/scripts/sendemailreminder.php diff --cc plugins/Event/actions/cancelrsvp.php index 31a2683751,662a1de0b3..5fe95358c3 --- a/plugins/Event/actions/cancelrsvp.php +++ b/plugins/Event/actions/cancelrsvp.php @@@ -137,10 -137,10 +137,10 @@@ class CancelrsvpAction extends Actio $notice = $this->rsvp->getNotice(); // NB: this will delete the rsvp, too if (!empty($notice)) { - common_log(LOG_DEBUG, "Deleting notice..."); + common_debug("Deleting notice..."); - $notice->delete(); + $notice->deleteAs($this->scoped); } else { - common_log(LOG_DEBUG, "Deleting RSVP alone..."); + common_debug("Deleting RSVP alone..."); $this->rsvp->delete(); } } catch (ClientException $ce) { diff --cc plugins/ExtendedProfile/actions/profiledetail.php index 37660175fa,ea0b8ad630..272dfbb53f --- a/plugins/ExtendedProfile/actions/profiledetail.php +++ b/plugins/ExtendedProfile/actions/profiledetail.php @@@ -23,8 -21,7 +21,7 @@@ if (!defined('GNUSOCIAL')) { exit(1); class ProfileDetailAction extends ShowstreamAction { - - function isReadOnly($args) + function isReadOnly(array $args=array()) { return true; } diff --cc plugins/OStatus/classes/Ostatus_profile.php index c63bf84dd1,d36cbe21d6..9d41b67273 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@@ -372,15 -371,16 +371,17 @@@ class Ostatus_profile extends Managed_D * send immediately but won't get the return value. * * @param mixed $entry XML string, Notice, or Activity + * @param Profile $actor Acting profile * @return boolean success */ - public function notifyDeferred($entry, $actor) + public function notifyDeferred($entry, Profile $actor) { if ($this->salmonuri) { + common_debug("OSTATUS: user {$actor->getNickname()} ({$actor->getID()}) wants to ping {$this->localProfile()->getNickname()} on {$this->salmonuri}"); $data = array('salmonuri' => $this->salmonuri, 'entry' => $this->notifyPrepXml($entry), - 'actor' => $actor->id); + 'actor' => $actor->getID(), + 'target' => $this->localProfile()->getID()); $qm = QueueManager::get(); return $qm->enqueue($data, 'salmon'); @@@ -530,172 -520,16 +521,16 @@@ * @param Activity $activity * @param string $method 'push' or 'salmon' * @return mixed saved Notice or false - * @todo FIXME: Break up this function, it's getting nasty long */ - public function processPost($activity, $method) + public function processPost(Activity $activity, $method) { - $notice = null; - - $profile = ActivityUtils::checkAuthorship($activity, $this->localProfile()); - - // It's not always an ActivityObject::NOTE, but... let's just say it is. - - $note = $activity->objects[0]; - - // The id URI will be used as a unique identifier for the notice, - // protecting against duplicate saves. It isn't required to be a URL; - // tag: URIs for instance are found in Google Buzz feeds. - $sourceUri = $note->id; - $dupe = Notice::getKV('uri', $sourceUri); - if ($dupe instanceof Notice) { - common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri"); - return $dupe; - } - - // We'll also want to save a web link to the original notice, if provided. - $sourceUrl = null; - if ($note->link) { - $sourceUrl = $note->link; - } else if ($activity->link) { - $sourceUrl = $activity->link; - } else if (preg_match('!^https?://!', $note->id)) { - $sourceUrl = $note->id; - } - - // Use summary as fallback for content - - if (!empty($note->content)) { - $sourceContent = $note->content; - } else if (!empty($note->summary)) { - $sourceContent = $note->summary; - } else if (!empty($note->title)) { - $sourceContent = $note->title; - } else { - // @todo FIXME: Fetch from $sourceUrl? - // TRANS: Client exception. %s is a source URI. - throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri)); - } - - // Get (safe!) HTML and text versions of the content - - $rendered = common_purify($sourceContent); - $content = common_strip_html($rendered); - - $shortened = common_shorten_links($content); - - // If it's too long, try using the summary, and make the - // HTML an attachment. - - $attachment = null; - - if (Notice::contentTooLong($shortened)) { - $attachment = $this->saveHTMLFile($note->title, $rendered); - $summary = common_strip_html($note->summary); - if (empty($summary)) { - $summary = $content; - } - $shortSummary = common_shorten_links($summary); - if (Notice::contentTooLong($shortSummary)) { - $url = common_shorten_url($sourceUrl); - $shortSummary = substr($shortSummary, - 0, - Notice::maxContent() - (mb_strlen($url) + 2)); - $content = $shortSummary . ' ' . $url; - - // We mark up the attachment link specially for the HTML output - // so we can fold-out the full version inline. - - // @todo FIXME i18n: This tooltip will be saved with the site's default language - // TRANS: Shown when a notice is longer than supported and/or when attachments are present. At runtime - // TRANS: this will usually be replaced with localised text from StatusNet core messages. - $showMoreText = _m('Show more'); - $attachUrl = common_local_url('attachment', - array('attachment' => $attachment->id)); - $rendered = common_render_text($shortSummary) . - '' . - '…' . - ''; - } - } - - $options = array('is_local' => Notice::REMOTE, - 'url' => $sourceUrl, - 'uri' => $sourceUri, - 'rendered' => $rendered, - 'replies' => array(), - 'groups' => array(), - 'peopletags' => array(), - 'tags' => array(), - 'urls' => array()); - - // Check for optional attributes... + $actor = ActivityUtils::checkAuthorship($activity, $this->localProfile()); - if (!empty($activity->time)) { - $options['created'] = common_sql_date($activity->time); - } - - if ($activity->context) { - // TODO: context->attention - list($options['groups'], $options['replies']) - = self::filterAttention($profile, $activity->context->attention); - - // Maintain direct reply associations - // @todo FIXME: What about conversation ID? - if (!empty($activity->context->replyToID)) { - $orig = Notice::getKV('uri', $activity->context->replyToID); - if ($orig instanceof Notice) { - $options['reply_to'] = $orig->id; - } - } - if (!empty($activity->context->conversation)) { - // we store the URI here, Notice class can look it up later - $options['conversation'] = $activity->context->conversation; - } - - $location = $activity->context->location; - if ($location) { - $options['lat'] = $location->lat; - $options['lon'] = $location->lon; - if ($location->location_id) { - $options['location_ns'] = $location->location_ns; - $options['location_id'] = $location->location_id; - } - } - } - - if ($this->isPeopletag()) { - $options['peopletags'][] = $this->localPeopletag(); - } - - // Atom categories <-> hashtags - foreach ($activity->categories as $cat) { - if ($cat->term) { - $term = common_canonical_tag($cat->term); - if ($term) { - $options['tags'][] = $term; - } - } - } - - // Atom enclosures -> attachment URLs - foreach ($activity->enclosures as $href) { - // @todo FIXME: Save these locally or....? - $options['urls'][] = $href; - } + $options = array('is_local' => Notice::REMOTE); try { - $saved = Notice::saveNew($profile->id, - $content, - 'ostatus', - $options); - if ($saved instanceof Notice) { - Ostatus_source::saveNew($saved, $this, $method); - if (!empty($attachment)) { - File_to_post::processNew($attachment->id, $saved->id); - } - } + $stored = Notice::saveActivity($activity, $actor, $options); + Ostatus_source::saveNew($stored, $this, $method); } catch (Exception $e) { common_log(LOG_ERR, "OStatus save of remote message $sourceUri failed: " . $e->getMessage()); throw $e; diff --cc plugins/OStatus/scripts/fixup-shadow.php index 817ef4eb16,ffaae5588d..817ef4eb16 mode 100644,100755..100755 --- a/plugins/OStatus/scripts/fixup-shadow.php +++ b/plugins/OStatus/scripts/fixup-shadow.php diff --cc plugins/OStatus/scripts/gcfeeds.php index f1db4b358f,a95cd54dbc..f1db4b358f mode 100644,100755..100755 --- a/plugins/OStatus/scripts/gcfeeds.php +++ b/plugins/OStatus/scripts/gcfeeds.php diff --cc plugins/OStatus/scripts/renew-feeds.php index 01136de417,8f8ac3ee1d..01136de417 mode 100644,100755..100755 --- a/plugins/OStatus/scripts/renew-feeds.php +++ b/plugins/OStatus/scripts/renew-feeds.php diff --cc plugins/OStatus/scripts/resub-feed.php index edf64cd5f6,d5d0924fbf..efad67dbb5 mode 100644,100755..100755 --- a/plugins/OStatus/scripts/resub-feed.php +++ b/plugins/OStatus/scripts/resub-feed.php @@@ -34,9 -34,11 +34,11 @@@ Options END_OF_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; - if (empty($args[0]) || !Validate::uri($args[0])) { + $validate = new Validate(); + + if (empty($args[0]) || !$validate->uri($args[0])) { print "$helptext"; exit(1); } diff --cc plugins/OStatus/scripts/rm_bad_feedsubs.php index 1957f95cb3,ce1698a60c..1957f95cb3 mode 100644,100755..100755 --- a/plugins/OStatus/scripts/rm_bad_feedsubs.php +++ b/plugins/OStatus/scripts/rm_bad_feedsubs.php diff --cc plugins/OStatus/scripts/testfeed.php index e22f22ac50,da1eee292e..2a12069b5f mode 100644,100755..100755 --- a/plugins/OStatus/scripts/testfeed.php +++ b/plugins/OStatus/scripts/testfeed.php @@@ -33,9 -33,11 +33,11 @@@ Mainly intended for testing funky feed END_OF_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; - if (empty($args[0]) || !Validate::uri($args[0])) { + $validate = new Validate(); + + if (empty($args[0]) || !$validate->uri($args[0])) { print "$helptext"; exit(1); } diff --cc plugins/OStatus/scripts/update-profile-data.php index 772cc073e2,ca48dc34a7..c56bedd05c mode 100644,100755..100755 --- a/plugins/OStatus/scripts/update-profile-data.php +++ b/plugins/OStatus/scripts/update-profile-data.php diff --cc plugins/OStatus/scripts/update-profile.php index 5b0c8b92e6,c5d9aa897c..40adda102e mode 100644,100755..100755 --- a/plugins/OStatus/scripts/update-profile.php +++ b/plugins/OStatus/scripts/update-profile.php @@@ -30,9 -30,11 +30,11 @@@ things restarted if the hub or feed URL END_OF_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; - if (empty($args[0]) || !Validate::uri($args[0])) { + $validate = new Validate(); + + if (empty($args[0]) || !$validate->uri($args[0])) { print "$helptext"; exit(1); } diff --cc plugins/OStatus/scripts/update_ostatus_profiles.php index 707dbe61f8,3f54c83cda..1f70bac897 mode 100644,100755..100755 --- a/plugins/OStatus/scripts/update_ostatus_profiles.php +++ b/plugins/OStatus/scripts/update_ostatus_profiles.php diff --cc plugins/OStatus/tests/slap.php index eaef76d8cd,e3f5439aed..eaef76d8cd mode 100644,100755..100755 --- a/plugins/OStatus/tests/slap.php +++ b/plugins/OStatus/tests/slap.php diff --cc plugins/OpenID/actions/publicxrds.php index 0000000000,25801e7861..eaeb84147d mode 000000,100644..100644 --- a/plugins/OpenID/actions/publicxrds.php +++ b/plugins/OpenID/actions/publicxrds.php @@@ -1,0 -1,77 +1,77 @@@ + + * @author Craig Andrews + * @author Robin Millette + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + + if (!defined('GNUSOCIAL')) { exit(1); } + + require_once __DIR__.'/../openid.php'; + + /** + * Public XRDS + * + * @category Action + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette + * @author Craig Andrews + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + */ + class PublicxrdsAction extends Action + { + /** + * Is read only? + * + * @return boolean true + */ - function isReadOnly($args) ++ function isReadOnly(array $args=array()) + { + return true; + } + + /** + * Class handler. + * + * @param array $args array of arguments + * + * @return nothing + */ + protected function handle() + { + parent::handle(); + $xrdsOutputter = new XRDSOutputter(); + $xrdsOutputter->startXRDS(); + Event::handle('StartPublicXRDS', array($this,&$xrdsOutputter)); + Event::handle('EndPublicXRDS', array($this,&$xrdsOutputter)); + $xrdsOutputter->endXRDS(); + } + } diff --cc plugins/Realtime/scripts/cleanupchannels.php index b6035bfac5,37883b1da6..b6035bfac5 mode 100644,100755..100755 --- a/plugins/Realtime/scripts/cleanupchannels.php +++ b/plugins/Realtime/scripts/cleanupchannels.php diff --cc plugins/RequireValidatedEmail/scripts/registerbyemail.php index 6935e00ee5,4d2000ab0f..6935e00ee5 mode 100644,100755..100755 --- a/plugins/RequireValidatedEmail/scripts/registerbyemail.php +++ b/plugins/RequireValidatedEmail/scripts/registerbyemail.php diff --cc plugins/Sitemap/scripts/updatecounts.php index 744dab8287,91bc0ac4e9..744dab8287 mode 100644,100755..100755 --- a/plugins/Sitemap/scripts/updatecounts.php +++ b/plugins/Sitemap/scripts/updatecounts.php diff --cc plugins/TwitterBridge/daemons/twitterdaemon.php index e563f53493,8b774889d1..e563f53493 mode 100644,100755..100755 --- a/plugins/TwitterBridge/daemons/twitterdaemon.php +++ b/plugins/TwitterBridge/daemons/twitterdaemon.php diff --cc plugins/TwitterBridge/daemons/twitterstatusfetcher.php index 7860a1fedf,83e8a0df5e..13a8d42b98 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@@ -149,15 -150,9 +150,9 @@@ class TwitterStatusFetcher extends Para unset($_DB_DATAOBJECT['CONNECTIONS']); } - function getTimeline($flink, $timelineUri = 'home_timeline') + function getTimeline(Foreign_link $flink, $timelineUri = 'home_timeline') { - if (empty($flink)) { - common_log(LOG_ERR, $this->name() . - " - Can't retrieve Foreign_link for foreign ID $fid"); - return; - } - - common_log(LOG_DEBUG, $this->name() . ' - Trying to get ' . $timelineUri . + common_debug($this->name() . ' - Trying to get ' . $timelineUri . ' timeline for Twitter user ' . $flink->foreign_id); $client = null; diff --cc plugins/TwitterBridge/scripts/initialize_notice_to_status.php index 12fb245748,f4a60c479d..12fb245748 mode 100644,100755..100755 --- a/plugins/TwitterBridge/scripts/initialize_notice_to_status.php +++ b/plugins/TwitterBridge/scripts/initialize_notice_to_status.php diff --cc plugins/WebFinger/WebFingerPlugin.php index 5b7dc20d86,ce8c847aa7..53a530333d --- a/plugins/WebFinger/WebFingerPlugin.php +++ b/plugins/WebFinger/WebFingerPlugin.php @@@ -54,7 -65,7 +65,7 @@@ class WebFingerPlugin extends Plugi $login = true; return false; } -- ++ return true; } diff --cc scripts/clearcache.php index 5904681edd,c67d6275d8..5904681edd mode 100644,100755..100755 --- a/scripts/clearcache.php +++ b/scripts/clearcache.php diff --cc scripts/createsim.php index e5b47df6de,624043161d..e5b47df6de mode 100644,100755..100755 --- a/scripts/createsim.php +++ b/scripts/createsim.php diff --cc scripts/deleteprofile.php index 0000000000,8eed6ff97b..c1ef5a449a mode 000000,100755..100755 --- a/scripts/deleteprofile.php +++ b/scripts/deleteprofile.php @@@ -1,0 -1,78 +1,78 @@@ + #!/usr/bin/env php + . + */ + + define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + + $shortoptions = 'i::n::u::y'; + $longoptions = array('id=', 'nickname=', 'uri=', 'yes'); + + $helptext = <<getProfile(); + } else if (have_option('u', 'uri')) { + $uri = get_option_value('u', 'uri'); + $oprofile = Ostatus_profile::getKV('uri', $uri); + if (!$oprofile instanceof Ostatus_profile) { + print "Can't find profile with URI '$uri'\n"; + exit(1); + } + $profile = $oprofile->localProfile(); + } else { + print "You must provide either an ID, a URI or a nickname.\n"; + exit(1); + } + + if (!have_option('y', 'yes')) { + print "About to PERMANENTLY delete profile '".$profile->getNickname()."' ({$profile->id}). Are you sure? [y/N] "; + $response = fgets(STDIN); + if (strtolower(trim($response)) != 'y') { + print "Aborting.\n"; + exit(0); + } + } + + print "Deleting..."; + $profile->delete(); + print "DONE.\n"; diff --cc scripts/dumpschema.php index 05638cda4c,9c5e3cf8b3..05638cda4c mode 100644,100755..100755 --- a/scripts/dumpschema.php +++ b/scripts/dumpschema.php diff --cc scripts/flushrouter.php index a9952b4304,51178a725c..a9952b4304 mode 100644,100755..100755 --- a/scripts/flushrouter.php +++ b/scripts/flushrouter.php diff --cc scripts/flushsite.php index 3950fb7cf7,b7f385ac45..3950fb7cf7 mode 100644,100755..100755 --- a/scripts/flushsite.php +++ b/scripts/flushsite.php diff --cc scripts/gnusocialversion.php index 91c2dc7f64,dbe9c54c5b..91c2dc7f64 mode 100644,100755..100755 --- a/scripts/gnusocialversion.php +++ b/scripts/gnusocialversion.php diff --cc scripts/importtwitteratom.php index d121179f47,a29526f27e..d121179f47 mode 100644,100755..100755 --- a/scripts/importtwitteratom.php +++ b/scripts/importtwitteratom.php diff --cc scripts/make-release.php index a3d9c70eb0,157cae067d..a3d9c70eb0 mode 100644,100755..100755 --- a/scripts/make-release.php +++ b/scripts/make-release.php diff --cc scripts/makegroupadmin.php index 3d3b1d3e84,345d93c665..3d3b1d3e84 mode 100644,100755..100755 --- a/scripts/makegroupadmin.php +++ b/scripts/makegroupadmin.php diff --cc scripts/registeruser.php index b7ee9f368c,97caf645cd..b7ee9f368c mode 100644,100755..100755 --- a/scripts/registeruser.php +++ b/scripts/registeruser.php diff --cc scripts/sessiongc.php index ef452fdb06,af55ddf3f0..ef452fdb06 mode 100644,100755..100755 --- a/scripts/sessiongc.php +++ b/scripts/sessiongc.php diff --cc scripts/settag.php index 3c234f2c31,19abce43c8..3c234f2c31 mode 100644,100755..100755 --- a/scripts/settag.php +++ b/scripts/settag.php diff --cc scripts/showcache.php index b4fe7b63ce,8ef08467d6..b4fe7b63ce mode 100644,100755..100755 --- a/scripts/showcache.php +++ b/scripts/showcache.php diff --cc scripts/showtable.php index 986260e1d2,eb18a98e20..986260e1d2 mode 100644,100755..100755 --- a/scripts/showtable.php +++ b/scripts/showtable.php diff --cc scripts/uncache_users.php index 6cd2101ad7,b5955fd5aa..6cd2101ad7 mode 100644,100755..100755 --- a/scripts/uncache_users.php +++ b/scripts/uncache_users.php diff --cc scripts/updatelocation.php index c8024cb769,abf9627cc7..c8024cb769 mode 100644,100755..100755 --- a/scripts/updatelocation.php +++ b/scripts/updatelocation.php diff --cc scripts/updateurls.php index c49187c299,8657d80b84..80b4ffc406 mode 100644,100755..100755 --- a/scripts/updateurls.php +++ b/scripts/updateurls.php diff --cc scripts/upgrade.php index 2873146b3d,56c81c8b31..dff4057cd4 mode 100644,100755..100755 --- a/scripts/upgrade.php +++ b/scripts/upgrade.php diff --cc scripts/userrole.php index a5eddeae5f,d1061b1832..a5eddeae5f mode 100644,100755..100755 --- a/scripts/userrole.php +++ b/scripts/userrole.php diff --cc tests/atompub/atompub_test.php index 4259c0cdc7,fb675c778e..4259c0cdc7 mode 100644,100755..100755 --- a/tests/atompub/atompub_test.php +++ b/tests/atompub/atompub_test.php diff --cc tests/oauth/oauth_post_notice.php index 6742ab1580,23fc04b531..6742ab1580 mode 100644,100755..100755 --- a/tests/oauth/oauth_post_notice.php +++ b/tests/oauth/oauth_post_notice.php