mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 21:35:17 +00:00
85 lines
1.3 KiB
PHP
85 lines
1.3 KiB
PHP
<?php
|
|
namespace Zotlabs\Module;
|
|
|
|
use App;
|
|
use Zotlabs\Web\Controller;
|
|
use Zotlabs\Web\SubModule;
|
|
|
|
require_once('include/security.php');
|
|
|
|
class Settings extends Controller {
|
|
|
|
private $sm = null;
|
|
|
|
function init() {
|
|
|
|
if (! local_channel()) {
|
|
return;
|
|
}
|
|
|
|
if ($_SESSION['delegate']) {
|
|
return;
|
|
}
|
|
|
|
App::$profile_uid = local_channel();
|
|
|
|
// default is channel settings in the absence of other arguments
|
|
|
|
if (argc() == 1) {
|
|
// We are setting these values - don't use the argc(), argv() functions here
|
|
App::$argc = 2;
|
|
App::$argv[] = 'channel';
|
|
}
|
|
|
|
$this->sm = new SubModule();
|
|
}
|
|
|
|
|
|
function post() {
|
|
|
|
if (! local_channel()) {
|
|
return;
|
|
}
|
|
|
|
if ($_SESSION['delegate']) {
|
|
return;
|
|
}
|
|
|
|
// logger('mod_settings: ' . print_r($_REQUEST,true));
|
|
|
|
if (argc() > 1) {
|
|
if ($this->sm->call('post') !== false) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
goaway(z_root() . '/settings' );
|
|
}
|
|
|
|
|
|
|
|
function get() {
|
|
|
|
nav_set_selected('Settings');
|
|
|
|
if ((! local_channel()) || ($_SESSION['delegate'])) {
|
|
notice( t('Permission denied.') . EOL );
|
|
return login();
|
|
}
|
|
|
|
|
|
$channel = App::get_channel();
|
|
if ($channel) {
|
|
head_set_icon($channel['xchan_photo_s']);
|
|
}
|
|
|
|
$o = $this->sm->call('get');
|
|
if ($o !== false) {
|
|
return $o;
|
|
}
|
|
|
|
$o = EMPTY_STR;
|
|
}
|
|
}
|
|
|
|
|