public static void makeAssurer(int uid) {
GigiPreparedStatement ps1 = DatabaseConnection.getInstance().prepare("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?");
ps1.setInt(1, uid);
- ps1.setInt(2, 0);
+ ps1.setInt(2, 1);
ps1.execute();
GigiPreparedStatement ps2 = DatabaseConnection.getInstance().prepare("INSERT INTO `notary` SET `from`=?, `to`=?, points='100'");
}
public static String executeBasicWebInteraction(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
+ URLConnection uc = post(cookie, path, query, formIndex);
+ String error = fetchStartErrorMessage(IOUtils.readURL(uc));
+ return error;
+ }
+
+ public static HttpURLConnection post(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
URLConnection uc = new URL("https://" + getServerName() + path).openConnection();
uc.addRequestProperty("Cookie", cookie);
String csrf = getCSRF(uc, formIndex);
+ query//
).getBytes("UTF-8"));
os.flush();
- String error = fetchStartErrorMessage(IOUtils.readURL(uc));
- return error;
+ return (HttpURLConnection) uc;
+ }
+
+ public HttpURLConnection get(String cookie, String path) throws IOException {
+ URLConnection uc = new URL("https://" + getServerName() + path).openConnection();
+ uc.addRequestProperty("Cookie", cookie);
+ return (HttpURLConnection) uc;
}
public static EmailAddress createVerifiedEmail(User u) throws InterruptedException, GigiApiException {