Commit Graph

3820 Commits

Author SHA1 Message Date
Brion Vibber 80e2f4f529 Fix up edge case in nickname processing: overlong display forms should be rejected before normalization (storage of display forms will also have fields with limited length) 2010-12-30 17:11:16 -08:00
Evan Prodromou 66f6b2a342 Events to hook for NoticeListElement <li> generation 2010-12-30 16:57:05 -08:00
Evan Prodromou 3b5c3d2c84 UUID-generation tools 2010-12-30 12:15:34 -08:00
Evan Prodromou c91b080a8e version 0.9.8dev 2010-12-29 16:18:43 -08:00
Evan Prodromou 3d62c1cf51 0.9.7alpha1 2010-12-29 16:15:57 -08:00
Evan Prodromou d8219c07be update version to 0.9.7 2010-12-29 16:14:00 -08:00
Evan Prodromou 80191b56df Show <activity:subject> in Atom group notice feed
Version 0.9.6 and below of StatusNet assume anything in <author> is a
Person. So, we include an <activity:subject> element, which will be
checked first by those versions of the code, only for group feeds.

At some point we'll take this out, but it's useful for now.
2010-12-29 15:33:57 -08:00
Evan Prodromou d3b10959f4 Merge branch '0.9.x' into noactor 2010-12-29 15:29:29 -08:00
Evan Prodromou 26afe79ed9 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-12-29 14:53:38 -08:00
Brion Vibber 90c7ff1983 Merge branch 'master' into 0.9.x 2010-12-28 11:37:38 -08:00
Brion Vibber d3d9797496 Prevent group creation by silenced users.
* adds Right::CREATEGROUP
* logic in Profile::hasRight() checks for silencing
* NewgroupAction checks for the permission before letting you see or process the form in the UI
* User_group::register() logic does a low-level check on the specified initial group admin, and rejects creation if that user doesn't have the right; guaranteeing that API methods etc will also have this restriction applied sensibly.
2010-12-28 11:34:02 -08:00
Evan Prodromou 8814fb3822 Merge branch '0.9.x' into socialbookmark 2010-12-27 22:38:36 -08:00
Evan Prodromou 1996545947 add events for restoring activities 2010-12-27 22:28:20 -08:00
Evan Prodromou 6393326557 Merge branch '0.9.x' into socialbookmark 2010-12-27 20:49:31 -08:00
Evan Prodromou c78170a275 Better job making an ActivityObject from an <atom:author> 2010-12-27 10:19:51 -08:00
Evan Prodromou ab92496ddc Stop using <activity:subject> for atom feeds 2010-12-27 10:03:34 -08:00
Evan Prodromou f5128015be Use outputTo() instead of asString() for including sub-elements 2010-12-27 09:46:25 -08:00
Evan Prodromou 1188d5bab2 Don't output deprecated <activity:actor> element 2010-12-27 09:25:26 -08:00
Brion Vibber 464e0f8115 Don't trust text/xml mime types; generic content detection gives useless stuff like that on SVG images! Todo: replace the extension check in this case with better content-based checks. 2010-12-22 13:56:19 -08:00
Evan Prodromou 402cac2f93 Merge branch '0.9.x' into socialbookmark
Conflicts:
	lib/activityobject.php
