Commit Graph

4953 Commits

Author SHA1 Message Date
Mikael Nordfeldth
99312c8cc2 Declaring some more static functions properly
As a bonus I added type declaration on Profile_block::exists and
Subscription::exists respectively.
2013-09-09 23:28:20 +02:00
Mikael Nordfeldth
a9c4bcd71f Removing unnecessary require_once lines (autoload!) 2013-09-09 23:06:56 +02:00
Mikael Nordfeldth
747fe9d59b Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
2013-09-09 23:03:34 +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
c735a8363e Conforming to code layout 2013-09-01 20:52:11 +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
8d57fb7dc0 Added a FormAction extension
FormAction will act as a parent class to Action classes that use forms
of various sorts, such as newgroup creation, settings actions etc.
2013-08-30 10:28:57 +02:00
Mikael Nordfeldth
13226c5d92 handle no longer uses $argarray or $args 2013-08-30 00:22:22 +02:00
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
Mikael Nordfeldth
fac7371179 pivotGet moved into Managed_DataObject 2013-08-29 10:13:07 +02:00
Mikael Nordfeldth
de55d8f83b plugins onAutoload now only overloads if necessary (extlibs etc.)
lib/plugin.php now has a parent onAutoload function that finds most common
files that are used in plugins (actions, dataobjects, forms, libs etc.) if
they are put in the standardised directories ('actions', 'classes', 'forms',
'lib' and perhaps some others in the future).
2013-08-28 16:10:30 +02:00
Mikael Nordfeldth
3a7261f70a IMPORTANT: Making prev. Memcached_DataObject working again with schemaDef
Lots of the Memcached_DataObject classes stopped working when upgraded to
Managed_DataObject because they lacked schemaDef().

I have _hopefully_ made it so that all the references to the table uses
each class' schemaDef, rather than the more manual ColumnDef stuff. Not
all plugins have been tested thoroughly yet.

NOTE: This is applied with getKV calls instead of staticGet, as it was
important for PHP Strict Standards compliance to avoid calling the non-
static functions statically. (unfortunately DB and DB_DataObject still do
this within themselves...)
2013-08-21 09:48:42 +02:00
Mikael Nordfeldth
e40044e2fa Further static declarations of functions
Validate could probably be replaced with filter_var if desired (PHP>=5.2.0)
2013-08-19 14:26:44 +02:00
Mikael Nordfeldth
97ce71e55d Managed_DataObject now has listGet for all classes 2013-08-18 21:02:33 +02:00
Mikael Nordfeldth
923f16abe5 Properly definingStatusNet class static functions with 'static' 2013-08-18 20:37:33 +02:00
Mikael Nordfeldth
761a849a34 Added shared default plugin list between profiles 2013-08-18 20:29:16 +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
794163c31f Default to NOT ask for current location for new users
It may be a bad experience for new users to immediately when trying
out the service be asked for their geographical position. Instead,
let them opt-in for this behaviour.
2013-08-12 14:40:55 +02:00
Mikael Nordfeldth
38ac5a7005 Automatic memcache support enabler for config 2013-08-12 13:14:50 +02:00
Mikael Nordfeldth
20bad68845 Added SSL option to web and cli installers 2013-08-12 13:08:14 +02:00
Mikael Nordfeldth
d6cf6e88cd letting the noticeform at the top show, to fix broken reply button javascript 2013-08-12 13:00:05 +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
Mikael Nordfeldth
f79aec36fe Merge remote-tracking branch 'statusnet/master'
This merges GNU Social with current development of StatusNet. The only conflicts were some documentation, where GNU Social's versions were retained.

Conflicts:
	doc-src/about
	doc-src/faq
	plugins/OpenID/doc-src/openid
2013-08-12 12:23:17 +02:00
Evan Prodromou
971636fb9b Upgrade version number 2013-07-16 11:23:47 -07:00
Evan Prodromou
3fc1d245a1 Merge 1.1.x into master 2013-07-16 10:57:06 -07:00
Evan Prodromou
540b90dbd9 Better verb comparison 2013-06-30 12:08:11 -04:00
Evan Prodromou
66f4a39105 Squashed commit of the following:
commit bd23a7da105d635414643dfcedd9c8f710d565b8
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 07:49:03 2013 -0400

    Make the after flag work correctly

commit 5c5845a2f866f0bbffedd8e2e5d1f512f87d5329
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 06:14:43 2013 -0400

    Add an 'after' flag for backup script
2013-06-29 07:52:09 -04:00
Evan Prodromou
4092ee1bd1 Squashed commit of the following:
commit bd23a7da105d635414643dfcedd9c8f710d565b8
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 07:49:03 2013 -0400

    Make the after flag work correctly

commit 5c5845a2f866f0bbffedd8e2e5d1f512f87d5329
Author: Evan Prodromou <evan@e14n.com>
Date:   Sat Jun 29 06:14:43 2013 -0400

    Add an 'after' flag for backup script
