Commit Graph

831 Commits

Author SHA1 Message Date
Evan Prodromou
6a6d88f0f4 user_id is primary key for user_location_prefs 2009-12-28 15:58:47 -08:00
Evan Prodromou
c1e3b2f032 remove namespace setting from location; it's unused 2009-12-28 15:58:05 -08:00
Evan Prodromou
33786b2c4e turn off exe bits 2009-12-28 15:57:54 -08:00
Evan Prodromou
51a33dc66d add user-location-prefs data objects 2009-12-28 15:57:38 -08:00
Evan Prodromou
e119362fde Merge branch 'locshunt' into 0.9.x 2009-12-28 15:49:27 -08:00
Evan Prodromou
98a579fedf Merge branch 'master' into 0.9.x 2009-12-28 15:49:14 -08:00
Evan Prodromou
ca6669538a Move location-argument-handling code into a single function
Moved the important parts of the location-argument-handling stuff
to a single function. Handles defaults and overrides correctly, and
easy to use. Changed Web and API channels to use it.
2009-12-28 15:13:15 -08:00
Evan Prodromou
39bdda9c7e More configuration options for location sharing 2009-12-28 14:43:34 -08:00
Evan Prodromou
29a1669c01 user_id is primary key for user_location_prefs 2009-12-28 14:43:14 -08:00
Evan Prodromou
bb93d6b1c7 remove namespace setting from location; it's unused 2009-12-28 14:21:07 -08:00
Evan Prodromou
bbf516b965 turn off exe bits 2009-12-28 13:59:31 -08:00
Evan Prodromou
c326824135 add user-location-prefs data objects 2009-12-28 13:59:03 -08:00
Evan Prodromou
c07f221040 check if other user exists before unsub 2009-12-28 10:42:31 -08:00
Evan Prodromou
3262930ed4 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2009-12-23 10:31:27 -08:00
Brion Vibber
fa0fbd0118 Fix for massively slow friends timeline query due to indexing bug introduced with repeats.
Sorting on notice.id when our primary selector was notice_inbox.user_id caused a filesort and table scan of the notice table.
Switchng to notice_inbox's notice_id means we can use our index, and everything comes right up.

Before:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice.id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                                        |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102600 | Using index; Using temporary; Using filesort |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY                            | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using index                                  |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+

After:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice_id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                    |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102816 | Using where; Using index |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY,notice_repeatof_idx        | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using where              |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
2009-12-22 20:30:41 -08:00
Brion Vibber
eab6d1c954 Fix for massively slow friends timeline query due to indexing bug introduced with repeats.
Sorting on notice.id when our primary selector was notice_inbox.user_id caused a filesort and table scan of the notice table.
Switchng to notice_inbox's notice_id means we can use our index, and everything comes right up.

Before:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice.id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                                        |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102600 | Using index; Using temporary; Using filesort |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY                            | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using index                                  |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+----------------------------------------------+

