-
Notifications
You must be signed in to change notification settings - Fork 0
/
adduser.php
97 lines (83 loc) · 3.18 KB
/
adduser.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
96
97
<?php
/*
* Giki - a flat-file PHP wiki
* Copyright (C) 2003 Sam Thursfield
* Copyright (C) 2005, 2006 Gregor Richards
*
* This file is part of Giki.
*
* Giki is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Giki is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Giki; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once("config.php");
require_once("display.php");
require_once("language.php");
require_once("logininc.php");
$user = @$_POST['user'];
$pass = @$_POST['pass'];
$passb = @$_POST['passb'];
if (!$login_plugin) {
if ($user && $pass) {
$node = "";
if ($pass != $passb) {
$title = $adduser;
$node = $pass_dont_match;
} else {
// load registration plugins
foreach ($plugins as $plugin) {
@include("gikiplugin-reg-$plugin.php");
}
$file=fopen($nodedir."logins.txt", "a+");
fputs($file, $user."\n");
fclose($file);
$file=fopen($nodedir."passwords.txt", "a+");
fputs($file, md5($pass)."\n");
fclose($file);
if ($remotelog === true) {
// remotelog.txt - record this new user
$datelogged = date( "Y-m-d H:i:s", time() );
$remoteip = $_SERVER[ "REMOTE_ADDR" ];
$userstring = $datelogged . " - " . $user . " - " . $remoteip;
$fp = fopen( $nodedir."remotelog.txt", "a" );
fputs( $fp, $userstring."\n" );
fclose( $fp );
}
$title = $useradded;
$node .= $useradded_d;
}
} else {
$title = $adduser;
$node = '<form action="adduser.php" method="post">' .
'<table border=0>' .
'<tr><td align=right>' . $tusername . ':</td>' .
'<td><input type="text" name="user" value=""></td></tr>' .
'<tr><td align=right>' . $tpassword . ':</td>' .
'<td><input type="password" name="pass" value=""></td></tr>' .
'<tr><td align=right>' . $trepeatpw . ':</td>' .
'<td><input type="password" name="passb" value=""></td></tr>' .
'</table>' .
'<input type="submit" name="submit" value="Submit"></form>';
// load registration plugins
foreach ($plugins as $plugin) {
@include("gikiplugin-reg-$plugin.php");
}
}
} else {
// Using a login plugin, so this page won't work
$title=$adduser;
$node=$no_registration;
}
$bar=array("<a href='index.php?title=$index'>$index</a>");
display($title, $node, $bar, $template);
?>