admin update
This commit is contained in:
@@ -2,7 +2,7 @@ var apx = apx || {};
|
||||
apx.apxauth = {};
|
||||
apx.apxauth.loadwco = async (id, ctx) => {
|
||||
// check if not authenticate, do nothing cause by default screensignin and wait authentification
|
||||
// if authenticate, if url xhash then redirect if no url then change wco-link=screenmytribes
|
||||
// if authenticate, if url xhash then redirect if no url then change wco-link=screenmyworld
|
||||
// if (dayjs(apx.data.headers.xdays).diff(dayjs(), "hours") >= 24) apx.apxauth.checkisauth();
|
||||
//load main.mustache of the component
|
||||
//when wco-xxx change it run this function
|
||||
@@ -35,7 +35,7 @@ apx.apxauth.getdata = (id, ctx) => {
|
||||
? apx.data.appdata.emailsupport
|
||||
: "";
|
||||
switch (ctx.link) {
|
||||
case "logout":
|
||||
case "myworld":
|
||||
if (!data.profils) data.profils = [];
|
||||
apx.data.headers.xprofils.forEach((p) => {
|
||||
if (!["anonymous", "pagans", "persons"].includes(p)) {
|
||||
@@ -45,15 +45,47 @@ apx.apxauth.getdata = (id, ctx) => {
|
||||
data.noprofils = data.profils.length == 0;
|
||||
data.member = apx.data.headers.xprofils.includes("persons");
|
||||
data.websites = apx.data.appdata.websites;
|
||||
// get tribes activities
|
||||
/*["", "https://wall-ants.ndda.fr"];
|
||||
data.optionlinks=apx.data.tpldata[tpldataname].optionlinks
|
||||
data.town=apx.data.town
|
||||
data.nation=apx.data.nation
|
||||
if (1==1 || apx.data.headers.xprofils.includes('major')){
|
||||
apx.data.tpldata[tpldataname].optionlinksmajor.forEach(o=>data.optionlinks.push(o))
|
||||
apx.save()
|
||||
}
|
||||
// get towns list
|
||||
axios
|
||||
.get(`/api/apxtri/tribes/activities`, {
|
||||
.get(`/api/apxtri/odmdb/idx/apxtri/towns/towns`, {
|
||||
headers: apx.data.headers,
|
||||
})
|
||||
.then((rep) => {})
|
||||
.catch((err) => {});
|
||||
*/
|
||||
.then((rep) => {
|
||||
console.log(rep)
|
||||
if (rep.status==200){
|
||||
apx.data.itms.towns=rep.data.data.idx
|
||||
data.townsnumber= Object.keys(apx.data.itms.towns).length;
|
||||
apx.data.wco.townsnumber={textContent:Object.keys(apx.data.itms.towns).length};
|
||||
apx.listendatawco('townsnumber');
|
||||
apx.save()
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("ERROR, geting towns itms not available",err)
|
||||
});
|
||||
axios
|
||||
.get(`/api/apxtri/odmdb/idx/apxtri/pagans/lst_alias`, {
|
||||
headers: apx.data.headers,
|
||||
})
|
||||
.then((rep) => {
|
||||
if (rep.status==200){
|
||||
console.log(rep)
|
||||
data.pagansnumber=rep.data.data.idx.length
|
||||
apx.data.wco.pagansnumber={textContent:rep.data.data.idx.length};
|
||||
apx.listendatawco('pagansnumber');
|
||||
apx.save();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("ERROR, geting pagans itms not available",err)
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -253,7 +285,7 @@ apx.apxauth.authentifyme = async (
|
||||
//location.reload();
|
||||
document
|
||||
.getElementById(idparent)
|
||||
.setAttribute("wco-link", "mytribes");
|
||||
.setAttribute("wco-link", "myworld");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -484,7 +516,7 @@ apx.apxauth.authenticatedetachedSignature = async (
|
||||
message
|
||||
) => {
|
||||
/**
|
||||
* Check that alias (pubkey) signe a message
|
||||
* Check that alias (pubkey) sign a message
|
||||
* @alias {string} alias link to the publickey
|
||||
* @pubK {string} publiKey text format
|
||||
* @detachedSignature {string} a detachedsignatured get from apx.apxauth.detachedSignature
|
||||
|
Reference in New Issue
Block a user