diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-10-31 17:04:34 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-10-31 17:04:34 +0100 |
commit | e61e581a2b66b0444db01d884465ea913929e343 (patch) | |
tree | b49eaedb3681c4b26637acdd375cda4c3d37b07c /api/savePrivacy.php | |
parent | 41c51b8bdb9c8e9fa4a7d56f260d594739d4107e (diff) | |
download | mist-e61e581a2b66b0444db01d884465ea913929e343.tar.gz mist-e61e581a2b66b0444db01d884465ea913929e343.tar.bz2 mist-e61e581a2b66b0444db01d884465ea913929e343.zip |
Updated 27 files, added 12 files and deleted 3 files (automated)
Diffstat (limited to 'api/savePrivacy.php')
-rw-r--r-- | api/savePrivacy.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/api/savePrivacy.php b/api/savePrivacy.php new file mode 100644 index 0000000..b18f0f2 --- /dev/null +++ b/api/savePrivacy.php @@ -0,0 +1,13 @@ +<?php + +header("X-Frame-Options: SAMEORIGIN"); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; +global $songs; global $_PROFILE; global $favorites; global $privacy; + +foreach ($privacy as $item => $_) { + if (isset($_GET[$item]) && ($_GET[$item] === "0" || $_GET[$item] === "1" || $_GET[$item] === "2")) { + $privacy[$item] = (int)$_GET[$item]; + } +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-privacy.json", json_encode($privacy));
\ No newline at end of file |