summaryrefslogtreecommitdiff
path: root/public/account
diff options
context:
space:
mode:
Diffstat (limited to 'public/account')
-rw-r--r--public/account/login/twitch.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/public/account/login/twitch.php b/public/account/login/twitch.php
index 7866eb5..ec10583 100644
--- a/public/account/login/twitch.php
+++ b/public/account/login/twitch.php
@@ -127,14 +127,16 @@ if (!is_dir($path)) {
mkdir($path, 0777, true);
}
-$fp = fopen("$path/$user_id", "wb");
-$request = curl_init();
-curl_setopt($request, CURLOPT_URL, $twitch_user["profile_image_url"]);
-curl_setopt($request, CURLOPT_FILE, $fp);
-curl_setopt($request, CURLOPT_HEADER, 0);
-
-curl_exec($request);
-curl_close($request);
-fclose($fp);
+if (!is_file("$path/$user_id")) {
+ $fp = fopen("$path/$user_id", "wb");
+ $request = curl_init();
+ curl_setopt($request, CURLOPT_URL, $twitch_user["profile_image_url"]);
+ curl_setopt($request, CURLOPT_FILE, $fp);
+ curl_setopt($request, CURLOPT_HEADER, 0);
+
+ curl_exec($request);
+ curl_close($request);
+ fclose($fp);
+}
header("Location: /account"); \ No newline at end of file