After:
mysql> explain SELECT notice.id AS id FROM notice JOIN notice_inbox ON notice.id = notice_inbox.notice_id WHERE notice_inbox.user_id = 18574 AND notice.repeat_of IS NULL ORDER BY notice_id DESC LIMIT 61 OFFSET 0;
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
| id | select_type | table        | type   | possible_keys                      | key     | key_len | ref                           | rows   | Extra                    |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
|  1 | SIMPLE      | notice_inbox | ref    | PRIMARY,notice_inbox_notice_id_idx | PRIMARY | 4       | const                         | 102816 | Using where; Using index |
|  1 | SIMPLE      | notice       | eq_ref | PRIMARY,notice_repeatof_idx        | PRIMARY | 4       | stoica.notice_inbox.notice_id |      1 | Using where              |
+----+-------------+--------------+--------+------------------------------------+---------+---------+-------------------------------+--------+--------------------------+
2009-12-22 20:18:27 -08:00
Evan Prodromou
f6bf952980 Merge branch 'testing' 2009-12-22 16:44:19 -08:00
Brion
38877a4922 Skip DB_DataObject's in-process cache for static gets on CLI processes.
The local process cache would grow forever, keeping things stuck in memory and preventing GC.
2009-12-22 16:24:01 -08:00
Evan Prodromou
530673b3cd Merge branch '0.9.x' into testing 2009-12-16 22:14:41 -05:00
Brion Vibber
0ca80f78fb Add doc comments listing the array parameters for User::register() and Notice::saveNew() 2009-12-16 09:27:48 -05:00
Brion Vibber
a998bda4a5 Fix UserRightsTest unit tests 2009-12-16 09:27:48 -05:00
Brion Vibber
00fb5feff8 Cleanup undefined variable notice: set a couple more null defaults for new params in Notice::saveNew().
Fixes this notice seen while using AJAX repeat button:
Notice: Undefined variable: uri in classes/Notice.php on line 243
2009-12-16 09:27:48 -05:00
Brion Vibber
e2e1843639 slight cleanup for a bit in Notice.php where a var was reused for different types, confusing tracking down a bug 2009-12-16 09:27:47 -05:00
Evan Prodromou
2a1468ec8b Merge branch '0.9.x' into testing 2009-12-15 16:24:52 -05:00
Evan Prodromou
22f02b35ad call DB_DataObject::__destruct() if it exists 2009-12-15 12:38:15 -05:00
Evan Prodromou
945661d942 take out DB_DataObject destructor 2009-12-15 12:33:17 -05:00
Evan Prodromou
797a0d79fb create a method for notification for new messages, and use it 2009-12-15 10:31:25 -05:00
Brion Vibber
b9040a7cc4 Add destructor on Memcached_DataObject to free DB_DataObject's global storage for an object when that object itself is destroyed.
Reduces some, but not all, memory leakage for long-running processes.
2009-12-14 16:36:01 -08:00
Evan Prodromou
2a8eee0e0b add friends_timeline with no repeats in it 2009-12-14 16:41:25 -05:00
Evan Prodromou
438a0d7f1c remove obsoleted getStream, getStreamDirect, getCachedStream from Notice; use stream() instead 2009-12-12 16:58:39 -05:00
Evan Prodromou
1ec54d3433 add statuses/retweeted_to_me to API 2009-12-12 16:15:23 -05:00
Evan Prodromou
698b28c95c clear repeat_of flag when a notice is deleted 2009-12-12 16:02:44 -05:00
Evan Prodromou
cfe67a9c01 add statuses/retweets_of_me to API 2009-12-12 16:00:27 -05:00
Evan Prodromou
138ce0cd05 add statuses/retweeted_by_me api action 2009-12-12 15:35:05 -05:00
Evan Prodromou
c622d14440 add statuses/retweets to API 2009-12-12 14:46:24 -05:00
Brion Vibber
727357695e Debug check to track down live error -- wrong data type sometimes being sent down to Memcached_DataObject::cacheKey() via various fetch functions, need a backtrace to track it down. 2009-12-11 14:19:18 -08:00
Evan Prodromou
afc86a86d3 save repeats from the form 2009-12-11 11:51:09 -05:00
Evan Prodromou
60754fc6de Merge branch '0.9.x' into forward 2009-12-11 11:38:08 -05:00
Evan Prodromou
79f81ad76d change Notice::saveNew() to use named arguments for little-used options 2009-12-11 11:29:51 -05:00
Evan Prodromou
81843f2acd show the repeat form in notice lists 2009-12-11 10:49:26 -05:00
Evan Prodromou
c9649f9321 reset executable bit on Notice.php and statusnet.ini 2009-12-11 10:23:36 -05:00
Evan Prodromou
da30890988 add repeat_of column to notice class 2009-12-11 10:22:56 -05:00
Evan Prodromou
e9b733e7f0 Merge branch '0.9.x' into testing 2009-12-11 09:55:47 -05:00
Evan Prodromou
433106dfc5 remove 'has forwarded' method from Profile 2009-12-10 14:40:48 -05:00
Evan Prodromou
dd098fee77 remove forward table from db scripts 2009-12-10 14:34:47 -05:00
Evan Prodromou
144faade3b move forwarding stuff to Repeat plugin 2009-12-10 13:31:16 -05:00
Craig Andrews
b07e1143cc Override login_token's sequenceKey() so that it behaves correctly 2009-12-10 13:08:24 -05:00
Evan Prodromou
fcce5a064a Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2009-12-08 21:18:49 -05:00
Evan Prodromou
45408142e9 reorder notices when not using memcached 2009-12-08 21:02:54 -05:00
Brenda Wallace
789378838b that pesky table named user - now quoted 2009-12-09 13:26:59 +13:00
Evan Prodromou
9dff9e6cea make sure not to forward blocked users 2009-12-08 17:42:07 -05:00
Evan Prodromou
c49ece9fb4 method to check if a profile has forwarded a notice 2009-12-08 17:20:17 -05:00
Evan Prodromou
7dd0f2fa9c pkeyGet() method for Forward and return value from saveNew() 2009-12-08 17:20:04 -05:00
Evan Prodromou
72c82a2e29 Basic function to store forwards and redistribute 2009-12-08 16:30:33 -05:00
Evan Prodromou
6bc6af667e fix exe flag 2009-12-08 15:43:34 -05:00
Evan Prodromou
0f1d0ab4d7 add DB_DataObject for forward table 2009-12-08 15:43:11 -05:00
Evan Prodromou
78fc9483d4 Merge branch '0.9.x' into testing 2009-12-08 14:43:21 -05:00
Craig Andrews
75cac0fd6b Added 'login' command that gives you a link that can be used to login to the website 2009-12-05 21:05:33 -05:00
Craig Andrews
d31b1d774e use the new htmloutputter->style() function 2009-12-04 20:20:44 -05:00
Zach Copley
d2b42577de Was deleting wrong subscription during block. Now deletes the blockee's sub if it exists. 2009-12-03 17:44:34 -08:00
Zach Copley
aef4cc0a59 Make it impossible to block (and thus unsubscribe from your
self-subscription) via the API.  Additionally, make it impossible
to block yourself or unsubscribe from yourself, period.

