Exemplo n.º 1
0
        $deb = trim($deb);
        $tgz = trim($tgz);
        $cvs = trim($cvs);
        $screenshots = trim($screenshots);
        $mailarch = trim($mailarch);
        $developer = trim($developer);
        $description = trim($description);
        $email = trim($email);
        $depend = trim($depend);
        $urgency = trim($urgency);
        $section = trim(strtok($seccat, "/"));
        $category = trim(strtok("."));
        $set = "name='{$name}',type='{$type}',version='{$version}',section='{$section}',category='{$category}',license='{$license}',homepage='{$homepage}',download='{$download}',changelog='{$changelog}',rpm='{$rpm}',deb='{$deb}',tgz='{$tgz}',cvs='{$cvs}',screenshots='{$screenshots}',mailarch='{$mailarch}',developer='{$developer}',description='{$description}',modification=NOW(),creation=NOW(),email='{$email}',depend='{$depend}',user='******',urgency='{$urgency}',status='{$status}'";
        $db->query("INSERT pending SET {$set}");
        // Select and show new/updated application with counters
        $where = "pending.name='{$name}' AND type='{$type}' AND version='{$version}' AND pending.user=auth_user.username";
        $group = "pending.name";
        $query = "SELECT * FROM pending,auth_user WHERE {$where} GROUP BY {$group}";
        apppend($query);
        if ($ml_notify) {
            $msg = "insert application {$name} {$version} (" . typestr($type) . ") by " . $auth->auth["uname"] . ".";
            mailuser("editor", "insert application", $msg);
        }
    }
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();
Exemplo n.º 2
0
            $where = "software.appid='{$id}' AND software.appid=counter.appid AND software.user=auth_user.username";
            $group = "software.appid";
            $query = "SELECT {$columns} FROM {$tables} WHERE {$where} GROUP BY {$group}";
            appfull($query);
            $query = "SELECT * FROM comments,auth_user WHERE appid='{$id}' AND auth_user.username=comments.user_cmt ORDER BY creation_cmt DESC";
            cmtshow($query);
        } else {
            // $operation = "INSERT"
            $tables = "pending,auth_user";
            $where = "pending.name='" . addslashes($name) . "' AND type='{$type}' AND version='" . addslashes($version) . "' AND pending.user=auth_user.username";
            $group = "pending.name";
            $query = "SELECT * FROM {$tables} WHERE {$where} GROUP BY {$group}";
            // echo "<p>$query\n";
            apppend($query);
        }
        if ($ml_notify) {
            $db->query("SELECT name,version,type FROM software WHERE appid='{$id}'");
            $db->next_record();
            $message = $action . " application " . $db->f("name") . " " . $db->f("version") . " (" . typestr($db->f("type")) . ") by " . $auth->auth["uname"];
            mailuser("editor", $action . " application", $message);
        }
    } else {
        $be->box_full($t->translate("Error"), $t->translate("No Application ID specified") . "." . "<br>" . $t->translate("Please select") . " <a href=\"" . $sess->url("appbyuser.php") . "\">" . $t->translate("Change Apps") . "</a>.");
    }
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();
Exemplo n.º 3
0
 function testTypestr()
 {
     global $t;
     $this->assertEquals($t->translate("Adaption"), typestr("A"));
     $this->assertEquals($t->translate("Expansion"), typestr("E"));
     $this->assertEquals($t->translate("Documentation"), typestr("C"));
     $this->assertEquals($t->translate("Development"), typestr("D"));
     $this->assertEquals($t->translate("Other"), typestr("O"));
     $this->assertEquals($t->translate("Other"), typestr("What?"));
     $this->assertEquals($t->translate("Other"), typestr(""));
 }
Exemplo n.º 4
0
                $where = "software.appid='{$id}' AND software.appid=counter.appid AND software.user=auth_user.username";
                $group = "software.appid";
                $query = "SELECT {$columns} FROM {$tables} WHERE {$where} GROUP BY {$group}";
                // echo "<p>SELECT $columns FROM $tables WHERE $where GROUP BY $group";
                appfull($query);
                // Delete pending apps
                $where = "idx='{$idx}'";
                $db->query("DELETE FROM pending WHERE {$where}");
                // echo "<p>DELETE FROM pending WHERE $where\n";
                break;
            case "delete":
                $where = "idx='{$idx}'";
                $db->query("DELETE FROM pending WHERE {$where}");
                $bx->box_full($t->translate("Done"), $t->translate("Pending Application deleted"));
                break;
        }
        // Notify administrators
        if ($ml_notify) {
            $message = $action . " application {$name} {$version} (" . typestr($type) . ") by " . $auth->auth["uname"];
            mailuser("editor", $action . " application", $message);
        }
    } else {
        $be->box_full($t->translate("Error"), $t->translate("No Application ID specified") . "." . "<br>" . $t->translate("Please select") . " <a href=\"" . $sess->url("appbyuser.php") . "\">" . $t->translate("Change Apps") . "</a>.");
    }
}
?>
<!-- end content -->

<?php 
require "./include/footer.inc";
@page_close();