forked from mkay/Exim4UI_mk1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmingroupchangesubmit.php
More file actions
25 lines (23 loc) · 1.05 KB
/
admingroupchangesubmit.php
File metadata and controls
25 lines (23 loc) · 1.05 KB
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
<?php
include_once dirname(__FILE__) . '/config/variables.php';
include_once dirname(__FILE__) . '/config/authpostmaster.php';
include_once dirname(__FILE__) . '/config/functions.php';
# Fix the boolean values
$_POST['is_public'] = isset($_POST['is_public']) ? 'Y' : 'N';
$_POST['enabled'] = isset($_POST['enabled']) ? 1 : 0;
# validate localpart
if (preg_match("/['@%!\/\|\" ']/",$_POST['localpart'])) {
header("Location: admingroupchange.php?group_id={$_POST['group_id']}&badname={$_POST['localpart']}");
die;
}
$query = "UPDATE groups SET name='{$_POST['localpart']}',
enabled={$_POST['enabled']}, is_public='{$_POST['is_public']}'
WHERE id={$_POST['group_id']} AND domain_id = {$_SESSION['domain_id']}";
echo $query;
$result = $db->query($query)."\n";
if (!DB::isError($result)) {
header ("Location: admingroupchange.php?group_id={$_POST['group_id']}&group_updated={$_POST['localpart']}");
} else {
header ("Location: admingroupchange.php?group_id={$_POST['group_id']}&group_failupdated={$_POST['localpart']}");
}
?>