I also made User use the subs.php helper function for unsubscribing
during a block.

Hopefully, these changes will get rid of the problem of people
accidentally deleting their self-subscriptions once and for all
(knock on wood).
2009-12-03 17:06:58 -08:00
Zach Copley
9dc888894b Merge branch 'master' into 0.9.x
* master: (67 commits)
  Ticket 2038: fix bad bug tracker link
  Fix regression in group posting: bug introduced in commit 1319002e15. Need to use actual profile object rather than an id on a variable that doesn't exist when checking blocks :D
  Log database errors when saving notice_inbox entries
  Drop the username from the log id for now; seems to trigger an error loop in some circumstances
  request id on logs... pid + random id per web request + username + method + url
  Add OpenID ini info back into statusnet.ini as a stopgap until we can
  Some changes to the OpenID DataObjects to make them emit the exact same
  OpenID plugin should set 'user_openid.display' as unique key
  Remove relationship: user_openid.user_id -> user.id. I don't think this
  Have OpenID plugin DataObjects emit their own .ini info
  Revert "Allow plugin DB_DataObject classes to not have to use the .ini file by overriding keys(), table(), and sequenceKey() for them"
  Catch and report exceptions from notice_to_omb_notice() instead of letting the OMB queue handler die.
  Fix regression in remote subscription; added hasRole() shadow method on Remote_profile.
  Fix fatal error on OMB subscription for first-timers
  Remove annoying log msg
  Drop error message on setlocale() failure; this is harmless, since we actually have a working locale set up.
  Catch uncaught exception
  Fixed bug where reply-sync bit wasn't getting saved
  Forgot to render the nav menu when on FB Connect login tab
  Facebook plugin no longer takes over Login and Connect settings nav menus
  ...

