aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/perm_upgrade.php32
-rw-r--r--install/schema_mysql.sql12
-rw-r--r--install/schema_postgres.sql10
-rw-r--r--install/update.php32
4 files changed, 17 insertions, 69 deletions
diff --git a/install/perm_upgrade.php b/install/perm_upgrade.php
index b5412b942..fffed9503 100644
--- a/install/perm_upgrade.php
+++ b/install/perm_upgrade.php
@@ -1,22 +1,22 @@
<?php
function perm_limits_upgrade($channel) {
- perm_limits_upgrade_create($channel['channel_id'],'view_stream',$channel['channel_r_stream']);
- perm_limits_upgrade_create($channel['channel_id'],'view_profile',$channel['channel_r_profile']);
- perm_limits_upgrade_create($channel['channel_id'],'view_contacts',$channel['channel_r_abook']);
- perm_limits_upgrade_create($channel['channel_id'],'view_storage',$channel['channel_r_storage']);
- perm_limits_upgrade_create($channel['channel_id'],'view_pages',$channel['channel_r_pages']);
- perm_limits_upgrade_create($channel['channel_id'],'send_stream',$channel['channel_w_stream']);
- perm_limits_upgrade_create($channel['channel_id'],'post_wall',$channel['channel_w_wall']);
- perm_limits_upgrade_create($channel['channel_id'],'post_comments',$channel['channel_w_comment']);
- perm_limits_upgrade_create($channel['channel_id'],'post_mail',$channel['channel_w_mail']);
- perm_limits_upgrade_create($channel['channel_id'],'post_like',$channel['channel_w_like']);
- perm_limits_upgrade_create($channel['channel_id'],'tag_deliver',$channel['channel_w_tagwall']);
- perm_limits_upgrade_create($channel['channel_id'],'chat',$channel['channel_w_chat']);
- perm_limits_upgrade_create($channel['channel_id'],'write_storage',$channel['channel_w_storage']);
- perm_limits_upgrade_create($channel['channel_id'],'write_pages',$channel['channel_w_pages']);
- perm_limits_upgrade_create($channel['channel_id'],'republish',$channel['channel_a_republish']);
- perm_limits_upgrade_create($channel['channel_id'],'delegate',$channel['channel_a_delegate']);
+ set_pconfig($channel['channel_id'],'perm_limits','view_stream',$channel['channel_r_stream']);
+ set_pconfig($channel['channel_id'],'perm_limits','view_profile',$channel['channel_r_profile']);
+ set_pconfig($channel['channel_id'],'perm_limits','view_contacts',$channel['channel_r_abook']);
+ set_pconfig($channel['channel_id'],'perm_limits','view_storage',$channel['channel_r_storage']);
+ set_pconfig($channel['channel_id'],'perm_limits','view_pages',$channel['channel_r_pages']);
+ set_pconfig($channel['channel_id'],'perm_limits','send_stream',$channel['channel_w_stream']);
+ set_pconfig($channel['channel_id'],'perm_limits','post_wall',$channel['channel_w_wall']);
+ set_pconfig($channel['channel_id'],'perm_limits','post_comments',$channel['channel_w_comment']);
+ set_pconfig($channel['channel_id'],'perm_limits','post_mail',$channel['channel_w_mail']);
+ set_pconfig($channel['channel_id'],'perm_limits','post_like',$channel['channel_w_like']);
+ set_pconfig($channel['channel_id'],'perm_limits','tag_deliver',$channel['channel_w_tagwall']);
+ set_pconfig($channel['channel_id'],'perm_limits','chat',$channel['channel_w_chat']);
+ set_pconfig($channel['channel_id'],'perm_limits','write_storage',$channel['channel_w_storage']);
+ set_pconfig($channel['channel_id'],'perm_limits','write_pages',$channel['channel_w_pages']);
+ set_pconfig($channel['channel_id'],'perm_limits','republish',$channel['channel_a_republish']);
+ set_pconfig($channel['channel_id'],'perm_limits','delegate',$channel['channel_a_delegate']);
}
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 223f94162..9a67cada0 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -904,18 +904,6 @@ CREATE TABLE IF NOT EXISTS `pconfig` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-create table if not exists perm_limits {
- id int(10) not null AUTO_INCREMENT,
- 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`),
- KEY `perm` (`perm`),
- KEY `channel_id` (`channel_id`),
- KEY `perm_limit` (`perm_limit`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-
CREATE TABLE IF NOT EXISTS `photo` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`aid` int(10) unsigned NOT NULL DEFAULT '0',
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 36018de3e..a86102b53 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -888,16 +888,6 @@ 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,
diff --git a/install/update.php b/install/update.php
index c87971913..f1d9adbd7 100644
--- a/install/update.php
+++ b/install/update.php
@@ -2366,36 +2366,6 @@ function update_r1179() {
require_once('install/perm_upgrade.php');
- if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
- $r1 = q("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 )");
- $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\") ");
-
-
- $r = $r1 && $r2 && $r3 && $r4;
- }
-
- else {
- $r1 = q("create table if not exists perm_limits {
- id int(10) not null AUTO_INCREMENT,
- 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`),
- KEY `perm` (`perm`),
- KEY `channel_id` (`channel_id`),
- KEY `perm_limit` (`perm_limit`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
-
- $r = $r1;
- }
-
$r1 = q("select * from channel where true");
if($r1) {
foreach($r1 as $rr) {
@@ -2410,7 +2380,7 @@ function update_r1179() {
}
}
- $r = $r && $r1 && $r2;
+ $r = $r1 && $r2;
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;