Ejemplo n.º 1
0
<?php

//
// this is the main page that gets loaded by end users
//
require_once "apps.inc";
commonHeader('Applications' . $title, false);
appHeader($_GET['the_cat'], $_GET['the_subcat']);
include "apps.php";
appFooter();
commonFooter(false);
Ejemplo n.º 2
0
<?php

//
// This is the form end users use to submit modifications to their apps to the database.
// A modified app is actually a new record with a pointer to the old one.  Once an administrator
// approves the new one the status is changed to active and the old one is removed from the system.
// This has the added benefit of bringing it to the top of the "newest applications" list.
//
require_once "apps.inc";
commonHeader('Edit your Application', false);
appHeader();
print "<h1>Edit Your PHPGTK Application</h1>";
//
// if the form was submitted add it to the databas
//
if ($action == "modify") {
    $res = mysql_query("SELECT * FROM app WHERE id = {$app_id}");
    if ($res) {
        $app = mysql_fetch_object($res);
        if ($app->submitter == $submitter) {
            if (!empty($_FILES[screenshot][name]) && ereg("^image/", $_FILES[screenshot][type])) {
                $has_screenshot = 'Y';
            } else {
                $has_screenshot = 'N';
            }
            $res = mysql_query("\n\t\t\t\t\tINSERT INTO app\n\t\t\t\t\t(id, modify_id, status, cat_id, date_added, name, has_screenshot, homepage_url, submitter, blurb)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(0, {$app->id}, 'M', {$cat_id}, NOW(), '{$name}', '{$has_screenshot}', '{$homepage_url}', '{$submitter}', '{$blurb}')\n\t\t\t\t");
            if ($res == true) {
                if ($has_screenshot == 'Y') {
                    $app_id = mysql_insert_id();
                    handleAppImage($_FILES[screenshot][tmp_name], $app_id);
                }
Ejemplo n.º 3
0
<?php

//
// This is the main administration page where approvals, rejections, deletions, etc. take place
//
//require_once("cvs-auth.inc");
require_once "email-validation.inc";
require_once "apps.inc";
if (!isset($MAGIC_COOKIE)) {
    Header("Location: http://master.php.net/manage/users.php");
    exit;
}
list($user, $pass) = explode(":", base64_decode($MAGIC_COOKIE));
$MAGIC_COOKIE = 'temp';
commonHeader("Applications Administration");
appHeader($the_cat, $the_subcat);
print "\n\t<h1>Applications Administration</h1>\n\tIf you just want to browse the applications, you're better off <A href='/apps/'>here</A>.\n\t<hr noshade size=1>\n";
//
// this block contains all the actions the script can take.  if we can't authenticate
// or find the app in question we bail out.
//
if (!empty($action) && !empty($app_id)) {
    $res = mysql_query("SELECT * FROM app WHERE id = {$app_id}");
    if ($res) {
        $app = mysql_fetch_object($res);
    } else {
        print "<p><b>Unable to find app #{$app_id}.</b></p>";
        appFooter();
        commonFooter();
        exit;
    }