- controllo della @ sull'username telegram (sugli Eventi)

- controllo email di test, se funzionante o no
This commit is contained in:
Surya Paolo
2025-07-29 12:54:40 +02:00
parent 85db3b4a61
commit 6013a624f6
11 changed files with 137 additions and 65 deletions

View File

@@ -3,7 +3,7 @@
v-if=" v-if="
((tools.getLinkUserTelegramByUser(myuser) || ((tools.getLinkUserTelegramByUser(myuser) ||
(myuser.email && tools.isEmailVerifiedByUser(myuser))) && (myuser.email && tools.isEmailVerifiedByUser(myuser))) &&
tools.isUserOk()) || tools.isUserOk(true)) ||
showBtnActivities showBtnActivities
" "
class="" class=""
@@ -40,18 +40,18 @@
</div> </div>
<div class="q-pa-xs"> <div class="q-pa-xs">
<q-btn <q-btn
v-if="tools.getLinkUserTelegramByUser(myuser) && tools.isUserOk()" v-if="tools.getLinkUserTelegramByUser(myuser) && tools.isUserOk(true)"
icon="fab fa-telegram" icon="fab fa-telegram"
color="blue" color="blue"
:type="tools.isUserOk() ? 'a' : 'btn'" :type="tools.isUserOk(true) ? 'a' : 'btn'"
size="md" size="md"
rounded rounded
:label="$t('dialog.contact')" :label="$t('dialog.contact')"
:href=" :href="
tools.isUserOk() ? tools.getLinkUserTelegramByUser(myuser) : null tools.isUserOk(true) ? tools.getLinkUserTelegramByUser(myuser) : null
" "
@click=" @click="
!tools.isUserOk() ? (showingtooltip = !showingtooltip) : false !tools.isUserOk(true) ? (showingtooltip = !showingtooltip) : false
" "
target="__blank" target="__blank"
> >

View File

@@ -449,6 +449,10 @@ export default defineComponent({
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) { if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
newval = tools.removespaces_slash(newval) newval = tools.removespaces_slash(newval)
} }
if (col.value.fieldtype === costanti.FieldType.username_telegram) {
newval = tools.removeatIniziale(newval)
}
// console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name) // console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name)
// console.log('row', props.row, 'col', props.mycol, 'newval', newval) // console.log('row', props.row, 'col', props.mycol, 'newval', newval)
@@ -953,10 +957,17 @@ export default defineComponent({
} }
function nameKeydown(e: any, col: any) { function nameKeydown(e: any, col: any) {
if (col.allowchar === costanti.ALLOWCHAR_CODE) { if (col.fieldtype === costanti.FieldType.username_telegram) {
if (!/^[a-z0-9_]*$/i.test(e.key)) {
e.preventDefault();
}
if (/^\W$/.test(e.key)) { } else {
e.preventDefault(); if (col.allowchar === costanti.ALLOWCHAR_CODE) {
if (/^\W$/.test(e.key)) {
e.preventDefault();
}
} }
} }
} }

View File

@@ -316,8 +316,6 @@
> >
<span style="font-size: 14px">{{ myvalue }}</span> <span style="font-size: 14px">{{ myvalue }}</span>
</div> </div>
</div> </div>
<!-- Componente di selezione del colore --> <!-- Componente di selezione del colore -->
@@ -333,7 +331,8 @@
<div <div
v-else-if=" v-else-if="
col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.string ||
col.fieldtype === costanti.FieldType.crypted col.fieldtype === costanti.FieldType.crypted ||
col.fieldtype === costanti.FieldType.username_telegram
" "
> >
<div <div
@@ -359,6 +358,19 @@
:rules="[(val) => !!val || !col.required || 'Campo richiesto']" :rules="[(val) => !!val || !col.required || 'Campo richiesto']"
:label="col.visulabel ? addstrrequired + t(col.label_trans) : col.label" :label="col.visulabel ? addstrrequired + t(col.label_trans) : col.label"
> >
<template
v-if="col.fieldtype === costanti.FieldType.username_telegram"
v-slot:prepend
>
<span class="text-h7 text-blue">@</span>
</template>
<template
v-if="col.fieldtype === costanti.FieldType.username_telegram"
v-slot:prepend
>
<span class="text-h7 text-blue">@</span>
</template>
</q-input> </q-input>
<q-field v-if="col.showLinkResult && myvalue"> <q-field v-if="col.showLinkResult && myvalue">
Diventerà: {{ tools.generateURL(col.showLinkResult, myvalue) }} Diventerà: {{ tools.generateURL(col.showLinkResult, myvalue) }}
@@ -560,7 +572,7 @@
{{ t(col.label_trans ? col.label_trans : '') }} {{ t(col.label_trans ? col.label_trans : '') }}
</span> </span>
<CGallery <CGallery
:filetype="shared_consts.FILETYPE.IMG" :filetype="shared_consts.FILETYPE.IMG"
:imagebak=" :imagebak="
col.showpicprofile_ifnotset col.showpicprofile_ifnotset
? userStore.getImgByProfile(row['profile'], true) ? userStore.getImgByProfile(row['profile'], true)
@@ -1492,7 +1504,8 @@
<div <div
v-else-if=" v-else-if="
col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.string ||
col.fieldtype === costanti.FieldType.crypted col.fieldtype === costanti.FieldType.crypted ||
col.fieldtype === costanti.FieldType.username_telegram
" "
> >
<q-input <q-input

