/** @var $User User */ if (isset($MSG)){ echo "<h1>$MSG</h1>"; if (isset($SubMSG)) echo "<p>$SubMSG</p>"; } else { $vectorapp = UserPrefs::get('p_vectorapp', $User->id); ?> <div class="briefing"> <?=$User->getAvatarWrap()?> <div class="title"> <h1><span class="role-badge"><?=Permission::labelInitials($User->role)?></span><span class="username"><?=$User->name?></span><a class="da" title="Visit DeviantArt profile" href="<?=$User->getDALink(User::LINKFORMAT_URL)?>"><?=str_replace(' fill="#FFF"','',file_get_contents(APPATH.'img/da-logo.svg'))?></a><?=!empty($vectorapp)?"<img class='vectorapp-logo' src='/img/vapps/$vectorapp.svg' alt='$vectorapp logo' title='".CoreUtils::$VECTOR_APPS[$vectorapp]." user'>":''?></h1> <p><?php echo "<span class='rolelabel'>{$User->rolelabel}</span>"; if ($canEdit){ echo ' <button id="change-role" class="blue typcn typcn-spanner'.($User->role==='ban'?' hidden':'').'" title="Change '.CoreUtils::posess($User->name).' group"></button>'; $BanLabel = ($User->role==='ban'?'Un-ban':'Ban').'ish'; $Icon = $User->role==='ban'?'world':'weather-night'; if (Permission::sufficient('staff', $User->role)) $Icon .= ' hidden'; echo ' <button id="ban-toggle" class="darkblue typcn typcn-'.$Icon.' '.strtolower($BanLabel).'" title="'."$BanLabel user".'"></button>'; } if (Permission::sufficient('developer')) echo " • <span class='userid'>{$User->id}</span>"; ?></p> </div> </div> <div class="details"> <?php if ($sameUser || Permission::sufficient('staff')){ $OldNames = $Database->where('id', $User->id)->orderBy('entryid',OLDEST_FIRST)->get('log__da_namechange',null,'old');
$exists = "<a href='http://{$un}.deviantart.com/'>{$exists}</a>"; } $SubMSG = "If this user {$exists}, sign in to import their details."; } } $canEdit = $sameUser = false; } else { $sameUser = $signedIn && $User->id === $currentUser->id; $canEdit = !$sameUser && Permission::sufficient('staff') && Permission::sufficient($User->role); $pagePath = "/@{$User->name}"; CoreUtils::fixPath($pagePath); } if (isset($MSG)) { HTTP::statusCode(404); } else { if ($sameUser) { $CurrentSession = $currentUser->Session; $Database->where('id != ?', array($CurrentSession['id'])); } $Sessions = $Database->where('user', $User->id)->orderBy('lastvisit', 'DESC')->get('sessions', null, 'id,created,lastvisit,platform,browser_name,browser_ver,user_agent,scope'); } $settings = array('title' => !isset($MSG) ? ($sameUser ? 'Your' : CoreUtils::posess($User->name)) . ' ' . ($sameUser || $canEdit ? 'account' : 'profile') : 'Account', 'no-robots', 'do-css', 'js' => array('user')); if ($canEdit) { $settings['js'][] = 'user-manage'; } $showSuggestions = $User->getPendingReservationCount() < 4; if ($showSuggestions) { $settings['js'][] = 'user-suggestion'; $settings['css'][] = 'user-suggestion'; } CoreUtils::loadPage($settings);
function testPosess() { $result = CoreUtils::posess('David'); self::assertEquals("David's", $result); $result = CoreUtils::posess('applications'); self::assertEquals("applications'", $result); }
?> </head> <body class="loading"> <header> <nav><ul> <li class="sidebar-toggle"> <svg class="loading-indicator" viewBox="0 0 45 45" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle r="20" cx="22.5" cy="22.5" class="loading-circle" transform="rotate(-90 22.5 22.5)"></circle> </svg> <div class="loader"></div> <img class="avatar" src="<?php echo $signedIn ? $currentUser->avatar_url : GUEST_AVATAR; ?> " alt='<?php echo ($signedIn ? CoreUtils::aposEncode(CoreUtils::posess($currentUser->name)) : 'Guest') . ' avatar'; ?> '> </li><?php echo CoreUtils::getNavigationHTML(isset($view) && $view === 'fatalerr'); ?> </ul></nav> </header> <div id="sidebar"> <?php include INCPATH . "views/sidebar.php"; ?> </div> <div id="main">