forked from SecareLupus/fc_pos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoph.php
95 lines (89 loc) · 3 KB
/
oph.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* @file oph.php
* @brief oph.php allows for the manipulation of hedons from arbitrary accounts.
*
* This file includes:
* funcs.inc:
* - selectMember()
* - printMemberString()
*
* credits.inc:
* - getCreditTotal()
* - transferCredits()
*
* Possible Arguments:
* SESSION:
* - adm - Used to determine whether the active user has admin
* privs.
* - ID - The ID of the active user, required as this app incurs an
* automatic email to the GM for review.
*
* POST:
* - to - The member ID of the member receiving the appropriated hedons.
* - from - The member ID of the member whose hedons are being appropriated.
* - qty - The number of hedons being appropriated.
* - reason - An explanation for why the transfer is happening. This is
* for review purposes.
*
* @link http://www.worldsapartgames.org/fc/oph.php @endlink
*
* @author Michael Whitehouse
* @author Creidieki Crouch
* @author Desmond Duval
* @copyright 2009-2014 Pioneer Valley Gaming Collective
* @version 1.8d
* @since Project has existed since time immemorial.
*/
$title = "Other People's Hedons";
$version = "1.8d";
require_once 'funcs.inc';
require_once 'credits.inc';
require_once 'header.php';
if ($_SESSION['adm'] != 1) {
echo "<h1>Restricted Page.</h1>";
include 'footer.php';
die();
}
echo "<h1>Transfer Other People's Hedons</h1>
This allows you to transfer a user's Hedons to another user. When you use
this, it will send an email to the General Manager.
<p>
<form action='oph.php' method='post'>
Take Hedons from: ";
selectMember('from', 0);
echo "<br>And give them to: ";
selectMember('to', 0);
echo "<br>Hedons: <input name='qty' size=3 maxlength=3><br>
Reason: <input name='reason' size=20 maxlength=40><br>
<input name='submit' type='submit' value='submit'><hr>\n";
if ($_POST['to'] > 0) {
$to = intval($_POST['to']);
$from = intval($_POST['from']);
$qty = intval($_POST['qty']);
$reason = $_POST['reason'];
if ($to == $_SESSION['ID']) {
echo "<h1>You cannot transfer to yourself!!!</h1>";
include 'footer.php';
die();
}
if (getCreditTotal($from) >= $qty) {
if (transferCredits($from, $to, $qty, "txed by member {$_SESSION['ID']} - $reason", 4)) {
echo "$qty Hedons transferred from " . printMemberString($from, 1)
. " to " . printMemberString($to, 1)
. " for reason: $reason<p>";
mail(
"[email protected]", "Hedons Transferred", "$qty Hedons "
. "transferred from " . printMemberString($from, 1) . " to "
. printMemberString($to, 1) . " for reason: $reason"
);
} else {
echo "Error transferring Credits<p>";
}
} else {
echo printMemberString($from, 1) . " does not have $qty Hedons. "
. "Current balance: " . getCreditTotal($from) . "<p>";
}
}
require 'footer.php';
?>