Exemple #1
0
<?php

use hydrogen\config\Config;
use appdb\usersession\UserSession;
use appdb\models\ApplicationModel;
use appdb\models\AppCategoryModel;
use hydrogen\errorhandler\ErrorHandler;
ErrorHandler::attachErrorString(json_encode(array('valid' => '0', 'error' => 'Server error.  Try again soon!')));
if (!class_exists('hydrogen\\config\\Config', false)) {
    die("Quit trying to hack my damn code.");
}
if (!UserSession::getPermission('view_all_apps')) {
    $jsonError = array('valid' => '0', 'error' => 'You do not have permission to browse applications.');
    die(json_encode($jsonError));
}
$legalSorts = array('newvers', 'newapps', 'appname', 'relevance');
$perpage = isset($_GET['perpage']) ? $_GET['perpage'] : 15;
if ($perpage != 15 && $perpage != 30 && $perpage != 60) {
    $perpage = 15;
}
$perpage += 0;
// Ensures we're not using a string that starts with a number
$sort = isset($_GET['sort']) ? $_GET['sort'] : $legalSorts[0];
$goodSort = false;
foreach ($legalSorts as $type) {
    if ($sort == $type) {
        $goodSort = true;
        break;
    }
}
if (!$goodSort) {
Exemple #2
0
							<option value="unknown">Unknown</option>
						</select>
					</div>
				</div>
			</div>
			<div id="addlinkblock">
				<span>Add another download location</span>
			</div>
			<div id="submitblock">
				<input type="submit" value="Submit Application" id="submitbutton" />
			</div>
		</div>
	</form>
	<?php 
} else {
    if (UserSession::getPermission('submit_new_itunes_apps') && !$allowSubmit) {
        ?>
	<div id="submitnotes">
		<h3>Before you get started, please read over these quick points:</h3>
		<h2 class="pheading">ABSOLUTELY NO PASSWORD-PROTECTED FILES</h2>
		<p>If downloading the file requires a password, or if the downloaded archive itself requires a password to be extracted, that link is not allowed here.  But you're welcome to re-package and re-upload these files so that they do not require a password!  Repeat violators will be banned.</p>
		<h2 class="pheading">Version numbers are important</h2>
		<p>If you don't know the version number for an application you can submit it as 'Unknown', but please do that as a last resort ONLY.  Accuracy is very important so that we can track updates.</p>
		<h2 class="pheading">Give credit where credit is due</h2>
		<p>If you're not aware who the cracker is for a particular release, you can leave that field blank -- however, please do your best to find out and give credit.  If there's evidence of credit stealing or intentionally not giving credits, you may be banned.</p>
		<p class="continuelink"><a href="?page=submit&bypass=true">Continue to the submission form</a></p>
	</div>
	<?php 
    } else {
        if (!$sawWarn) {
            ?>
Exemple #3
0
use appdb\usersession\UserSession;
use appdb\itunes\AppStoreScraper;
use appdb\models\ApplicationModel;
use appdb\models\AppCategoryModel;
use appdb\models\AppVersionModel;
use hydrogen\errorhandler\ErrorHandler;
ErrorHandler::attachErrorString(json_encode(array('valid' => '0')));
if (!class_exists('hydrogen\\config\\Config', false)) {
    die("Quit trying to hack my damn code.");
}
function returnInvalid()
{
    die(json_encode(array('valid' => 0)));
}
// Requires permission: submit_new_itunes_apps
if (!UserSession::getPermission('submit_new_itunes_apps')) {
    returnInvalid();
}
if (isset($_GET['id']) && preg_match("/\\d+/", $_GET['id'])) {
    try {
        $appinfo = new AppStoreScraper((int) $_GET['id']);
    } catch (InvalidITunesIDException $e) {
        returnInvalid();
    } catch (AppNotFoundException $e) {
        returnInvalid();
    } catch (TimeoutException $e) {
        returnInvalid();
    }
    $smallicon = $appinfo->getITunesID() . 'icon-57x57.png';
    $bigicon = $appinfo->getITunesID() . 'icon-100x100.png';
    $am = ApplicationModel::getInstance();
Exemple #4
0
     case 1:
         $line .= 'APP';
         break;
     case 2:
         $line .= 'IPA';
         break;
     default:
         $line .= 'Unknown';
 }
 $line .= "</td>\n";
 $parsed_url = parse_url($link->url);
 $domain = $parsed_url['host'];
 while (preg_match('/\\..+\\./', $domain)) {
     $domain = substr($domain, strpos($domain, '.') + 1);
 }
 if (!UserSession::getPermission('view_unscrambled_links')) {
     $path = substr($parsed_url['path'], 1);
     $lastslash = strrpos($path, '/');
     $frontpath = substr($path, 0, $lastslash);
     $endpath = substr($path, $lastslash);
     $newpath = '/';
     while (strlen($frontpath) > 0) {
         $digit = rand(0, strlen($frontpath) - 1);
         $newpath .= $frontpath[$digit];
         $frontpath = substr($frontpath, 0, $digit) . substr($frontpath, $digit + 1);
     }
     $newpath .= $endpath;
     $url = $parsed_url['scheme'] . "://" . $parsed_url['host'] . $newpath;
     if ($parsed_url['query']) {
         $query = $parsed_url['query'];
         $newquery = '?';