forked from tinyspeck/hammock
-
Notifications
You must be signed in to change notification settings - Fork 3
/
view.php
37 lines (27 loc) · 879 Bytes
/
view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
$dir = dirname(__FILE__);
include("$dir/lib/init.php");
verify_auth();
load_plugins();
$instance = getPluginInstance($_GET['id']);
if (!is_object($instance)) die("instance not found");
if ($_POST['delete-instance']){
$instance->deleteMe();
header("location: ./");
exit;
}
if ($_POST['new-token']){
$instance->regenToken();
$instance->saveConfig();
header("location: {$instance->getViewUrl()}&newtoken=1");
exit;
}
$instance->checkRequirements();
$smarty->assign('instance', $instance);
$smarty->assign('id', $instance->id);
$smarty->assign('name', $instance::NAME);
$smarty->assign('icon', $instance->iconUrl(128, "service", true));
$smarty->assign('asset', $instance->getAssets());
$editpage = render_edit($GLOBALS['cfg']['team'], $instance);
$smarty->assign('html', $editpage);
$smarty->display('page_view.txt');