Commit Graph

58 Commits

Author SHA1 Message Date
Stefan Parviainen 85e76773a0 Use grouped select field for role selection 2015-01-01 15:54:16 +01:00
friendica ca0c310b65 change PERMS_CONTACTS to PERMS_SPECIFIC in permission roles so that individual connections can be revoked instead of this being inherited and un-changeable 2014-12-26 00:09:34 -08:00
Klaus Weidenbach 63646a1440 Some Doxygen comments and small cleanups. 2014-12-07 19:27:14 +01:00
friendica 50244f943d minor photo flag issue - and some more whitespace edits 2014-11-19 16:29:35 -08:00
Habeas Codice ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -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
zottel e7b634f81d set channel_w_stream to 0 for forum roles 2014-11-10 12:25:35 +01:00
friendica 583b445bc0 add "repository" permissions role and make sure we have a sane "accept" default for the custom role. 2014-10-27 16:19:30 -07:00
friendica 655c3e1b47 put privacy role selector in settings page. Change visibility of various permissions items accordingly. 2014-10-26 19:32:12 -07:00
friendica f8468b4c3a allow custom role permissions and fix site timezone. 2014-09-29 23:36:41 -07:00
friendica cb434818f8 closing tag 2014-09-19 16:50:43 -07:00
friendica c6062d7872 usability tweaks 2014-09-17 21:52:30 -07:00
friendica 51d9f0d97a channel permission roles 2014-09-17 21:16:15 -07:00
friendica eca420ec96 defined several permission roles - these will probably require some review and adjustment.
social
social_restricted
social_private
forum
forum_restricted
forum_private
feed
feed_restricted
soapbox
2014-09-17 19:46:55 -07:00
friendica 4014093572 implement permission roles - the backend should be done except for maybe a couple of small tweaks. Now we just need to define the rest of the roles and create a chooser for them. Adam started on this some time back but I don't know where that has gone. 2014-09-17 17:59:46 -07:00
friendica d9ff121930 beginning of permission role settings 2014-08-17 22:53:00 -07:00
Jeroen c1b89b413a Added some missing translation strings. Fixed to scalable for a few font sizes. 2014-08-14 20:02:05 +00:00
friendica 640dbdf5e9 a bit more cleanup and a bug fix or two for the new private post security model 2014-08-07 17:14:11 -07:00
friendica b19176169c provide a specific permission for liking profiles (reuse the obsolete bookmark permission), also remove the unused 'unconnected contacts' view for now. 2014-07-17 20:54:30 -07:00
friendica 53217ad9a7 add 'block_public' checking to get_all_perms() and perm_is_allowed() so we have everything related to allowing or denying something in one place. Currently this check is done separately in a huge number of places. Now we can start to remove all the extra checks. A couple of them are still necessary, but most are now redundant. 2014-07-03 19:36:59 -07:00
Alexandre Hannud Abdo b20887995a Implements a new permission level PERMS_PENDING
With this a user can allow some action to any user which connects
to them, even before they've connected back.

Ref.
https://mobiliza.org.br/display/478d9e71eaf55748dc646d3990651d6d34cfb7db5c38360538ec730ca3ccf908@zothub.com

Also some code cleanup and an alternative logic for handling
notifications of permission changes in zot.php.

This assumes that private posts are still restricted to people in
your addressbook. Regardless of your global permissions, a
pending channel won't get private posts, even if the post
only has a deny clause not matching the pending channel.
2014-06-19 15:13:32 -03:00
friendica c1f8eda719 Remove automatic bookmarking - it was a bad idea and just leads to menu clutter. Bookmarks can always be saved manually if desired. 2014-04-30 17:50:06 -07:00
friendica bf41ccbf35 'anybody in this network' permissions were not being allowed for non-connected channels. 2014-04-09 16:30:03 -07:00
friendica 24d119b8c4 introduce a new privacy level "PERMS_AUTHED" to indicate somebody that is able to successfully authenticate (but is not necessarily in this network). 2014-02-18 20:59:25 -08:00
friendica d3120264cb more snakebite stuff 2014-02-17 18:23:01 -08:00
friendica 3665bc38ef bookmarking 2014-02-04 16:06:56 -08:00
friendica d8f16442a1 bookmark permissions 2014-02-04 00:52:34 -08:00
friendica abb68e846d remove the text "requires compatible chat plugin" 2014-02-02 16:02:04 -08:00
friendica dffce63662 implement republish permission for use in sourced channels 2013-09-30 21:49:26 -07:00
friendica 20f3d09708 some sane permission defaults. 2013-08-18 20:20:03 -07:00
friendica f384695e3d more diagnostics 2013-07-15 03:12:51 -07:00
friendica ee21dfc245 fix "new connection has less permissions than public" 2013-06-15 15:45:54 -07:00
friendica c21f8c68e3 by default pending connections have no rights 2013-06-06 18:35:37 -07:00
friendica d72d30fabb more permissions descriptive text to lessen confusion 2013-05-21 17:13:51 -07:00
friendica f2de266ce6 doc update plus fix the "only to those in my address book" permission 2013-05-18 01:25:54 -07:00
friendica ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
friendica 8a474cbff5 permission plugin hooks 2013-02-19 14:22:10 -08:00
friendica 4f7f547190 why oh why is poco_load not getting called? oh - that's why. 2013-01-24 14:31:57 -08:00
friendica 6e6b268e25 auto permissions (such as for forums or whatever) - untested but might just work 2013-01-23 21:15:40 -08:00
friendica 610dc2823a read/write "pages" permissions and fiddly bits - per Thomas 2013-01-14 16:17:57 -08:00
friendica 3a5fea516a syntax error 2013-01-13 23:16:04 -08:00
friendica 5182d6d820 this should make tag delivery (e.g. forums) work - but not yet fully tested 2013-01-13 18:35:12 -08:00
friendica f09b9f1e44 add permission controls to "storage" objects such as attachments or other stored files 2012-12-22 03:33:12 -08:00
friendica 7737382378 revamp permissions, blocking a contact takes priority over all other permission settings, such as "allow anybody in network to do xyz". If they're blocked they can't do it. 2012-12-10 20:09:19 -08:00
friendica b0970850d4 Allow forum/account delegation by anybody? On any site? But of course... 2012-12-10 13:44:54 -08:00
friendica 9a726f0308 finish basic item encoding, add plugin compatibility tag, notes on improving $global_perms for edge cases 2012-11-16 13:57:55 -08:00
friendica 5bf3ddfcf6 got zot 2012-11-12 20:59:18 -08:00
friendica c1b931549c permissions and contact permissions are now sticky 2012-11-08 17:33:38 -08:00
friendica 4f1170b656 change permission settings from radio buttons to select boxes 2012-11-05 15:26:01 -08:00
friendica 9547e8004d slightly better wording of permission choices 2012-11-02 02:18:52 -07:00