Ejemplo n.º 1
0
function save_server($file)
{
    $fh = fopen($file, 'w');
    if (!$fh) {
        return "can't open file";
    }
    $stringData = '<?xml version="1.0" encoding="utf-8"?>';
    $stringData .= '<root>';
    $vars = getRealPOST();
    $stringData .= $vars['fcnt'];
    //jqGridUtils::GetParam('fcnt');
    $stringData .= '</root>';
    if (fwrite($fh, $stringData) === FALSE) {
        return "Cannot write to file ({$myFile})";
    }
    fclose($fh);
    return "success";
}
Ejemplo n.º 2
0
                if (empty($subkey)) {
                    $vars[$name[0]][] = $value;
                } else {
                    $vars[$name[0]][substr($name[1], 0, -1)] = $value;
                }
            } else {
                $vars[$name[0]] = $value;
            }
        }
    }
    return $vars;
}
// We need the actual POST
$originalPost = $_POST;
// Fix the POST array. Metadata fields can contain . _ and more
$_POST = getRealPOST();
// Get correct revision
$revisionid = -1;
$msg = null;
// If post is set it has priority
if (!empty($_POST)) {
    if (!isset($_POST['eid']) | !isset($_POST['revisionid'])) {
        throw new SimpleSAML_Error_Exception('eid and revisionid parameter must be set');
    }
    $eid = $_POST['eid'];
    // Note that when saving an entity 'revision id' does mean the revision the the new version will be based on
    $parentRevisionId = $_POST['revisionid'];
} else {
    if (!empty($_GET)) {
        if (!isset($_GET['eid'])) {
            throw new SimpleSAML_Error_Exception('eid parameter must be set');