mirror of https://github.com/gnosygnu/xowa
parent
5073db8044
commit
38f5f6de7c
@ -1,42 +0,0 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*;
|
||||
public class Xoapi_net implements Gfo_invk, Gfo_evt_itm {
|
||||
public Xoapi_net() {this.ev_mgr = new Gfo_evt_mgr(this);}
|
||||
public Gfo_evt_mgr Evt_mgr() {return ev_mgr;} private Gfo_evt_mgr ev_mgr;
|
||||
public void Init_by_kit(Xoae_app app) {
|
||||
}
|
||||
public boolean Enabled() {return enabled;} private boolean enabled = true;
|
||||
public void Enabled_(boolean v) {
|
||||
this.enabled = v;
|
||||
gplx.core.ios.IoEngine_system.Web_access_enabled = v;
|
||||
Gfo_evt_mgr_.Pub_val(this, gplx.xowa.guis.menus.dom.Xog_mnu_evt_mgr.Evt_selected_changed, v);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_enabled)) return this.Enabled();
|
||||
else if (ctx.Match(k, Invk_enabled_n_)) this.Enabled_(Bool_.N);
|
||||
else if (ctx.Match(k, Invk_enabled_y_)) this.Enabled_(Bool_.Y);
|
||||
else if (ctx.Match(k, Invk_enabled_x_)) this.Enabled_(this.Enabled());
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String
|
||||
Invk_enabled = "enabled", Invk_enabled_n_ = "enabled_n_", Invk_enabled_y_ = "enabled_y_", Invk_enabled_x_ = "enabled_x_"
|
||||
;
|
||||
public static final String Evt_enabled_changed = "enabled_changed";
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.apis.xowa.usrs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*; import gplx.xowa.apps.apis.*; import gplx.xowa.apps.apis.xowa.*;
|
||||
import gplx.xowa.guis.views.*;
|
||||
public class Xoapi_logs implements Gfo_invk {
|
||||
private Xoae_app app;
|
||||
public void Ctor_by_app(Xoae_app app) {this.app = app;}
|
||||
public void Init_by_kit(Xoae_app app) {}
|
||||
public boolean Enabled() {return app.Log_wtr().Enabled();}
|
||||
public void Enabled_(boolean v) {
|
||||
app.Log_wtr().Enabled_(v);
|
||||
if (!v)
|
||||
Io_mgr.Instance.DeleteFil_args(app.Log_wtr().Session_fil()).MissingFails_off().Exec();
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_enabled)) return Yn.To_str(this.Enabled());
|
||||
else if (ctx.Match(k, Invk_enabled_)) Enabled_(m.ReadYn("v"));
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_enabled = "enabled", Invk_enabled_ = "enabled_";
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
public class Xoa_misc_mgr implements Gfo_invk {
|
||||
private Xoa_app app;
|
||||
public void Init_by_app(Xoa_app app) {
|
||||
this.app = app;
|
||||
app.Cfg().Bind_many_app(this, Cfg__web_enabled, Cfg__logs_enabled);
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Cfg__web_enabled)) gplx.core.ios.IoEngine_system.Web_access_enabled = m.ReadYn("v");
|
||||
else if (ctx.Match(k, Cfg__logs_enabled)) {
|
||||
if (app.Tid_is_edit()) {
|
||||
Xoae_app appe = (Xoae_app)app;
|
||||
boolean logs_enabled = m.ReadYn("v");
|
||||
appe.Log_wtr().Enabled_(logs_enabled);
|
||||
if (!logs_enabled)
|
||||
Io_mgr.Instance.DeleteFil_args(appe.Log_wtr().Session_fil()).MissingFails_off().Exec();
|
||||
}
|
||||
}
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
private static final String Cfg__web_enabled = "xowa.app.web.enabled", Cfg__logs_enabled = "xowa.app.logs.enabled";
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.users; import gplx.*; import gplx.xowa.*;
|
||||
public class Xou_security_mgr implements Gfo_invk {
|
||||
public Xou_security_mgr(Xoae_app app) {this.app = app;} private Xoae_app app;
|
||||
public boolean Web_access_enabled() {return app.Api_root().Net().Enabled();}
|
||||
public void Web_access_enabled_(boolean v) {app.Api_root().Net().Enabled_(v);}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_web_access_enabled)) return Yn.To_str(this.Web_access_enabled());
|
||||
else if (ctx.Match(k, Invk_web_access_enabled_)) Web_access_enabled_(m.ReadYn("v"));
|
||||
return this;
|
||||
}
|
||||
public static final String
|
||||
Invk_web_access_enabled = "web_access_enabled", Invk_web_access_enabled_ = "web_access_enabled_";
|
||||
}
|
Loading…
Reference in new issue