mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
accept.c: moved text.c bit above "%s#%s.c" so it would work for ~user#channels; place/threads: user auth check
This commit is contained in:
parent
7ffe715010
commit
4ff296fff1
3 changed files with 2734 additions and 19 deletions
|
@ -384,12 +384,6 @@ object compile_object(string file) {
|
||||||
return rob;
|
return rob;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
if (sscanf(file, "%s/text.c", path) && path != "") {
|
|
||||||
rob = clone_object(NET_PATH "text");
|
|
||||||
rob -> sPath(path);
|
|
||||||
D2(if (rob) PP(("DB CLONED: %O becomes %s/text\n", rob, path));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (sscanf(file, "place/%s.c", name) && name != "") {
|
if (sscanf(file, "place/%s.c", name) && name != "") {
|
||||||
#ifdef SANDBOX
|
#ifdef SANDBOX
|
||||||
string t;
|
string t;
|
||||||
|
@ -441,6 +435,12 @@ object compile_object(string file) {
|
||||||
#endif
|
#endif
|
||||||
return rob;
|
return rob;
|
||||||
}
|
}
|
||||||
|
if (sscanf(file, "%s/text.c", path) && path != "") {
|
||||||
|
rob = clone_object(NET_PATH "text");
|
||||||
|
rob -> sPath(path);
|
||||||
|
D2(if (rob) PP(("DB CLONED: %O becomes %s/text\n", rob, path));)
|
||||||
|
return rob;
|
||||||
|
}
|
||||||
if (sscanf(file, "%s#%s.c", path, name) && name != "") {
|
if (sscanf(file, "%s#%s.c", path, name) && name != "") {
|
||||||
unless (name = SIMUL_EFUN_FILE->legal_name(name))
|
unless (name = SIMUL_EFUN_FILE->legal_name(name))
|
||||||
return (object)0;
|
return (object)0;
|
||||||
|
|
2720
world/net/place/#archetype.gen#
Normal file
2720
world/net/place/#archetype.gen#
Normal file
File diff suppressed because it is too large
Load diff
|
@ -533,6 +533,12 @@ htget(prot, query, headers, qs, data) {
|
||||||
int a;
|
int a;
|
||||||
int limit = to_int(query["limit"]) || DEFAULT_BACKLOG;
|
int limit = to_int(query["limit"]) || DEFAULT_BACKLOG;
|
||||||
int offset = to_int(query["offset"]);
|
int offset = to_int(query["offset"]);
|
||||||
|
int authed = checkToken(query) ? 1 : 0;
|
||||||
|
unless (isPublic() || authed) {
|
||||||
|
write("<h1>404</h1>");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
string webact = PLACE_PATH + MYLOWERNICK;
|
string webact = PLACE_PATH + MYLOWERNICK;
|
||||||
// shouldnt it be "html" here?
|
// shouldnt it be "html" here?
|
||||||
sTextPath(query["layout"] || MYNICK, query["lang"], "ht");
|
sTextPath(query["layout"] || MYNICK, query["lang"], "ht");
|
||||||
|
@ -542,18 +548,7 @@ htget(prot, query, headers, qs, data) {
|
||||||
htok(prot);
|
htok(prot);
|
||||||
// kommentare + urspruengliche Nachricht anzeigen
|
// kommentare + urspruengliche Nachricht anzeigen
|
||||||
displayHeader("entry");
|
displayHeader("entry");
|
||||||
displayEntry(to_int(query["id"]), checkToken(query) ? 1 : 0);
|
displayEntry(to_int(query["id"]), authed);
|
||||||
#if 0
|
|
||||||
// eingabeformular ohne betreff
|
|
||||||
write("<form action='"+ webact +"' method='GET'>\n"
|
|
||||||
"<input type='hidden' name='request' value='post'>\n"
|
|
||||||
"PSYC Uni: <input type='text' name='uni'><br>\n"
|
|
||||||
"<input type='hidden' name='reply' value='"+ query["comments"] +"'>\n"
|
|
||||||
"<textarea name='text' rows='14' cols='80'>Enter your text here</textarea><br>\n"
|
|
||||||
"<input type='submit' value='submit'>\n"
|
|
||||||
"</form>\n");
|
|
||||||
write("<br><hr><br>");
|
|
||||||
#endif
|
|
||||||
//logView(a < 24 ? a : 12, "html", 15);
|
//logView(a < 24 ? a : 12, "html", 15);
|
||||||
displayFooter();
|
displayFooter();
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -589,7 +584,7 @@ htget(prot, query, headers, qs, data) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//::htget(prot, query, headers, qs, data, 1); // no processing, just info
|
::htget(prot, query, headers, qs, data, 1); // no processing, just info
|
||||||
|
|
||||||
string export = query["export"] || query["format"];
|
string export = query["export"] || query["format"];
|
||||||
if (export == "js") {
|
if (export == "js") {
|
||||||
|
|
Loading…
Reference in a new issue