-
Notifications
You must be signed in to change notification settings - Fork 0
/
addtp.php
37 lines (29 loc) · 985 Bytes
/
addtp.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
include_once('config.inc.php');
include_once('auth.inc.php');
include_once('util.inc.php');
include_once('userprefs.inc.php');
include_once('domaintable.inc.php');
include_once('users.inc.php');
include_once('forms.inc.php');
include_once('pages.inc.php');
include_once('search.inc.php');
include_once('error.inc.php');
include_once('validate.inc.php');
include_once('templates.inc.php');
include_once('addrecord.inc.php');
$user = $_SESSION["userid"];
if (isset($_POST['add'])) {
if (isset($_POST['name'])) { $name = $_POST['name']; } else { $name=""; }
if (isadmin()) { /* only admin can set the owner field */
if (isset($_POST['owner'])) { $owner = $_POST['owner']; } else { $owner=$_SESSION['userid']; }
if (isset($_POST['public'])) { $public = $_POST['public']; } else { $public=0; }
} else {
$owner = $_SESSION['userid'];
$public = 0;
}
/* validate */
add_template($name, $owner, $public);
}
redirect("templates.php");
?>