aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-11 19:29:30 -0800
committerfriendica <info@friendica.com>2014-11-11 19:29:30 -0800
commitb5af6679857eeafcb360d7dec69acf11af034c1d (patch)
tree91a5118b270c7966a8f75b5ad572ce71a2c15d16
parent37742be6af5aee1a5be8ba878379d9e21b39377d (diff)
downloadvolse-hubzilla-b5af6679857eeafcb360d7dec69acf11af034c1d.tar.gz
volse-hubzilla-b5af6679857eeafcb360d7dec69acf11af034c1d.tar.bz2
volse-hubzilla-b5af6679857eeafcb360d7dec69acf11af034c1d.zip
slow progress on sys publishing, making sure all the data we need is in the places we need it but validate it anyway
-rwxr-xr-xboot.php4
-rw-r--r--include/text.php2
-rw-r--r--include/widgets.php2
-rw-r--r--mod/webpages.php27
4 files changed, 25 insertions, 10 deletions
diff --git a/boot.php b/boot.php
index 4b1c008cd..fb059f8b0 100755
--- a/boot.php
+++ b/boot.php
@@ -677,8 +677,8 @@ class App {
public $css_sources = array();
public $js_sources = array();
public $theme_info = array();
-
- public $nav_sel;
+ public $is_sys = false;
+ public $nav_sel;
public $category;
diff --git a/include/text.php b/include/text.php
index ba1f9e5a3..686dee4a2 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2024,7 +2024,7 @@ function design_tools() {
$channel = get_app()->get_channel();
- if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] == 1 && is_site_admin()) {
+ if(get_app()->is_sys && is_site_admin()) {
require_once('include/identity.php');
$channel = get_sys_channel();
}
diff --git a/include/widgets.php b/include/widgets.php
index dcad3eff6..cb5dc6846 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -585,7 +585,7 @@ function widget_design_tools($arr) {
// otherwise local_user() is sufficient for permissions.
if($a->profile['profile_uid'])
- if($a->profile['profile_uid'] != local_user())
+ if(($a->profile['profile_uid'] != local_user()) && (! $a->is_sys))
return '';
if(! local_user())
diff --git a/mod/webpages.php b/mod/webpages.php
index e7aef5fb0..d80a9a86e 100644
--- a/mod/webpages.php
+++ b/mod/webpages.php
@@ -1,16 +1,33 @@
<?php
-function webpages_content(&$a) {
+function webpages_init(&$a) {
+
+ if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
+ require_once('include/identity.php');
+ $sys = get_sys_channel();
+ if($sys && intval($sys['channel_id'])) {
+ $a->is_sys = true;
+ }
+ }
if(argc() > 1)
$which = argv(1);
- else {
+ else
+ return;
+
+ profile_load($a,$which,$profile);
+
+}
+
+
+function webpages_content(&$a) {
+
+ if(! $a->profile) {
notice( t('Requested profile is not available.') . EOL );
$a->error = 404;
return;
}
-
$uid = 0;
$owner = 0;
$channel = null;
@@ -19,7 +36,7 @@ function webpages_content(&$a) {
$profile = 0;
$channel = $a->get_channel();
- if($which === 'sys' && is_site_admin()) {
+ if($a->is_sys && is_site_admin()) {
require_once('include/identity.php');
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
@@ -29,8 +46,6 @@ function webpages_content(&$a) {
}
}
- profile_load($a,$which,$profile);
-
if(! $owner) {
// Figure out who the page owner is.
$r = q("select channel_id from channel where channel_address = '%s'",