diff options
author | redmatrix <git@macgirvin.com> | 2016-07-04 16:30:03 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-04 16:30:03 -0700 |
commit | 6bf2e8a1087546a1986adddcdab486af0891383e (patch) | |
tree | 13698b3214520952f22d92408b46570cdd2d165b /install | |
parent | 805ecde6a5ce50856e96ea47cba4a02e7848672f (diff) | |
download | volse-hubzilla-6bf2e8a1087546a1986adddcdab486af0891383e.tar.gz volse-hubzilla-6bf2e8a1087546a1986adddcdab486af0891383e.tar.bz2 volse-hubzilla-6bf2e8a1087546a1986adddcdab486af0891383e.zip |
some perms fixes to stuff that was already written before I move on
Diffstat (limited to 'install')
-rw-r--r-- | install/perm_upgrade.php | 70 | ||||
-rw-r--r-- | install/schema_postgres.sql | 11 | ||||
-rw-r--r-- | install/update.php | 3 |
3 files changed, 48 insertions, 36 deletions
diff --git a/install/perm_upgrade.php b/install/perm_upgrade.php index ff6cda2e2..b5412b942 100644 --- a/install/perm_upgrade.php +++ b/install/perm_upgrade.php @@ -23,41 +23,41 @@ function perm_limits_upgrade($channel) { function perm_abook_upgrade($abook) { - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_stream',intval(($abook['their_perms'] & PERMS_R_STREAM)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_profile',intval(($abook['their_perms'] & PERMS_R_PROFILE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_contacts',intval(($abook['their_perms'] & PERMS_R_ABOOK)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_storage',intval(($abook['their_perms'] & PERMS_R_STORAGE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_pages',intval(($abook['their_perms'] & PERMS_R_PAGES)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','send_stream',intval(($abook['their_perms'] & PERMS_W_STREAM)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_wall',intval(($abook['their_perms'] & PERMS_W_WALL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_comments',intval(($abook['their_perms'] & PERMS_W_COMMENT)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_mail',intval(($abook['their_perms'] & PERMS_W_MAIL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_like',intval(($abook['their_perms'] & PERMS_W_LIKE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','tag_deliver',intval(($abook['their_perms'] & PERMS_W_TAGWALL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','chat',intval(($abook['their_perms'] & PERMS_W_CHAT)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','write_storage',intval(($abook['their_perms'] & PERMS_W_STORAGE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','write_pages',intval(($abook['their_perms'] & PERMS_W_PAGES)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','republish',intval(($abook['their_perms'] & PERMS_A_REPUBLISH)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','delegate',intval(($abook['their_perms'] & PERMS_A_DELEGATE)? 1 : 0)); - - - - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_stream',intval(($abook['my_perms'] & PERMS_R_STREAM)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_profile',intval(($abook['my_perms'] & PERMS_R_PROFILE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_contacts',intval(($abook['my_perms'] & PERMS_R_ABOOK)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_storage',intval(($abook['my_perms'] & PERMS_R_STORAGE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_pages',intval(($abook['my_perms'] & PERMS_R_PAGES)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','send_stream',intval(($abook['my_perms'] & PERMS_W_STREAM)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_wall',intval(($abook['my_perms'] & PERMS_W_WALL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_comments',intval(($abook['my_perms'] & PERMS_W_COMMENT)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_mail',intval(($abook['my_perms'] & PERMS_W_MAIL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_like',intval(($abook['my_perms'] & PERMS_W_LIKE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','tag_deliver',intval(($abook['my_perms'] & PERMS_W_TAGWALL)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','chat',intval(($abook['my_perms'] & PERMS_W_CHAT)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','write_storage',intval(($abook['my_perms'] & PERMS_W_STORAGE)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','write_pages',intval(($abook['my_perms'] & PERMS_W_PAGES)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','republish',intval(($abook['my_perms'] & PERMS_A_REPUBLISH)? 1 : 0)); - set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','delegate',intval(($abook['my_perms'] & PERMS_A_DELEGATE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_stream',intval(($abook['abook_their_perms'] & PERMS_R_STREAM)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_profile',intval(($abook['abook_their_perms'] & PERMS_R_PROFILE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_contacts',intval(($abook['abook_their_perms'] & PERMS_R_ABOOK)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_storage',intval(($abook['abook_their_perms'] & PERMS_R_STORAGE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','view_pages',intval(($abook['abook_their_perms'] & PERMS_R_PAGES)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','send_stream',intval(($abook['abook_their_perms'] & PERMS_W_STREAM)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_wall',intval(($abook['abook_their_perms'] & PERMS_W_WALL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_comments',intval(($abook['abook_their_perms'] & PERMS_W_COMMENT)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_mail',intval(($abook['abook_their_perms'] & PERMS_W_MAIL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','post_like',intval(($abook['abook_their_perms'] & PERMS_W_LIKE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','tag_deliver',intval(($abook['abook_their_perms'] & PERMS_W_TAGWALL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','chat',intval(($abook['abook_their_perms'] & PERMS_W_CHAT)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','write_storage',intval(($abook['abook_their_perms'] & PERMS_W_STORAGE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','write_pages',intval(($abook['abook_their_perms'] & PERMS_W_PAGES)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','republish',intval(($abook['abook_their_perms'] & PERMS_A_REPUBLISH)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'their_perms','delegate',intval(($abook['abook_their_perms'] & PERMS_A_DELEGATE)? 1 : 0)); + + + + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_stream',intval(($abook['abook_my_perms'] & PERMS_R_STREAM)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_profile',intval(($abook['abook_my_perms'] & PERMS_R_PROFILE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_contacts',intval(($abook['abook_my_perms'] & PERMS_R_ABOOK)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_storage',intval(($abook['abook_my_perms'] & PERMS_R_STORAGE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','view_pages',intval(($abook['abook_my_perms'] & PERMS_R_PAGES)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','send_stream',intval(($abook['abook_my_perms'] & PERMS_W_STREAM)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_wall',intval(($abook['abook_my_perms'] & PERMS_W_WALL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_comments',intval(($abook['abook_my_perms'] & PERMS_W_COMMENT)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_mail',intval(($abook['abook_my_perms'] & PERMS_W_MAIL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','post_like',intval(($abook['abook_my_perms'] & PERMS_W_LIKE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','tag_deliver',intval(($abook['abook_my_perms'] & PERMS_W_TAGWALL)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','chat',intval(($abook['abook_my_perms'] & PERMS_W_CHAT)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','write_storage',intval(($abook['abook_my_perms'] & PERMS_W_STORAGE)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','write_pages',intval(($abook['abook_my_perms'] & PERMS_W_PAGES)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','republish',intval(($abook['abook_my_perms'] & PERMS_A_REPUBLISH)? 1 : 0)); + set_abconfig($abook['abook_channel'],$abook['abook_hash'],'my_perms','delegate',intval(($abook['abook_my_perms'] & PERMS_A_DELEGATE)? 1 : 0)); }
\ No newline at end of file diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 378308233..36018de3e 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -888,6 +888,17 @@ CREATE TABLE "pconfig" ( PRIMARY KEY ("id"), UNIQUE ("uid","cat","k") ); +create table perm_limits ( + id serial NOT NULL, + perm varchar(64) not null default '', + channel_id int(10) unsigned not null default 0, + perm_limit int(10) unsigned not null default 0, + primary key id +); +create index "idx_perm" on perm_limits ("perm"); +create index "idx_channel_id" on perm_limits ("channel_id"); +create index "idx_perm_limit" on perm_limits ("perm_limit"); + CREATE TABLE "photo" ( "id" serial NOT NULL, "aid" bigint NOT NULL DEFAULT '0', diff --git a/install/update.php b/install/update.php index 865555b00..c87971913 100644 --- a/install/update.php +++ b/install/update.php @@ -2371,7 +2371,8 @@ function update_r1179() { id serial NOT NULL, perm varchar(64) not null default '', channel_id int(10) unsigned not null default 0, - perm_limit int(10) unsigned not null default 0 )"); + perm_limit int(10) unsigned not null default 0 + primary_key id )"); $r2 = q("create index \"idx_perm\" on perm_limits (\"perm\") "); $r3 = q("create index \"idx_channel_id\" on perm_limits (\"channel_id\") "); $r4 = q("create index \"idx_perm_limit\" on perm_limits (\"perm_limit\") "); |