aboutsummaryrefslogtreecommitdiffstats
path: root/mod/webpages.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/webpages.php')
-rw-r--r--mod/webpages.php27
1 files changed, 21 insertions, 6 deletions
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'",