diff --git a/client/swish-ask.sh b/client/swish-ask.sh index 8de1c9d34..39dc91126 100755 --- a/client/swish-ask.sh +++ b/client/swish-ask.sh @@ -7,6 +7,7 @@ server=${SWISH_SERVER-http://localhost:3050} srctext= +curlarg= format=${SWISH_FORMAT-prolog} program=$(basename $0) @@ -57,6 +58,10 @@ while [ $done = false ]; do esac shift ;; + https://*.pl|http://*.pl) + curlarg+=" -d src_url=$1" + shift + ;; *.pl) script=$(echo $1 | sed 's/.*=//') srctext+=":- include('$script'). " @@ -84,4 +89,5 @@ curl -s \ -d format=csv \ -d chunk=10 \ -d solutions=all \ + $curlarg \ $server/pengine/create diff --git a/lib/authenticate.pl b/lib/authenticate.pl index 6d3e54bb9..e68ce791d 100644 --- a/lib/authenticate.pl +++ b/lib/authenticate.pl @@ -31,6 +31,7 @@ [ swish_add_user/3, % +User, +Passwd, +Fields swish_add_user/1, % +Dict swish_add_user/0, + swish_logged_in/3, % +Request, -User, -Data swish_current_user/2 % ?User, ?Data ]). :- use_module(library(pengines), []). @@ -198,6 +199,15 @@ password_file(File), http_current_user(File, User, [_Hash,Group,RealName,Email]). +%% swish_logged_in(+Request, -User, -UserData) is det. +% +% True when Request is associated with User. + +swish_logged_in(Request, User, UserData) :- + logged_in(Request, User), + swish_current_user(User, UserData). + + %% swish_add_user(+User, +Passwd, +Fields) is det. % % Add a new user to the SWISH password file. Defined Fields are diff --git a/lib/page.pl b/lib/page.pl index 5b96723c9..758c14890 100644 --- a/lib/page.pl +++ b/lib/page.pl @@ -254,7 +254,7 @@ ModifiedWhenLoaded \== Modified. source_metadata(Path, _Code, module, Module) :- file_name_extension(_, Ext, Path), - prolog_file_type(Ext, prolog), + user:prolog_file_type(Ext, prolog), xref_public_list(Path, _, [module(Module)]). confirm_access(Path, Options) :- diff --git a/lib/render.pl b/lib/render.pl index 2fa89d03a..e4e167915 100644 --- a/lib/render.pl +++ b/lib/render.pl @@ -90,7 +90,7 @@ % % @see use_rendering/2. -:- multifile user:term_expansion/2. +:- multifile system:term_expansion/2. use_rendering(Rendering) :- use_rendering(Rendering, []). @@ -111,9 +111,9 @@ retractall(Into:'swish renderer'(Renderer, _)), assertz(Into:'swish renderer'(Renderer, Options)). -user:term_expansion((:- use_rendering(Renderer)), Expanded) :- +system:term_expansion((:- use_rendering(Renderer)), Expanded) :- expand_rendering(Renderer, [], Expanded). -user:term_expansion((:- use_rendering(Renderer, Options)), Expanded) :- +system:term_expansion((:- use_rendering(Renderer, Options)), Expanded) :- expand_rendering(Renderer, Options, Expanded). expand_rendering(Module:Renderer, Options, @@ -224,6 +224,6 @@ throw(error(context_error(nodirective, register_renderer(Name, Comment)), _)). -user:term_expansion((:- register_renderer(Name, Comment)), +system:term_expansion((:- register_renderer(Name, Comment)), swish_render:renderer(Name, Module, Comment)) :- prolog_load_context(module, Module). diff --git a/lib/template_hint.pl b/lib/template_hint.pl index eba917e86..0272c8863 100644 --- a/lib/template_hint.pl +++ b/lib/template_hint.pl @@ -441,8 +441,8 @@ Type = directory. file_type(_, Name, Type) :- file_name_extension(_, Ext, Name), - prolog_file_type(Ext, prolog), - \+ prolog_file_type(Ext, qlf), + user:prolog_file_type(Ext, prolog), + \+ user:prolog_file_type(Ext, qlf), Type = prolog. %% library_template_from(+From:list, -Template) is det.