View File

@@ -50,7 +50,7 @@ export default defineComponent({
const $router = useRouter() const $router = useRouter()
const datastat = ref(<any>{ const datastat = ref(<INotData>{
num_reg: 0, num_reg: 0,
num_reg_today: 0, num_reg_today: 0,
online_today: 0, online_today: 0,
@@ -160,6 +160,7 @@ export default defineComponent({
// console.log('load') // console.log('load')
myloadingload.value = true myloadingload.value = true
datastat.value = await globalStore.getStatSite() datastat.value = await globalStore.getStatSite()
datastat.value = {}
eseguipolling.value = true eseguipolling.value = true

View File

@@ -1,62 +1,86 @@
<template> <template>
<div
<div v-if="!globalStore.serverError" class="q-ma-sm"> v-if="!globalStore.serverError"
class="q-ma-sm"
<div v-if="tools.isLogged() && (site.confpages?.enableRegMultiChoice || (!site.confpages?.enabledRegNeedTelegram))"> >
<div
v-if="
tools.isLogged() &&
(site.confpages?.enableRegMultiChoice || !site.confpages?.enabledRegNeedTelegram)
"
>
<CVerifyEmail v-if="!tools.isEmailVerified() && !tools.TelegVerificato()"> <CVerifyEmail v-if="!tools.isEmailVerified() && !tools.TelegVerificato()">
</CVerifyEmail> </CVerifyEmail>
</div> </div>
<div v-if="userStore.isUserWaitingVerifAportador()" class="centeritems"> <div
<q-banner inline-actions rounded class="bg-light-grey text-black"> v-if="userStore.isUserWaitingVerifAportador()"
<div class="text-h7" class="centeritems"
>Sei in attesa di essere Ammesso da >
{{ tools.getAportadorSolidario() }}.<br> <div class="text-h5 text-center text-bold q-mb-md">Attendi Ammissione</div>
Ti arriverà una notifica sulla Chat Telegram <strong>'BOT RISO'</strong>.<br /><br />
Se non dovesse arrivarti entro qualche ora, contattalo per ricordarglielo.<br /> <q-card class="q-ma-md q-pa-sm bg-light-blue text-dark shadow-6">
</div> <div class="text-h7 justify-center">
Sei in attesa di essere Ammesso da {{ tools.getAportadorSolidario() }}.<br />
Ti arriverà una notifica sulla Chat Telegram
<a :href="tools.getLinkBotTelegram('', '')"
><strong>{{ tools.getBotName() }}</strong></a
>.<br /><br />
Se non dovesse arrivarti entro qualche ora, contattala per avvisarla:<br />
</div>
<q-btn
rounded
class="q-ma-sm justify-center row"
color="primary"
:to="tools.getLinkProfileAportador()"
:label="`Apri Profilo di ` + tools.getAportadorSolidario()"
>
</q-btn>
<br /><br />
<div class="text-h7 row justify-center text-bold">Per supporto con Telegram:</div>
<q-btn
rounded
type="a"
class="q-ma-sm justify-center row"
color="primary"
icon="fab fa-telegram"
href="https://t.me/surya1977"
:label="`Contatta Surya`"
>
</q-btn>
<div class="text-h7 row justify-center">Oppure tramite email:</div>
<q-btn
rounded
type="a"
class="q-ma-sm justify-center row"
color="grey"
icon="fas fa-envelope"
href="mailto:surya@riso.app?Subject=Richiesta%20di%20aiuto%20su%20Riso"
:label="`Invia Email a Surya`"
>
</q-btn>
</q-card>
<div class="row justify-center">
<q-btn <q-btn
rounded rounded
class="q-ma-sm" class="q-ma-sm"
color="positive" color="positive"
@click="tools.refreshPage()" @click="tools.refreshPage()"
icon="refresh" icon="refresh"
label="Aggiorna la Pagina" label="Verifica ora se sei stato Ammesso"
> >
</q-btn> </q-btn>
<br> </div>
<q-btn
rounded
class="q-ma-sm"
color="primary"
:to="tools.getLinkProfileAportador()"
:label="`Profilo di ` + tools.getAportadorSolidario()"
>
</q-btn>
<br><br>
<div class="text-h7"> Per supporto ed Aiuto:</div>
<q-btn
rounded
type="a"
class="q-ma-sm"
color="primary"
icon="fab fa-telegram"
href="https://t.me/surya1977"
:label="`Contatta l'Assistenza (Surya)`"
>
</q-btn>
</q-banner>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" src="./CUserNonVerif.ts"> <script lang="ts" src="./CUserNonVerif.ts"></script>
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import './CUserNonVerif.scss'; @import './CUserNonVerif.scss';

View File

@@ -491,6 +491,7 @@ export const costanti = {
editor_nohtml: 20000, editor_nohtml: 20000,
verifica: 21000, verifica: 21000,
pickcolor: 22000, pickcolor: 22000,
username_telegram: 23000,
}, },
TypeMov: { TypeMov: {

View File

@@ -2296,7 +2296,7 @@ export const colmyBachecas = [
AddCol({ AddCol({
name: 'contact_telegram', name: 'contact_telegram',
label_trans: 'event.contact_telegram', label_trans: 'event.contact_telegram',
fieldtype: costanti.FieldType.string, fieldtype: costanti.FieldType.username_telegram,
isadvanced_field: true, isadvanced_field: true,
}), }),
AddCol({ AddCol({
@@ -2375,7 +2375,7 @@ export const colTableSites = [
AddCol({ name: 'dir', label_trans: 'sites.dir' }), AddCol({ name: 'dir', label_trans: 'sites.dir' }),
AddCol({ name: 'dir_test', label_trans: 'sites.dir_test', fieldtype: costanti.FieldType.string }), AddCol({ name: 'dir_test', label_trans: 'sites.dir_test', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'email_from', label_trans: 'sites.email_from', fieldtype: costanti.FieldType.string }), AddCol({ name: 'email_from', label_trans: 'sites.email_from', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'email_pwd', label_trans: 'sites.email_pwd', fieldtype: costanti.FieldType.string }), AddCol({ name: 'email_pwd', label_trans: 'sites.email_pwd', fieldtype: costanti.FieldType.password }),
AddCol({ name: 'telegram_key', label_trans: 'sites.telegram_key', fieldtype: costanti.FieldType.string }), AddCol({ name: 'telegram_key', label_trans: 'sites.telegram_key', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'telegram_bot_name', label_trans: 'sites.telegram_bot_name', fieldtype: costanti.FieldType.string }), AddCol({ name: 'telegram_bot_name', label_trans: 'sites.telegram_bot_name', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'telegram_support_chat', label_trans: 'sites.telegram_support_chat', fieldtype: costanti.FieldType.string }), AddCol({ name: 'telegram_support_chat', label_trans: 'sites.telegram_support_chat', fieldtype: costanti.FieldType.string }),
@@ -3082,7 +3082,7 @@ export const colTableOperator = [
AddCol({ name: 'email', label_trans: 'reg.email' }), AddCol({ name: 'email', label_trans: 'reg.email' }),
AddCol({ name: 'img', label_trans: 'event.img' }), AddCol({ name: 'img', label_trans: 'event.img' }),
AddCol({ name: 'cell', label_trans: 'reg.cell' }), AddCol({ name: 'cell', label_trans: 'reg.cell' }),
AddCol({ name: 'usertelegram', label_trans: 'op.usertelegram' }), AddCol({ name: 'usertelegram', label_trans: 'op.usertelegram', fieldtype: costanti.FieldType.username_telegram }),
AddCol({ name: 'qualification', label_trans: 'op.qualification' }), AddCol({ name: 'qualification', label_trans: 'op.qualification' }),
AddCol({ name: 'disciplines', label_trans: 'op.disciplines' }), AddCol({ name: 'disciplines', label_trans: 'op.disciplines' }),
AddCol({ name: 'certifications', label_trans: 'op.certifications' }), AddCol({ name: 'certifications', label_trans: 'op.certifications' }),

View File

@@ -5057,6 +5057,16 @@ export const tools = {
return mystr; return mystr;
}, },
removeatIniziale(mystr: string) {
mystr = mystr.trim()
// remove @ from the beginning
if (mystr.startsWith('@')) {
mystr = mystr.substring(1);
}
return mystr
},
removespaces_slash(mystr: string) { removespaces_slash(mystr: string) {
mystr = mystr.replace(/\s+/g, ''); mystr = mystr.replace(/\s+/g, '');
mystr = mystr.replace(/\//g, ''); mystr = mystr.replace(/\//g, '');
@@ -5598,9 +5608,9 @@ export const tools = {
} }
}, },
isUserOk() { isUserOk(anchesenonammesso: boolean = false) {
const userStore = useUserStore(); const userStore = useUserStore();
if (userStore) return userStore.isUserOk(); if (userStore) return userStore.isUserOk(anchesenonammesso);
else return false; else return false;
}, },
@@ -5705,6 +5715,16 @@ export const tools = {
return ''; return '';
} }
}, },
getLinkUserTelegramAportador() {
const aportador = this.getAportadorSolidario()
if (aportador) {
if (userprofile.profile?.username_telegram) {
return 'https://t.me/' + userprofile.profile.username_telegram;
}
} else {
return '';
}
},
TelegCode() { TelegCode() {
const userStore = useUserStore(); const userStore = useUserStore();

View File

@@ -794,7 +794,7 @@ export const useUserStore = defineStore('UserStore', {
return this.my.profile.teleg_id! > 0 || this.my.profile.teleg_id_old! > 0; return this.my.profile.teleg_id! > 0 || this.my.profile.teleg_id_old! > 0;
}, },
isUserOk(): boolean { isUserOk(anchesenonammesso: boolean = false): boolean {
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
if ( if (
@@ -803,7 +803,7 @@ export const useUserStore = defineStore('UserStore', {
) { ) {
return ( return (
((this.isTelegIdOk() && this.isUsernameTelegOk()) || this.my.verified_email!) && ((this.isTelegIdOk() && this.isUsernameTelegOk()) || this.my.verified_email!) &&
this.my.verified_by_aportador! (anchesenonammesso || this.my.verified_by_aportador!)
); );
} else { } else {
//if (tools.getAskToVerifyReg()) { //if (tools.getAskToVerifyReg()) {
@@ -813,13 +813,15 @@ export const useUserStore = defineStore('UserStore', {
) { ) {
return ( return (
this.isTelegIdOk() && this.isTelegIdOk() &&
this.my.verified_by_aportador! && (anchesenonammesso || this.my.verified_by_aportador!) &&
this.isUsernameTelegOk() this.isUsernameTelegOk()
); );
} else { } else {
return this.my.verified_email!; return this.my.verified_email!;
} }
} }
return false
// return this.my.verified_email! && this.isTelegIdOk() && this.my.verified_by_aportador! // return this.my.verified_email! && this.isTelegIdOk() && this.my.verified_by_aportador!
}, },

View File

@@ -2250,7 +2250,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
console.log(usertosend); console.log(usertosend);
return Api.SendReq('/news/testemail', 'POST', usertosend).then((res) => { return Api.SendReq('/news/testemail', 'POST', usertosend).then((res) => {
return res; return res?.data?.code === serv_constants.RIS_CODE_OK;
}); });
}, },
@@ -2408,7 +2408,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
return Api.SendReq('/site/load', 'POST', paramquery) return Api.SendReq('/site/load', 'POST', paramquery)
.then((res) => { .then((res) => {
// console.log('datastat', res) // console.log('datastat', res)
this.datastat = res.data.datastat; this.datastat = res.data?.datastat;
return this.datastat; return this.datastat;
}) })
.catch((error) => { .catch((error) => {

View File

@@ -276,7 +276,7 @@
<CContactUser <CContactUser
:myuser="userStore.userprofile" :myuser="userStore.userprofile"
:showBtnActivities="false" :showBtnActivities="false"
:showBtnRis="true" :showBtnRis="tools.isUserOk()"
:sendRIS="tools.isUserOk() ? sendRIS : false" :sendRIS="tools.isUserOk() ? sendRIS : false"
:causalDest="causalDest" :causalDest="causalDest"
@showed="showed" @showed="showed"