diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-28 15:39:55 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-09-28 15:39:55 +0000 |
commit | ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f (patch) | |
tree | 3416983de2c7a93f98e576068c7af8e91176527a /central/trunk/includes/instadisc.php | |
parent | 0bed7609d62da9132801ff2dee9311e2edb9f934 (diff) | |
download | instadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.tar.gz instadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.tar.bz2 instadisc-ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f.zip |
Central: Completed step 9
Refs #69
Diffstat (limited to 'central/trunk/includes/instadisc.php')
-rw-r--r-- | central/trunk/includes/instadisc.php | 26 |
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 | ||
240 | function 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 | ?> |