Commit graph

27 commits

Author SHA1 Message Date
Habeas Codice
dbb3cda9a6 missed one 2015-04-07 05:45:24 -07:00
Habeas Codice
1162af4c0d "PHP Strict Standards: Only variables should be passed by reference" 2015-04-07 05:42:47 -07:00
friendica
505e5e90b2 fix os_mkdir 2015-03-29 16:05:08 -07:00
Klaus
2b45bf1908 RedDAV: fix renaming files.
How can no one have spot this bug yet?!? Is no one using WebDAV?
Took me 2 days to figure out it was not my RedDAV rewrite, but that this should have never worked. :-!
2015-03-06 00:21:32 +01:00
friendica
a496036066 local_user => local_channel 2015-01-28 20:56:04 -08:00
marijus
f455036905 show shared button only to local user 2015-01-28 09:49:36 +01:00
marijus
65aa6cf708 move userReadableSize() and getIconFromType() from /include/RedDAV/RedBrowser.php to include/text.php and add template for mod/sharedwithme 2015-01-27 19:00:16 +01:00
marijus
d94114ec98 add some mimetypes 2015-01-22 12:12:42 +01:00
friendica
21da3443f3 Merge https://github.com/friendica/red into pending_merge 2015-01-18 19:25:10 -08:00
friendica
4c45068d70 typo 2015-01-18 19:24:59 -08:00
Habeas Codice
aeed498752 fix postgres escaping 2015-01-18 18:40:33 -08:00
friendica
89a2012f7f remove all hardwired references to 'cloud' in the files interfaces and replace with $a->module. It's OK to leave them in the RedBrowser component because this will remain under /cloud. All the DAV bits need to be abstracted as they will eventually end up under /dav. $a->module will contain the correct string to use. 2015-01-18 17:52:09 -08:00
marijus
1c2d956d7f basic proof of concept file activity support - will send activity via the filestorage module and via attach_delete() 2015-01-18 14:44:58 +01:00
friendica
2fc0d64139 uninitialised theme parent in mod/cloud 2015-01-12 19:29:43 -08:00
friendica
1b3e52af2d theme toggle issue when viewing mod/cloud of another channel 2015-01-12 18:33:39 -08:00
marijus
4edc9a696b design fixes for photos, files and random fixes 2014-12-30 21:04:48 +01:00
marijus
cafc1b64b0 some more mime-type -> icon for filebrowser 2014-12-27 14:28:02 +01:00
marijus
0cb0c2b1bf more work on files 2014-12-27 10:10:56 +01:00
marijus
27d786c979 files: make mod/filestorage.php load via ajax and some design work. work in progress... 2014-12-21 20:11:30 +01:00
Klaus Weidenbach
233903c844 Add security logger to RedDAV.
Some smaller clean ups whitepsaces and tabs, use PHP_EOL, Doxygen, etc.
2014-12-14 01:50:56 +01: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
friendica
cb15c73dae move all theme initialisation to one place - just after calling module_init. Revert if there are serious issues, but please note the issues in as much detail as possible so we can work through them. 2014-10-20 16:47:58 -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
friendica
6d0fbba7b4 change parent constructor per discussion 2014-10-08 17:12:10 -07:00
friendica
ddcc0ad567 dav issue 2014-10-08 16:47:30 -07: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