-
Notifications
You must be signed in to change notification settings - Fork 0
/
updmap.php
42 lines (32 loc) · 1.16 KB
/
updmap.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
38
39
40
41
42
<?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('domain.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');
include_once('recmap.inc.php');
$user = $_SESSION["userid"];
if (isset($_POST['update'])) {
if (isset($_POST['id'])) { $id = $_POST['id']; } else { error("Invalid record id"); }
if (isset($_POST['value'])) { $value = $_POST['value']; } else { rror("Invalid value"); }
if (!(is_owner_recmap($id, $user)) && !(isadmin())) {
error("Invalid record id");
}
/* pull the recmap and get the record id */
$recid = get_recid_recmap($id);
$query = $DB->prepare("UPDATE records SET content=? WHERE id=?");
$dbreturn = $DB->execute($query, array($value, (int) $recid));
$_SESSION['infonotice']="Updated record with content $value";
redirect("index.php");
}
redirect("index.php");
?>