Commit Graph

3247 Commits

Author SHA1 Message Date
Mikael Nordfeldth
c5bf6cb05e Using a bit more of $this->scoped (Action parent class)
$this->scoped is the currently active profile, which is intended
to replace the $user object in the long run...
2013-09-09 20:45:20 +02:00
Mikael Nordfeldth
b2a0aa20bf NewapplicationAction converted to FormAction
Cutting down on a bunch of redundant code. We're reusing a lot of stuff
from FormAction and Action now instead of having copies of code all over.
2013-09-02 12:13:46 +02:00
Mikael Nordfeldth
f0e967fefd needLogin renamed checkLogin and made a property
Action extended classes now can set 'needLogin' as a protected property,
which is defaulted to 'false'. However, FormAction defaults this to 'true'
because most of the form actions will require a current login to be valid.

NewgroupAction, NewmessageAction, NewnoticeAction are all affected by this
commit and in the future we will migrate each potential formaction to the
proper class parent tree. :)
2013-09-02 11:58:47 +02:00
Mikael Nordfeldth
e5e3aeb4e6 newmessage (and Message class) fixed for FormAction
Also added a needLogin function to the Action class, which will do
redirect to login page with proper returnto setting.
2013-09-02 11:05:30 +02:00
Mikael Nordfeldth
89b10666bb IMPORTANT: parent::handlePost() in NewnoticeAction
otherwise we don't do csrf checking etc...
2013-09-02 11:05:21 +02:00
Mikael Nordfeldth
0612e5ec87 NewnoticeAction converted to extend FormAction
There are still several improvements which can be made, such as not
having an entirely separate setup of ajax form functions. Instead
those should be implemented in FormAction. But at least now we got
rid of the redundant code use in prepare/handle.
2013-09-01 20:56:35 +02:00
Mikael Nordfeldth
83000f6f5e Proper definition of $args array in NewgroupAction->prepare
Also, there is no need to do 'return' after throwing a ClientError
Exception. And we'll use the Action->clientError for logging benefits
until the error handling is properly done all the way to backend.
2013-09-01 19:44:09 +02:00
Mikael Nordfeldth
cfa699e445 NewgroupAction converted to extend FormAction
Had to change Action function 'prepare' to 'protected', as you can't
(of course) protect something that's been public in a parent class. The
other way around seems fine for PHP... Eventually all actions will have
protected 'prepare' (use execute/run)

A feature of the previously fixed initialization of Action classes, is
that we now have $this->scoped which is the current profile in use. As
of now that is always a local User, except the corresponding Profile
object.

Also, instead of calling 'showForm' everywhere, in case of an error we
just throw an exception of some sort and pass the message along there.

I've also introduced in FormAction the 'showInstructions' function in
order to get a unified instructions/info/error display method.

TODO: Improve info/error message handling, and what/when/where to show.
2013-08-31 18:01:13 +02:00
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Mikael Nordfeldth
ea837cea67 added missing return statement after showForm call
Issue #3125 at http://status.net/open-source/issues/3125 (and its duplicate 3127) describe buggy behaviour when trying to create a new group - i.e. the group is still created but with nickname NULL.

The reason the group is created is that when failing Nickname::normalize, the function trySave() in actions/newgroup.php doesn't call 'return' - meaning it just keeps going despite the error thrown. It a

So the simple solution to this bug was adding a return call at line 128, inside the catch just after the showForm(...) call.
2013-08-12 12:44:19 +02:00
Mikael Nordfeldth
3ad3535cd8 Merge commit 'refs/merge-requests/230' of git://gitorious.org/statusnet/mainline into merge-requests/230 2013-08-12 12:37:46 +02:00
Jean Baptiste Favre
c23efdbdb0 PHP 5.4 compatibility: remove call-time pass by reference 2013-06-19 11:16:05 +02:00
Jean Baptiste Favre
fcdd4d2cf0 Fix introduced bug, trying to shorten an empty status. 2013-06-15 19:07:43 +02:00
Jean Baptiste Favre
58a2630933 Code cleaning. Do call shortenLinks only once, right before saving new notice. 2013-06-15 19:07:43 +02:00
Jean Baptiste Favre
344a10be8b Code cleaning, remove 'TEST' tags. 2013-06-15 19:07:43 +02:00
Jean Baptiste Favre
ec072e0af7 Notice update with media attachment may fail through API when status text + attachment length get higher than max notice length. Calling URL shortener can make global length less than maxlength, though allowing notice update. 2013-06-15 19:07:43 +02:00
Jean Baptiste Favre
6d47fadf42 Fix introduced bug, trying to shorten an empty status. 2013-06-15 19:04:32 +02:00
Jean Baptiste Favre
54374365e9 Code cleaning. Do call shortenLinks only once, right before saving new notice. 2013-06-15 19:04:31 +02:00
Jean Baptiste Favre
f803b22752 Code cleaning, remove 'TEST' tags. 2013-06-15 19:04:31 +02:00
Jean Baptiste Favre
6387e0a90d Notice update with media attachment may fail through API when status text + attachment length get higher than max notice length. Calling URL shortener can make global length less than maxlength, though allowing notice update. 2013-06-15 19:04:31 +02:00
Jean Baptiste Favre
180cc39c4a Fix for #3649 issue. 2013-06-15 17:01:10 +02:00
Jean Baptiste Favre
b23a744fba Fix for #3649 issue. 2013-06-15 16:58:50 +02:00
Jean Baptiste Favre
359f3ca113 Fix for #3651: oAuth apps list does only show the latest registered application 2013-06-15 14:19:15 +02:00
Jean Baptiste Favre
4284f28dec Fix for #3651: oAuth apps list does only show the latest registered application 2013-06-15 14:09:46 +02:00
Evan Prodromou
6aaee4e5fe $this->q => $q 2012-11-11 22:55:22 -05:00
Evan Prodromou
edf2879021 Divert tag and url searches 2012-11-11 21:27:11 -05:00
Evan Prodromou
64288a62f8 Adding a search notice stream object 2012-11-11 21:05:13 -05:00
Evan Prodromou
c809dd24c5 Don't show big invite button if invites are disabled 2012-10-17 10:10:42 -04:00
Evan Prodromou
86e3cbbcce Don't show big invite button if invites are disabled 2012-10-17 10:09:40 -04:00
Evan Prodromou
46f6b2c119 Don't call free on the results of a member query 2012-07-04 14:45:50 -04:00
Evan Prodromou
ae84e8f524 Use the current logged-in use for home timeline 2012-07-03 12:22:59 -04:00
Evan Prodromou
b4da5f3785 Merge branch 'master' into 1.0.x
Conflicts:
	plugins/Blacklist/BlacklistPlugin.php
