12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409 |
- <?php
- #declare(strict_types = 1);
-
- require_once SERVER_ROOT.'/classes/twofa.class.php';
- $UserID = $_REQUEST['userid'];
-
- if (!is_number($UserID)) {
- error(404);
- }
-
- $DB->query("
- SELECT
- m.Username,
- m.TwoFactor,
- m.PublicKey,
- m.Email,
- m.IRCKey,
- m.Paranoia,
- i.Info,
- i.Avatar,
- i.StyleID,
- i.StyleURL,
- i.SiteOptions,
- i.UnseededAlerts,
- p.Level AS Class,
- i.InfoTitle
- FROM users_main AS m
- JOIN users_info AS i ON i.UserID = m.ID
- LEFT JOIN permissions AS p ON p.ID = m.PermissionID
- WHERE m.ID = ?", $UserID);
- list($Username, $TwoFactor, $PublicKey, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $StyleID, $StyleURL, $SiteOptions, $UnseededAlerts, $Class, $InfoTitle) = $DB->next_record(MYSQLI_NUM, [5, 10]);
-
- $TwoFA = new TwoFactorAuth();
- $Email = apcu_exists('DBKEY') ? Crypto::decrypt($Email) : '[Encrypted]';
-
- if ((int) $UserID !== $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
- error(403);
- }
-
- $Paranoia = json_decode($Paranoia, true);
- if (!is_array($Paranoia)) {
- $Paranoia = [];
- }
-
- function paranoia_level($Setting)
- {
- global $Paranoia;
- // 0: very paranoid; 1: stats allowed, list disallowed; 2: not paranoid
- return (in_array($Setting . '+', $Paranoia)) ? 0 : (in_array($Setting, $Paranoia) ? 1 : 2);
- }
-
- function display_paranoia($FieldName)
- {
- $Level = paranoia_level($FieldName);
- echo "<label><input type='checkbox' name='p_{$FieldName}_c'" . checked($Level >= 1) . " onchange='AlterParanoia()' /> Show count</label> ";
- echo "<label><input type='checkbox' name='p_{$FieldName}_l'" . checked($Level >= 2) . " onchange='AlterParanoia()' /> Show list</label> ";
- }
-
- function checked($Checked)
- {
- return ($Checked ? ' checked="checked"' : '');
- }
-
- if ($SiteOptions) {
- $SiteOptions = json_decode($SiteOptions, true) ?? [];
- } else {
- $SiteOptions = [];
- }
-
- /**
- * Show header
- */
- View::show_header(
- "$Username $ENV->CRUMB Settings",
- 'user,password_validate,validate,cssgallery,preview_paranoia,bbcode,user_settings,donor_titles,vendor/easymde.min',
- 'vendor/easymde.min'
- );
-
- $DonorRank = Donations::get_rank($UserID);
- $DonorIsVisible = Donations::is_visible($UserID);
-
- if ($DonorIsVisible === null) {
- $DonorIsVisible = true;
- }
-
- extract(Donations::get_enabled_rewards($UserID));
- $Rewards = Donations::get_rewards($UserID);
- $ProfileRewards = Donations::get_profile_rewards($UserID);
- ?>
-
- <div>
- <div class="header">
- <h2>
- <?=Users::format_username($UserID, false, false, false)?>
- <?=$ENV->CRUMB?> Settings
- </h2>
- </div>
-
- <!-- Side menu / settings filter -->
- <form class="edit_form" name="user" id="userform" method="post" autocomplete="off">
- <div class="sidebar">
- <div class="box" id="settings_sections">
-
- <div class="head">
- <strong>Sections</strong>
- </div>
-
- <ul class="nobullet">
- <li data-gazelle-section-id="all_settings">
- <h2>
- <a href="#">All Settings</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="site_appearance">
- <h2>
- <a href="#">Site Appearance</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="torrent_settings">
- <h2>
- <a href="#">Torrents</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="community_settings">
- <h2>
- <a href="#">Community</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="notification_settings">
- <h2>
- <a href="#">Notifications</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="profile_settings">
- <h2>
- <a href="#">Profile</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="paranoia_settings">
- <h2>
- <a href="#">Paranoia</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="security_settings">
- <h2>
- <a href="#">Security</a>
- </h2>
- </li>
-
- <li data-gazelle-section-id="live_search">
- <input type="text" id="settings_search" placeholder="Filter settings" />
- </li>
-
- <li>
- <input type="submit" id="submit" value="Save profile" />
- </li>
-
- </ul>
- </div>
- </div>
-
- <div class="main_column">
- <div>
- <input type="hidden" name="action" value="take_edit" />
- <input type="hidden" name="userid" value="<?=$UserID?>" />
- <input type="hidden" name="auth"
- value="<?=$LoggedUser['AuthKey']?>" />
- </div>
-
- <!-- Site Appearance -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="site_appearance">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Site Appearance</strong>
- </td>
- </tr>
-
- <!-- Stylesheet -->
- <tr id="site_style_tr">
- <td class="label">
- <strong>Stylesheet</strong>
- </td>
-
- <td>
- <select name="stylesheet" id="stylesheet">
- <?php foreach ($Stylesheets as $Style) { ?>
-
- <option value="<?=($Style['ID'])?>"
- <?=(int) $Style['ID'] === $StyleID ? ' selected="selected"' : ''?>><?=($Style['ProperName'])?>
- </option>
- <?php } ?>
- </select>
-  
- <a data-toggle-target="#css_gallery" class="brackets">Show gallery</a>
- <div id="css_gallery" class="hidden">
- <?php foreach ($Stylesheets as $Style) { ?>
- <div class="preview_wrapper">
- <div class="preview_image"
- name="<?=($Style['Name'])?>">
- <img
- src="<?=STATIC_SERVER.'styles/preview/thumb_'.$Style['Name'].'.png'?>"
- alt="<?=$Style['Name']?>" />
- <p class="preview_name">
- <label><input type="radio" name="stylesheet_gallery"
- value="<?=($Style['ID'])?>" />
- <?=($Style['ProperName'])?></label>
- </p>
- </div>
- </div>
- <?php } ?>
- </div>
- </td>
- </tr>
-
- <!-- Stylesheet additions -->
- <tr id="style_additions_tr"
- class="<?=($Stylesheets[$LoggedUser['StyleID']]['Additions'][0] ?? false)?'':'hidden'?>">
- <td class="label">
- <strong>Stylesheet additions</strong>
- </td>
-
- <td>
- <?php
- foreach ($Stylesheets as $Style) {
- $StyleAdditions = explode(';', $Style['Additions']);
-
- # Main ul
- echo '<ul class="nobullet style_addition'; # open quote
- echo ($Style['ID'] === $Stylesheets[$LoggedUser['StyleID']]['ID'])
- ? '"'
- : ' hidden"';
- echo ' id="style_addition_' . $Style['Name'] . '">';
-
- $Checked = (in_array('default_font', $SiteOptions['StyleAdditions'] ?? [])
- ? 'checked'
- : '');
-
- echo <<<HTML
- <li>
- <input type="radio" name="style_additions[]" value="default_font"
- id="default_font" $Checked />
- <label for="default_font">default_font</label>
- </li>
- HTML;
-
- # For each style addition
- foreach ($StyleAdditions as $i => $Addition) {
- # Radio options, e.g., fonts
- if (preg_match('/radio/', $Addition)) {
- $Addition = explode('=', $Addition)[1];
- $Checked = (in_array($Addition, $SiteOptions['StyleAdditions'] ?? [])
- ? 'checked'
- : '');
-
- echo <<<HTML
- <li>
- <input type="radio" name="style_additions[]" value="$Addition"
- id="addition_$Addition" $Checked />
- <label for="addition_$Addition">$Addition</label>
- </li>
- HTML;
- }
-
- # Checkbox options, e.g., pink and haze
- if (preg_match('/checkbox/', $Addition)) {
- $Addition = explode('=', $Addition)[1];
- $Checked = (in_array($Addition, $SiteOptions['StyleAdditions'] ?? [])
- ? 'checked'
- : '');
-
- echo <<<HTML
- <li>
- <input type="checkbox" name="style_additions[]" value="$Addition"
- id="addition_$Addition" $Checked />
- <label for="addition_$Addition">$Addition</label>
- </li>
- HTML;
- }
- }
-
- echo '</ul>';
- } ?>
- </td>
- </tr>
-
- <!-- External stylesheet URL -->
- <tr id="site_extstyle_tr">
- <td class="label">
- <strong>External stylesheet URL</strong>
- </td>
-
- <td>
- <input type="text" size="40" name="styleurl" id="styleurl"
- value="<?=display_str($StyleURL)?>" />
- </td>
- </tr>
-
- <!-- Profile stats -->
- <?php if (check_perms('users_mod')) { ?>
- <tr id="site_autostats_tr">
- <td class="label tooltip" title="Staff Only">
- <strong>Profile stats</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="autoload_comm_stats" <?Format::selected(
- 'AutoloadCommStats' ,
- 1,
- 'checked',
- $SiteOptions
- ); ?>
- />
- Automatically fetch the snatch and peer stats on profile pages
- </label>
- </td>
- </tr>
- <?php } ?>
- </table>
-
- <!-- Torrents -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="torrent_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Torrents</strong>
- </td>
- </tr>
-
- <!-- Default search type -->
- <?php if (check_perms('site_advanced_search')) { ?>
- <tr id="tor_searchtype_tr">
- <td class="label">
- <strong>Default search type</strong>
- </td>
-
- <td>
- <ul class="options_list nobullet">
- <li>
- <input type="radio" name="searchtype" id="search_type_simple" value="0" <?=(int)$SiteOptions['SearchType']===0?' checked="checked"':''?>
- />
- <label for="search_type_simple">Simple</label>
- </li>
-
- <li>
- <input type="radio" name="searchtype" id="search_type_advanced" value="1" <?=(int)$SiteOptions['SearchType']===1?' checked="checked"':''?>
- />
- <label for="search_type_advanced">Advanced</label>
- </li>
- </ul>
- </td>
- </tr>
- <?php } ?>
-
- <!-- Torrent grouping -->
- <tr id="tor_group_tr">
- <td class="label">
- <strong>Torrent grouping</strong>
- </td>
-
- <td>
- <div class="option_group">
- <input type="checkbox" name="disablegrouping" id="disablegrouping" <?=$SiteOptions['DisableGrouping2'] === 0 ? ' checked="checked"' : ''?>
- />
- <label for="disablegrouping">Enable torrent grouping</label>
- </div>
- </td>
- </tr>
-
- <!-- Torrent group display -->
- <tr id="tor_gdisp_search_tr">
- <td class="label">
- <strong>Torrent group display</strong>
- </td>
-
- <td>
- <div class="option_group">
- <ul class="options_list nobullet">
- <li>
- <input type="radio" name="torrentgrouping" id="torrent_grouping_open" value="0" <?=$SiteOptions['TorrentGrouping'] === 0 ? ' checked="checked"' : ''?>
- />
- <label for="torrent_grouping_open">Open</label>
- </li>
-
- <li>
- <input type="radio" name="torrentgrouping" id="torrent_grouping_closed" value="1" <?=$SiteOptions['TorrentGrouping'] === 1 ? ' checked="checked"' : ''?>
- />
- <label for="torrent_grouping_closed">Closed</label>
- </li>
- </ul>
- </div>
- </td>
- </tr>
-
- <!-- Snatched torrents indicator -->
- <tr id="tor_snatched_tr">
- <td class="label">
- <strong>Snatched torrents indicator</strong>
- </td>
-
- <td>
- <input type="checkbox" name="showsnatched" id="showsnatched" <?=!empty($SiteOptions['ShowSnatched']) ? ' checked="checked"' : ''?>
- />
- <label for="showsnatched">Enable snatched torrents indicator</label>
- </td>
- </tr>
-
- <!-- Cover art (torrents) -->
- <tr id="tor_cover_tor_tr">
- <td class="label">
- <strong>Cover art (torrents)</strong>
- </td>
-
- <td>
- <ul class="options_list nobullet">
- <li>
- <input type="hidden" name="coverart" value="" />
- <input type="checkbox" name="coverart" id="coverart" <?=!isset($SiteOptions['CoverArt']) || $SiteOptions['CoverArt'] ? ' checked="checked"' : ''?>
- />
- <label for="coverart">Enable cover artwork</label>
- </li>
-
- <li>
- <input type="checkbox" name="show_extra_covers" id="show_extra_covers" <?=$SiteOptions['ShowExtraCovers'] ? ' checked="checked"' : ''?>
- />
- <label for="show_extra_covers">Enable additional cover artwork</label>
- </li>
- </ul>
- </td>
- </tr>
-
- <!-- Cover art (collections) -->
- <tr id="tor_cover_coll_tr">
- <td class="label">
- <strong>Cover art (collections)</strong>
- </td>
-
- <td>
- <select name="collagecovers" id="collagecovers">
- <option value="10" <?=$SiteOptions['CollageCovers'] === 10 ? ' selected="selected"' : ''?>>10
- </option>
-
- <option value="25" <?=($SiteOptions['CollageCovers'] === 25 || !isset($SiteOptions['CollageCovers'])) ? ' selected="selected"' : ''?>>25
- (default)</option>
-
- <option value="50" <?=$SiteOptions['CollageCovers'] === 50 ? ' selected="selected"' : ''?>>50
- </option>
-
- <option value="100" <?=$SiteOptions['CollageCovers'] === 100 ? ' selected="selected"' : ''?>>100
- </option>
-
- <option value="1000000" <?=$SiteOptions['CollageCovers'] === 1000000 ? ' selected="selected"' : ''?>>All
- </option>
-
- <option value="0" <?=($SiteOptions['CollageCovers'] === 0 || (!isset($SiteOptions['CollageCovers']) && $SiteOptions['HideCollage'])) ? ' selected="selected"' : ''?>>None
- </option>
- </select>
- covers per page
- </td>
- </tr>
-
- <!-- Torrent search filters -->
- <tr id="tor_showfilt_tr">
- <td class="label">
- <strong>Torrent search filters</strong>
- </td>
-
- <td>
- <ul class="options_list nobullet">
- <li>
- <input type="checkbox" name="showtfilter" id="showtfilter" <?=(!isset($SiteOptions['ShowTorFilter']) || $SiteOptions['ShowTorFilter'] ? ' checked="checked"' : '')?>
- />
- <label for="showtfilter">Display filter controls</label>
- </li>
-
- <li>
- <input type="checkbox" name="showtags" id="showtags" <?php Format::selected('ShowTags', 1, 'checked', $SiteOptions); ?>
- />
- <label for="showtags">Display official tag filters</label>
- </li>
- </ul>
- </td>
- </tr>
-
- <!-- Autocompletion -->
- <tr id="tor_autocomp_tr">
- <td class="label">
- <strong>Autocompletion</strong>
- </td>
-
- <td>
- <select name="autocomplete">
- <option value="0" <?=empty($SiteOptions['AutoComplete']) ? ' selected="selected"' : ''?>>Everywhere
- </option>
-
- <option value="2" <?=$SiteOptions['AutoComplete'] === 2 ? ' selected="selected"' : ''?>>Searches
- only</option>
-
- <option value="1" <?=$SiteOptions['AutoComplete'] === 1 ? ' selected="selected"' : ''?>>Disable
- </option>
- </select>
- </td>
- </tr>
- </table>
-
- <!-- Community -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="community_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Community</strong>
- </td>
- </tr>
-
- <!-- Posts per page (forums) -->
- <tr id="comm_ppp_tr">
- <td class="label">
- <strong>Posts per page (forums)</strong>
- </td>
-
- <td>
- <select name="postsperpage" id="postsperpage">
- <option value="25" <?=$SiteOptions['PostsPerPage'] === 25 ? ' selected="selected"' : ''?>>25
- (default)</option>
-
- <option value="50" <?=$SiteOptions['PostsPerPage'] === 50 ? ' selected="selected"' : ''?>>50
- </option>
-
- <option value="100" <?=$SiteOptions['PostsPerPage'] === 100 ? ' selected="selected"' : ''?>>100
- </option>
- </select>
- posts per page
- </td>
- </tr>
-
- <!-- Inbox sorting -->
- <tr id="comm_inbsort_tr">
- <td class="label">
- <strong>Inbox sorting</strong>
- </td>
-
- <td>
- <input type="checkbox" name="list_unread_pms_first" id="list_unread_pms_first" <?=!empty($SiteOptions['ListUnreadPMsFirst']) ? ' checked="checked"' : ''?>
- />
- <label for="list_unread_pms_first">List unread private messages first</label>
- </td>
- </tr>
-
- <!-- Emoticons -->
- <tr id="comm_emot_tr">
- <td class="label">
- <strong>Emoticons</strong>
- </td>
-
- <td>
- <input type="checkbox" name="disablesmileys" id="disablesmileys" <?=!empty($SiteOptions['DisableSmileys']) ? ' checked="checked"' : ''?>
- />
- <label for="disablesmileys">Disable emoticons</label>
- </td>
- </tr>
-
- <!-- Avatar display (posts) -->
- <tr id="comm_avatars_tr">
- <td class="label">
- <strong>Avatar display (posts)</strong>
- </td>
-
- <td>
- <select name="disableavatars" id="disableavatars">
- <option value="1" <?=(int)$SiteOptions['DisableAvatars'] === 1 ? ' selected="selected"' : ''?>>Disable
- avatars</option>
- <option value="0" <?=(int)$SiteOptions['DisableAvatars'] === 0 ? ' selected="selected"' : ''?>>Show
- avatars</option>
- </select>
- </td>
- </tr>
-
- <!-- Auto-save reply text -->
- <tr id="comm_autosave_tr">
- <td class="label">
- <strong>Auto-save reply text</strong>
- </td>
-
- <td>
- <input type="checkbox" name="disableautosave" id="disableautosave" <?=!empty($SiteOptions['DisableAutoSave']) ? ' checked="checked"' : ''?>
- />
- <label for="disableautosave">Disable text auto-saving</label>
- </td>
- </tr>
-
- <!-- Displayed badges -->
- <tr id="comm_badge_tr">
- <td class="label">
- <strong>Displayed badges</strong>
- </td>
-
- <td>
- <?php
- $Badges = Badges::get_badges($UserID);
- if (empty($Badges)) {
- ?><span>You have no badges :(</span><?php
- } else {
- $Count = 0;
- foreach ($Badges as $BadgeID => $Displayed) { ?>
- <input type="checkbox" name="badges[]" class="badge_checkbox"
- value="<?=$BadgeID?>" <?=($Displayed)?"checked ":""?>/>
- <?=Badges::display_badge($BadgeID, true)?>
- <?php
- $Count++;
- echo ($Count % 8) ? '' : '<br>';
- }
- } ?>
- </td>
- </tr>
- </table>
-
- <!-- Notifications -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="notification_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Notifications</strong>
- </td>
- </tr>
-
- <!-- Automatic thread subscriptions -->
- <tr id="notif_autosubscribe_tr">
- <td class="label">
- <strong>Automatic thread subscriptions</strong>
- </td>
-
- <td>
- <input type="checkbox" name="autosubscribe" id="autosubscribe" <?=!empty($SiteOptions['AutoSubscribe']) ? ' checked="checked"' : ''?>
- />
- <label for="autosubscribe">Enable automatic thread subscriptions</label>
- </td>
- </tr>
-
- <!-- Unseeded torrent alerts -->
- <tr id="notif_unseeded_tr">
- <td class="label">
- <strong>Unseeded torrent alerts</strong>
- </td>
-
- <td>
- <input type="checkbox" name="unseededalerts" id="unseededalerts" <?=checked($UnseededAlerts)?> />
- <label for="unseededalerts">Enable unseeded torrent alerts</label>
- </td>
- </tr>
- <?php NotificationsManagerView::render_settings(NotificationsManager::get_settings($UserID)); ?>
- </table>
-
- <!-- Profile -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="profile_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Profile</strong>
- </td>
- </tr>
-
- <!-- Avatar URL -->
- <tr id="pers_avatar_tr">
- <td class="label tooltip" title="512 KiB max size / 600 px max height">
- <strong>Avatar URL</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="avatar" id="avatar"
- value="<?=display_str($Avatar)?>" />
- </td>
- </tr>
-
- <!-- Second avatar URL -->
- <?php if ($HasSecondAvatar) { ?>
- <tr id="pers_avatar2_tr">
- <td class="label">
- <strong>Second avatar URL</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="second_avatar" id="second_avatar"
- value="<?=$Rewards['SecondAvatar']?>" />
- </td>
- </tr>
- <?php }
-
- # Avatar mouseover text
- if ($HasAvatarMouseOverText) { ?>
- <tr id="pers_avatarhover_tr">
- <td class="label">
- <strong>Avatar mouseover text</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="avatar_mouse_over_text" id="avatar_mouse_over_text"
- value="<?=$Rewards['AvatarMouseOverText']?>" />
- </td>
- </tr>
- <?php }
-
- # Donor icon mouseover text
- if ($HasDonorIconMouseOverText) { ?>
- <tr id="pers_donorhover_tr">
- <td class="label">
- <strong>Donor icon mouseover text</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="donor_icon_mouse_over_text" id="donor_icon_mouse_over_text"
- value="<?=$Rewards['IconMouseOverText']?>" />
- </td>
- </tr>
- <?php }
-
- # Donor icon link
- if ($HasDonorIconLink) { ?>
- <tr id="pers_donorlink_tr">
- <td class="label">
- <strong>Donor icon link</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="donor_icon_link" id="donor_icon_link"
- value="<?=$Rewards['CustomIconLink']?>" />
- </td>
- </tr>
- <?php }
-
- # Custom donor icon URL
- if ($HasCustomDonorIcon) { ?>
- <tr id="pers_donoricon_tr">
- <td class="label">
- <strong>Custom donor icon URL</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="donor_icon_custom_url" id="donor_icon_custom_url"
- value="<?=$Rewards['CustomIcon']?>" />
- </td>
- </tr>
- <?php } ?>
-
- <!-- Profile title 1 -->
- <tr id="pers_proftitle_tr">
- <td class="label">
- <strong>Profile title 1</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="profile_title" id="profile_title"
- value="<?=display_str($InfoTitle)?>" />
- </td>
- </tr>
-
- <!-- Profile info 1 -->
- <tr id="pers_profinfo_tr">
- <td class="label">
- <strong>Profile info 1</strong>
- </td>
-
- <td>
- <?php
- $textarea = new TEXTAREA_PREVIEW(
- $Name = 'info',
- $ID = 'info',
- $Value = display_str($Info) ?? '',
- ); ?>
- </td>
- </tr>
-
- <!-- Excuse this numbering confusion, we start numbering our profile info/titles at 1 in the donor_rewards table -->
- <?php if ($HasProfileInfo1) { ?>
- <tr id="pers_proftitle2_tr">
- <td class="label">
- <strong>Profile title 2</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="profile_title_1" id="profile_title_1"
- value="<?=display_str($ProfileRewards['ProfileInfoTitle1'])?>" />
- </td>
- </tr>
-
- <!-- 2 -->
- <tr id="pers_profinfo2_tr">
- <td class="label">
- <strong>Profile info 2</strong>
- </td>
-
- <td>
- <?php
- $textarea = new TEXTAREA_PREVIEW(
- $Name = 'profile_info_1',
- $ID = 'profile_info_1',
- $Value = display_str($ProfileRewards['ProfileInfo1']) ?? '',
- ); ?>
- </td>
- </tr>
- <?php }
-
- # 3
- if ($HasProfileInfo2) { ?>
- <tr id="pers_proftitle3_tr">
- <td class="label">
- <strong>Profile title 3</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="profile_title_2" id="profile_title_2"
- value="<?=display_str($ProfileRewards['ProfileInfoTitle2'])?>" />
- </td>
- </tr>
-
- <!-- 3 -->
- <tr id="pers_profinfo3_tr">
- <td class="label">
- <strong>Profile info 3</strong>
- </td>
-
- <td>
- <?php
- $textarea = new TEXTAREA_PREVIEW(
- $Name = 'profile_info_2',
- $ID = 'profile_info_2',
- $Value = display_str($ProfileRewards['ProfileInfo2']) ?? '',
- ); ?>
- </td>
- </tr>
- <?php }
-
- # 4
- if ($HasProfileInfo3) { ?>
- <tr id="pers_proftitle4_tr">
- <td class="label">
- <strong>Profile title 4</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="profile_title_3" id="profile_title_3"
- value="<?=display_str($ProfileRewards['ProfileInfoTitle3'])?>" />
- </td>
- </tr>
-
- <!-- 4 -->
- <tr id="pers_profinfo4_tr">
- <td class="label">
- <strong>Profile info 4</strong>
- </td>
-
- <td>
- <?php
- $textarea = new TEXTAREA_PREVIEW(
- $Name = 'profile_info_3',
- $ID = 'profile_info_3',
- $Value = display_str($ProfileRewards['ProfileInfo3']) ?? '',
- ); ?>
- </td>
- </tr>
- <?php }
-
- # 5
- if ($HasProfileInfo4) { ?>
- <tr id="pers_proftitle5_tr">
- <td class="label">
- <strong>Profile title 5</strong>
- </td>
-
- <td>
- <input type="text" size="50" name="profile_title_4" id="profile_title_4"
- value="<?=display_str($ProfileRewards['ProfileInfoTitle4'])?>" />
- </td>
- </tr>
-
- <!-- 5 -->
- <tr id="pers_profinfo5_tr">
- <td class="label">
- <strong>Profile info 5</strong>
- </td>
-
- <td>
- <?php
- $textarea = new TEXTAREA_PREVIEW(
- $Name = 'profile_info_4',
- $ID = 'profile_info_4',
- $Value = display_str($ProfileRewards['ProfileInfo4']) ?? '',
- ); ?>
- </td>
- </tr>
- <?php } ?>
- </table>
-
- <!-- Paranoia -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="paranoia_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Paranoia</strong>
- </td>
- </tr>
-
- <tr>
- <td class="label"> </td>
- <td>
- <p>
- <strong>Select the profile elements you wish to display to other users.</strong>
- </p>
-
- <p>
- For example, if you select "Show count" for "Requests (filled)," the number of requests you have filled
- will be visible.
- If you select "Show bounty," the amount of request bounty you have received will be visible.
- If you select "Show list," the full list of requests you have filled will be visible.
- </p>
-
- <p>
- <span class="warning">
- Note: Paranoia has nothing to do with your security on this site.
- These settings only determine if others can view your site activity.
- Some information will remain available in the site log.
- </span>
- </p>
- </td>
- </tr>
-
- <!-- Recent activity -->
- <tr id="para_lastseen_tr">
- <td class="label">
- <strong>Recent activity</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="p_lastseen" <?=checked(!in_array('lastseen', $Paranoia))?>
- />
- Last seen
- </label>
- </td>
- </tr>
-
- <!-- Presets -->
- <tr id="para_presets_tr">
- <td class="label">
- <strong>Presets</strong>
- </td>
-
- <td>
- <input type="button" onclick="ParanoiaResetOff();" value="Everything" />
- <input type="button" onclick="ParanoiaResetStats();" value="Stats Only" />
- <input type="button" onclick="ParanoiaResetOn();" value="Nothing" />
- </td>
- </tr>
-
- <!-- Donations -->
- <tr id="para_donations_tr">
- <td class="label">
- <strong>Donations</strong>
- </td>
-
- <td>
- <input type="checkbox" id="p_donor_stats" name="p_donor_stats" onchange="AlterParanoia();" <?=$DonorIsVisible ? ' checked="checked"' : ''?>
- />
- <label for="p_donor_stats">Show donor stats</label>
-
- <input type="checkbox" id="p_donor_heart" name="p_donor_heart" onchange="AlterParanoia();" <?=checked(!in_array('hide_donor_heart', $Paranoia))?>
- />
- <label for="p_donor_heart">Show donor heart</label>
- </td>
- </tr>
-
- <!-- Statistics -->
- <tr id="para_stats_tr">
- <td class="label">
- <strong>Statistics</strong>
- </td>
-
- <td>
- <?php
- $UploadChecked = checked(!in_array('uploaded', $Paranoia));
- $DownloadChecked = checked(!in_array('downloaded', $Paranoia));
- $RatioChecked = checked(!in_array('ratio', $Paranoia));
- ?>
-
- <label><input type="checkbox" name="p_uploaded" onchange="AlterParanoia();" <?=$UploadChecked?> /> Uploaded</label> 
- <label><input type="checkbox" name="p_downloaded" onchange="AlterParanoia();" <?=$DownloadChecked?> /> Downloaded</label> 
- <label><input type="checkbox" name="p_ratio" onchange="AlterParanoia();" <?=$RatioChecked?> /> Ratio</label>
- </td>
- </tr>
-
- <!-- Required Ratio -->
- <tr id="para_reqratio_tr">
- <td class="label">
- <strong>Required Ratio</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="p_requiredratio" <?=checked(!in_array('requiredratio', $Paranoia))?>
- /> Required Ratio
- </label>
- </td>
- </tr>
-
- <!-- Comments (torrents) -->
- <tr id="para_comments_tr">
- <td class="label">
- <strong>Comments (torrents)</strong>
- </td>
-
- <td>
- <?php display_paranoia('torrentcomments'); ?>
- </td>
- </tr>
-
- <!-- Collections (started) -->
- <tr id="para_collstart_tr">
- <td class="label">
- <strong>Collections (started)</strong>
- </td>
-
- <td>
- <?php display_paranoia('collages'); ?>
- </td>
- </tr>
-
- <!-- Collections (contributed to) -->
- <tr id="para_collcontr_tr">
- <td class="label">
- <strong>Collections (contributed to)</strong>
- </td>
-
- <td>
- <?php display_paranoia('collagecontribs'); ?>
- </td>
- </tr>
-
- <!-- Requests (filled) -->
- <tr id="para_reqfill_tr">
- <td class="label">
- <strong>Requests (filled)</strong>
- </td>
-
- <td>
- <?php
- $RequestsFilledCountChecked = checked(!in_array('requestsfilled_count', $Paranoia));
- $RequestsFilledBountyChecked = checked(!in_array('requestsfilled_bounty', $Paranoia));
- $RequestsFilledListChecked = checked(!in_array('requestsfilled_list', $Paranoia));
- ?>
-
- <label><input type="checkbox" name="p_requestsfilled_count" onchange="AlterParanoia();" <?=$RequestsFilledCountChecked?> /> Show
- count</label>
- <label><input type="checkbox" name="p_requestsfilled_bounty" onchange="AlterParanoia();" <?=$RequestsFilledBountyChecked?> /> Show
- bounty</label>
- <label><input type="checkbox" name="p_requestsfilled_list" onchange="AlterParanoia();" <?=$RequestsFilledListChecked?> /> Show list</label>
- </td>
- </tr>
-
- <!-- Requests (voted for) -->
- <tr id="para_reqvote_tr">
- <td class="label">
- <strong>Requests (voted for)</strong>
- </td>
-
- <td>
- <?php
- $RequestsVotedCountChecked = checked(!in_array('requestsvoted_count', $Paranoia));
- $RequestsVotedBountyChecked = checked(!in_array('requestsvoted_bounty', $Paranoia));
- $RequestsVotedListChecked = checked(!in_array('requestsvoted_list', $Paranoia));
- ?>
-
- <label><input type="checkbox" name="p_requestsvoted_count" onchange="AlterParanoia();" <?=$RequestsVotedCountChecked?> /> Show
- count</label>
- <label><input type="checkbox" name="p_requestsvoted_bounty" onchange="AlterParanoia();" <?=$RequestsVotedBountyChecked?> /> Show
- bounty</label>
- <label><input type="checkbox" name="p_requestsvoted_list" onchange="AlterParanoia();" <?=$RequestsVotedListChecked?> /> Show list</label>
- </td>
- </tr>
-
- <!-- Uploaded torrents -->
- <tr id="para_upltor_tr">
- <td class="label">
- <strong>Uploaded torrents</strong>
- </td>
-
- <td>
- <?php display_paranoia('uploads'); ?>
- </td>
- </tr>
-
- <!-- Uploaded torrents (unique groups) -->
- <tr id="para_uplunique_tr">
- <td class="label">
- <strong>Uploaded torrents (unique groups)</strong>
- </td>
-
- <td>
- <?php display_paranoia('uniquegroups'); ?>
- </td>
- </tr>
-
- <!-- Torrents (seeding) -->
- <tr id="para_torseed_tr">
- <td class="label">
- <strong>Torrents (seeding)</strong>
- </td>
-
- <td>
- <?php display_paranoia('seeding'); ?>
- </td>
- </tr>
-
- <!-- Torrents (leeching) -->
- <tr id="para_torleech_tr">
- <td class="label">
- <strong>Torrents (leeching)</strong>
- </td>
-
- <td>
- <?php display_paranoia('leeching'); ?>
- </td>
- </tr>
-
- <!-- Torrents (snatched) -->
- <tr id="para_torsnatch_tr">
- <td class="label">
- <strong>Torrents (snatched)</strong>
- </td>
-
- <td>
- <?php display_paranoia('snatched'); ?>
- </td>
- </tr>
-
- <!-- Torrents (upload subscriptions) -->
- <tr id="para_torsubscr_tr">
- <td class="label tooltip" title="Can others subscribe to your uploads?">
- <strong>Torrents (upload subscriptions)</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="p_notifications" <?=checked(!in_array('notifications', $Paranoia))?>
- /> Allow torrent upload subscriptions
- </label>
- </td>
- </tr>
-
- <?php
- $DB->query("
- SELECT COUNT(UserID)
- FROM users_info
- WHERE Inviter = ?", $UserID);
- list($Invited) = $DB->next_record();
- ?>
-
- <!-- Invitees -->
- <tr id="para_invited_tr">
- <td class="label">
- <strong>Invitees</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="p_invitedcount" <?=checked(!in_array('invitedcount', $Paranoia))?>
- /> Show count
- </label>
- </td>
- </tr>
-
- <?php
- $DB->query("
- SELECT COUNT(ArtistID)
- FROM torrents_artists
- WHERE UserID = ?", $UserID);
- list($ArtistsAdded) = $DB->next_record();
- ?>
-
- <!-- Artists added -->
- <tr id="para_artistsadded_tr">
- <td class="label">
- <strong>Artists added</strong>
- </td>
-
- <td>
- <label>
- <input type="checkbox" name="p_artistsadded" <?=checked(!in_array('artistsadded', $Paranoia))?>
- /> Show count
- </label>
- </td>
- </tr>
-
- <!-- Preview paranoia -->
- <tr id="para_preview_tr">
- <td></td>
- <td><a href="#" id="preview_paranoia" class="brackets">Preview paranoia</a></td>
- </tr>
- </table>
-
- <!-- Security -->
- <table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border user_options"
- id="security_settings">
- <tr class="colhead_dark">
- <td colspan="2">
- <strong>Security</strong>
- </td>
- </tr>
-
- <!-- 2FA, U2F, and PGP -->
- <tr id="acc_2fa_tr">
- <td class="label">
- <strong>2FA, U2F, and PGP</strong>
- </td>
-
- <td>
- <a href="user.php?action=2fa">Click here to view additional account security options</a>
- </td>
- </tr>
-
- <!-- Current password -->
- <tr id="acc_currentpassword_tr">
- <td class="label">
- <strong>Current password</strong>
- </td>
-
- <td>
- <div>
- <input type="password" size="40" name="cur_pass" id="cur_pass" maxlength="307200" value="" />
- </div>
-
- <strong class="important_text">
- When changing any of the settings below, you must enter your current password here
- </strong>
- </td>
- </tr>
-
- <tr id="acc_resetpk_tr">
- <td class="label">
- <strong>Reset passkey</strong>
- </td>
-
- <td>
- <div>
- <label>
- <input type="checkbox" name="resetpasskey" id="resetpasskey" />
- Reset your passkey?
- </label>
- </div>
-
- <p class="setting_description">
- Any active torrents must be downloaded again to continue leeching/seeding
- </p>
- </td>
- </tr>
-
- <!-- IRC key -->
- <tr id="acc_irckey_tr">
- <td class="label">
- <strong>IRC key</strong>
- </td>
-
- <td>
- <div>
- <input type="text" size="50" name="irckey" id="irckey"
- value="<?=display_str($IRCKey)?>" />
- </div>
-
- <p class="setting_description">
- This key will be used when authenticating with <?=BOT_NICK?> on the
- <a href="wiki.php?action=article&name=IRC">IRC network</a>.
-
- <ul>
- <li>This value is stored in plaintext and should not be your password</li>
- <li>IRC keys must be between 6 and 32 characters</li>
- </ul>
- </td>
- </tr>
-
-
- <!-- API keys -->
- <tr id="acc_api_keys_tr">
- <td class="label">
- <strong>API Keys</strong>
- </td>
-
- <td>
- <p>
- API keys can be generated to access our
- <a href="https://docs.biotorrents.de" target="_blank">JSON API</a>.
- Please rememeber to revoke tokens you no longer use.
- </p>
-
- <p>
- <strong class="important_text">
- Treat your tokens like passwords and keep them secret.
- </strong>
- </p>
-
- <table class="api_keys">
- <tr class="colhead">
- <th>Name</th>
- <th>Created</th>
- <th>Revoke</th>
- </tr>
-
- <?php
- $DB->query("
- SELECT
- `ID`,
- `Name`,
- `Token`,
- `Created`
- FROM
- `api_user_tokens`
- WHERE
- `UserID` = '$UserID'
- AND `Revoked` = '0'
- ORDER BY
- `Created`
- DESC
- ");
-
- foreach ($DB->to_array(false, MYSQLI_ASSOC, false) as $row) { ?>
- <tr>
- <td>
- <?= $row['Name'] ?>
- </td>
-
- <td>
- <?= time_diff($row['Created']) ?>
- </td>
-
- <td style='text-align: center'>
- <a
- href='user.php?action=token&do=revoke&user_id=<?=$LoggedUser['ID'] ?>&token_id=<?= $row['ID'] ?>'>Revoke</a>
- </tr>
- <?php
- } /* foreach */ ?>
- </table>
-
- <p>
- <a
- href='user.php?action=token&user_id=<?= $LoggedUser['ID'] ?>'>Click
- here to create a new token</a>
- </p>
- </td>
- </tr>
-
-
- <!-- Email address -->
- <tr id="acc_email_tr">
- <td class="label">
- <strong>Email address</strong>
- </td>
-
- <td>
- <div>
- <input type="email" size="50" name="email" id="email"
- value="<?=display_str($Email)?>" />
- </div>
- </td>
- </tr>
-
- <!-- Password -->
- <tr id="acc_password_tr">
- <td class="label">
- <strong>Password</strong>
- </td>
-
- <td>
- <div>
- <label>
- <input type="password" minlength="15" size="40" name="new_pass_1" id="new_pass_1" maxlength="307200"
- value="" placeholder="New password" />
- <strong id="pass_strength"></strong>
- </label>
- </div>
-
- <div>
- <label>
- <input type="password" minlength="15" size="40" name="new_pass_2" id="new_pass_2" maxlength="307200"
- value="" placeholder="Confirm new password" />
- <strong id="pass_match"></strong>
- </label>
- </div>
-
- <div>
- <textarea id="password_display" name="password_display" rows="2" cols="50" onclick="this.select();"
- readonly></textarea>
- <button type="button" id="password_create" onclick="pwgen('password_display');">Generate</button>
- </div>
-
- <p class="setting_description">
- <?= $ENV->PASSWORD_ADVICE ?>
- </p>
- </td>
- </tr>
- </table>
- </div>
- </form>
- </div>
- <?php View::show_footer();
|