-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.php
41 lines (30 loc) · 1.25 KB
/
common.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
<?php
$RPC_HOST = "[::1]";
$RPC_PORT = 8080;
$HASHCASH_BASE_URL = '/hashcash';
$HASHCASH_DEFAULT_EMAIL = "[email protected]";
$HASHCASH_RAND_MAX = (10 ** 7) / 2;
$HASHCASH_ROUNDS = 400;
$ACCOUTNAME_MAX_LEN = 20;
$ERROR_SESSION_INIT = "Internal Error";
$ERROR_ILLEGAL_METHOD = "Illegal Method";
$ERROR_MISSING_ARGS = "Missing Arguments";
$ERROR_ACTIVE_SESSION = "There is an active session. <a href=\"reset.php\">Clear it</a>?";
$ERROR_MISSING_SECRET = "Session was not properly initalized with a secret, <a href=\"reset.php\">try again</a>.";
$ERROR_MISSING_PROOF = "Proof is missing. <a href=\"reset.php\">Retry</a>?";
$ERROR_PROOF_ALREADY_CONFIRMED = "Proof was already confirmed, <a href=\"reset.php\">start fresh</a>?";
$ERROR_PROOF_INCORRECT = "Proof was incorrect, <a href=\"reset.php\">try again</a>.";
$ERROR_ACCOUNTNAME_MISSING = "Enter an accoutname.";
$ERROR_ACCOUNTNAME_MAXLEN = "Your accoutname should not be longer than $ACCOUTNAME_MAX_LEN characters.";
$ERROR_ACCOUNTNAME_CASE = "Your accountname has to be lowercase letters.";
$ERROR_PASSWORD_MISSING = "Enter a password.";
function error($msg)
{
header("Content-Type", "text/plain");
die("error:$msg");
}
function ok($msg)
{
header("Content-Type", "text/plain");
die("ok:$msg");
}