forked from tinyspeck/hammock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.php
37 lines (23 loc) · 727 Bytes
/
add.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
37
<?php
$dir = dirname(__FILE__);
include("$dir/lib/init.php");
verify_auth();
load_plugins();
if ($_POST['done']){
$instance = createPluginInstance($_POST['plugin']);
$instance->iid = $_POST['uid'];
$instance->onParentInit();
$instance->onInit();
$instance->icfg['created'] = time();
$instance->icfg['creator_id'] = $GLOBALS['cfg']['user']['user_id'];
$instance->saveConfig();
header("location: view.php?id={$instance->iid}");
exit;
}
$id = $_GET['id'];
if (!isset($plugins[$id])) die("plugin not found");
$instance = createPluginInstance($id);
$instance->createInstanceId();
$instance->checkRequirements();
$smarty->assign('instance', $instance);
$smarty->display('page_add.txt');