Conflicts:
	db/08to09_pg.sql
	db/statusnet_pg.sql
	locale/pt_BR/LC_MESSAGES/statusnet.mo
	plugins/Mapstraction/MapstractionPlugin.php
2009-11-30 10:28:58 -08:00
Brion Vibber
4965476998 Fix regression in group posting: bug introduced in commit 1319002e15. Need to use actual profile object rather than an id on a variable that doesn't exist when checking blocks :D 2009-11-27 14:54:55 -08:00
Brion Vibber
2b8a3e3511 Fix regression in group posting: bug introduced in commit 1319002e15. Need to use actual profile object rather than an id on a variable that doesn't exist when checking blocks :D 2009-11-27 14:52:58 -08:00
Brion Vibber
2ba67e9b62 Log database errors when saving notice_inbox entries 2009-11-27 14:21:23 -08:00
Brion Vibber
e85e47b509 Log database errors when saving notice_inbox entries 2009-11-27 14:20:57 -08:00
Zach Copley
261ee0264a Add OpenID ini info back into statusnet.ini as a stopgap until we can
get plugins to load ini info properly on status.net
2009-11-26 18:49:18 +00:00
Zach Copley
54ad3b21d7 Remove relationship: user_openid.user_id -> user.id. I don't think this
is used. And if we need it, the OpenID plugin should do it.
2009-11-25 23:55:03 +00:00
Zach Copley
2b6cf0d8b6 Revert "Allow plugin DB_DataObject classes to not have to use the .ini file by overriding keys(), table(), and sequenceKey() for them"
This reverts commit a373d07ae0.

Conflicts:

	classes/statusnet.ini
	lib/schema.php
	plugins/Authentication/AuthenticationPlugin.php
	plugins/OpenID/OpenIDPlugin.php
	plugins/UserFlag/UserFlagPlugin.php
2009-11-25 23:54:36 +00:00
Zach Copley
bd4a613c38 Merge branch 'fix-openid' into 0.9.x 2009-11-25 23:33:13 +00:00
Zach Copley
035c8cfd71 Remove relationship: user_openid.user_id -> user.id. I don't think this
is used. And if we need it, the OpenID plugin should do it.
2009-11-25 23:29:12 +00:00
Brion Vibber
b771a8bb21 Fix regression in remote subscription; added hasRole() shadow method on Remote_profile.
DB_DataObject hides errors by silently returning null for any non-existent method call, making it harder to tell what the heck's going on... the rights check for blocked remote users returned null for the check for subscribe rights, thus eval'ing to false. We now log a note in this circumstance, which would have cut about 3 hours off of the debug time.
2009-11-25 22:23:21 +00:00
Brion Vibber
4d71dbe98c Fix regression in remote subscription; added hasRole() shadow method on Remote_profile.
DB_DataObject hides errors by silently returning null for any non-existent method call, making it harder to tell what the heck's going on... the rights check for blocked remote users returned null for the check for subscribe rights, thus eval'ing to false. We now log a note in this circumstance, which would have cut about 3 hours off of the debug time.
2009-11-25 22:22:21 +00:00
Zach Copley
8acc1587b1 Revert "Allow plugin DB_DataObject classes to not have to use the .ini file by overriding keys(), table(), and sequenceKey() for them"
This reverts commit a373d07ae0.

Conflicts:

	classes/statusnet.ini
	lib/schema.php
	plugins/Authentication/AuthenticationPlugin.php
	plugins/OpenID/OpenIDPlugin.php
	plugins/UserFlag/UserFlagPlugin.php
