Commit graph

46 commits

Author SHA1 Message Date
redmatrix
ec00c5b18a the view_photos and post_photos permissions are redundant and are now mapped to view_storage and write_storage 2015-07-19 17:53:52 -07:00
redmatrix
70975dda4a remove all QR-code stuff from core - now in qrator addon 2015-06-25 19:05:49 -07:00
redmatrix
bc72d3fd26 move profile photos to new methods 2015-06-15 23:37:51 -07:00
redmatrix
23f7f60bf7 make new os_storage flag work 2015-06-14 15:59:11 -07:00
friendica
50943f439c issue #777, make photo cache time configurable, read the comments. 2014-12-27 18:19:51 -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
Jeroen
a17eae941b image/jpeg > image/png 2014-10-05 21:38:47 +00:00
root
874b8d40ff Changed some comments. 2014-05-10 11:22:00 -07:00
root
ed5cebd3d6 Made code changes to serve higher resolution images in displays with high pixel density. 2014-05-10 11:15:27 -07:00
friendica
8b93881ce7 qr code support 2014-01-07 20:36:16 -08:00
friendica
7c81889b33 make default profile photo configurable - should be functional but needs admin ui 2013-12-19 16:33:36 -08:00
friendica
75ebf06131 some work on modularising the default profile photo so we can make them site selectable. Also red != friendica so we don't need all these friendica logos taking up space 2013-12-09 14:05:52 -08:00
friendica
be7e732391 fix forbidden photos and vcard photo template 2013-11-12 19:25:23 -08:00
friendica
e9d899f737 log forbidden photos with complete URL and observer webbie (if available). 2013-07-21 19:56:57 -07:00
friendica
a2738389ed make forbidden sign less obnoxious and more theme-able 2013-07-21 19:37:58 -07:00
friendica
72e83f69bc photo driver abstraction 2013-04-25 20:01:24 -07:00
friendica
24cd0d98a7 this should fix xchan photo permissions 2013-01-31 16:39:50 -08:00
friendica
2f9a9ec8b1 enforce the new enhanced permissions (not just simple access controls) on photos - caveat: the default profile photo cannot be restricted. Any such restrictions will be ignored. 2013-01-30 19:52:07 -08:00
friendica
968b9ce1af more heavy lifting 2012-10-23 21:24:23 -07: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
5ff6e9348b a few minor changes 2012-08-26 23:05:00 -07:00
friendica
ba2452a076 png support for embedded private photos 2012-06-07 16:02:56 -07:00
Fabio Comuni
7cc8c369cb Add support for PNG images with alpha 2012-06-07 17:42:13 +02:00
friendica
7cfa7a7671 tell browser not to cache permission denied (private) photos so that after authenticating we don't have to fight the browser - plus more prvgroup work 2012-05-17 19:59:46 -07:00
Tobias Hößl
720c8324c7 Some Bugfixes, and variable checks 2012-04-17 11:33:50 +00:00
Michael Vogel
c88c2515e4 API: Improved the timeline. Several (disabled) tests with caching of photos. 2012-04-11 19:31:01 +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
ef33cfcc9a move friend suggestions to top of contact page, add default contact profile photos if missing 2012-03-20 16:05:32 -07:00
friendica
894278dbcc change default profile photo to something more interesting than a reddish brown square 2012-03-20 15:41:06 -07:00
Tobias Hößl
b102a1d5ec is not always defined; but if defined, then always of type integer 2012-02-26 20:43:23 +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
Friendika
f4c961b906 override pragma 2011-10-01 02:22:48 -07:00
Friendika
8fb2d02d3d typo last checkin 2011-09-30 18:00:32 -07:00
Friendika
0508ccf50f restore photo cache 2011-09-30 17:47:33 -07:00
Friendika
d45a66e700 allow custom avatar sizes - needed for Diaspora hcard/vcard 2011-08-03 21:05:39 -07:00
Friendika
53653f6a4d consolidate perrmisions sql, minor duepuntozero validation fixes 2011-06-30 17:35:35 -07:00
Friendika
cb6c1f91b7 rolling version number in preparation for release 2011-05-09 16:51:25 -07:00
Friendika
2270e73fcd show permission denied photo when direct link was accessed and authentication is insufficient to view 2011-03-09 21:29:32 -08:00
Friendika
d825db3649 lint 2010-11-07 15:46:49 -08:00
Friendika
b94cb8d234 add micro profile photo 2010-11-04 23:50:32 -07:00
Mike Macgirvin
f0b6400584 more lint 2010-10-31 16:38:22 -07:00
Mike Macgirvin
06bdf8a4cf atom auto-discover, fix image preloading in ajax 2010-08-10 16:54:36 -07:00
Mike Macgirvin
04e65823d7 more post branch bug fixes 2010-08-10 05:58:22 -07:00
Mike Macgirvin
d090033a0a more photo progress 2010-08-04 20:03:38 -07:00
Mike Macgirvin
c3fd5ed732 one true profile photo, force nicknames 2010-07-19 19:09:58 -07:00
Mike Macgirvin
6348e70daa Initial checkin 2010-07-01 16:48:07 -07:00