Commit Graph

144 Commits

Author SHA1 Message Date
Mikael Nordfeldth
b18e24723f Preparing more object-oriented Action handling
Action classes can now be run by calling the static function 'run'.
Eventually actions will be migrated so most functionality gets put
into parent classes, and the children don't have to have as much
duplicate code as they have now.
2013-08-29 23:33:05 +02:00
Evan Prodromou
c9d635b675 Fix hand-made trim in getPath() with ltrim (duh) 2011-10-03 09:26:42 -04:00
Evan Prodromou
6145df6670 trim initial '/' from paths 2011-10-03 09:15:53 -04:00
Brion Vibber
2967c5c0fa issue #3261 -- fix generic exception handler to pass through generic exception info, as already done for exceptions happening within an action. This fixes things like addPlugin() failures being hidden with a generic message.
If any email issues remain, they should be treated specifically if special treatment is needed.
2011-07-26 15:56:04 -07:00
Evan Prodromou
55068030d2 hook for defining new read-write tables 2011-05-06 17:18:38 -07:00
Siebrand Mazeland
34ed86981b Fixes for an xgettext peculiarity. 2011-04-04 01:01:42 +02:00
Siebrand Mazeland
2dbdb0f185 Translator documentation updated/added.
i18n tweaks.
Superfluous whitespace removed.

YAY! All StatusNet core messages in the 1.0.x branch have been documented at this point in time!!!
2011-04-04 00:41:48 +02:00
Zach Copley
b7d0746694 Merge branch '0.9.x' into 1.0.x
Conflicts:
	actions/confirmaddress.php
	actions/emailsettings.php
	actions/hostmeta.php
	actions/imsettings.php
	actions/login.php
	actions/profilesettings.php
	actions/showgroup.php
	actions/smssettings.php
	actions/urlsettings.php
	actions/userauthorization.php
	actions/userdesignsettings.php
	classes/Memcached_DataObject.php
	index.php
	lib/accountsettingsaction.php
	lib/action.php
	lib/common.php
	lib/connectsettingsaction.php
	lib/designsettings.php
	lib/personalgroupnav.php
	lib/profileaction.php
	lib/userprofile.php
	plugins/ClientSideShorten/ClientSideShortenPlugin.php
	plugins/Facebook/FBConnectSettings.php
	plugins/Facebook/FacebookPlugin.php
	plugins/NewMenu/NewMenuPlugin.php
	plugins/NewMenu/newmenu.css
2011-02-28 15:39:43 -08:00
Brion Vibber
de7726dd00 Performance counters: records number of total and unique cache get/set/incr/deletes and queries, and logs to syslog.
$config['site']['logperf'] = true; // to record & dump total hits of each type and the runtime to syslog
$config['site']['logperf_detail'] = true; // very verbose -- dump the individual cache keys and queries as they get used (may contain private info in some queries)

Seeing 180 cache gets on a timeline page seems not unusual currently; since these run in serial, even relatively small roundtrip times can add up heavily.
We should consider ways to reduce the number of round trips, such as more frequently storing compound objects or the output of processing in memcached.
Doing parallel multi-key lookups could also help by collapsing round-trip times, but might not be easy to fit into SN's object model. (For things like streams this should actually work pretty well -- grab the list, then when it's returned go grab all the individual items in parallel and return the list)
2011-01-31 13:12:56 -08:00
Evan Prodromou
ca4bf54131 add a comment to show runtime at the end of a page 2011-01-31 13:59:38 -05:00
Evan Prodromou
f9b2feb7f5 Merge branch '0.9.x' into 1.0.x
Conflicts:
	README
2011-01-12 18:05:56 -05:00
Brion Vibber
6e894c010f Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x 2011-01-04 12:14:08 -08:00
Brion Vibber
fb9ecddbf1 Ticket #2649: fix for undefined $base_url in lighttpd code path
The $base_url var is never defined, and the code has actually always been wrong since it was added.
Just removing it seems to work fine :)
2011-01-04 12:07:52 -08:00
Evan Prodromou
7aa201fa52 Merge branch 'master' into 0.9.x
Conflicts:
	lib/router.php
