예제 #1
0
<?php

include_once '../../config/symbini.php';
include_once $serverRoot . '/classes/CollectionProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
if (!$SYMB_UID) {
    header('Location: ../../profile/index.php?refurl=../collections/misc/collmetadata.php?' . $_SERVER['QUERY_STRING']);
}
$action = array_key_exists("action", $_REQUEST) ? $_REQUEST["action"] : "";
$collid = array_key_exists("collid", $_REQUEST) ? $_REQUEST["collid"] : 0;
$statusStr = '';
$collManager = new CollectionProfileManager();
if (!$collManager->setCollid($collid)) {
    $collid = '';
}
$isEditor = 0;
if ($IS_ADMIN) {
    $isEditor = 1;
} elseif ($collid) {
    if (array_key_exists("CollAdmin", $userRights) && in_array($collid, $userRights["CollAdmin"])) {
        $isEditor = 1;
    } elseif (array_key_exists("CollEditor", $userRights) && in_array($collid, $userRights["CollEditor"])) {
        $isEditor = 1;
    }
}
if ($isEditor) {
    if ($action == 'Save Edits') {
        $statusStr = $collManager->submitCollEdits($_POST);
        if ($statusStr == true) {
            header('Location: collprofiles.php?collid=' . $collid);
        }