2010-12-22 12:09:42 -08:00
Evan Prodromou 35d9a065fb Revert "initialize ActivityObject::$extra"
This reverts commit 3e82000d57.
2010-12-22 12:07:13 -08:00
Evan Prodromou e11ca1e052 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-12-22 12:05:40 -08:00
Brion Vibber 448dfb69d4 Initialize $extra member to empty array on ActivityObject 2010-12-22 12:03:05 -08:00
Evan Prodromou 3e82000d57 initialize ActivityObject::$extra 2010-12-22 12:02:50 -08:00
Evan Prodromou 5fe8301129 disable account deletion by default 2010-12-22 11:25:47 -08:00
Evan Prodromou 9a6ceb3303 Merge branch 'righttoleave' into 0.9.x 2010-12-22 11:22:51 -08:00
Evan Prodromou 17515aacac drop previous in oembedhelperexception code 2010-12-20 18:32:43 -05:00
Evan Prodromou f63355451d fixup exception constructor for php 5.2 2010-12-20 18:28:42 -05:00
Evan Prodromou 24f9a991b6 Let activity objects write directly to activity's own outputter 2010-12-20 13:30:33 -05:00
Evan Prodromou 6a6dd81d1f Let activity objects write directly to activity's own outputter 2010-12-20 13:26:57 -05:00
Evan Prodromou 688841fb41 ActivityObject has attribute for other elements 2010-12-19 10:16:44 -05:00
Evan Prodromou 25d03c42e6 Add events for representing objects as activity:object
Add 6 new events to make it easier to override the type of an activity object.
2010-12-18 17:24:41 -05:00
Brion Vibber fb8312ebf4 Ticket #2959: implement api/users/profile_image endpoint in Twitter-compat API 2010-12-17 17:10:52 -08:00
Evan Prodromou 573bbeced1 action to restore a user's backup from the Web interface 2010-12-17 18:56:48 -05:00
Evan Prodromou 1d6091cad2 Two bug fixes in activityimporter 2010-12-17 18:56:17 -05:00
Evan Prodromou 120802b807 change code order to make shorter lines 2010-12-17 18:55:00 -05:00
Evan Prodromou 1a81356622 I'm still not sure when it's useful to reset a notice's author 2010-12-17 17:37:43 -05:00
Evan Prodromou 4b41d05a13 Make restoreuser use new FeedImporter queue handler 2010-12-17 16:27:20 -05:00
Evan Prodromou 044763cf06 move activity importing code to two different queuehandler classes 2010-12-17 13:12:17 -05:00
Evan Prodromou 6469d75fb0 Move accountrestorer class to feed importer 2010-12-17 13:10:23 -05:00
Evan Prodromou 16fc5314fb move code to get an author object for a feed to a library from Ostatus_profile 2010-12-17 13:09:37 -05:00
Brion Vibber ed24c95ac2 Fix ticket #2929: router cache now clears itself when switching singleuser mode in and out 2010-12-16 13:42:10 -08:00
Evan Prodromou 39804809dd distribute flag for Notice::saveNew() 2010-12-16 16:17:38 -05:00
Evan Prodromou 2e2519afee Move account restoration code to a shared library
Moved most of the heavy-lifting for account restoration out of
restoreuser.php and into its own class, with the hope that we'll do
the work from the Web eventually.
2010-12-15 17:53:38 -05:00
Evan Prodromou e16cb8c03a Merge branch '0.9.x' into righttoleave 2010-12-15 16:48:28 -05:00
Brion Vibber 6c67114198 Mark OembedAction, XrdAction, and (plugin) AutocompleteAction as read-only. Tweaked ApiStatusesShow and ApiTimelineUser to still claim read-only when hit with a HEAD request (usually link checkers or a precursor to a GET, and should be semantically equivalent to a GET without actually transferring data) 2010-12-14 16:14:15 -08:00
Brion Vibber 2ed1e9b126 AtomPub discovery fix: gets MarsEdit's auto API detection working.
Router entry for AtomPubService was slightly off, generating an incorrect link in the RSD data.
2010-12-14 14:43:50 -08:00
Evan Prodromou d840578aa0 An action to delete your own account
The new DeleteaccountAction lets a user delete their own account
(subject to global rights set by the admin). It presents a form to
delete the account, with an "I am sure." text entry box.

It then schedules the account for deletion and logs the user out.
2010-12-14 12:38:43 -05:00
Evan Prodromou 5089d3065c add an action to backup the current account in ActivityStreams format 2010-12-13 16:32:39 -05:00
Evan Prodromou 75aaa98462 define rights for account maintenance and default rules 2010-12-13 16:28:32 -05:00
Evan Prodromou 7c7b91e61a define configuration settings for account maintenance security 2010-12-13 16:28:02 -05:00
Evan Prodromou 4be9c0a0e9 fix URL for memberships feed 2010-12-13 13:50:57 -05:00
Evan Prodromou 4b7a0d366c add atompub membership actions to router 2010-12-13 12:40:01 -05:00
Evan Prodromou 37c447be46 Show a single favorite for AtomPub 2010-12-10 18:50:50 -05:00
Evan Prodromou 167f760ab8 Merge branch '0.9.x' into activityatompub
Conflicts:
	lib/router.php
2010-12-10 17:04:55 -05:00
Brion Vibber d55f606cf8 Tweaking nickname format regexes: added one that explicitly allows numbers, to be used in router setup. 2010-12-09 16:43:35 -08:00
Evan Prodromou c619a257fe Add subscription feed for AtomPub 2010-12-09 16:05:07 -05:00
Evan Prodromou 11a0bde459 AtomPub for single subscription 2010-12-09 13:11:02 -05:00
Evan Prodromou 94ff04e190 Don't cache user-specific information for Notice atom entries 2010-12-08 13:59:12 -05:00
Evan Prodromou db519d3ffb whitespace problems in lib/router 2010-12-07 16:23:12 -05:00
Evan Prodromou 57859a4bc8 generate links for apinamespace.org/atom and /twitter in userxrd 2010-12-07 15:53:34 -05:00
Evan Prodromou eab8d752e8 allow <Property> elements in <Link> in XRD 2010-12-07 15:53:08 -05:00
Evan Prodromou d5466ac87e fix whitespace in lib/xrdaction.php 2010-12-07 15:26:43 -05:00
Evan Prodromou 1fb506c27d use codeKey() in activity caching 2010-12-06 17:28:22 -05:00
Evan Prodromou 25f644f4b9 Merge branch '0.9.x' into cacheactivity 2010-12-06 17:22:34 -05:00
Evan Prodromou b35352790f Merge branch 'master' of gitorious.org:statusnet/mainline 2010-12-06 17:21:38 -05:00
Evan Prodromou 49757c79ee Config flag to disable router caching if needed 2010-12-06 17:21:01 -05:00
Evan Prodromou a33d1d6090 use Cache::codeKey() in Router class 2010-12-06 17:20:44 -05:00
Evan Prodromou 004d58fdb8 Make code-dependent cache entries more volatile
If a cache entry is dependent on the code that's running, upgrading
(or enabling/disabling plugins) can generate hard-to-track
inconsistencies.

