Commit graph

79 commits

Author SHA1 Message Date
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
friendica
902b5c52e5 backtrack on attribution for wall-to-wall comments - triggered too often and unnecessarily. 2014-10-22 18:14:21 -07:00
Klaus Weidenbach
bc2ad74813 When you delete something in /cloud stay in the right folder.
When you deleted a file in /cloud you was always jumped back to /cloud/[channel],
now you will stay in the parent folder.
Some more doxygen documentation.
Removed duplicate data from logging output and reduced logging in RedDAV in general.
2014-10-14 00:15:41 +02:00
Klaus Weidenbach
dc4593f5b5 Moved classes from reddav.php into own files.
Finished moving classes out from include/reddav.php into own files. Also
continued with namespace for RedDAV.
Improved some docs and added some todos and fixmes.
2014-10-12 00:33:37 +02:00
Klaus Weidenbach
33394f58ff Moved RedBrowser class from reddav.php to it's own file.
First step on cleaning up ReadDAV classes and restructuring it bit in
preparation for adding some more DAV features, photo access, CalDAV, etc.
and hopefully also some PHPunits.
Add a PHP5.3 namespace for RedDAV classes. Any objections against this or
the vendor namespace?
Add some more documentation for RedBrowser.
2014-10-06 23:38:33 +02:00
Klaus Weidenbach
305498eb16 Some documentation for include/reddav.php and a bit code cleanup.
Removed some duplicate code in RedBasicAuth and restructured a bit.
Still work in progress.
2014-10-05 15:24:16 +02:00
friendica
c7086b77fd move code out of templates - not sure how this even worked. 2014-07-03 00:58:49 -07:00
Klaus Weidenbach
ffea675240 Add rename support for DAV directories.
This works only over DAV right now, no GUI yet.
2014-06-30 01:08:29 +02:00
Klaus Weidenbach
aacb293f2e Return a correct timestamp when a folder is empty.
If a folder was empty a zero timestamp was returned. Now it will
return the timestamp of the folder itself.
2014-06-29 21:15:37 +02:00
Klaus Weidenbach
322091cd12 Fixed some more timestamp bugs in RedDAV.
Fixed an SQL-query in RedFile::put(), where parameters where in wrong order.
2014-06-29 17:49:46 +02:00
Klaus Weidenbach
5be3ba8436 Fixed a wrong timestamp update when adding a file.
When a file was uploaded the timestamp of the containing folder
should get updated, but the timestamp of the first file in the
folder was mistakenly updated.
There are some more wrong timestamps, but still looking for the bug.
2014-06-29 16:00:21 +02:00
Klaus Weidenbach
f49b74c5f6 Some documentation for include/reddav.php and a new tpl-file.
Documented include/reddav.php a bit more to understand what it is
about to try to clean up some parts. Still a lot to be done here.
I put serveral @todo markers that need to be checked.

Moved some more HTML to template file.

