$values['name'] = $values['ipaddress'] = $_SERVER['REMOTE_ADDR']; } // Load the DataLayer @(include_once 'includes/datalayer.class.php'); // Make sure the DataLayer class loaded sucessfully if (!class_exists('DataLayer')) { die("ERROR: Unable to load DataLayer class.\n"); } $dl = new DataLayer($config['datalayer']); if ($dl === false) { die("ERROR: Unable to connect to database.\n"); } // Now that we have the IP address, see if this server is already in our // database. If so, just update, otherwise, insert a new record // Remove the server $dl->Server_Delete_ByIPAddressPort($values); } else { if ($input['action'] == 'LIST') { // Check some of our input if (isset($input['version']) && !valid_version($input['version'])) { die("ERROR: Invalid version specified. Must begin with 'BZFS' and be followed by a four digit, zero-padded number (e.g. BZFS0026)\n"); } // If they specified a username, make sure it's valid. If not, unset it and // spit out an error message if (isset($input['username']) && !valid_username($input['username'])) { echo "ERROR: A valid username was not specified. Usernames must use only " . "alphanumeric characters, hyphens, underscores, or periods. Must be " . "2 to 25 characters long.\n"; unset($input['username']); } if (isset($input['password']) && !valid_password($input['password'])) { echo "ERROR: Password must be between 4 and 30 characters long.\n"; unset($input['password']);