mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:35:12 +00:00
move sudo to addons
This commit is contained in:
parent
3be7f6fe08
commit
ac87b4fc2b
4 changed files with 20 additions and 42 deletions
|
@ -50,3 +50,6 @@ Announce
|
||||||
|
|
||||||
Announce and relay activities are supported on the inbound side but are not generated. Instead a new message is generated with an embedded rendering of the shared content as the message content. This message may (should) contain additional commentary in order to comply with the Fair Use provisions of copyright law.
|
Announce and relay activities are supported on the inbound side but are not generated. Instead a new message is generated with an embedded rendering of the shared content as the message content. This message may (should) contain additional commentary in order to comply with the Fair Use provisions of copyright law.
|
||||||
|
|
||||||
|
Mastodon Custom Emojis
|
||||||
|
|
||||||
|
Mastodon Custom Emojis are only supported for post content. Display names and message titles are considered text only fields and embedded images (the mechanism behind custom emojis) are not supported in these locations.
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
namespace Zotlabs\Module\Admin;
|
namespace Zotlabs\Module\Admin;
|
||||||
|
|
||||||
|
use App;
|
||||||
use Zotlabs\Daemon\Master;
|
use Zotlabs\Daemon\Master;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Admin Module for Channels.
|
* @brief Admin Module for Channels.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Channels {
|
class Channels {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,13 +120,13 @@ class Channels {
|
||||||
|
|
||||||
$total = q("SELECT count(*) as total FROM channel where channel_removed = 0 and channel_system = 0");
|
$total = q("SELECT count(*) as total FROM channel where channel_removed = 0 and channel_system = 0");
|
||||||
if($total) {
|
if($total) {
|
||||||
\App::set_pager_total($total[0]['total']);
|
App::set_pager_total($total[0]['total']);
|
||||||
\App::set_pager_itemspage(100);
|
App::set_pager_itemspage(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
$channels = q("SELECT * from channel where channel_removed = 0 and channel_system = 0 order by $key $dir limit %d offset %d ",
|
$channels = q("SELECT * from channel where channel_removed = 0 and channel_system = 0 order by $key $dir limit %d offset %d ",
|
||||||
intval(\App::$pager['itemspage']),
|
intval(App::$pager['itemspage']),
|
||||||
intval(\App::$pager['start'])
|
intval(App::$pager['start'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($channels) {
|
if($channels) {
|
||||||
|
@ -138,11 +140,18 @@ class Channels {
|
||||||
$channels[$x]['allowcode'] = true;
|
$channels[$x]['allowcode'] = true;
|
||||||
else
|
else
|
||||||
$channels[$x]['allowcode'] = false;
|
$channels[$x]['allowcode'] = false;
|
||||||
|
|
||||||
|
$channels[$x]['channel_link'] = z_root() . '/channel/' . $channels[$x]['channel_address'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$t = get_markup_template('admin_channels.tpl');
|
logger('channels1: ' . print_r($channels,true));
|
||||||
$o = replace_macros($t, array(
|
|
||||||
|
call_hooks('admin_channels',$channels);
|
||||||
|
|
||||||
|
logger('channels2: ' . print_r($channels,true));
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template('admin_channels.tpl'), [
|
||||||
// strings //
|
// strings //
|
||||||
'$title' => t('Administration'),
|
'$title' => t('Administration'),
|
||||||
'$page' => t('Channels'),
|
'$page' => t('Channels'),
|
||||||
|
@ -169,7 +178,7 @@ class Channels {
|
||||||
// values //
|
// values //
|
||||||
'$baseurl' => z_root(),
|
'$baseurl' => z_root(),
|
||||||
'$channels' => $channels,
|
'$channels' => $channels,
|
||||||
));
|
]);
|
||||||
$o .= paginate($a);
|
$o .= paginate($a);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Zotlabs\Module;
|
|
||||||
|
|
||||||
use Zotlabs\Web\Controller;
|
|
||||||
use Zotlabs\Lib\Config;
|
|
||||||
|
|
||||||
class Sudo extends Controller {
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
|
|
||||||
if ((argc() < 2) || (! intval(Config::Get('system','allow_sudo')))) {
|
|
||||||
http_status_exit(404,'Not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! is_site_admin()) {
|
|
||||||
http_status_exit(403,'Permission denied');
|
|
||||||
}
|
|
||||||
|
|
||||||
$c = channelx_by_nick(argv(1));
|
|
||||||
if ($c) {
|
|
||||||
$tmp = $_SESSION;
|
|
||||||
$_SESSION['delegate_push'] = $tmp;
|
|
||||||
$_SESSION['delegate_channel'] = $c['channel_id'];
|
|
||||||
$_SESSION['delegate'] = get_observer_hash();
|
|
||||||
$_SESSION['account_id'] = intval($c['channel_account_id']);
|
|
||||||
$_SESSION['sudo'] = 1;
|
|
||||||
|
|
||||||
change_channel($c['channel_id']);
|
|
||||||
goaway(z_root());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -30,7 +30,7 @@
|
||||||
{{foreach $channels as $c}}
|
{{foreach $channels as $c}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class='channel_id'>{{$c.channel_id}}</td>
|
<td class='channel_id'>{{$c.channel_id}}</td>
|
||||||
<td class='channel_name'><a href="channel/{{$c.channel_address}}">{{$c.channel_name}}</a></td>
|
<td class='channel_name'><a href="{{$c.channel_link}}">{{$c.channel_name}}</a></td>
|
||||||
<td class='channel_address'>{{$c.channel_address}}</td>
|
<td class='channel_address'>{{$c.channel_address}}</td>
|
||||||
<td class="checkbox_bulkedit"><input type="checkbox" class="channels_ckbx" id="id_channel_{{$c.channel_id}}" name="channel[]" value="{{$c.channel_id}}"/></td>
|
<td class="checkbox_bulkedit"><input type="checkbox" class="channels_ckbx" id="id_channel_{{$c.channel_id}}" name="channel[]" value="{{$c.channel_id}}"/></td>
|
||||||
<td class="tools">
|
<td class="tools">
|
||||||
|
|
Loading…
Reference in a new issue