Exemplo n.º 1
0
function add()
{
    global $sess, $title, $level, $description, $int_node, $thisnode, $glob_language;
    if (is_trail($title)) {
        $title = $title . "/";
    }
    if (level_count($title) > 0) {
        include "directory/edit/err_invalidslash.html";
    } else {
        $title = str_replace(' ', '_', $title);
        $obj['name'] = $thisnode['path'] . $title;
        $obj['name'] = str_replace(' ', '_', $obj['name']);
        $obj['parent'] = path2id($thisnode['path']);
        $obj['level'] = $level;
        $obj['objecttype'] = 'node';
        $obj['description'] = $description;
        $obj['useraccess'] = 0;
        $obj['friendaccess'] = 0;
        $obj['owner'] = '';
        $obj['language'] = $glob_language;
        $intid = path2id_ex($int_node, 1);
        $obj['intnode'] = $intid != -1 ? $intid : "";
        add_object($obj, true);
        header("Location: " . $sess->url($thisnode['path']));
    }
}
Exemplo n.º 2
0
<?php

session_start();
include_once "inc/functions.php";
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case "add_location":
            add_location($_POST['loc_name']);
            break;
        case "loc_options":
            get_locations_options();
            break;
        case "add_object":
            add_object($_POST['obj_name'], $_POST['obj_quant'], $_POST['obj_location'], $_POST['obj_comm']);
            break;
        case "loc_table":
            get_locations();
            break;
        case "obj_table":
            get_objects_add_style();
            break;
        case "add_user":
            add_user($_POST['name'], $_POST['uname'], $_POST['pass'], $_POST['dpt'], $_POST['level']);
            break;
        case "view_report":
            view_report($_POST['id']);
            break;
        case "search_object":
            get_objects_add_style(1, $_POST['key']);
            break;
        case "delete_obj":
Exemplo n.º 3
0
function create($kat, $title, $description, $pass_language_check = false)
{
    global $sess, $auth, $glob_language_name, $glob_language;
    if (!defined("SPELLING_INC")) {
        include "commonapi/spelling.inc";
    }
    if (!strstr($kat, '/')) {
        $kat = base64_decode($kat);
    }
    $predef['kat'] = $kat;
    $predef['title'] = $title;
    $predef['description'] = $description;
    $title = str_replace(' ', '_', $title);
    $exists = get_node_info($kat . $title);
    $exists = $exists != -1;
    if (strstr($title, '/')) {
        $errfile = "err_invalidslash.html";
        addform($predef, $errfile);
        exit;
    } elseif ($title == "") {
        $errfile = "err_notitle.html";
        addform($predef, $errfile);
        exit;
    } elseif ($description == "") {
        $errfile = "err_nodesc.html";
        addform($predef, $errfile);
        exit;
    } elseif ($exists) {
        $errfile = "err_object_exists.html";
        addform($predef, $errfile);
        exit;
    } elseif (!check_language($description, $glob_language_name) and !$pass_language_check) {
        lang_query($kat, $title, $description);
    } else {
        $title = str_replace(' ', '_', $title);
        $obj['name'] = $kat . $title;
        $obj['parent'] = path2id($kat);
        $obj['level'] = level_count($kat);
        $obj['objecttype'] = "trail";
        $obj['description'] = $description;
        $obj['useraccess'] = 4;
        $obj['friendaccess'] = 12;
        $obj['owner'] = $auth->auth["uid"];
        $obj['language'] = $glob_language;
        add_object($obj, true);
        Header("Location: " . $sess->url(build_good_url($obj['name']) . "?reloadparent=1"));
        exit;
        // echo("Debug: dieses Fenster schliessen");
    }
}
Exemplo n.º 4
0
 /**
  * Add inputs to a map/reduce operation. This method takes three
  * different forms, depending on the provided inputs. You can
  * specify either  a RiakObject, a string bucket name, or a bucket,
  * key, and additional arg.
  * @param mixed $arg1 - RiakObject or Bucket
  * @param mixed $arg2 - Key or blank
  * @param mixed $arg3 - Arg or blank
  * @return RiakMapReduce
  */
 function add($arg1, $arg2 = NULL, $arg3 = NULL)
 {
     if (func_num_args() == 1) {
         if ($arg1 instanceof RiakObject) {
             return add_object($arg1);
         } else {
             return $this->add_bucket($arg1);
         }
     }
     return $this->add_bucket_key_data($arg1, $arg2, $arg3);
 }
Exemplo n.º 5
0
function add_object_ajax_func()
{
    // check nonce
    if (!wp_verify_nonce($_POST['nonce'], 'nonce')) {
        die(json_encode(array('error' => 'unauthorized')));
    }
    // response output
    header('Content-Type: application/json');
    echo json_encode(add_object($_POST['serialized']), true);
    exit;
}
Exemplo n.º 6
0
$upfile = '/home/ychenlucs15/public_html/uploads/' . $_FILES['userfile']['name'];
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
    if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
        echo 'Problem: Could not move file to destination directory';
        exit;
    }
} else {
    echo 'Problem: Possible file upload attack. Filename: ';
    echo $_FILES['userfile']['name'];
    exit;
}
$format = $_FILES['userfile']['type'];
$size = $_FILES['userfile']['size'];
$location = '/home/ychenlucs15/public_html/uploads/' . $_FILES['userfile']['name'];
$author = $_SESSION['valid_user'];
if (add_object($title, $author, $discipline, $language, $keyword, $structure, $aggrelvl, $interacttype, $resourcetype, $interactlvl, $enduserrole, $learningtime, $cost, $copyright, $format, $size, $location, $version, $status)) {
    echo '<div class="container theme-showcase">';
    echo '<div class="page-header">';
    echo '<p>Object was added.</p>';
    echo '</div>';
    echo '</div>';
} else {
    echo '<div class="container theme-showcase">';
    echo '<div class="page-header">';
    echo '<p>Object could not be added.</p>';
    echo '</div>';
    echo '</div>';
}
echo '<div class="container theme-showcase">';
echo '<div class="page-header">';
do_html_url("member.php", "Go back to member page");