Changed getETag() return format according to documentation. (ETag MUST
be surrounded by double-quotes)
2014-06-29 01:17:06 +02:00
friendica
74fe151f96 bring back profile_tabs for unauthenticated visitors to /cloud page 2014-06-25 21:21:54 -07:00
Klaus Weidenbach
45dde16f3e Templified cloud's directory listing.
Moved HTML for the directory listing from include/reddav.php to it's
own template file.
Still need to clean it up bit more, but should be useable already.
2014-06-26 02:01:53 +02:00
Paolo Tacconi
dda949ee3b Delete confirmation is translatable 2014-06-25 12:07:36 +02:00
Paolo Tacconi
378aaf4a61 Display quota and translatable strings 2014-06-25 11:54:10 +02:00
tuscanhobbit
cc4001fce7 Fixes to links and forward URLs in filestorage 2014-06-24 12:05:11 +02:00
friendica
177c33be10 block edit/delete ability for everybody but the owner 2014-06-23 16:05:00 -07:00
tuscanhobbit
f6959dd18b Dav file browser on a single page 2014-06-24 00:04:13 +02:00
friendica
b17f923abb give the cloud file list a bit of padding 2014-05-27 16:49:47 -07:00
jeroenpraat
d93df86298 Fixed some wrapping problems when the user has set a larger font size. And some UI love for the file permissions page (as requested by Mike ;) and changed the position of the file properties link on the cloud page. 2014-05-05 13:54:56 +00:00
friendica
95751dddff some fixes to #395 2014-04-07 20:20:28 -07:00
friendica
64dfe3ab64 issue #395, item 2 2014-04-06 03:47:53 -07:00
friendica
8c177fbc4b cleanup 2014-03-18 16:50:46 -07:00
Thomas Willingham
c8fb979ed8 oops 2014-03-18 02:43:36 +00:00
Thomas Willingham
1446cc8096 Missed one 2014-03-18 02:41:58 +00:00
friendica
aa07edbdd1 sprintf error 2014-03-17 18:44:01 -07:00
friendica
ecb2e52a74 little fixes of hopefully nil significance 2014-03-16 20:34:21 -07:00
friendica
075b7fa9c8 This should resolve the dav authentication loop (correctly) 2014-02-22 13:33:18 -08:00
Klaus
01f31c2f20 Make asset icons work in subdir installs as well.
This should be the right way I guess, especially if red# is installed in a subdirectory. (untested)
2014-02-15 22:25:14 +01:00
Klaus
53d6d4c655 Fix call to asset icons in RedBrowser.
RedBrowser was not displaying asset icons correctly, because the URL was wrong.
2014-02-15 21:48:40 +01:00
friendica
213c03c606 more debugging dav in windows, windows never forgets your dav credentials even if you get them wrong and even if you remove them from the credential vault. This makes it very difficult to manage two or more channels with file resources. 2014-02-13 03:52:16 -08:00
friendica
5cedc324eb reddav - disable assets 2014-02-13 03:06:48 -08:00
friendica
13a3dcf47f dav issue when listing protected contents from OS interface 2014-02-12 00:04:35 -08:00
friendica
8089c3202b better auth logging in dav 2014-02-11 21:20:34 -08:00
friendica
b92f00587b don't allow the browser to open uploaded html/css/js 2014-02-09 14:56:52 -08:00
friendica
0fae8acdef fix basic auth with account (not channel) login 2014-01-30 14:36:56 -08:00
friendica
677f5f641e more testing of chatroom interfaces, also corrected a function call that should have been a class instantiation in reddav 2014-01-29 16:02:02 -08:00
friendica
a13393fb23 seems you can't easily have a blank password for DAV guests, so the guest password is now +++ 2014-01-21 20:42:10 -08:00
friendica
0dbbe007e8 add the quota and volume size code 2014-01-21 15:38:02 -08:00
friendica
0250223438 revert 26dfcecf05 2014-01-19 22:34:28 -08:00
Thomas Willingham
26dfcecf05 Prevent zids messing up dav 2014-01-20 06:28:38 +00:00
Thomas Willingham
9fb36df8d9 Fix dav directory creation. 2014-01-20 01:54:52 +00:00
Thomas Willingham
1a76f1c659 Un-break dav auth. 2014-01-17 20:52:57 +00:00
friendica
e4217dc141 fix folder timestamps and change them when a child DAV file is written to 2014-01-15 04:02:15 -08:00
friendica
47b8071ca7 dav: throw exception if channel for requested DAV directory is deleted 2014-01-15 03:12:47 -08:00
friendica
cff7056f8f mod_attach: output stream wasn't working 2014-01-11 12:58:00 -08:00
friendica
f125be846c DAV put() issues 2014-01-10 19:18:30 -08:00
friendica
0ce3e7235a other reddav issues, but probably won't fix the empty file 2014-01-10 13:47:56 -08:00
friendica
ffa86dfea8 this may fix filesize 0 issues 2014-01-10 13:10:50 -08:00