580 lines
32 KiB
PHP
580 lines
32 KiB
PHP
|
<?php
|
||
|
require_once __DIR__ . '/../startup.php';
|
||
|
|
||
|
$mdparser = new Parsedown();
|
||
|
$userData = $flashii->getUserdata($_SESSION['uid']);
|
||
|
$settingsBody = '';
|
||
|
$settingsMenu = [];
|
||
|
|
||
|
if($flashii->loggedIn()) {
|
||
|
if(isset($_GET['mode'])) {
|
||
|
switch($_GET['mode']) {
|
||
|
// General
|
||
|
case 'home':
|
||
|
$settingsBody .= '<div class="head">Settings / Home</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<h1 class="stylised" style="line-height: 1.8em; text-align: center;">Select an option from the menu on the right!</h1>';
|
||
|
$settingsBody .= '<h3 style="text-align: center;">Some parts may require you to enter a CAPTCHA (mainly in the "Account" section), this is for security purposes and might be removed in the future.</h3>';
|
||
|
break;
|
||
|
|
||
|
case 'profile':
|
||
|
$settingsBody .= '<div class="head">Settings / Edit Profile</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'These are the external account links etc. on your profile, shouldn\'t need any additional explanation for this one.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/profile">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
// Website
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Website</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="website" placeholder="URL to your website" value="'. $userData['website'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// Twitter
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Twitter</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="twitter" placeholder="Your Twitter Username" value="'. $userData['twitter'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// GitHub
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>GitHub</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="github" placeholder="Your GitHub Username" value="'. $userData['github'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// Skype
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Skype</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="skype" placeholder="Your Skype Username" value="'. $userData['skype'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// YouTube
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>YouTube</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="youtube" placeholder="ID or Username excluding http://youtube.com/*/" value="'. $userData['youtube'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '<div><input id="youtubetype" type="checkbox" name="youtubetype"'. ($userData['youtube_type'] ? ' checked="true"' : null) .' /> <label style="font-size: 10px;" for="youtubetype">I <b>don\'t</b> have a Channel Username (url looks like https://www.youtube.com/channel/UCXZcw5hw5C7Neto-T_nRXBQ).</label></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// SoundCloud
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>SoundCloud</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="soundcloud" placeholder="Your SoundCloud username" value="'. $userData['soundcloud'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// Steam
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Steam</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="steam" placeholder="Your Steam Community Username" value="'. $userData['steam'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// osu!
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>osu!</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="osu" placeholder="Your osu! Username" value="'. $userData['osu'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// Origin
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Origin</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="origin" placeholder="Your Origin User ID" value="'. $userData['eaorigin'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// Xbox Live
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Xbox Live</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="xboxlive" placeholder="Your Xbox User ID" value="'. $userData['xboxlive'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
// PSN
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>PSN</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="psn" placeholder="Your PSN User ID" value="'. $userData['playstation'] .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
// Birthday
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Birthday</h2></div>';
|
||
|
$settingsBody .= '<div><input type="date" name="birthday" placeholder="YYYY-MM-DD" value="'. (empty($userData['birthdate']) ? '' : date('Y-m-d', $userData['birthdate'])) .'" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'gender':
|
||
|
$settingsBody .= '<div class="head">Settings / Gender</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Your gender is an important personal choice, below is a list with genders you can set.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/set2.php?mode=gender">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Gender</h2></div>';
|
||
|
$settingsBody .= '<div><select name="gender" value="'. $userData['gender'] .'" class="inputStyling" style="width: 100%;">';
|
||
|
|
||
|
foreach($gaytumblrshit as $id => $gender)
|
||
|
$settingsBody .= '<option value="' . $id . '" ' . ($id == $userData['gender'] ? ' selected' : '') . '>' . $gender . '</option>';
|
||
|
|
||
|
$settingsBody .= '</select></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
|
||
|
// Aesthetics
|
||
|
case 'avatar':
|
||
|
$settingsBody .= '<div class="head">Settings / Avatar</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Your avatar which is displayed all over the site and on your profile.<br />Maximum image size is 500x500, minimum image size is 20x20, maximum file size is 10 MB.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/avatar">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div style="text-align: center;"><img src="/a/'. $_SESSION['uid'] .'" alt="Your Avatar" class="default-avatar-setting" /></div>';
|
||
|
|
||
|
$settingsBody .= '<div><input style="width: calc(100% - 16px);" type="text" name="avatar" placeholder="URL to remote image" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '<div style="text-align: center;"><input type="submit" value="Submit" name="submit" class="inputStyling" /></div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'background':
|
||
|
if(!$flashii->checkRank($fwSettings['premiumRanks'])) {
|
||
|
header('Location: /settings/');
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
$settingsBody .= '<div class="head">Settings / Background</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'The background that is displayed on your profile.<br />Maximum image size is 2560x1440, minimum image size is 20x20, maximum file size is 10 MB.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/background">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div style="text-align: center;"><img src="/bg/'. $userData['id'] .'" alt="Your Background" class="background-frame" /></div>';
|
||
|
|
||
|
$settingsBody .= '<div><input style="width: calc(100% - 16px);" type="text" name="background" placeholder="URL to remote image" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '<div style="text-align: center;"><input type="submit" value="Submit" name="submit" class="inputStyling" /></div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'page':
|
||
|
$settingsBody .= '<div class="head">Settings / Profile Page</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'This is the big markdown block that\'s displayed on the left side of your profile.<br /><a class="default" href="/r/typography" target="_blank">Click here if you don\'t know how to markdown.</a>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/markdown">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div><textarea name="markdown" placeholder="# Welcome to my profile page!" class="inputStyling" style="width: calc(100% - 12px); height: 500px;" />'. $userData['profilemarkdown'] .'</textarea></div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
|
||
|
// Account
|
||
|
case 'email':
|
||
|
$settingsBody .= '<div class="head">Settings / E-Mail Address</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'You e-mail address is/will eventually be used for password restoration and stuff like that, we won\'t spam you ;).';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/email">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<h3 style="text-align: center;">Your e-mail address is currently set to <span style="font-weight: 700;">'. $userData['email'] . '</span>.</h3>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>E-Mail Address</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="emailnew" placeholder="Enter your new e-mail address" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Confirmation</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="emailver" placeholder="Just to make sure..." class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Verification</h2></div>';
|
||
|
$settingsBody .= recaptcha_get_html($RECAPTCHApublickey);
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'username':
|
||
|
if(!$flashii->checkRank($fwSettings['premiumRanks'])) {
|
||
|
header('Location: /settings/');
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
$settingsBody .= '<div class="head">Settings / Username</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Probably the biggest part of your identity on a site, <b>you can only change this once every 30 days so choose wisely</b>.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$eligible = ((time() - $userData['last_namechange']) > 2592000);
|
||
|
$daydifferenece = (30 - round((time() - $userData['last_namechange']) / 86400));
|
||
|
|
||
|
$settingsBody .= '<h1 class="stylised" style="text-align: center; margin-top: 10px;'. ($eligible ? null : ' color: #c44;') .'">You are '. ($eligible ? null : 'not ') .'eligible for a name change.</h1>';
|
||
|
if(!$eligible) {
|
||
|
$settingsBody .= '<h3 style="text-align: center;">You can change your name again in '. $daydifferenece .' days.</h3>';
|
||
|
} else {
|
||
|
$settingsBody .= '<form method="post" action="/sys/username">';
|
||
|
|
||
|
$settingsBody .= '<h3 style="text-align: center;">Your current username is <span style="font-weight: 700;">'. $userData['username'] . '</span>.</h3>';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Username</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="usernew" placeholder="Enter your new username (Max 20 characters)" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Confirmation</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="userver" placeholder="Just to make sure since you\'ll be stuck with it for 30 days..." class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Verification</h2></div>';
|
||
|
$settingsBody .= recaptcha_get_html($RECAPTCHApublickey);
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
}
|
||
|
break;
|
||
|
|
||
|
case 'usertitle':
|
||
|
if(!$flashii->checkRank($fwSettings['premiumRanks'])) {
|
||
|
header('Location: /settings/');
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
$settingsBody .= '<div class="head">Settings / User Title</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'That little piece of text displayed under your username on your profile.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/usertitle">';
|
||
|
|
||
|
$settingsBody .= '<h3 style="text-align: center;">Your current user title is:<br /><span style="font-weight: 700;">'. $userData['usertitle'] . '</span></h3>';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>New user title</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="usertitle" placeholder="Enter your new user title (Max 64 characters)" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'password':
|
||
|
$settingsBody .= '<div class="head">Settings / Password</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Used to log in to the site, I recommend making it not too easy to guess.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/password">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Current Password</h2></div>';
|
||
|
$settingsBody .= '<div><input type="password" name="currentpw" placeholder="Enter your current password for verification." class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>New Password</h2></div>';
|
||
|
$settingsBody .= '<div><input type="password" name="newpw" placeholder="Enter your new password (Max 128 characters)." class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Confirmation</h2></div>';
|
||
|
$settingsBody .= '<div><input type="password" name="conpw" placeholder="Enter your new password again to make sure you didn\'t fuck up." class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Save" name="submit" class="inputStyling" /> <input type="button" value="Reset" name="reset" onclick="window.location.reload();" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
case 'groups':
|
||
|
$settingsBody .= '<div class="head">Settings / Groups</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Manage what groups you\'re in and what is set as your main group, groups are like the "power levels" of this site. Your main group is highlighted.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$groups = unserialize($userData['groups']);
|
||
|
|
||
|
$settingsBody .= '<table class="settings-table">';
|
||
|
|
||
|
$settingsBody .= '<thead>';
|
||
|
$settingsBody .= '<tr><th>Group Name</th><th style="width: 125px;">Actions</th></tr>';
|
||
|
$settingsBody .= '</thead>';
|
||
|
|
||
|
$settingsBody .= '<tfoot>';
|
||
|
$settingsBody .= '<tr><th>Group Name</th><th>Actions</th>';
|
||
|
$settingsBody .= '</tfoot>';
|
||
|
|
||
|
$settingsBody .= '<tbody>';
|
||
|
foreach($groups as $group) {
|
||
|
$groupData = $flashii->getRankdata($group);
|
||
|
|
||
|
$settingsBody .= '<tr';
|
||
|
|
||
|
if($group == $userData['userrole'])
|
||
|
$settingsBody .= ' class="current-session"';
|
||
|
|
||
|
$settingsBody .= '>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= $groupData['name'];
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= '<form method="post" action="/sys/groups">';
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
$settingsBody .= '<input type="hidden" value="'. $group .'" name="groupid" />';
|
||
|
$settingsBody .= '<input type="submit" value="Set Default" name="default" />';
|
||
|
$settingsBody .= '<input type="submit" value="Leave" name="leave" '. ($group < 2 ? 'disabled ' : '') .'/>';
|
||
|
$settingsBody .= '</form>';
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '</tr>';
|
||
|
}
|
||
|
$settingsBody .= '</tbody>';
|
||
|
|
||
|
$settingsBody .= '</table>';
|
||
|
break;
|
||
|
|
||
|
|
||
|
// Danger Zone
|
||
|
case 'sessions':
|
||
|
$settingsBody .= '<div class="head">Settings / Sessions</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Session keys are a way of identifying yourself with the system without keeping your password in memory. ';
|
||
|
$settingsBody .= 'If someone finds one of your session keys they could possibly compromise your account, if you see any sessions here that shouldn\'t be here hit the Kill button to kill the selected session. ';
|
||
|
$settingsBody .= 'If you get logged out after clicking one you\'ve most likely killed your current session, to make it easier to avoid this from happening your current session is highlighted.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$sessions = $flashii->getUserSessions($_SESSION['uid']);
|
||
|
|
||
|
$settingsBody .= '<table class="settings-table">';
|
||
|
|
||
|
$settingsBody .= '<thead>';
|
||
|
$settingsBody .= '<tr><th>IP</th style="width: 110px;"><th style="width: 370px;">Useragent</th><th>Login time</th><th></th></tr>';
|
||
|
$settingsBody .= '</thead>';
|
||
|
|
||
|
$settingsBody .= '<tfoot>';
|
||
|
$settingsBody .= '<tr><th>IP</th><th>Useragent</th><th>Login time</th><th></th></tr>';
|
||
|
$settingsBody .= '</tfoot>';
|
||
|
|
||
|
$settingsBody .= '<tbody>';
|
||
|
foreach($sessions as $session) {
|
||
|
$settingsBody .= '<tr';
|
||
|
|
||
|
if($session['skey'] == $_SESSION['sid'])
|
||
|
$settingsBody .= ' class="current-session"';
|
||
|
|
||
|
$settingsBody .= '>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= $session['ip'];
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= $session['uagent'];
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= date($fwSettings['dateFormat'], $session['time']);
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '<td>';
|
||
|
$settingsBody .= '<form method="post" action="/sys/session">';
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
$settingsBody .= '<input type="hidden" value="'. $session['sid'] .'" name="sessionid" />';
|
||
|
$settingsBody .= '<input type="submit" value="Kill" name="submit" />';
|
||
|
$settingsBody .= '</form>';
|
||
|
$settingsBody .= '</td>';
|
||
|
|
||
|
$settingsBody .= '</tr>';
|
||
|
}
|
||
|
$settingsBody .= '</tbody>';
|
||
|
|
||
|
$settingsBody .= '</table>';
|
||
|
break;
|
||
|
|
||
|
case 'regkeys';
|
||
|
if(!$regCheck) {
|
||
|
header('Location: /settings/');
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
$settingsBody .= '<div class="head">Settings / Registration Keys</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'Sometimes we activate the registration key system which means that users can only register using your "referer" keys, this means we can keep unwanted people from registering. Each user can generate 5 of these keys, bans and deactivates render these keys useless.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$keys = $database->query("SELECT * FROM `flashii_regcodes` WHERE `uid`='". $_SESSION['uid'] ."' ORDER BY `id` DESC")->fetch_all(MYSQLI_ASSOC);
|
||
|
|
||
|
$settingsBody .= '<table class="settings-table">';
|
||
|
|
||
|
$settingsBody .= '<thead>';
|
||
|
$settingsBody .= '<tr><th>Registration Code</th><th style="width: 80px;">State</th></tr>';
|
||
|
$settingsBody .= '</thead>';
|
||
|
|
||
|
$settingsBody .= '<tfoot>';
|
||
|
$settingsBody .= '<tr><th>Registration Code</th><th style="width: 80px;">State</th></tr>';
|
||
|
$settingsBody .= '</tfoot>';
|
||
|
|
||
|
$settingsBody .= '<tbody>';
|
||
|
foreach($keys as $key) {
|
||
|
$settingsBody .= '<tr>';
|
||
|
|
||
|
$settingsBody .= '<td style="padding: 5px 0;">'. $key['code'] .'</td>';
|
||
|
$settingsBody .= '<td style="padding: 5px 0; background: '. ($key['used'] ? '#C22' : '#2C2') .';">'. ($key['used'] ? 'Used' : 'Unused') .'</td>';
|
||
|
|
||
|
$settingsBody .= '</tr>';
|
||
|
}
|
||
|
$settingsBody .= '</tbody>';
|
||
|
|
||
|
$settingsBody .= '</table>';
|
||
|
|
||
|
if(count($keys) < 5)
|
||
|
$settingsBody .= '<h1 style="text-align: center;"><a href="/sys/genregkey" class="default">Generate new key</a></h1>';
|
||
|
break;
|
||
|
|
||
|
case 'deactivate';
|
||
|
$settingsBody .= '<div class="head">Settings / Deactivate Account</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="settings-explanation">';
|
||
|
$settingsBody .= 'You can deactivate your account here if you want to leave :(.';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<form method="post" action="/sys/deactivate">';
|
||
|
|
||
|
$settingsBody .= '<input type="hidden" name="sessid" value="'. session_id() .'" /><input type="hidden" name="timestamp" value="'. time() .'" />';
|
||
|
|
||
|
$settingsBody .= '<h3>In order for this to go through properly we require you to enter a few forms.</h3>';
|
||
|
$settingsBody .= '<h3>If you want your account reactivated contact the Administrator, it is not allowed to have more than one account.</h3>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Username</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="username" placeholder="Case sensitive" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Password</h2></div>';
|
||
|
$settingsBody .= '<div><input type="password" name="password" placeholder="Security" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>E-Mail Address</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="email" placeholder="More security" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Type "I am one hundred percent sure that I want to deactivate my account." without the quotes.</h2></div>';
|
||
|
$settingsBody .= '<div><input type="text" name="sensitive" placeholder="Are you 100% case sensitively sure?" class="inputStyling" /></div>';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-field">';
|
||
|
$settingsBody .= '<div><h2>Verification</h2></div>';
|
||
|
$settingsBody .= recaptcha_get_html($RECAPTCHApublickey);
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '<div class="profile-save">';
|
||
|
$settingsBody .= '<input type="submit" value="Good night, sweet prince." name="submit" class="inputStyling" />';
|
||
|
$settingsBody .= '</div>';
|
||
|
|
||
|
$settingsBody .= '</form>';
|
||
|
break;
|
||
|
|
||
|
|
||
|
// Not Found
|
||
|
default:
|
||
|
$settingsBody .= '<div class="head">Settings / 404</div>';
|
||
|
$settingsBody .= 'Could not find what you were looking for.';
|
||
|
break;
|
||
|
}
|
||
|
} else {
|
||
|
header('Location: /settings/home');
|
||
|
}
|
||
|
|
||
|
$settingsMenu = [
|
||
|
'General' => [
|
||
|
'Home' => ['/settings'],
|
||
|
'Edit Profile' => ['/settings/profile'],
|
||
|
'Gender' => ['/settings/gender'],
|
||
|
],
|
||
|
'Aesthetics' => [
|
||
|
'Avatar' => ['/settings/avatar'],
|
||
|
'Background' => ['/settings/background', $flashii->checkRank($fwSettings['premiumRanks'])],
|
||
|
'Profile Page' => ['/settings/page'],
|
||
|
],
|
||
|
'Account' => [
|
||
|
'E-Mail Address' => ['/settings/email'],
|
||
|
'Username' => ['/settings/username', $flashii->checkRank($fwSettings['premiumRanks'])],
|
||
|
'User Title' => ['/settings/usertitle', $flashii->checkRank($fwSettings['premiumRanks'])],
|
||
|
'Password' => ['/settings/password'],
|
||
|
'Groups' => ['/settings/groups'],
|
||
|
],
|
||
|
'Danger zone' => [
|
||
|
'Sessions' => ['/settings/sessions'],
|
||
|
'Registration Keys' => ['/settings/regkeys', $regCheck],
|
||
|
'Deactivate Account' => ['/settings/deactivate'],
|
||
|
],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
require_once fiiSwitch_path();
|