コード例 #1
0
        $response[title] = FW_ERROR_NO_PERM;
        $response[text] = FW_ERROR_NO_PERM_TXT;
        $iserror = 1;
        print draw_response($response);
    }
} else {
    $PAGE[PAGE_INTITLE] = PRATICHE_ADD;
    $PAGE[TXT_TITLE] = PRATICHE_ADD;
    $ad = "add";
    if (check_perm_mod($module, "c") == 1 && ($_SESSION[user][admin] == 1 || $_SESSION[user][pratiche_add] == 1)) {
        if ($_POST[form_id] == $thisform["name"]) {
            $result = $_POST;
        } else {
            $result[permessi] = "U" . $_SESSION[fw_userid] . "=66666";
        }
        $thisform[Fields][pr_numero][content] = "hidden||" . get_first_prat() . "||";
        $thisform[Fields][pr_data_ins][content] = "hidden||" . date("Y-m-d") . "||";
        $thisform[Fields][pr_data_mod][content] = "hidden||" . date("Y-m-d") . "||";
        $thisform[Fields][send][content] = "submit||" . PRATICHE_ADD . "||";
        $response[title] = PRATICHE_ADD_DONE;
        $response[text] = PRATICHE_ADD_DONE_TXT . "<br><br>" . make_button("pratiche_view.php", PRATICHE_BACK_LIST);
    } else {
        $response[title] = FW_ERROR_NO_PERM;
        $response[text] = FW_ERROR_NO_PERM_TXT;
        $iserror = 1;
        print draw_response($response);
    }
}
if ($iserror != 1) {
    if ($_POST[pr_valore] == 0) {
        $_POST[pr_valore] = $_POST[pr_valore_ignore];
コード例 #2
0
ファイル: new_user.php プロジェクト: HadoDokis/knomos-plus
        } else {
            print draw_form($thisform, $module, $error, $_POST, $page);
        }
        if ($manage >= 1) {
            $rsg = $DB->Execute("DELETE FROM " . $CONF[auth_group_table] . " WHERE userid=" . $manage);
            if (is_array($_POST[gruppi])) {
                foreach ($_POST[gruppi] as $gru) {
                    $DB->Execute("INSERT INTO " . $CONF[auth_group_table] . " SET groupid='{$gru}', userid='" . $manage . "'");
                }
            }
            if (!isset($_GET[id]) && $_POST[ref_prat] == 1) {
                $rs_dupe = $DB->Execute("SELECT * FROM users WHERE nome='" . $_POST[nome] . "'");
                if ($rs_dupe->RecordCount() > 1) {
                    $DB->Execute("INSERT INTO pratiche SET pr_codice='" . make_nome_prat($_POST[nome] . " " . $_POST[codice]) . "', pr_numero='" . get_first_prat() . "', pr_oggetto='" . ADMIN_USER_PERSPRAT . " " . $_POST[nome] . "', pr_operatore='" . $manage . "', pr_data_ins=NOW(), pr_data_mod=NOW(), pr_criterio='MIN*1', permessi='U" . $manage . "=6666'");
                } else {
                    $DB->Execute("INSERT INTO pratiche SET pr_codice='" . make_nome_prat($_POST[nome]) . "', pr_numero='" . get_first_prat() . "', pr_oggetto='" . ADMIN_USER_PERSPRAT . " " . $_POST[nome] . "', pr_operatore='" . $manage . "', pr_data_ins=NOW(), pr_data_mod=NOW(), pr_criterio='MIN*1', permessi='U" . $manage . "=6666'");
                }
                $pratid = mysql_insert_id();
                $DB->Execute("UPDATE users SET ref_prat={$pratid} WHERE id={$manage}");
            }
            print draw_response($response);
        }
    } else {
        print draw_form($thisform, $module, "", $result);
    }
} else {
    $response[title] = FW_ERROR_NO_PERM;
    $response[text] = FW_ERROR_NO_PERM_TXT;
    $iserror = 1;
    print draw_response($response);
}