2009-11-25 13:38:59 -08:00
Zach Copley
c0190af982 Remove annoying log msg 2009-11-25 19:23:33 +00:00
Zach Copley
40e875f9cc Remove annoying log msg 2009-11-25 19:22:09 +00:00
Craig Andrews
e9b877a4a3 correct the primary key for login_token 2009-11-20 10:56:06 -05:00
Evan Prodromou
224d82793c Revert "Added 'login' command that gives you a link that can be used to login to the website"
This reverts commit b9d40f723b.

Conflicts:

	actions/login.php
	classes/statusnet.ini
	db/08to09.sql
	db/08to09_pg.sql
	db/statusnet_pg.sql
	lib/command.php
	lib/commandinterpreter.php
2009-11-20 02:50:43 -08:00
Craig Andrews
cac5a417f2 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x 2009-11-18 17:04:42 -05:00
Eric Helgeson
199ccdb53f Consolidate group creation into static function in User_group 2009-11-18 15:54:24 -05:00
Craig Andrews
d07df8a796 Added Authorization plugin
Added LDAPAuthorization plugin
2009-11-18 14:19:43 -05:00
Evan Prodromou
3a980a75fc Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2009-11-17 14:51:38 -05:00
Zach Copley
638df94f88 Need to check the Profile rather than the User. 2009-11-17 08:48:16 -08:00
Evan Prodromou
bac2d80c91 Merge branch '0.9.x' into adminpanel
Conflicts:
	classes/User.php
2009-11-17 08:04:14 -05:00
Evan Prodromou
6a1afda259 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/statusnet.ini
2009-11-17 06:25:07 -05:00
Craig Andrews
a373d07ae0 Allow plugin DB_DataObject classes to not have to use the .ini file by overriding keys(), table(), and sequenceKey() for them 2009-11-16 15:24:25 -05:00
Evan Prodromou
d59af02960 disallow email on faves from sandboxed users 2009-11-16 14:28:55 -05:00
Evan Prodromou
440af7ed7a silenced users can't send direct messages 2009-11-16 19:51:41 +01:00
Evan Prodromou
e9321a1806 more rights denied to silenced and sandboxed 2009-11-16 19:46:08 +01:00
Evan Prodromou
f1efb845e4 don't allow sandboxed users to post public notices 2009-11-16 19:22:22 +01:00
Evan Prodromou
d2145a5b7f Move rights check to profile and add right for new notices
Added a right for new notices, realized that the hasRight() method
should be on the profile, and moved it.

Makes this a less atomic commit but that's the way it goes sometimes.
2009-11-16 19:03:59 +01:00
Craig Andrews
7177585630 getGroups was not handling the case where limit=null correctly 2009-11-16 11:22:45 -05:00
Evan Prodromou
3e08309826 change uses of User_role to Profile_role 2009-11-16 16:06:52 +01:00
Evan Prodromou
dd10e9729b fix exe flag after createTable 2009-11-16 16:05:22 +01:00
Evan Prodromou
fa00aed88b remove User_role class 2009-11-16 16:04:51 +01:00
Evan Prodromou
4e00ce01a9 Rename user_role to profile_role
Renamed the user_role table to profile_role. Remote users can have a
role on the site; that 'role' may be negative (silenced or sandboxed).
2009-11-16 16:02:47 +01:00
Evan Prodromou
792590bcdc move role functions to Profile class 2009-11-16 15:52:33 +01:00
Craig Andrews
6470ccd1b8 getSubscribers and getSubscriptions were not handling the case where limit=null correctly 2009-11-16 00:19:19 -05:00
Evan Prodromou
c9475c76a8 define rights around how to silence, sandbox, and delete a user 2009-11-15 15:59:10 +01:00
Craig Andrews
ed690615de Added a User_username table that links the external username with a StatusNet user_id
Added EmailAuthenticationPlugin
Added ReverseUsernameAuthenticationPlugin
Changed the StartChangePassword and EndChangePassword events to take a user, instead of a nickname
User::allowed_nickname was declared non-static, but used as if it was static, so I made the declaration static
2009-11-12 20:12:36 -05:00