Implemented EnableRegister functionnality in userprint() for qware template

This commit is contained in:
Rooty 2021-09-27 05:59:52 +02:00
parent b82e879608
commit e6ca195ed1
2 changed files with 22 additions and 16 deletions

View File

@ -17,10 +17,12 @@
</div>
<button type="submit" id="btnLogin" class="btn btn-block btn-outline-secondary btn-lg btn-sm" aria-pressed="true" mXattribut="value:BtnEnter" mXattribut="title:titleButton"><i class="fa fa-lg fa-sign-in"></i><mx:text id="auth"/></button>
<a class="btn btn-block btn-outline-secondary btn-lg btn-sm" role="button" aria-pressed="true" mXattribut="href:urlActionNewAccount"><i class="fa fa-lg fa-community"></i> <mx:text id="NEWACCOUNT"/></a> <!--community group users-->
<mx:bloc id="blocSubscription">
<a class="btn btn-block btn-outline-secondary btn-lg btn-sm" role="button" aria-pressed="true" mXattribut="href:urlActionNewSubscription"><i class="fa fa-lg fa-handshake-o"></i> <mx:text id="NEWSUBSCRIPTION"/></a> <!--handshake-o -->
</mx:bloc id="blocSubscription">
<mx:bloc id="blocRegister">
<a class="btn btn-block btn-outline-secondary btn-lg btn-sm" role="button" aria-pressed="true" mXattribut="href:urlActionNewAccount"><i class="fa fa-lg fa-community"></i> <mx:text id="NEWACCOUNT"/></a> <!--community group users-->
</mx:bloc id="blocRegister">
<mx:bloc id="blocSubscription">
<a class="btn btn-block btn-outline-secondary btn-lg btn-sm" role="button" aria-pressed="true" mXattribut="href:urlActionNewSubscription"><i class="fa fa-lg fa-handshake-o"></i> <mx:text id="NEWSUBSCRIPTION"/></a> <!--handshake-o -->
</mx:bloc id="blocSubscription">
<a class="btn btn-block btn-outline-secondary btn-lg btn-sm" role="button" aria-pressed="true" mXattribut="href:urlActionForgotPassword"><i class="fa fa-lg fa-cut-key"></i> <mx:text id="FORGOTPASSWORD"/></a> <!--cut-key-->
</form>
</div>

View File

@ -86,26 +86,32 @@ class UserPrint extends Printing
}
$node=$GLOBALS["SYSTEM_USER_SESSION"]->getNode(recupCommunity());
/* Création de l'URL pour nouveau compte */
$urlNewAccount = $_SERVER['SCRIPT_NAME'];
$urlNewAccount.= "?system=authNewAccount";
$urlNewAccount = addIdToUrl($urlNewAccount);
$MaTemplate->MxAttribut("urlActionNewAccount", Navigation::formatUrl($urlArray["id"],"Home","formLecture","",recupCommunity()));
// var_dump($node->getCType());
// var_dump($node->getRegisterEnable());
if( $node->getRegisterEnable() )
if( $node->getRegisterEnable() == 'on')
{
/* Création de l'URL pour nouveau compte */
$urlNewAccount = $_SERVER['SCRIPT_NAME'];
$urlNewAccount.= "?system=authNewAccount";
$urlNewAccount = addIdToUrl($urlNewAccount);
$MaTemplate->MxAttribut("blocRegister".".urlActionNewAccount", Navigation::formatUrl($urlArray["id"],"Home","formLecture","",recupCommunity()));
// $MaTemplate->MxAttribut("blocRegister".".urlActionNewAccount", $urlNewAccount);
$MaTemplate->MxText("blocRegister".".NEWACCOUNT", getMessage("UserPrintNewAccount"));
if ($node->getCType() == "asso")
{
$MaTemplate->MxText("blocSubscription".".NEWSUBSCRIPTION", getMessage("UserPrintNewSubscription"));
$MaTemplate->MxAttribut("blocSubscription".".urlActionNewSubscription", Navigation::formatUrl($urlArray["id"], "Home", "formLectureAdh", "", recupCommunity()));
} else {
$MaTemplate->MxBloc("blocSubscription", "delete");
}
}
else
} else {
$MaTemplate->MxBloc("blocSubscription", "delete");
$MaTemplate->MxBloc("blocRegister", "delete");
}
/* Création de l'URL pour rappel du mot de passe */
$urlForgotPassword = $_SERVER['SCRIPT_NAME'];
@ -120,8 +126,6 @@ class UserPrint extends Printing
$MaTemplate->MxFormField("login", "text", "login", "", "title='".getMessage("tipUserPrintLogin")."'");
$MaTemplate->MxText("PASSWORD", getMessage("UserPrintPassword"));
$MaTemplate->MxFormField("password", "password", "password", "", "title='".getMessage("tipUserPrintPassword")."'");
$MaTemplate->MxAttribut("urlActionNewAccount", $urlNewAccount);
$MaTemplate->MxText("NEWACCOUNT", getMessage("UserPrintNewAccount"));
$MaTemplate->MxAttribut("urlActionForgotPassword", $urlForgotPassword);
$MaTemplate->MxText("FORGOTPASSWORD", getMessage("UserPrintForgotPassword"));
$MaTemplate->MxAttribut("urlActionLogin", $url);