static void webmain_real()
{
glocal string document;
glocal string user;
glocal CONNECT_INFO con;
glocal CONNECT_INFO con_sess;
glocal.con.port = "/dev/bod.sock";
glocal.con.secret = util_readsecret();
glocal.con_sess.port = "/dev/sessiond.sock";
glocal.con_sess.secret = glocal.con.secret;
("/etc/bolixonode.conf",true);
if (strncmp(line,"node=",5)==0){
util_setnodeurl(line+5);
}
return 0;
const char *pt = w_image.c_str();
if (*pt == '/') pt++;
const char *ptuser = pt;
pt = strchr(pt,'/');
bool image = true;
if (pt == NULL){
glocal.user = ptuser;
image = false;
}else if (strstr(pt,".html")!=NULL){
glocal.user = string (ptuser,pt-ptuser);
glocal.document = pt+1;
image = false;
}
if (!image){
glocal bool exist = false;
glocal bool pubdir = false;
glocal string website;
glocal string interest;
(glocal.con,glocal.user);
glocal.exist = exist;
glocal.pubdir = pubdir;
glocal.website = website;
glocal.interest = interest;
if (!glocal.exist){
tlmpweb_title (glocal.user.c_str());
util_defstyles();
DIV f; f.dispflex().flowcol().print();
DIV o; o.flexfixe().print();
{
DIV dd; dd.sfloat("right").print();
/-
}
o.flexfixe().print();
DIV d; d.borderradius(5).border(1,"black").marginauto().w(50).paddings(20,20).vpaddings(20,20).vmargins(50,0).print();
/-
htmlprintf (MSG_U(E_NOPUBLICPAGE,"No public page for user %s"),glocal.user.c_str());
/-
/-#I_CHECKBOLIXODIR You may want to do a search on the
/-
/-#I_DIRECTORY Bolixo.org directory
/-
}else{
const char *ptsession = tlmpweb_getcookie("session");
while (true){
if (ptsession == nullptr){
(glocal.con);
w_session = sessionid;
websession_setcookie("session",sessionid,time(NULL)+48*60*60);
break;
}else{
w_session=ptsession;
if (trli_getsessioninfo(glocal.con_sess) != -1){
break;
}
w_session.clear();
ptsession=nullptr;
}
}
//tlmp_error ("session=%s\n",w_session.c_str());
if (w_session.empty()) return;
webtable_ctrloutput();
();
VAR var;
var.name = "geometry";
for (auto &v:tb){
SNAMEVAL val;
val.sname = "id";
val.sval = v.id.c_str();
var.vals.push_back(move(val));
val.sname = "height";
val.sval = string_f("%u",v.height);
var.vals.push_back(move(val));
val.sname = "width";
val.sval = string_f("%u",v.width);
var.vals.push_back(move(val));
val.sname = "scroll_top";
val.sval = string_f("%u",v.scroll_top);
var.vals.push_back(move(val));
val.sname = "scroll_left";
val.sval = string_f("%u",v.scroll_left);
var.vals.push_back(move(val));
}
add_to_instrument ("setvar savetablegeometry");
(glocal.con_sess,w_session.c_str(),var);
if (!success) tlmp_error ("Can't set variable geometry: %s\n",msg);
();
glocal msgs;
glocal int ret = -1;
(glocal.con,glocal.user,offset,nb);
if (success){
glocal.ret = 0;
glocal.msgs.clear();
for (auto &m:messages) glocal.msgs.push_back(m);
}
return glocal.ret;
glocal int ret = -1;
glocal files;
(glocal.con,glocal.user,string_f("/project%s",path.ptr),offset,nb);
if (success){
glocal.ret = 0;
glocal.files.clear();
for (auto &f:files) glocal.files.push_back(f);
}
return glocal.ret;
glocal int ret = -1;
glocal BOB_TYPE *content = &content;
(glocal.con,glocal.user,string_f("/project/%s",path.ptr),0);
if (success){
glocal.ret = 0;
*glocal.content = content;
}
return glocal.ret;
string tmp = util_flipspaces(modified.ptr);
const char *modified_ptr = tmp.c_str();
if (is_image){
const char *slash = name.ptr[0] == '/' ? "" : "/";
return string_f("/public/%s/project%s%s?mod=%s",glocal.user.c_str(),slash,name.ptr,modified_ptr);
}else{
return string_f("/public/%s?file=%s&mod=%s",glocal.user.c_str(),name.ptr,modified_ptr);
}
return string_f("/public/%s/msg/%s?mod=%s",glocal.user.c_str(),name.ptr,modified.ptr);
("/etc/bolixonode.conf",true);
//if (strncmp(line,"node=",5)==0) nodename = line+5;
if (strncmp(line,"dirserver=",10)==0) util_setdirserver(line+10);
//if (strncmp(line,"org=",4)==0) org = line+4;
return 0;
tlmpweb_title (glocal.user.c_str());
//tlmpweb_setbaseurl(string_f("/Public/%s",glocal.user.c_str()));
util_defstyles();
?>
tlmpweb_body ("white",NULL);
// These DIV are there so the layout is properly computed by the javascript fixsize (created by util_endscript())
DIV dm("","main"); dm.w(100).print();
DIV dh("","head"); dh.print();
dh.end();
DIV db("tabs","body"); db.w(100).print();
FORM_HIDDEN t(w_image);
public_display (*this,glocal.con,glocal.user,glocal.pubdir,glocal.website,glocal.interest);
if (util_sendpublicfile(glocal.con,name)==-1){
tlmpweb_httpnotfound();
}
string wfile;
if (w_file.isset()) wfile = string_f("&file=%s",w_file.c_str());
util_endscript(string_f("image=%s%s%s",glocal.user.c_str()
,w_showmsg.isset() ? "&showmsg=1" : "",wfile.c_str()));
}
}else{
if (util_sendpublicfile(glocal.con,w_image.c_str())==-1){
tlmpweb_httpnotfound();
}
}
}