2013-06-29 07:49:43 -04:00
Evan Prodromou
660b8f0c9c Merge branch '1.1.x' of gitorious.org:statusnet/mainline into 1.1.x 2013-06-25 22:27:23 -04:00
Evan Prodromou
37bbb96e1b Better output for shares 2013-06-25 22:27:02 -04:00
Evan Prodromou
557105b86d Better output for shares 2013-06-25 22:26:27 -04:00
Jean Baptiste Favre
723f0f1929 PHP 5.4: Fix 'mysql has gone away' error when using mysqli driver with forked daemons (at least TwitterBridge) 2013-06-20 11:07:51 +02:00
Evan Prodromou
35ff643230 Turn off Activity by default 2013-06-16 02:16:40 +00:00
Jean Baptiste Favre
368906258a You need an API key when using embed.ly. Unfortunatly oembedhelper.php does not support it. This commit aims to fix it. 2013-06-15 18:35:41 +02:00
Evan Prodromou
14fbd68a12 Cast lat/lon to float; check for non-empty 2013-06-08 21:16:58 -04:00
Evan Prodromou
8853821db2 Bad variable in ActivityObject::fromMessage() 2013-06-08 21:07:56 -04:00
Evan Prodromou
f8393d10b7 Bad variable in ActivityObject::fromMessage() 2013-06-08 21:05:09 -04:00
Evan Prodromou
0a0aeed413 Use the link property for the URL, not the ID 2013-06-08 19:19:16 -04:00
Evan Prodromou
ce451c0018 Use the link property for the URL, not the ID 2013-06-08 19:18:28 -04:00
Evan Prodromou
0fb6819200 Add direct messages to backup 2013-06-08 17:54:35 -04:00
Evan Prodromou
96d7b68c50 Store direct messages as an activity 2013-06-08 17:54:27 -04:00
Evan Prodromou
393130d80f Add direct messages to backup 2013-06-08 17:53:47 -04:00
Evan Prodromou
9fd2c3e1c9 Store direct messages as an activity 2013-06-08 17:45:49 -04:00
Evan Prodromou
caf5f0b3bd Some more well-known sources from plugins 2013-06-07 11:49:47 -04:00
Evan Prodromou
ec04acb9b4 Some more well-known sources from plugins 2013-06-07 11:49:34 -04:00
Evan Prodromou
08eca420ca Add generator to JSON output 2013-06-07 11:35:06 -04:00
Evan Prodromou
fe2c0a9687 Add generator to JSON output 2013-06-07 11:34:54 -04:00
Evan Prodromou
25823f6e5b Some better context for notices as arrays 2013-06-07 03:11:33 -04:00
Evan Prodromou
6164940e8c Some better context for notices as arrays 2013-06-07 03:11:23 -04:00
Evan Prodromou
9bb5d8c695 Coerce width, height of media link to integer 2013-06-07 00:30:19 -04:00
Evan Prodromou
9a3c3c5cf8 Coerce width, height of media link to integer 2013-06-07 00:30:04 -04:00
Evan Prodromou
221c724b4c Fix the switch on type 2013-06-05 16:58:54 -04:00
Evan Prodromou
77f23354ad Fix the switch on type 2013-06-05 16:58:31 -04:00
Evan Prodromou
0e83c5c824 Better type check, better URL 2013-06-05 16:51:46 -04:00
Evan Prodromou
a6bb41a742 Better type check, better URL 2013-06-05 16:51:35 -04:00
Evan Prodromou
dbceb7ba1a Better URL creation for attachments 2013-06-05 16:14:07 -04:00
Evan Prodromou
7366ee73f5 Better handling of null values in ActivityObject::mimeTypeToObjectType 2013-06-05 16:14:02 -04:00
Evan Prodromou
a9b2a86004 Better URL creation for attachments 2013-06-05 16:12:54 -04:00
Evan Prodromou
5ba2cb07ea Better handling of null values in ActivityObject::mimeTypeToObjectType 2013-06-05 16:11:51 -04:00
Evan Prodromou
7229533b0f Use real attachments for JSON output 2013-06-05 09:39:43 -04:00
Evan Prodromou
772383e84b Use real attachments for JSON output 2013-06-05 09:39:13 -04:00
Evan Prodromou
460d80d09e Don't set the title of a notice to its plain-text content. 2013-06-04 22:28:45 -04:00
Evan Prodromou
74ec87c27c Don't set the title of a notice to its plain-text content. 2013-06-04 22:27:29 -04:00
Evan Prodromou
15d466ebe6 Don't add content as title for notes 2013-06-04 19:53:07 -04:00
Evan Prodromou
736bc9cc96 Don't add content as title for notes 2013-06-04 19:52:38 -04:00
Evan Prodromou
fa6138195b Change geopoint to location 2013-06-04 17:23:09 -04:00
Evan Prodromou
759754555d Change geopoint to location 2013-06-04 17:22:51 -04:00
Evan Prodromou
a2dd5dfef3 Remove duplicate of extensions 2013-06-04 17:16:34 -04:00
Evan Prodromou
b2849c4bb3 Remove duplicate of extensions 2013-06-04 17:15:43 -04:00
Evan Prodromou
46f43052f9 Use status_net, portablecontacts_net namespaces 2013-06-04 17:12:54 -04:00
Evan Prodromou
f66fedaac8 Use status_net, portablecontacts_net namespaces 2013-06-04 17:12:28 -04:00
Evan Prodromou
cba2b1ad9c Slightly better ActivityStreams JSON output 2013-06-04 17:01:05 -04:00
Evan Prodromou
879a6f9ce7 Slightly better ActivityStreams JSON output 2013-06-04 17:00:51 -04:00
Evan Prodromou
795a4a02ba Add the service type for activity objects 2013-06-04 16:31:03 -04:00
Evan Prodromou
64bf691c9c Add the service type for activity objects 2013-06-04 16:29:47 -04:00
Evan Prodromou
2ad5aece55 Better handling of multiple objects 2013-06-04 15:21:59 -04:00
Evan Prodromou
a23290883b Better handling of multiple objects 2013-06-04 15:20:21 -04:00
Evan Prodromou
8e3bd04d98 Only a single object in activitystrea.ms JSON output 2013-06-03 09:11:43 -04:00
Evan Prodromou
11a14a87ba Only a single object in activitystrea.ms JSON output 2013-06-03 09:10:56 -04:00
Evan Prodromou
7ad5ed1db9 Merge branch 'master' of gitorious.org:statusnet/mainline 2013-06-02 15:24:57 -04:00
Evan Prodromou
49d265faa0 Add a registration activity to the end of every backup 2013-06-02 14:41:41 -04:00
Evan Prodromou
cbb5586ab7 Add a registration activity to the end of every backup 2013-06-02 14:38:00 -04:00
Evan Prodromou
1662ccccce Close the collection object 2013-05-29 17:05:09 -04:00
Evan Prodromou
2a3abf8850 Close the collection object 2013-05-29 17:03:08 -04:00
Evan Prodromou
a9f4575d31 Correctly output commas for JSON backups 2013-05-29 16:46:39 -04:00
Evan Prodromou
2f5cdbb9c1 Correctly output commas for JSON backups 2013-05-29 16:45:52 -04:00
Evan Prodromou
1c1bcd7cc6 Add JSON output for backups
Conflicts:
	lib/useractivitystream.php
