-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·273 lines (226 loc) · 6.78 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<?php
/*
* UWS - Universal Wealth System
* index.php
* GPL license
* author: Fabio Barone
* date: 30. Nov. 2009
*
* This is the portal file for the UWS, where the user arrives for login.
* Currently it is only displaying some dummy information and a simple
* username / login entry.
*
* The username is checked and if the user does not exist, a correspondent
* error message is shown. If the password is incorrect, another
* error message is shown. There is also a link to the register page.
*/
include "config.php";
//Checks if there is a login cookie
if(isset($_COOKIE['uws_login']))
//if there is, it logs you in and directes you to the members page
{
$username = $_COOKIE['uws_login'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM members WHERE name = '$username'") or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if ($pass != $info['password'])
{
}
else
{
header("Location: home.php");
}
}
}
$error="";
//if the login form is submitted
if (isset($_POST['submit'])) { // if form has been submitted
//echo "hallo\n";
// makes sure they filled it in
if(!$_POST['uname'] | !$_POST['pwd']) {
$error=translate("uws:fill-in");
//echo $error;
//die($error);
}
// checks it against the database
if (!get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check = mysql_query("SELECT * FROM members WHERE name = '".$_POST['uname']."'") or die(mysql_error());
//Gives error if user doesn't exist
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
$error = translate("uws:no-such-user");
//die($error);
}
while($info = mysql_fetch_array( $check ))
{
$_POST['pwd'] = stripslashes($_POST['pwd']);
$info['password'] = stripslashes($info['password']);
$_POST['pwd'] = md5($_POST['pwd']);
$member_id = $info['member_id'];
//gives error if the password is wrong
if ($_POST['pwd'] != $info['password']) {
$error = translate("uws:wrong_pwd");
//die($error);
}
else
{
// if login is ok then we add a cookie
$_POST['uname'] = stripslashes($_POST['uname']);
$hour = time() + 3600;
$user = $_POST['uname'];
$pass = $_POST['pass'];
session_start();
$_SESSION['uname'] = $user;
$sql = "SELECT member_id FROM members WHERE name='$user'";
$query = mysql_query($sql);
$result = mysql_fetch_row($query);
$_SESSION['member_id'] = $result[0];
setcookie("uws_login", $user, $hour);
setcookie("Key_my_site", $pass , $hour);
//then redirect them to the home area
header("Location: home.php");
}
}
//print "not set2";
//header("Location: index.php");
// if they are not logged in
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
terrafirma1.0 by nodethirtythree design
http://www.nodethirtythree.com
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Universal Wealth System UWS - Start</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/javascript">
function put_errors_invisible()
{
//document.getElementById('errors').style.visibility='hidden';
}
function put_errors_visible()
{
//document.getElementById('errors').style.visibility='visible';
}
</script>
</head>
<body onload=put_errors_invisible()>
<div id="outer">
<div id="upbg"></div>
<div id="inner">
<div id="header">
<h1><span>UWS</span><sup>pre-alpha</sup></h1>
<h2><?php echo translate("uws:slogan") ?></h2>
</div>
<div id="splash"></div>
<div id="menu">
<ul>
</ul>
<div id="date"><?php echo date('d F Y')?> </div>
</div>
<div id="primarycontent">
<!-- primary content start -->
<div class="post">
<div class="header">
<h3>UWS in development</h3>
<div class="date">July 3, 2009</div>
</div>
<div class="content">
<img src="images/pic1.jpg" class="picA floatleft" alt="" />
<p>After different attempts, the UWS electronic system is now finally in development. A first release should be available soon.</p>
<p></p>
</div>
<div class="footer">
<ul>
<li class="printerfriendly"><a href="#">Printer Friendly</a></li>
<li class="readmore"><a href="#">Read more</a></li>
</ul>
</div>
</div>
<div class="post">
<div class="header">
<h3>The UWS explained</h3>
<div class="date">July 3, 2009</div>
</div>
<div class="content">
<p>The UWS is a completely different way of looking at economy.</p> <p></p>
</div>
<div class="footer">
<ul>
<li class="printerfriendly"><a href="#">Printer Friendly</a></li>
<li class="readmore"><a href="#">Read more</a></li>
</ul>
</div>
</div>
<div class="post">
<div class="header">
<h3>The UWS in action</h3>
<div class="date">July 3, 2009</div>
</div>
<div class="content">
<p>At the OS, a beautiful estate in North-East Brazil, the UWS is being applied in practice.</p>
<p>Read on if you want to know more about the experiences in this little paradise.
</div>
<div class="footer">
<ul>
<li class="printerfriendly"><a href="#">Printer Friendly</a></li>
<li class="readmore"><a href="#">Read more</a></li>
</ul>
</div>
</div>
<!-- primary content end -->
</div>
<div id="secondarycontent">
<!-- secondary content start -->
<h3><?php echo translate("uws:login") ?></h3>
<div class="content">
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<?php echo translate("uws:user") ?>:<br>
<input type="text" name="uname" id="uname" value=""/>
<?php echo translate("uws:pwd") ?>:<br>
<input type="password" name="pwd" id="pwd" value=""/>
<input type="submit" name="submit" id="submit" value="<?php echo translate("uws:login") ?>"/>
<a href="register.php"><?php echo translate("uws:register")?></a>
</form>
<p></p>
</div>
<div id="errors">
<span style='color:red' name='PHPSpan'>
<table border='1'>
<tr>
<td><?php echo $error ?></td>
</tr>
</table>
</span><br />
</div>
<h3>Links</h3>
<div class="content">
<ul class="linklist">
<li class="first"><a href="#"></a></li>
<li><a href="#">Dignissim nec augue </a></li>
<li><a href="#">Nunc ante elit nulla</a></li>
<li><a href="#">Aliquam suscipit</a></li>
<li><a href="#">Cursus sed arcu sed</a></li>
<li><a href="#">Aliquam suscipit</a></li>
<li><a href="#">Donec mollis dolore</a></li>
<li><a href="#">Eu ante cras at risus</a></li>
</ul>
</div>
<!-- secondary content end -->
</div>
<div id="footer">
© UWS. </a>.
</div>
</div>
</div>
</body>
</html>