modification du form pour prendre en compte le plugin verif mobile, + css
This commit is contained in:
parent
229d8247a0
commit
58f388d026
6 changed files with 131 additions and 77 deletions
|
@ -41,3 +41,8 @@ $GLOBALS['comptespip_editer'] = [
|
|||
)
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
if (test_plugin_actif('verifmob')) {
|
||||
$GLOBALS['formulaires_verif_mobile'][] = 'editer_compte_spip';
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
|
||||
<div class="se_connecter inner">
|
||||
<div class="grid-2">
|
||||
<div class="sinscrire">
|
||||
<h3 class="mlm"><:comptespip:sinscrire:></h3>
|
||||
<div class="ajax sinscrire">
|
||||
<h3 class="comptespip_titre_form"><i class="fa fa-user-plus"></i> <:comptespip:sinscrire:></h3>
|
||||
[(#FORMULAIRE_EDITER_COMPTE_SPIP{})]
|
||||
</div>
|
||||
<div class="login">
|
||||
<h3 class="mlm"><:comptespip:se_connecter:></h3>
|
||||
<h3 class="comptespip_titre_form"><i class="fa fa-unlock"></i> <:comptespip:se_connecter:></h3>
|
||||
[(#LOGIN_PUBLIC{#URL_PAGE{#CONFIG{comptespip/page_redirection_connexion}}})]
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,3 +5,42 @@
|
|||
.formulaire_spip .comptespip_logo_auteur .editer_logo {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.formulaire_editer_compte_spip legend {
|
||||
font-family: inherit;
|
||||
font-size: 2rem;
|
||||
}
|
||||
.formulaire_editer_compte_spip label {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
.formulaire_editer_compte_spip button {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.se_connecter .formulaire_spip {
|
||||
background-color: rgba(235, 235, 235, 1) !important;
|
||||
}
|
||||
.se_connecter .boutons {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.se_connecter fieldset {
|
||||
background-color: transparent !important;
|
||||
border: 1px solid rgb(0, 0, 0);
|
||||
padding: 0 3rem 2rem;
|
||||
margin: 4rem 0;
|
||||
}
|
||||
.se_connecter legend {
|
||||
width: auto;
|
||||
padding: 0 1.5rem;
|
||||
letter-spacing: initial;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
h3.comptespip_titre_form {
|
||||
margin-bottom: -3rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<style type="text/css" media="screen">
|
||||
.editer_telephone {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
#CACHE{0}
|
||||
<div class="formulaire_spip formulaire_#FORM">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
|
@ -24,9 +20,24 @@
|
|||
</div>
|
||||
]
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend><:comptespip:identite:></legend>
|
||||
#GENERER_SAISIES{#ENV{_saisies}}
|
||||
</fieldset>
|
||||
|
||||
<BOUCLE_con(CONDITION){si #PLUGIN{verifmob}|oui}>
|
||||
<div class="verif_mobile">
|
||||
<label for="indicatif"><:gabo:telephone:></label>
|
||||
<style type="text/css" media="screen">
|
||||
.editer_telephone {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
<fieldset>
|
||||
<legend><:comptespip:telephone|ucfirst:></legend>
|
||||
<div class="editer">
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{mobile}}
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<div class="verif_mobile editer">
|
||||
<button class="badge" onclick="return false;">+</button>
|
||||
<input class="text" type="text"
|
||||
name="indicatif"
|
||||
|
@ -47,23 +58,21 @@
|
|||
>
|
||||
<button class="btn--warning envoyer_sms mts mlm" type="button"><:gabo:envoyer_sms:></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='editer saisie_confirmation obligatoire[ (#ENV*{erreurs}|table_valeur{confirmation}|oui)erreur]'>
|
||||
<label for="confirmation"><:comptespip:code_confirmation_sms:> <em class="obligatoire"><:info_obligatoire_02:></em></label>
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{confirmation_sms}}
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<input type="text" class="text" id="confirmation_sms" name="confirmation_sms" value="#ENV{confirmation_sms}">
|
||||
</div>
|
||||
<button class="btn btn--warning renvoyer_sms" type="button"> <:comptespip:renvoyer_sms:> </button>
|
||||
</fieldset>
|
||||
[(#INCLURE{fond=inclure/verif_mobile})]
|
||||
</BOUCLE_con>
|
||||
|
||||
<div class="mobile_envoye">
|
||||
<div class="editer_groupe">
|
||||
<fieldset>
|
||||
<legend><:comptespip:identite:></legend>
|
||||
#GENERER_SAISIES{#ENV{_saisies}}
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
<div class="editer_groupe">
|
||||
<fieldset>
|
||||
<legend><:comptespip:mot_de_passe:></legend>
|
||||
[(#SET{min,#VAL{minlength=}|concat{#ENV{pass_longeur_mini,6}}})]
|
||||
[(#SET{chaine_langue,#VAL{comptespip:champ_password}|_T{#ARRAY{min,#ENV{pass_longeur_mini}}}})]
|
||||
|
||||
<div class="editer_groupe">
|
||||
<div style="height: 0;">
|
||||
[(#SAISIE{input,new_password}
|
||||
{type=hidden}
|
||||
|
@ -72,6 +81,9 @@
|
|||
{type=hidden}
|
||||
)]
|
||||
</div>
|
||||
|
||||
[(#SET{min,#VAL{minlength=}|concat{#ENV{pass_longeur_mini,6}}})]
|
||||
[(#SET{chaine_langue,#VAL{comptespip:champ_password}|_T{#ARRAY{min,#ENV{pass_longeur_mini}}}})]
|
||||
[(#SAISIE{input,password}
|
||||
{type=password}
|
||||
{attributs=#GET{min}}
|
||||
|
@ -81,24 +93,14 @@
|
|||
{type=password}
|
||||
{label=<:comptespip:champ_password_confirm:>}
|
||||
)]
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="editer-groupe">
|
||||
<fieldset>
|
||||
<div class='editer saisie_confirmation obligatoire[ (#ENV*{erreurs}|table_valeur{confirmation}|oui)erreur]'>
|
||||
<label for="confirmation"><:addcompte:code_confirmation_sms:> <em class="obligatoire"><:info_obligatoire_02:></em></label>
|
||||
<input type="text" class="text" id="confirmation_sms" name="confirmation_sms" value="#ENV{confirmation_sms}">
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="boutons">
|
||||
[(#ENV{id_auteur}|!={new}|et{#AUTORISER{supprimer,comptespip}|oui}|et{#CONFIG{comptespip/interdire_suppression}|!={oui}|oui})
|
||||
<a class="supprimer_compte_spip btn" href="[(#URL_PAGE{supprimer_compte_spip})]"><:comptespip:btn_supprimer_compte_spip:></a>
|
||||
]
|
||||
<button type="submit" class="btn"><:comptespip:valider:></button>
|
||||
<button class="btn btn-warning renvoyer_sms" type="button"> <:addcompte:renvoyer_sms:> </button>
|
||||
</div>
|
||||
</div>
|
||||
</div></form>
|
||||
|
||||
|
|
|
@ -18,6 +18,9 @@ function formulaires_editer_compte_spip_charger_dist($id_auteur = 'new', $redir
|
|||
$valeurs['_bigup_rechercher_fichiers'] = 'true';
|
||||
$valeurs['logo'] = '';
|
||||
}
|
||||
if (test_plugin_actif('verifmob') and isset($valeurs['telephone'])) {
|
||||
$valeurs['mobile'] = substr($valeurs['telephone'],1);
|
||||
}
|
||||
}
|
||||
|
||||
$valeurs['alea'] = '';
|
||||
|
@ -112,16 +115,15 @@ function formulaires_editer_compte_spip_verifier_dist($id_auteur = 'new', $redi
|
|||
// si verif mobile, unicite du login (telephone)
|
||||
if (test_plugin_actif('verifmob')) {
|
||||
$tel = '0' . _request('mobile');
|
||||
$test = sql_countsel('login', 'spip_auteurs', [
|
||||
$test = sql_countsel('spip_auteurs', [
|
||||
'login='.sql_quote($tel),
|
||||
'id_auteur!='.intval($id_auteur)
|
||||
]);
|
||||
if ($test) {
|
||||
$erreurs['mobile'] = _T('gabo:telephone_deja_enregistre');
|
||||
$erreurs['mobile'] = _T('comptespip:telephone_deja_enregistre');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $erreurs;
|
||||
}
|
||||
|
||||
|
@ -187,6 +189,9 @@ function formulaires_editer_compte_spip_traiter_dist($id_auteur = 'new', $redir
|
|||
$set['alea_futur'] = creer_uniqid();
|
||||
}
|
||||
}
|
||||
if (lire_config('comptespip/login_telephone') === 'oui') {
|
||||
$set['login'] = _request('telephone');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -209,6 +214,7 @@ function formulaires_editer_compte_spip_traiter_dist($id_auteur = 'new', $redir
|
|||
$set[$champ] = _request($champ);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($set) > 0) {
|
||||
$r = sql_updateq('spip_auteurs', $set, 'id_auteur='.intval($id_auteur));
|
||||
}
|
||||
|
|
|
@ -70,4 +70,6 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
|
|||
|
||||
// T
|
||||
'titre_page_configurer_comptespip' => 'CompteSPIP',
|
||||
'telephone_deja_enregistre' => "Ce téléphone est déjà présent",
|
||||
'telephone' => 'téléphone',
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue