} else {
        ?>
						<li><a href="/secure/notifications/">NOTIFICATIONS</a></li>
						
						<?php 
    }
    // ** END NOTIFICATIONS **
    if (isset($_SESSION['user_id'], $_SESSION['user_nick'], $_SESSION['user_token']) && clientPartOfGroup('Moderators')) {
        ?>
						<li role="presentation" class="divider"></li>
						<li><a href="/secure/mod/">MOD CP</a></li>
						<?php 
    }
    ?>
						<?php 
    if (isset($_SESSION['user_id'], $_SESSION['user_nick'], $_SESSION['user_token']) && clientPartOfGroup('Administrators')) {
        ?>
						<li><a href="/secure/admin/">ADMIN CP</a></li>
						<?php 
    }
    ?>
						
						<li role="presentation" class="divider"></li>
						<li><a href="/secure/signout/">LOGOUT</a></li>
						<?php 
} else {
    ?>
						<li><a href="/secure/login/">LOGIN</a></li>
						<li><a href="/secure/register/">REGISTER</a></li>
						<?php 
}
/**
 * Exit and print a message if user isn't logged in or doesn't belong to a certain group
 *
 * @param string $groupName The group name to check against
 */
function verifyGroup($groupName)
{
    printAndExitIfTrue(!clientPartOfGroup($groupName), 'You do not have permission to access this page.');
}
Example #3
0
    $appToRemove = $matchingApps[0];
    printAndExitIfTrue($appToRemove['publishstate'] === 2 || $appToRemove['publishstate'] === 3, 'This app is rejected or already hidden.');
    $_SESSION['hide_app_guid' . $guidId] = $appToRemove['guid'];
    $_SESSION['remove_token' . $appToRemove['guid']] = uniqid(mt_rand(), true);
    ?>
		<h1 class="text-center"><?php 
    echo 'Hiding ' . $appToRemove['name'];
    ?>
</h1>
		<br />
		<form role="form" class="small-width" action="action.php" method="post" accept-charset="utf-8">
			<label for="pass">Enter your password and an exclamation mark to confirm hiding the app:</label>
			<input type="password" class="form-control no-bottom-border-radius" id="pass" name="pass" placeholder="Password" required>
			
			<button type="submit" name="submit" class="btn btn-lg btn-danger btn-block no-top-border-radius">Hide</button>
			
			<input type="hidden" name="removetoken" value="<?php 
    echo md5($_SESSION['remove_token' . $appToRemove['guid']]);
    ?>
">
			<input type="hidden" name="guidid" value="<?php 
    echo $guidId;
    ?>
">
		</form>
<?php 
    if (!clientPartOfGroup('Developers')) {
        echo '<div class="text-center" style="color: red; font-weight: bold;">WARNING: You\'ll have to republish the app to unhide it.</div>';
    }
}
require_once '../../common/ucpfooter.php';
     throwExceptionIfTrue($file['error'] === 1 || $file['error'] === 2, $file['name'] . ' exceeds the file size limit.');
     throwExceptionIfTrue($file['error'] === 3, $file['name'] . ' wasn\'t fully uploaded.');
     throwExceptionIfTrue($file['error'] > 4, $file['name'] . ' encountered an internal error upon upload: ' . $file['error']);
 }
 //Check captcha
 $reCaptcha = new ReCaptcha(getConfigValue('apikey_recaptcha_secret'));
 $resp = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
 throwExceptionIfTrue($resp == null || !$resp->success, 'Invalid or no captcha response.');
 $appName = escapeHTMLChars($_POST['name']);
 $appVersion = escapeHTMLChars($_POST['version']);
 $appCategory = $_POST['category'];
 $appSubCategory = $subCategorySelected ? $_POST['subcategory'] : null;
 $appDescription = escapeHTMLChars(str_replace(['\\r\\n', '\\r', '\\n'], ' ', $_POST['description']));
 $app3dsxPath = $_FILES['3dsx']['tmp_name'];
 $appSmdhPath = $_FILES['smdh']['tmp_name'];
 $isDeveloper = clientPartOfGroup('Developers');
 $updatingApp = isset($_SESSION['user_app_version' . $guid]);
 //Check which optional files were uploaded
 $uploadingAppData = isset($_FILES['appdata']) && !deletingFile('appdata') && is_uploaded_file($_FILES['appdata']['tmp_name']);
 if ($uploadingAppData) {
     $appDataPath = $_FILES['appdata']['tmp_name'];
 }
 $uploadingWebIcon = isset($_FILES['webicon']) && !deletingFile('webicon') && is_uploaded_file($_FILES['webicon']['tmp_name']);
 if ($uploadingWebIcon) {
     $webIconPath = $_FILES['webicon']['tmp_name'];
     //Verify that image is JPEG/PNG
     $imageMIME = getimagesize($webIconPath)['mime'];
     throwExceptionIfTrue(!($imageMIME && ($imageMIME === 'image/jpeg' || $imageMIME === 'image/png')), 'Invalid hi-res icon file type. It must be in JPEG or PNG format.');
 }
 $screenshotsUploaded = array();
 for ($i = 1; $i <= getConfigValue('downloadmii_max_screenshots'); $i++) {