%PDF- %PDF-
| Direktori : /home/bitrix/www/local/templates/p4_new/components/bitrix/system.auth.form/auth/ |
| Current File : //home/bitrix/www/local/templates/p4_new/components/bitrix/system.auth.form/auth/template.php |
<?if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die();
} ?>
<?php
$not_yet_conf = (isset($arResult['ERROR_MESSAGE']['MESSAGE']) && (strpos($arResult['ERROR_MESSAGE']['MESSAGE'], 'еще не подтвердили регистрацию') > 0
|| strpos($arResult['ERROR_MESSAGE']['MESSAGE'], 'have not yet confirmed your registration') > 0));
function extract_emails($str)
{
// Регулярное выражение, которое извлекает все email из строки:
$regexp = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i';
preg_match_all($regexp, $str, $m);
return isset($m[0]) ? $m[0][0] : 'N';
}
//echo '<pre>'; print_r(extract_emails($arResult['ERROR_MESSAGE']['MESSAGE'])); echo '</pre>';?>
<div class="container-fluid t" style="<?=$not_yet_conf ? 'display: none;' : ''; ?>">
<div class="row tc">
<div class="modal-dialog">
<div class="col-xs-12 modal-content nopadding violetbg2" id="authdiv">
<div class="col-xs-12 modal-header t">
<div class="tc" style="text-align: center;"><?=GetMessage('AUTH_LOGIN_TC'); ?></div>
<div class="tc">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
</div>
<div class="col-xs-12 modal-body center whitebg t">
<?=GetMessage('AUTH_ONLY_MOBILE_APP'); ?>
<br/><br/>
<a class="col-xs-12 btn btn-transparent" href="http://port4lio.app/">
Ok
</a>
</div>
<div class="col-xs-12 modal-body center whitebg t" style="display: none">
<form class="form-signin login-page" name="system_auth_form<?=$arResult['RND']; ?>" method="post" target="_top" action="<?=$arResult['AUTH_URL']; ?>">
<?if ('' != $arResult['BACKURL']):?>
<input type="hidden" name="backurl" value="<?=$arResult['BACKURL']; ?>" />
<?endif; ?>
<?if (false && isset($arResult['POST']) && is_array($arResult['POST'])): // исключаем конфликт с CHANGE_PWD
foreach ($arResult['POST'] as $key => $value):?>
<input type="hidden" name="<?=$key; ?>" value="<?=$value; ?>" />
<?endforeach; ?>
<?if (0 == count($arResult['POST'])):?>
<input type="hidden" name="AUTH_FORM" value="Y" />
<input type="hidden" name="TYPE" id="auth_type" value="AUTH" />
<?endif; ?>
<?endif; ?>
<div class="tc">
<input type="hidden" name="AUTH_FORM" value="Y" />
<input type="hidden" name="TYPE" id="auth_type" value="AUTH" />
<input type="hidden" id="auth_error" value="<?=$arResult['ERROR'] && 'AUTH' == $arResult['POST']['TYPE'] ? 'Y' : 'N'; ?>" />
<?php
if ('Y' == $arResult['SHOW_ERRORS'] && $arResult['ERROR'] && 'AUTH' == $arResult['POST']['TYPE']) {
?>
<div class="alert alert-warning">
<?=$arResult['ERROR_MESSAGE']['MESSAGE']; ?>
</div>
<?php
}
if (isset($_SESSION['REG_CONFIRMATION'])) {
?>
<div class=" alert-success alert">
<?echo $_SESSION['REG_CONFIRMATION']['MESSAGE_TEXT']; ?>
</div>
<?php
unset($_SESSION['REG_CONFIRMATION']);
}
//echo $_REQUEST['hj'];
?>
<!-- </input><label for="inputEmail" class="sr-only">E-mail</label> -->
<input id="inputEmail" name="USER_LOGIN" value="<?=$arResult['USER_LOGIN']; ?>" class="form-control" required="" type="email" placeholder="E-mail">
<!-- <label for="inputPassword" class="sr-only">Password</label> -->
<input id="inputPassword" name="USER_PASSWORD" class="form-control" required="" type="password" placeholder="<?=GetMessage('AUTH_PASSWORD'); ?>">
<label class="checkbox">
<input id="USER_REMEMBER_frm" name="USER_REMEMBER" value="Y" type="checkbox" style="margin-left: -1px;">
<?echo GetMessage('AUTH_REMEMBER_SHORT'); ?>
</label>
<div style="clear:both;"></div>
<a href="<?=SITE_DIR; ?>auth/pass_rest.php" rel="nofollow"><?=GetMessage('AUTH_FORGOT_PASSWORD_2'); ?></a>
<input type="submit" value="<?=GetMessage('AUTH_LOGIN_BUTTON'); ?>" class="col-xs-12 btn btn-default btn-transparent" />
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<button type="button" id="btn-not-yet-conf" style="display: none;" data-site-id="<?=SITE_ID; ?>" data-conf-email="<?=$not_yet_conf ? extract_emails($arResult['ERROR_MESSAGE']['MESSAGE']) : 'N'; ?>" data-not-conf="<?=$not_yet_conf ? 'Y' : 'N'; ?>" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#not_yet_conf">
</button>
<div class="modal fade nopadding violetbg2" tabindex="-1" role="dialog" id="not_yet_conf">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" style="margin-top: -4px;"><?=GetMessage('AUTH_ATTENTION'); ?></h4>
</div>
<div class="modal-body">
<p style="text-align: center; margin-top: 25px;"><?=GetMessage('AUTH_YOU_HAVE_NOT_YET_CONFIRMED'); ?></p>
</div>
<div class="modal-footer">
<a href="<?=SITE_DIR; ?>" id="send_activ_mail" style="margin-right: 17%;" class="btn btn-default btn-transparent cancel_social"><?=GetMessage('AUTH_SEND_ACTIVATION_MAIL'); ?></a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
if($("#btn-not-yet-conf").attr("data-not-conf") == "Y"){
$("#signin").modal("hide");
$("#btn-not-yet-conf").click();
$("#btn-not-yet-conf").attr("data-not-conf", "N");
};
$('#signin .container-fluid, #signin div.modal-dialog').click(function(e){
if (e.target == this) $('#signin').modal('hide');
});
$("#send_activ_mail").click(function(){
var conf_email = $("#btn-not-yet-conf").attr("data-conf-email");
var site_id = $("#btn-not-yet-conf").attr("data-site-id");
console.log(conf_email);
if (conf_email.indexOf("@") > 0){
BX.ajax.post( // отправка письма
'/local/components/p4/p.ajax.send_activ_mail/ajax.php',
{
'conf_email': conf_email,
'site_id': site_id,
'sessid': BX.bitrix_sessid()
},
function(result){
}
);
};
});
});
</script>