2012-03-08 06:08:11 -06:00
Siebrand Mazeland
de7ad991f9 Consistency update. 2012-03-05 00:38:39 +01:00
Evan Prodromou
23bafaba26 add canonical rel 2012-01-26 11:02:29 -05:00
Evan Prodromou
25f1e16952 Revert "don't show profile page of silenced users"
This reverts commit 7bb59ad2a1.
2011-12-31 09:34:59 -08:00
Evan Prodromou
7bb59ad2a1 don't show profile page of silenced users 2011-12-31 09:09:07 -08:00
Evan Prodromou
c9fbe2ead7 remove common_debug() from search.json, search.atom 2011-12-30 22:23:50 -08:00
Evan Prodromou
eb05bdfcaf remove debug message I'm sick of seeing 2011-12-30 22:16:22 -08:00
Michele macno Azzolari
ad2fd9abd4 Fix whitescreen on recoverpassword with unknown user 2011-12-02 15:48:29 -05:00
Siebrand Mazeland
c2db2483a0 Remove trailing whitespace in UI text. 2011-10-29 14:34:50 +02:00
Evan Prodromou
b8079549ce Include the current profile in popular notice section for all 2011-10-20 10:54:33 -04:00
Evan Prodromou
22fead1b46 Squashed commit of the following:
commit fb1dfa9e98ded23fb5bdebae6465424a8cb8acd6
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:40:07 2011 -0400

    Use popular notice stream for favorited page

commit e1d409ff738e39061ad35589d546ce9bed456975
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:32:23 2011 -0400

    Use a caching stream for popular notice section

    Instead of a big cached query, we now use a caching notice stream for
    the popular notice section. It uses a single-table query at the
    bottom, then scopes the notices and filters for silenced users. This
    should be much nicer to our database servers.

    Also clears the popular cache when someone favors or disfavors
    something. A nice optimization would be to save the last weights and
    re-calculate them at invalidation time, adding the new notice (or not)
    depending on its own score. That will have to wait for another day,
    though.

commit e9b7ab4c26c95e755adaff53c3957dcfca31c16b
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:31:14 2011 -0400

    Let CachingNoticeStream users skip the ';last' optimization
2011-10-20 10:40:39 -04:00
Siebrand Mazeland
7602f605d5 Remove unneeded trailing space. 2011-10-10 15:06:39 +02:00
Siebrand Mazeland
436068dc0d Use getBestName() instead of nickname per FIXMEs.
Update translator documentation.
2011-10-10 15:05:43 +02:00
Evan Prodromou
c85abebc36 Remove missing twittersettings page from subscriptions helper 2011-10-03 09:13:54 -04:00
Evan Prodromou
82badb19c7 Move docs menu to site primary menu 2011-09-30 14:24:27 -04:00
Evan Prodromou
636455ad82 Fix conflict between URL parameter and POST parameter with groups
Group edit page is at /group/:nickname/edit. There's also a form
parameter named 'nickname'. The two were conflicting.

I changed the form parameter to 'newnickname' and it works.

I'm not sure how this ever worked before, though.
2011-09-30 11:48:00 -04:00
Evan Prodromou
cd6e0a920f slightly better usergroups pagination 2011-09-30 11:38:54 -04:00
Evan Prodromou
9ba736c032 Add a dummy 'top' action to take you to the main page of the site 2011-09-30 09:45:17 -04:00
Evan Prodromou
32845a1051 Make lists work in single-user mode
Added routes to the router for list pages in single-user mode.

For each of the actions in those routes, use the global single-user
nickname rather than a nickname URL argument to determine the tagger ID.

In nav, and for Ajax, provide the right nicknames.
2011-09-29 12:29:12 -04:00