<%@language = "javascript" %>
<% /*
     $Revision$
     $Id$

     File:          create_bookmark.asp
     Description:
     Parameters:    url: url naar bookmark

*/ %>

<%
var JSON_Result = true;
%>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/json2.js" -->

<%
protectRequest.validateToken();
user.checkAutorisation("WEB_HLPADM");

var path = getFParam("path");
var query = getFParam("query", "");
var naam = getFParam("naam");
var result = { message: "", success: true };

// rooturl moet er af
if (path.substring(0, rooturl.length).toUpperCase() == rooturl.toUpperCase())
    path = path.substring(rooturl.length);

var bookmark_id = shared.random(16);
var sql = "INSERT INTO fac_bookmark"
        + " (fac_bookmark_id, fac_bookmark_path, fac_bookmark_query, fac_bookmark_naam, fac_bookmark_flags, prs_perslid_key)"
        + " VALUES ("+safe.quoted_sql(bookmark_id)
                     +", "+safe.quoted_sql(path)+", "
                     +safe.quoted_sql(query)
                     +", "
                     +safe.quoted_sql(naam)
                     + ",1+2" // Zichtbaar voor PRSSYS en gewone gebruikers
                     +", " + user_key + ")";
Oracle.Execute(sql);

result.message = L("lcl_fac_bookmark") + ": " + naam;

Response.Write(JSON.stringify(result));
%>