This change adds a close-to-unique fingerprint of the running code to
some cache keys, so that if the fingerprint changes, the old values
are ignored and new values are used.

If the automated uniqueness fails, an administrator can add an extra
config value, $config['site']['build'], that's thrown into the key also.
2010-12-06 17:20:26 -05:00
Evan Prodromou bb63fd4b75 Config flag to disable router caching if needed 2010-12-06 17:19:41 -05:00
Evan Prodromou 8c4e14b59c use Cache::codeKey() in Router class 2010-12-06 17:08:52 -05:00
Evan Prodromou b3d47ed6cc Make code-dependent cache entries more volatile
If a cache entry is dependent on the code that's running, upgrading
(or enabling/disabling plugins) can generate hard-to-track
inconsistencies.

This change adds a close-to-unique fingerprint of the running code to
some cache keys, so that if the fingerprint changes, the old values
are ignored and new values are used.

If the automated uniqueness fails, an administrator can add an extra
config value, $config['site']['build'], that's thrown into the key also.
2010-12-06 17:05:32 -05:00
Evan Prodromou 8564fc51c5 cache generated activity info 2010-12-06 16:38:02 -05:00
Evan Prodromou da8b268e06 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2010-12-06 15:52:03 -05:00
Evan Prodromou 0c0418bdfb correctly generate enclosure in Activity::asString() 2010-12-06 15:51:42 -05:00
Brion Vibber 2617c40e04 Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/User.php
2010-12-06 12:44:19 -08:00
Brion Vibber 76f3dc32e0 Added User::singleUserNickname() as (temporary?) fallback for single-user lookup as a workaround for site setup of 1user sites. We found that an external tool attempting to spin up StatusNet and then register the user would fail because StatusNet's router setup dies on being unable to find its single-user account, since the nickname is needed in setting up routing entries. This tweak will let it survive, using the configured setting as a fallback if it can't actually find the user account. 2010-12-06 12:39:09 -08:00
Evan Prodromou 1f0949f9ac remove common_debug() from Activity::asString() 2010-12-06 15:22:52 -05:00
Evan Prodromou b28266b3d6 Convert Notice::asAtomEntry() to use Notice::asActivity() and Activity::asString()
We had two ways to generate an activity entry from a notice; one through
Notice::asAtomEntry() and one through Notice::asActivity() and
Activity::asString(). The code paths had already diverged somewhat. I
took the conditions that were in Notice::asAtomEntry() and made sure
they were replicated in the other two functions. Then, I rewrote
Notice::asAtomEntry() to use the other two functions instead.

This change passes the ActivityGenerationTests unit tests, but there
may be some other stuff that's not getting covered.
2010-12-05 16:15:05 -05:00
Brion Vibber aa96c3c1d9 Fix for tickets #2917, #2262: user URL shortening options not being applied in non-web channels
common_shorten_links() can only access the web session's logged-in user, so never properly took user options into effect for posting via XMPP, API, mail, etc.

Adds an optional $user parameter on common_shorten_links(), and a $user->shortenLinks() as a clearer interface for that.
Tweaked some lower-level functions so $user gets passed down -- making the $notice_id param previously there for saving URLs at notice save time generalized a little.

Note also ticket #2919: there's a lot of duplicate code calling the shortening, checking the length, and reporting near-identical error messages. These should be consolidated to aid in code and translation maintenance.
2010-12-02 13:41:56 -08:00
Brion Vibber f68d4e7d06 Fix dumb mistake -- changed function names partway through writing Nickname and forgot to update a couple places. :) 2010-12-01 11:21:00 -08:00
Evan Prodromou 7aa201fa52 Merge branch 'master' into 0.9.x
Conflicts:
	lib/router.php
