Exemplo n.º 1
0
    case 'saveedit':
        save_category(1);
        break;
    case 'opencat':
        category_status('open');
        break;
    case 'closecat':
        category_status('close');
        break;
    case 'new':
        images_form(0);
        break;
    case 'resize':
        resize_images();
        break;
    case 'edit':
        edit_image();
        break;
    case 'update':
        update_image();
        break;
    case 'delete':
        delete_image();
        break;
    case 'thumbs':
        update_thumbnails();
        break;
    default:
        show_images();
        break;
}
Exemplo n.º 2
0
// get root constants
if (!defined('WW_ROOT')) {
    include_once '../../ww_config/model_functions.php';
}
$url = $_SERVER["PHP_SELF"] . '?sess=' . $_GET['sess'] . '&author_id=' . $_GET['author_id'] . '&image_id=' . $_GET['image_id'];
// now bring in our functions
include_once WW_ROOT . '/ww_config/model_functions.php';
include_once WW_ROOT . '/ww_config/combined_functions.php';
include_once WW_ROOT . '/ww_config/author_controller_functions.php';
include_once WW_ROOT . '/ww_config/author_view_functions.php';
// get image details
$image_id = isset($_GET['image_id']) ? (int) $_GET['image_id'] : '';
// process edited image
$edit_success = 0;
if (isset($_POST['submit'])) {
    $edit = update_image($image_id);
    $edit_success = $edit == false ? 0 : 1;
}
// replace thumbnail
if (isset($_POST['replace_thumb'])) {
    if (isset($_FILES['new_thumb']) && empty($_FILES['new_thumb']['error'])) {
        $current = $_POST['current_thumb'];
        $new = $_FILES['new_thumb'];
        $thumb_error = replace_file($current, $new);
        if (is_array($thumb_error)) {
            header('Location: ' . $url);
        }
    }
}
// get image details
$image = get_image($image_id);
Exemplo n.º 3
0
$page_title = 'Images';
$images_per_page = 12;
// upload image
if (isset($_POST['upload_image']) && $_POST['upload_image'] == 'upload') {
    $upload_status = insert_image();
    if (is_int($upload_status)) {
        header('Location: ' . $_SERVER["PHP_SELF"] . '?page_name=images&image_id=' . $upload_status);
    } else {
        $error = $upload_status;
    }
}
// update image details
if (isset($_POST['update']) && $_POST['update'] == 'update details') {
    $image_id = (int) $_POST['image_id'];
    if (!empty($image_id)) {
        $update_status = update_image($image_id);
        if ($update_status == true) {
            header('Location: ' . $url);
        } else {
            $error = $update_status;
        }
    }
}
// insert image details -  for rogue images
if (isset($_POST['insert']) && $_POST['insert'] == 'insert details') {
    $insert_status = insert_image_details($_POST);
    if ($insert_status == true) {
        header('Location: ' . $_SERVER["PHP_SELF"] . '?page_name=images&image_id=' . $insert_status);
    } else {
        $error = $insert_status;
    }
Exemplo n.º 4
0
    /*
          echo '<a href="#"><i class="icon-plus"></i></a>';
          echo '&nbsp;&nbsp'; */
    //echo '<a href="' . $_SERVER['PHP_SELF'] . '?deleted_image_id=' . $row['id'] . '"><i class="icon-trash"></i></a>';
    echo '&nbsp;&nbsp';
    echo '</div></div></li>';
}
if (isset($_GET['deleted_image_id'])) {
    delete_image($dbc, $_GET['deleted_image_id']);
}
if (isset($_POST['submit'])) {
    $image_id = $_POST['image_id'];
    $name = $_POST['name'];
    $subject = $_POST['subject'];
    $description = $_POST['description'];
    if ($image_id = update_image($dbc, $image_id, $name, $subject, $description)) {
        echo '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert">&times;</button>';
        echo '图片"' . $name . '"的信息已成功录入!</div>';
    }
}
?>
<script language="javascript" type="text/javascript">
    function popUpload(str)
    {
        if (str.length == 0)
        {
            document.getElementById("myContent").innerHTML = "没有可展示的东西!";
            document.getElementById("myContent").style.border = "0px";
            return;
        }
        if (window.XMLHttpRequest)
Exemplo n.º 5
0
$page['title'] = "S_CONFIGURATION_OF_ZABBIX";
$page['file'] = 'config.php';
$page['hist_arg'] = array('config');
include_once 'include/page_header.php';
$fields = array('config' => array(T_ZBX_INT, O_OPT, NULL, IN('0,3,5,6,7,8,9,10'), NULL), 'alert_history' => array(T_ZBX_INT, O_NO, NULL, BETWEEN(0, 65535), 'isset({config})&&({config}==0)&&isset({save})'), 'event_history' => array(T_ZBX_INT, O_NO, NULL, BETWEEN(0, 65535), 'isset({config})&&({config}==0)&&isset({save})'), 'work_period' => array(T_ZBX_STR, O_NO, NULL, NULL, 'isset({config})&&({config}==7)&&isset({save})'), 'refresh_unsupported' => array(T_ZBX_INT, O_NO, NULL, BETWEEN(0, 65535), 'isset({config})&&({config}==5)&&isset({save})'), 'alert_usrgrpid' => array(T_ZBX_INT, O_NO, NULL, DB_ID, 'isset({config})&&({config}==5)&&isset({save})'), 'imageid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, 'isset({config})&&({config}==3)&&(isset({form})&&({form}=="update"))'), 'name' => array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, 'isset({config})&&({config}==3)&&isset({save})'), 'imagetype' => array(T_ZBX_INT, O_OPT, NULL, IN('1,2'), 'isset({config})&&({config}==3)&&(isset({save}))'), 'valuemapid' => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, 'isset({config})&&({config}==6)&&(isset({form})&&({form}=="update"))'), 'mapname' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==6)&&isset({save})'), 'valuemap' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'rem_value' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), NULL), 'add_value' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({add_map})'), 'add_newvalue' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({add_map})'), 'add_map' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'del_map' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'event_ack_enable' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, IN('0,1'), 'isset({config})&&({config}==8)&&isset({save})'), 'event_expire' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, BETWEEN(1, 65535), 'isset({config})&&({config}==8)&&isset({save})'), 'event_show_max' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, BETWEEN(1, 65535), 'isset({config})&&({config}==8)&&isset({save})'), 'default_theme' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==9)&&isset({save})'), 'regexpids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'regexpid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({config})&&({config}==10)&&(isset({form})&&({form}=="update"))'), 'rename' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==10)&&isset({save})'), 'test_string' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==10)&&isset({save})'), 'delete_regexp' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'g_expressionid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, null), 'expressions' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({config})&&({config}==10)&&isset({save})'), 'new_expression' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'cancel_new_expression' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'clone' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'add_expression' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'edit_expressionid' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'delete_expression' => array(T_ZBX_STR, O_OPT, NULL, NULL, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form_refresh' => array(T_ZBX_INT, O_OPT, NULL, NULL, NULL));
$_REQUEST['config'] = get_request('config', get_profile('web.config.config', 0));
check_fields($fields);
update_profile('web.config.config', $_REQUEST['config'], PROFILE_TYPE_INT);
$result = 0;
if ($_REQUEST['config'] == 3) {
    /* IMAGES ACTIONS */
    if (isset($_REQUEST['save'])) {
        $file = isset($_FILES['image']) && $_FILES['image']['name'] != '' ? $_FILES['image'] : NULL;
        if (isset($_REQUEST['imageid'])) {
            /* UPDATE */
            $result = update_image($_REQUEST['imageid'], $_REQUEST['name'], $_REQUEST['imagetype'], $file);
            $msg_ok = S_IMAGE_UPDATED;
            $msg_fail = S_CANNOT_UPDATE_IMAGE;
            $audit_action = 'Image [' . $_REQUEST['name'] . '] updated';
        } else {
            /* ADD */
            if (!count(get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY))) {
                access_deny();
            }
            $result = add_image($_REQUEST['name'], $_REQUEST['imagetype'], $file);
            $msg_ok = S_IMAGE_ADDED;
            $msg_fail = S_CANNOT_ADD_IMAGE;
            $audit_action = 'Image [' . $_REQUEST['name'] . '] added';
        }
        show_messages($result, $msg_ok, $msg_fail);
        if ($result) {
    //Determine if modify is set & if so display the form to either modify the image or text
    if ($modify == "text") {
        if ($prev_text == NULL) {
            $prev_text = $page[$prevtext_column];
            show_text_update_form($projectid, $image, $prev_text, $prevtext_column);
            $show_resolution_form = FALSE;
        } else {
            Page_modifyText($projectid, $image, $prev_text, $prevtext_column, $pguser);
            echo "<p><b>" . _("Update of Text from Previous Round Complete!") . "</b></p>";
        }
    } elseif ($modify == "image") {
        if (!count($_FILES)) {
            show_image_update_form($projectid, $image);
            $show_resolution_form = FALSE;
        } else {
            update_image($projectid, $image);
        }
    }
    if ($show_resolution_form) {
        show_resolution_form($projectid, $image, $state, $prev_round_num, $is_a_bad_page, $b_User, $b_Code);
    }
} else {
    //Get variables passed from form
    $state = get_enumerated_param($_POST, 'state', null, $PAGE_STATES_IN_ORDER);
    //If the PM fixed the problem or stated the report was invalid update the database to reflect
    if ($resolution == "fixed" || $resolution == "invalid") {
        $round = get_Round_for_page_state($state);
        Page_eraseBadMark($projectid, $image, $round, $pguser);
    }
    //Redirect the user back to the project detail page.
    header("Location: {$code_url}/tools/project_manager/page_detail.php?project={$projectid}");