2013-05-24 13:51:57 -04:00
Evan Prodromou
4f818c5c81 Add JSON output for backups 2013-05-24 13:50:24 -04:00
Evan Prodromou
bf18684509 More aggressively avoid OOM errors in useractivitystream 2013-05-24 09:19:17 -04:00
Evan Prodromou
d7880c17ec Don't abort if an activity throws an exception when backing up 2013-05-23 15:02:43 -04:00
Evan Prodromou
fc7d74050f Make optional arguments for getNoticeIds explicit 2013-04-30 09:56:30 -04:00
Evan Prodromou
9d42137024 Make optional arguments for getNoticeIds explicit 2013-04-30 09:56:14 -04:00
Evan Prodromou
d06965603d Still bad 2012-11-11 21:36:42 -05:00
Evan Prodromou
e2680b1f13 Bad caching parameter 2012-11-11 21:34:40 -05:00
Mikael Nordfeldth
9361c07bb3 mrb reported 417 Expectation failed errors due to now commented line 2012-10-27 06:24:26 -07:00
Mikael Nordfeldth
9d73f6444a mrb reported 417 Expectation failed errors due to now commented line 2012-10-27 10:40:31 +02:00
Evan Prodromou
ba7e73ee97 Merge branch '1.1.x' 2012-09-07 10:29:55 -04:00
Evan Prodromou
f21881d5fa Don't send @-reply notification if the mentioned person has blocked the sender 2012-09-07 10:27:14 -04:00
Evan Prodromou
9b97adc7ad Squashed commit of the following:
commit 2b9bce9ef8f6cf55b7ac62231bcc0173260ba472
Merge: 3ba4f24 12b680e
Author: Evan Prodromou <evan@status.net>
Date:   Mon Aug 13 14:31:46 2012 -0400

    Merge commit 'refs/merge-requests/207' of git://gitorious.org/statusnet/mainline into merge-requests/207

commit 12b680e375db9de01cac77dd9a71adb729292dc7
Author: Mikael Nordfeldth <mmn@hethane.se>
Date:   Fri Aug 10 20:49:52 2012 +0200

    testing whether $user is predefined before otherwise setting it to common_current_user()
2012-08-13 14:34:31 -04:00