mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-25 07:56:01 +08:00
alert move to tpl
This commit is contained in:
parent
4f975fbf0d
commit
baca2d706f
5 changed files with 30 additions and 41 deletions
|
@ -59,11 +59,8 @@ switch ($do) {
|
|||
$ui->assign('address', $address);
|
||||
$ui->assign('email', $email);
|
||||
$ui->assign('phonenumber', $phonenumber);
|
||||
$ui->assign('notify', '<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>Verification code is Wrong</div></div>');
|
||||
$ui->assign('notify', 'Wrong Verification code');
|
||||
$ui->assign('notify_t', 'd');
|
||||
$ui->display('register-otp.tpl');
|
||||
exit();
|
||||
}else{
|
||||
|
@ -95,11 +92,8 @@ switch ($do) {
|
|||
$ui->assign('address', $address);
|
||||
$ui->assign('email', $email);
|
||||
$ui->assign('phonenumber', $phonenumber);
|
||||
$ui->assign('notify', '<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>Failed to register</div></div>');
|
||||
$ui->assign('notify', 'Failed to register');
|
||||
$ui->assign('notify_t', 'd');
|
||||
run_hook('view_otp_register'); #HOOK
|
||||
$ui->display('register-rotp.tpl');
|
||||
}
|
||||
|
@ -109,11 +103,8 @@ switch ($do) {
|
|||
$ui->assign('address', $address);
|
||||
$ui->assign('email', $email);
|
||||
$ui->assign('phonenumber', $phonenumber);
|
||||
$ui->assign('notify', '<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>' . $msg . '</div></div>');
|
||||
$ui->assign('notify', $msg);
|
||||
$ui->assign('notify_t', 'd');
|
||||
$ui->display('register.tpl');
|
||||
}
|
||||
break;
|
||||
|
@ -134,22 +125,16 @@ switch ($do) {
|
|||
//expired 10 minutes
|
||||
if(file_exists($otpPath) && time()-filemtime($otpPath)<1200){
|
||||
$ui->assign('username', $username);
|
||||
$ui->assign('notify', '<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS</div></div>');
|
||||
$ui->assign('notify', 'Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS');
|
||||
$ui->assign('notify_t', 'd');
|
||||
$ui->display('register-otp.tpl');
|
||||
}else{
|
||||
$otp = rand(100000,999999);
|
||||
file_put_contents($otpPath, $otp);
|
||||
Message::sendSMS($username,$config['CompanyName']."\nYour Verification code are: $otp");
|
||||
$ui->assign('username', $username);
|
||||
$ui->assign('notify', '<div class="alert alert-success">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>Verification code has been sent to your phone</div></div>');
|
||||
$ui->assign('notify', 'Verification code has been sent to your phone');
|
||||
$ui->assign('notify_t', 's');
|
||||
$ui->display('register-otp.tpl');
|
||||
}
|
||||
}else{
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
<hr>
|
||||
</div>
|
||||
{if isset($notify)}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
{$notify}
|
||||
</div>
|
||||
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>{$notify}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
|
|
|
@ -34,10 +34,11 @@
|
|||
<hr>
|
||||
</div>
|
||||
{if isset($notify)}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
{$notify}
|
||||
</div>
|
||||
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>{$notify}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
|
|
|
@ -22,10 +22,11 @@
|
|||
<hr>
|
||||
</div>
|
||||
{if isset($notify)}
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
{$notify}
|
||||
</div>
|
||||
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>{$notify}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
|
|
|
@ -21,10 +21,11 @@
|
|||
<hr>
|
||||
</div>
|
||||
{if isset($notify)}
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-sm-offset-3">
|
||||
{$notify}
|
||||
</div>
|
||||
<div class="alert alert-{if $notify_t == 's'}success{else}danger{/if}">
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div>{$notify}</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
|
|
Loading…
Reference in a new issue