2010-11-30 14:46:26 -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
Evan Prodromou
806832e339 Revert "Ticket #2796: don't allow arbitrary overriding of the 'action' class and other parameters pulled from the URL mapper."
This reverts commit 4193a826d3.
2010-11-26 11:18:41 -05:00
Brion Vibber
4193a826d3 Ticket #2796: don't allow arbitrary overriding of the 'action' class and other parameters pulled from the URL mapper.
This protects against oddities such as manual invocation of the ClientError action, which can spoof error messages.
2010-11-19 15:30:52 -08:00
Craig Andrews
90c87553ee Redirect to https when making an http request for a sensitive action 2010-10-20 20:26:35 -04:00
Craig Andrews
8d54809c35 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-09-07 13:45:52 -04:00
Evan Prodromou
86a702953a Merge branch '0.9.x' into 1.0.x 2010-09-06 10:12:17 -04:00
Brion Vibber
ab0ced4dfd Suppress notices in index.php running under lighttpd 2010-09-03 17:57:23 -07:00
Brion Vibber
b1a68e15b7 Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts:
	lib/default.php
	lib/util.php
	plugins/UrlShortener/UrlShortenerPlugin.php (has been removed?)
2010-06-10 15:37:06 -07:00
Brenda Wallace
1cd029753f added 2 missing authors, foudn automatically in git logs 2010-06-08 16:27:10 +12:00
Craig Andrews
6317f7d92b Assigning my copyrights to the Free Software Foundation 2010-05-27 18:27:33 -04:00
Brion Vibber
cae1329f3b Merge branch '0.9.x' into 1.0.x
Conflicts:
	lib/util.php
2010-04-30 13:16:13 -07:00
Craig Andrews
42348bc167 add rsd to the list of login actions
Allows rsd.xml to be reached on private sites. Fixes http://status.net/trac/ticket/2309
2010-04-27 22:00:26 -04:00
Craig Andrews
d7d3a50d87 Don't attempt to retrieve the current user from the DB while processing a DB error 2010-04-18 19:28:49 -04:00
Craig Andrews
9398c61ed3 Use PHP exceptions for PEAR error handling.
Allows for the common try/catch construct, which makes error handling cleaner and easier.
2010-04-18 19:28:41 -04:00
Brion Vibber
26f49de0dd Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	lib/attachmentlist.php
2010-03-22 12:37:45 -07:00
Brion Vibber
4168b9cec1 Log backtraces for non-ClientException exceptions caught at the top-level handler. 2010-03-22 11:33:56 -07:00
Brion Vibber
f62b8a80cf Pull back for now on switch of PEAR error mode to exceptions; seems to trigger out exceptions at various times we don't want them.
For instance this was throwing an exception for DB_DataObject::staticGet when there's no match... definitely not what we want when all our code expects to get a nice null.
Example of this causing trouble: http://gitorious.org/statusnet/mainline/merge_requests/131

Revert "Don't attempt to retrieve the current user from the DB while processing a DB error"

This reverts commit 68347691b0.

Revert "Use PHP exceptions for PEAR error handling."

This reverts commit d8212977ce.
2010-03-16 16:32:25 -07:00
Brion Vibber
88f66131a1 Pull back for now on switch of PEAR error mode to exceptions; seems to trigger out exceptions at various times we don't want them.
For instance this was throwing an exception for DB_DataObject::staticGet when there's no match... definitely not what we want when all our code expects to get a nice null.
Example of this causing trouble: http://gitorious.org/statusnet/mainline/merge_requests/131

Revert "Don't attempt to retrieve the current user from the DB while processing a DB error"

This reverts commit 68347691b0.

Revert "Use PHP exceptions for PEAR error handling."

