about summary refs log tree commit diff stats
path: root/central/trunk/includes
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-28 15:39:55 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-28 15:39:55 +0000
commitff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f (patch)
tree3416983de2c7a93f98e576068c7af8e91176527a /central/trunk/includes
parent0bed7609d62da9132801ff2dee9311e2edb9f934 (diff)
downloadinstadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.tar.gz
instadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.tar.bz2
instadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.zip
Central: Completed step 9
Refs #69
Diffstat (limited to 'central/trunk/includes')
-rw-r--r--central/trunk/includes/instadisc.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/central/trunk/includes/instadisc.php b/central/trunk/includes/instadisc.php index 003ad1b..1c4c968 100644 --- a/central/trunk/includes/instadisc.php +++ b/central/trunk/includes/instadisc.php
@@ -237,4 +237,30 @@ function instaDisc_changePassword($username, $password)
237 $setpass2 = mysql_query($setpass); 237 $setpass2 = mysql_query($setpass);
238} 238}
239 239
240function instaDisc_initalizePort($username)
241{
242 $getports = "SELECT * FROM users WHERE ip = \"" . mysql_real_escape_string($username) . "\" AND port <> 0 ORDER BY port ASC";
243 $getports2 = mysql_query($getports);
244 $i=0;
245 while ($getports3[$i] = mysql_fetch_array($getports2))
246 {
247 $i++;
248 }
249
250 if ($i==0)
251 {
252 $port = 1204;
253 } else if ($i>=4331)
254 {
255 return 0;
256 } else {
257 $port = (61204 + ($i-1));
258 }
259
260 $setuser = "UPDATE users SET port = " . $port . " WHERE username = \"" . mysql_real_escape_string($username) . "\"";
261 $setuser2 = mysql_query($setuser);
262
263 return $port;
264}
265
240?> 266?>