2010-11-30 14:46:26 -05:00
Evan Prodromou af31767b63 was using Cache::get() and ::set() wrong 2010-11-30 14:44:16 -05:00
Evan Prodromou c86dff9901 use a CRC32 of the plugin names rather than actual names 2010-11-30 10:11:53 -05:00
Evan Prodromou 8c993a502c use a CRC32 of the plugin names rather than actual names 2010-11-30 10:11:39 -05:00
Evan Prodromou f5c8549068 Squashed commit of the following:
commit 39fdd181d95d2c39a3ea1ca330b10a99a92b961f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Nov 29 10:37:49 2010 -0500

    use cache key prefix for router cache key

commit 4cb9e56941922489b83d6425c059cf770991e68f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Nov 29 10:31:21 2010 -0500

    use a unique hashkey based on the software version and loaded plugins

commit 44458b48aef719543e11f83b41fded65cbcb8be9
Author: Evan Prodromou <evan@status.net>
Date:   Sat Nov 27 17:04:15 2010 -0500

    cache the NUM object

commit 809c188307a9b4ada15f3d7fa573a6034341efef
Author: Evan Prodromou <evan@status.net>
Date:   Sat Nov 27 15:44:12 2010 -0500

    accelerate routing by pivoting paths on actions
2010-11-30 09:58:00 -05:00
Evan Prodromou 02da858cef Squashed commit of the following:
commit 39fdd181d95d2c39a3ea1ca330b10a99a92b961f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Nov 29 10:37:49 2010 -0500

    use cache key prefix for router cache key

commit 4cb9e56941922489b83d6425c059cf770991e68f
Author: Evan Prodromou <evan@status.net>
Date:   Mon Nov 29 10:31:21 2010 -0500

    use a unique hashkey based on the software version and loaded plugins

commit 44458b48aef719543e11f83b41fded65cbcb8be9
Author: Evan Prodromou <evan@status.net>
Date:   Sat Nov 27 17:04:15 2010 -0500

    cache the NUM object

commit 809c188307a9b4ada15f3d7fa573a6034341efef
Author: Evan Prodromou <evan@status.net>
Date:   Sat Nov 27 15:44:12 2010 -0500

    accelerate routing by pivoting paths on actions
2010-11-30 09:57:02 -05:00
Brion Vibber 3be352551a Normalize username strings in command parsing 2010-11-29 16:44:40 -08:00
Brion Vibber 3f0557aa8e General code safety: validate input and escape SQL strings in common_relative_profile() 2010-11-29 16:44:01 -08:00
Brion Vibber e03d2584aa Use Nickname::DISPLAY_FMT instead of manual regex fragments in router setup for nickname parameters. 2010-11-29 16:02:35 -08:00
Brion Vibber 82799f675f Add Nickname test cases for @-reply regexes in common_find_mentions 2010-11-29 15:07:55 -08:00
Brion Vibber fffc10a230 Nickname class to encapsulate validation & common regexes for nickname formats.
This provides initial infrastructure for decoupling display names from internal canonical names, but continues to have us storing and using the canonical forms.

It should be/become possible to provide mixed-case and underscore-containing names in links, @-mention, !-group, etc, but we don't store those alternate forms generally.
2010-11-29 14:46:10 -08:00
Brion Vibber dc350b5463 Work in progress on nickname validation changes. lib/nickname.php appears to have been destroyed by NetBeans and will be rewritten shortly. Sigh. 2010-11-29 14:15:25 -08:00
Brion Vibber 6c4e5a89c1 Add some doc comments on nickname-related stuff in util.php 2010-11-29 11:31:10 -08:00
Evan Prodromou edf660c6ff Make userxrd work without OStatus enabled 2010-11-26 22:09:51 -05:00
Evan Prodromou fcc0825b14 Make userxrd part of the default hostmeta 2010-11-26 21:46:51 -05:00
Evan Prodromou 0a4911552e Move user xrd action to core and use hooks to extend
Moved the Webfinger user XRD action from the OStatus plugin to core.
Added hooks to add OStatus-specific stuff, but kept general stuff in
the core.
2010-11-26 21:38:38 -05:00
Craig Andrews 3f3b38766f move xrd and hostmeta out of the OStatus plugin and into core
add event for setting up hostmeta, and use them in the OStatus plugin
2010-11-26 21:12:14 -05:00
Brion Vibber cff14c7e10 Merge branch 'master' into 0.9.x 2010-11-19 16:18:53 -08:00
Brion Vibber b615998309 Fix ticket #2700: some numeric IDs were misinterpreted as hex numbers instead of strings when '0x123' passed in.
Switched from is_numeric() to a custom self::is_decimal() which is more strict.
This makes our behavior match Twitter's API a bit better, so eg this:

  http://identi.ca/api/statuses/home_timeline/0x6d686b.xml

should now be equivalent to:

  http://identi.ca/api/statuses/home_timeline.xml?screen_name=0x6d686b

instead of:

  http://identi.ca/api/statuses/home_timeline.xml?user_id=7170155
2010-11-19 16:12:28 -08:00