about summary refs log tree commit diff stats
path: root/central/trunk/includes/instadisc.php
diff options
context:
space:
mode:
Diffstat (limited to 'central/trunk/includes/instadisc.php')
-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?>