示例#1
0
文件: forms.php 项目: PseudoAj/mfcs
 function validID()
 {
     $engine = EngineAPI::singleton();
     if (!isset($engine->cleanGet['MYSQL']['formID']) || is_empty($engine->cleanGet['MYSQL']['formID']) || !validate::integer($engine->cleanGet['MYSQL']['formID'])) {
         if (objects::validID($engine->cleanGet['MYSQL']['objectID'])) {
             $object = objects::get($engine->cleanGet['MYSQL']['objectID']);
             if ($object === FALSE) {
                 return FALSE;
             }
             http::setGet('formID', $object['formID']);
         } else {
             return FALSE;
         }
     }
     return TRUE;
 }
示例#2
0
文件: object.php 项目: PseudoAj/mfcs
 }
 //////////
 // Project Tab Stuff
 $selectedProjects = objects::getProjects($engine->cleanGet['MYSQL']['objectID']);
 localVars::add("projectOptions", projects::generateProjectChecklist($selectedProjects));
 // Project Tab Stuff
 //////////
 localvars::add("formName", $form['title']);
 localvars::add("formID", $form['ID']);
 log::insert("Data Entry: Object: View Page", 0, $form['ID']);
 // handle submission
 if (isset($engine->cleanPost['MYSQL']['submitForm'])) {
     if (forms::submit($engine->cleanGet['MYSQL']['formID']) === FALSE) {
         throw new Exception("Error Submitting Form.");
     }
     http::setGet("objectID", localvars::get("newObjectID"));
     log::insert("Data Entry: Object: Successful Submission", localvars::get("newObjectID"), $form['ID']);
 } else {
     if (isset($engine->cleanPost['MYSQL']['updateForm'])) {
         if (forms::submit($engine->cleanGet['MYSQL']['formID'], $engine->cleanGet['MYSQL']['objectID']) === FALSE) {
             throw new Exception("Error Updating Form.");
         }
         log::insert("Data Entry: Object: Successful update", $engine->cleanGet['MYSQL']['objectID'], $form['ID']);
     } else {
         if (isset($engine->cleanPost['MYSQL']['projectForm'])) {
             $engine->cleanPost['MYSQL']['projects'] = isset($engine->cleanPost['MYSQL']['projects']) ? $engine->cleanPost['MYSQL']['projects'] : array();
             // Add All the new ones
             if (objects::addProjects($engine->cleanGet['MYSQL']['objectID'], $engine->cleanPost['MYSQL']['projects']) === FALSE) {
                 throw new Exception("Error adding projects to Object.");
             }
             log::insert("Data Entry: Object: Successful Project Update", $engine->cleanGet['MYSQL']['objectID'], $form['ID']);
示例#3
0
include "../header.php";
// Turn off and kill engine's output buffer
$engine->obCallback = FALSE;
ob_end_clean();
recurseInsert("acl.php", "php");
$permissions = TRUE;
$type = "zip";
try {
    $error = FALSE;
    if (!isset($engine->cleanGet['MYSQL']['objectID'])) {
        throw new Exception("No ObjectID Provided.");
    }
    // If we have an objectID and no formID, lookup the formID from the object and set it back into the GET
    if (isset($engine->cleanGet['MYSQL']['objectID']) and !isset($engine->cleanGet['MYSQL']['formID'])) {
        $object = objects::get($engine->cleanGet['MYSQL']['objectID']);
        http::setGet('formID', $object['formID']);
    }
    // Object ID Validation
    if (objects::validID(TRUE, $engine->cleanGet['MYSQL']['objectID']) === FALSE) {
        throw new Exception("ObjectID Provided is invalid.");
    }
    if (mfcsPerms::isViewer($engine->cleanGet['MYSQL']['formID']) === FALSE) {
        $permissions = FALSE;
        throw new Exception("Permission Denied to view objects created with this form.");
    }
    if (isset($engine->cleanGet['MYSQL']['type']) && $engine->cleanGet['MYSQL']['type'] == "tar") {
        $type = "tar";
    }
    if (is_array($object['data']['digitalFiles'])) {
        $files = array();
        foreach ($object['data']['digitalFiles']['files']['archive'] as $file) {
示例#4
0
文件: move.php 项目: PseudoAj/mfcs
<?php

include "../header.php";
$permissions = TRUE;
try {
    if (!isset($engine->cleanGet['MYSQL']['objectID']) && isset($engine->cleanPost['MYSQL']['objectID'])) {
        http::setGet("objectID", $engine->cleanPost['MYSQL']['objectID']);
    }
    if (objects::validID() === FALSE) {
        throw new Exception("ObjectID Provided is invalid.");
    }
    if (($object = objects::get($engine->cleanGet['MYSQL']['objectID'])) === FALSE) {
        throw new Exception("Error retrieving Object");
    }
    if (($form = forms::get($object['formID'])) === FALSE) {
        throw new Exception("Error retrieving form.");
    }
    if (mfcsPerms::isAdmin($object['formID']) === FALSE) {
        $permissions = FALSE;
        throw new Exception("Permission Denied to view objects created with this form.");
    }
    if (forms::isMetadataForm($object['formID']) === FALSE) {
        throw new Exception("Object provided (Only Metadata can be moved).");
    }
    // handle submission
    $return = NULL;
    if (isset($engine->cleanPost['MYSQL']['moveMetadata'])) {
    }
    if (($compatibleForms = forms::compatibleForms($form['ID'])) === FALSE) {
        throw new Exception("Error getting compatible forms");
    }