Exemplo n.º 1
0
/* Copyright (c) 2002-2010                                      */
/* Inclusive Design Institute                                   */
/* http://atutor.ca												*/
/*                                                              */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License  */
/* as published by the Free Software Foundation.				*/
/****************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
require AT_INCLUDE_PATH . '../mods/_standard/file_storage/file_storage.inc.php';
$owner_type = abs($_REQUEST['ot']);
$owner_id = abs($_REQUEST['oid']);
$owner_arg_prefix = '?ot=' . $owner_type . SEP . 'oid=' . $owner_id . SEP;
if (!fs_authenticate($owner_type, $owner_id)) {
    $msg->addError('ACCESS_DENIED');
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php', AT_PRETTY_URL_IS_HEADER));
    exit;
}
if (isset($_GET['done'])) {
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php' . $owner_arg_prefix . 'folder=' . abs($_GET['folder']), AT_PRETTY_URL_IS_HEADER));
    exit;
} else {
    if (isset($_GET['cancel'])) {
        $msg->addFeedback('CANCELLED');
        header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php' . $owner_arg_prefix . 'folder=' . abs($_GET['folder']), AT_PRETTY_URL_IS_HEADER));
        exit;
    } else {
        if (isset($_POST['edit_cancel'])) {
            $msg->addFeedback('CANCELLED');
Exemplo n.º 2
0
/* Copyright (c) 2002-2010                                      */
/* Inclusive Design Institute                                   */
/* http://atutor.ca												*/
/*                                                              */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License  */
/* as published by the Free Software Foundation.				*/
/****************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
require AT_INCLUDE_PATH . '../mods/_standard/file_storage/file_storage.inc.php';
$owner_type = abs($_REQUEST['ot']);
$owner_id = abs($_REQUEST['oid']);
$owner_arg_prefix = '?ot=' . $owner_type . SEP . 'oid=' . $owner_id . SEP;
if (!($owner_status = fs_authenticate($owner_type, $owner_id)) || !query_bit($owner_status, WORKSPACE_AUTH_WRITE)) {
    $msg->addError('ACCESS_DENIED');
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php', AT_PRETTY_URL_IS_HEADER));
    exit;
}
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php' . $owner_arg_prefix . 'folder=' . abs($_POST['folder']), AT_PRETTY_URL_IS_HEADER));
    exit;
} else {
    if (isset($_POST['submit'])) {
        $_POST['id'] = abs($_POST['id']);
        if (!$_POST['name']) {
            $msg->addError('MISSING_FILENAME');
        }
        if (!$msg->containsErrors()) {
Exemplo n.º 3
0
        $owner_id = $_SESSION['course_id'];
    } else {
        if ($owner_type == WORKSPACE_PERSONAL) {
            $owner_id = $_SESSION['member_id'];
        } else {
            if ($owner_type == WORKSPACE_GROUP) {
                $owner_id = $group_id;
            }
        }
    }
}
$owner_arg_prefix = '?ot=' . $owner_type . SEP . 'oid=' . $owner_id . SEP;
if ($assignment_for == 'my') {
    $owner_arg_prefix .= 'folder=' . $_SESSION['member_id'];
}
if (!($owner_status = fs_authenticate($owner_type, $owner_id))) {
    $msg->addError('ACCESS_DENIED');
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php', AT_PRETTY_URL_IS_HEADER));
    exit;
}
$_SESSION['fs_owner_type'] = $owner_type;
$_SESSION['fs_owner_id'] = $owner_id;
$_SESSION['fs_folder_id'] = $folder_id;
if (isset($_GET['submit_workspace'])) {
    header('Location: ' . url_rewrite('mods/_standard/file_storage/index.php' . $owner_arg_prefix, AT_PRETTY_URL_IS_HEADER));
    exit;
}
// action - Submit Assignment
if (isset($_GET['assignment']) && (isset($_GET['files']) || isset($_GET['folders']))) {
    if (isset($_GET['folders'])) {
        $msg->addError('HAND_IN_FOLDER');