This reverts commit d8212977ce.
2010-03-16 16:24:31 -07:00
Jeffery To
fa1262f51e Fixed IE7 prompting the user to download OpenSearch description xml after login (for a private site)
Flow:
1. Browser (IE7) is redirected to the login page.
2. Browser reads the page, sees OpenSearch descriptions, tries to
   download them. Each request gets recorded by SN as the page the user
   should be redirected to after logging in (returnto).
3. User logs in, then gets redirected to the returnto action, which is
   an OpenSearch description.

The OpenSearch descriptions aren't sensitive so making them public in a
private site should be okay.

(I recall fixing this in 0.8.x... :-( )
2010-03-16 11:38:51 -04:00
Brion Vibber
b218aee94e Merge commit 'origin/testing' into 0.9.x
Conflicts:
	lib/action.php
	lib/adminpanelaction.php
2010-03-04 06:07:28 -08:00
James Walker
4103e8584c Making one time passwords work on private sites 2010-03-03 18:17:40 -05:00
Brion Vibber
06db00d303 remove debug line 2010-03-03 15:15:46 -08:00
Brion Vibber
0881eba80e Language setting fixes:
- switch 'en_US' to 'en', fixes the "admin panel switches to Arabic" bug
- tweak setting descriptions to clarify that most of the time we'll be using browser language
- add a backend switch to disable language detection (should this be exposed to ui?)
2010-03-03 12:10:43 -08:00
Craig Andrews
68347691b0 Don't attempt to retrieve the current user from the DB while processing a DB error 2010-03-01 21:53:54 -05:00
Craig Andrews
d8212977ce Use PHP exceptions for PEAR error handling.
Allows for the common try/catch construct, which makes error handling cleaner and easier.
2010-03-01 21:44:41 -05:00
Evan Prodromou
dc62246443 Add a robots.txt URL to the site root
Adds a robots.txt file to the site root. Defaults defined by
'robotstxt' section of config. New events StartRobotsTxt and
EndRobotsTxt to let plugins add information. Probably not
useful if path is not /, but won't hurt anything, either.
2010-01-31 10:12:26 -05:00
Evan Prodromou
63a0e84a8b lost config in index.php made all traffic go to master 2010-01-28 16:52:42 -05:00
Evan Prodromou
a33194effb Revert "Revert "move RW setup above user get in index.php so remember_me works""
This reverts commit be7bca2303.
2010-01-28 16:52:05 -05:00
Evan Prodromou
be7bca2303 Revert "move RW setup above user get in index.php so remember_me works"
This reverts commit fa78953337.
2010-01-28 16:50:28 -05:00
Evan Prodromou
fa78953337 move RW setup above user get in index.php so remember_me works 2010-01-28 16:35:38 -05:00
Evan Prodromou
74a03cbe1f always set up database_rw, regardless, so cached sessions work 2010-01-28 14:27:35 -05:00
Evan Prodromou
4d7cdbf1c6 don't write Inbox if on a read-only page, but encache 2010-01-13 16:28:42 -08:00
Evan Prodromou
46b11070fe add inbox to list of always-readwrite tables 2010-01-11 18:31:49 -08:00
Jeffery To
c17d7b671d Set returnto when redirected to login of a private install (for 0.9.x)
Can't use returnToArgs() because we don't have an action object yet.
2009-12-18 09:46:15 -05:00
Brion Vibber
3d6a55a49f Fix ticket 1816: Database errors recorded as "Array"
PEAR error backtrace lines are now correctly formatted as strings in debug log, roughly as debug_print_backtrace() does (but with argument values swapped out for types to avoid being overly verbose).

Todo: exceptions and PEAR error objects should log backtraces the same way; right now it doesn't look like exceptions get backtraces logged.

Todo: At one line per line, it's potentially tough to figure out what backtrace goes with what event if traffic is heavy; even if not heavy it's awkward to jump back into a log file after grepping to find the backtrace. Consider using a random per-event ID which can go in the log output -- bonus points for exposing the error ID to users so ops can track down actual error details in logs from a user report.
2009-11-17 09:07:44 -08: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