diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-28 01:01:24 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-28 01:01:24 +0500 |
| commit | c95dfa9e3dd18c0835626ec29b814cc2b11b7fae (patch) | |
| tree | 7e86569d5742820f99bd90dc58a8dae74ef6d1d2 /public | |
| parent | 5ab2480c609b3f2540f5eb840e9cf3eb0589317d (diff) | |
fix: don't update avatar on login
Diffstat (limited to 'public')
| -rw-r--r-- | public/account/login/twitch.php | 20 |
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 |
