Commit graph

71 commits

Author SHA1 Message Date
friendica
a496036066 local_user => local_channel 2015-01-28 20:56:04 -08:00
Habeas Codice
0368fe49f3 Fix unescaped image data 2015-01-10 11:08:37 -08:00
Habeas Codice
db29dc6bff implicit type conversion 2014-11-21 15:33:21 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
habeascodice
c07643e407 Allows extra content to be inserted at end of profile_photo page. Needed for openclipatar addon. 2014-09-28 19:33:37 -07:00
sirius
6cf5a69d7e Now we also refresh permissions after the user posted connedit. 2014-04-20 00:58:26 +02:00
sirius
3845e1de7d Added permission handling of profile-photos
Now we automatically set the appropiate viewing-permissions on profile edit and revert photos chosen as default profile picture bacl to public access.
2014-04-20 00:31:18 +02:00
sirius
b0dc9f13ed Merging in conflict 2014-04-16 00:40:01 +02:00
sirius
8b8feea12f Added hackish support for permissions-sync between profile and profile-pictures 2014-04-14 00:45:24 +02:00
friendica
40e2900326 comanchify all the simple cases - those that only load a profile. Rework permission checks for the profile sidebar so that it is all done internally. Remove crepair which we aren't using. 2013-12-11 14:54:36 -08:00
friendica
7ae371d286 couple of errant SQL queries 2013-12-05 20:40:27 -08:00
friendica
38577cf26c issue #225 2013-12-05 18:17:16 -08:00
friendica
20b22421d3 big changes to photo->store() which is now photo->save() and takes an array instead of a list of args. Also the beginning of the migration to using photo_flags to indicate special purpose photos such as profile photos and contact photos and "thing" photos. 2013-08-07 01:42:45 -07:00
friendica
72e83f69bc photo driver abstraction 2013-04-25 20:01:24 -07:00
friendica
c42936e265 we don't need to quote or rename 'default' in mySQL if we just use the original column name 'is_default' 2013-02-15 17:23:02 -08:00
friendica
3ee75a795a Whinging whining stupid fucks. 2013-02-12 02:02:35 -08:00
friendica
32d07c3df7 fix profile selector on profile_photo page (unquoted mysql reserved word 'default') 2013-02-10 19:54:43 -08:00
friendica
2a6abaf9d5 partial cleanup of mod/profile_photo - needs a LOT more 2013-02-05 20:14:19 -08:00
friendica
cf2488e999 clean up the photo storage backend, revamp mod/wall_upload 2013-01-22 17:48:42 -08:00
friendica
f04ce3b093 more work on notification system, fix a couple of minor issues from smarty conversion 2013-01-07 13:40:58 -08:00
Zach Prezkuta
a0d19ffb72 implement Smarty3 2013-01-06 15:57:11 -07:00
friendica
e3c2e58979 "profile url" e.g. the wall/stream is now "channel url". "Profile URL" goes to the profile details. 2012-10-29 17:14:02 -07:00
friendica
ad3f04c1d4 restore profile_photo functionality after structural changes 2012-10-24 17:37:15 +11:00
friendica
846a9813b2 here's where the heavy lifting begins - everything is likely to be broken for quite some time as we add location and db independence to items and conversations and work through the rest of the permissions and how to federate the buggers. 2012-10-01 18:02:11 -07:00
friendica
fbafd92f7f moving a lot of structure around. 'entity' is now 'channel' 2012-09-25 17:57:20 -07:00
friendica
a08666be14 unbreak some more stuff 2012-09-04 19:49:29 -07:00
friendica
80bd128425 more DB cleanup 2012-08-30 18:47:07 -07:00
friendica
eac29badb2 start on contacts/profiles 2012-08-30 18:17:38 -07:00
friendica
8c3c3d5fd7 stuff 2012-08-27 01:22:08 -07:00
friendica
d683df17bd Removing connectors we won't be needing - this is probably going to break some shit. 2012-07-18 04:49:15 -07:00
friendica
a10e9d335a front end for alternate profile photos 2012-07-17 17:08:14 -07:00
friendica
073eb1b845 backend support for alternate profile photos for private profiles 2012-07-17 16:02:16 -07:00
friendica
94fabe3a29 upstream fixes and a lot of taxonomy stuff 2012-07-10 06:28:02 -07:00
Fabio Comuni
2438c6e45d png support: update database.sql, fix some typos, fix tinymce image browser 2012-06-07 20:17:31 +02:00
Fabio Comuni
7cc8c369cb Add support for PNG images with alpha 2012-06-07 17:42:13 +02:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
friendica
117d2165f5 form security error when using existing photo 2012-03-27 04:51:20 -07:00
Tobias Hößl
59766b944c Some security against XSRF-attacks 2012-03-12 20:17:37 +00:00
friendica
8aa2552372 add remove_user hook (it looks like dreamhost changed all my file permissions, this will make a nasty commit) 2012-01-18 16:21:30 -08:00
friendica
8a19c7c379 warn about photo caching when updating profile pic 2011-11-12 13:47:51 -08:00
Friendika
da416e0181 bug in diaspora_reshare 2011-10-20 05:43:33 -07:00
Friendika
8f1e2efd5b if photo is uploaded to "profile photos" album it could not be made into profile photo. 2011-09-15 03:06:43 -07:00
Fabio Comuni
e1107b55c6 add info() function. Works like notice() but show messages in a div with class info-message.
update code to use info() instead of notice() when appropriate (non-error message)
add info-message class style in themes
2011-05-23 11:39:57 +02:00
Friendika
b2e92e0af3 deprecate load_view_file 2011-05-11 04:37:13 -07:00
Friendika
c052d68828 don't use load_view_file() except in email templates and install of htconfig - to avoid getting wrong file when package is updated by copying over an older version. 2011-05-10 16:12:50 -07:00
Friendika
a0e7d8fa00 redirect to profile photo upload on very first login 2011-04-23 17:31:23 -07:00
Friendika
e35a5bac55 the rest of the english html templates except for htconfig 2011-04-07 23:10:43 -07:00
Friendika
f1db34eebc more templates gone 2011-03-29 17:19:12 -07:00
Friendika
9838245c6c Merge branch 'gettext' of https://github.com/fabrixxm/friendika into fabrixxm-gettext 2011-03-18 05:07:42 -07:00
Friendika
3f432a7b82 share,retweet,relay,forward, whatever 2011-03-16 19:36:59 -07:00