forked from kevinowino869/mitrobill
Patch Addon
Add container dark mode Add Registration Mandatory Fields
This commit is contained in:
parent
b34b9064d0
commit
77d25738b1
@ -27,32 +27,32 @@ switch ($do) {
|
||||
$address = _post('address');
|
||||
|
||||
// Separate phone number input if OTP is required
|
||||
if ($config['sms_otp_registration'] == 'yes') {
|
||||
$phone_number = alphanumeric(_post('phone_number'), "+_.@-");
|
||||
} else {
|
||||
$phone_number = $username; // When OTP is not required, treat username as phone number
|
||||
}
|
||||
$phone_number = ($config['sms_otp_registration'] == 'yes') ? alphanumeric(_post('phone_number'), "+_.@-") : $username;
|
||||
|
||||
$msg = '';
|
||||
if (Validator::Length($username, 35, 2) == false) {
|
||||
$msg .= 'Username should be between 3 to 55 characters' . '<br>';
|
||||
$msg .= "Username should be between 3 to 55 characters<br>";
|
||||
}
|
||||
if ($config['man_fields_fname'] == 'yes') {
|
||||
if (Validator::Length($fullname, 36, 2) == false) {
|
||||
$msg .= 'Full Name should be between 3 to 25 characters' . '<br>';
|
||||
$msg .= "Full Name should be between 3 to 25 characters<br>";
|
||||
}
|
||||
}
|
||||
if (!Validator::Length($password, 35, 2)) {
|
||||
$msg .= 'Password should be between 3 to 35 characters' . '<br>';
|
||||
$msg .= "Password should be between 3 to 35 characters<br>";
|
||||
}
|
||||
if ($config['man_fields_email'] == 'yes') {
|
||||
if (!Validator::Email($email)) {
|
||||
$msg .= 'Email is not Valid<br>';
|
||||
}
|
||||
}
|
||||
if ($password != $cpassword) {
|
||||
$msg .= Lang::T('Passwords does not match') . '<br>';
|
||||
}
|
||||
|
||||
// OTP verification if OTP is enabled
|
||||
if ($_c['sms_otp_registration'] == 'yes') {
|
||||
$otpPath .= sha1($phone_number . $db_pass) . ".txt";
|
||||
$otpPath .= sha1("$phone_number$db_pass") . ".txt";
|
||||
run_hook('validate_otp'); #HOOK
|
||||
// Expire after 10 minutes
|
||||
if (file_exists($otpPath) && time() - filemtime($otpPath) > 1200) {
|
||||
@ -204,5 +204,3 @@ switch ($do) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -188,6 +188,10 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
// Save all settings including tax system
|
||||
$_POST['man_fields_email'] = isset($_POST['man_fields_email']) ? 'yes' : 'no';
|
||||
$_POST['man_fields_fname'] = isset($_POST['man_fields_fname']) ? 'yes' : 'no';
|
||||
$_POST['man_fields_address'] = isset($_POST['man_fields_address']) ? 'yes' : 'no';
|
||||
$_POST['man_fields_custom'] = isset($_POST['man_fields_custom']) ? 'yes' : 'no';
|
||||
$enable_session_timeout = isset($_POST['enable_session_timeout']) ? 1 : 0;
|
||||
$_POST['enable_session_timeout'] = $enable_session_timeout;
|
||||
foreach ($_POST as $key => $value) {
|
||||
|
@ -368,6 +368,29 @@
|
||||
<p class="help-block col-md-4">{Lang::T('The method which OTP will be sent to user')}<br>
|
||||
{Lang::T('For Registration and Update Phone Number')}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('Registration Mandatory Fields')}:</label><br>
|
||||
<label class="col-md-3 control-label">
|
||||
<input type="checkbox" name="man_fields_email" value="yes"
|
||||
{if !isset($_c['man_fields_email']) || $_c['man_fields_email'] neq 'no'}checked{/if}>
|
||||
{Lang::T('Email')}
|
||||
</label>
|
||||
<label class="col-md-3 control-label">
|
||||
<input type="checkbox" name="man_fields_fname" value="yes"
|
||||
{if !isset($_c['man_fields_fname']) || $_c['man_fields_fname'] neq 'no'}checked{/if}>
|
||||
{Lang::T('Full Name')}
|
||||
</label>
|
||||
<label class="col-md-3 control-label">
|
||||
<input type="checkbox" name="man_fields_address" value="yes"
|
||||
{if !isset($_c['man_fields_address']) || $_c['man_fields_address'] neq 'no'}checked{/if}>
|
||||
{Lang::T('Address')}
|
||||
</label>
|
||||
<label class="col-md-3 control-label">
|
||||
<input type="checkbox" name="man_fields_custom" value="yes"
|
||||
{if !isset($_c['man_fields_custom']) || $_c['man_fields_custom'] neq 'no'}checked{/if}>
|
||||
{Lang::T('Custom Fields')}
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-success btn-block" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
|
@ -38,21 +38,28 @@
|
||||
<input type="file" required class="form-control" id="photo" name="photo" accept="image/*">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_fname'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Full Name')}</label>
|
||||
<input type="text" required class="form-control" id="fullname" value="{$fullname}"
|
||||
name="fullname">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_address'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Email')}</label>
|
||||
<input type="text" class="form-control" placeholder="xxxxxx@xxx.xx" id="email"
|
||||
value="{$email}" name="email">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_address'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Address')}</label>
|
||||
<input type="text" name="address" id="address" value="{$address}" class="form-control">
|
||||
</div>
|
||||
{if $_c['man_fields_custom'] neq 'no'}
|
||||
{$customFields}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,21 +47,29 @@
|
||||
<input type="file" required class="form-control" id="photo" name="photo" accept="image/*">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_fname'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Full Name')}</label>
|
||||
<input type="text" required class="form-control" id="fullname" value="{$fullname}"
|
||||
name="fullname">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_email'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Email')}</label>
|
||||
<input type="text" class="form-control" id="email" placeholder="xxxxxxx@xxxx.xx"
|
||||
value="{$email}" name="email">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_address'] neq 'no'}
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Address')}</label>
|
||||
<input type="text" name="address" id="address" value="{$address}" class="form-control">
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['man_fields_custom'] neq 'no'}
|
||||
{$customFields}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -173,6 +173,7 @@
|
||||
background-color: #efeb0a;
|
||||
border-color: #efeb0a;
|
||||
}
|
||||
|
||||
.panel-cron-danger>.panel-heading {
|
||||
border-bottom-right-radius: 21px;
|
||||
border-bottom-left-radius: 21px;
|
||||
@ -1136,6 +1137,11 @@
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.dark-mode .container {
|
||||
background-color: #353638;
|
||||
|
||||
}
|
||||
|
||||
/* Dark Mode - Select2 Dropdown ends here */
|
||||
|
||||
/* dark mode styles start ends here */
|
||||
@ -1288,8 +1294,8 @@
|
||||
href="{$_url}services/hotspot">Hotspot</a></li>
|
||||
<li {if $_routes[1] eq 'pppoe' }class="active" {/if}><a
|
||||
href="{$_url}services/pppoe">PPPOE</a></li>
|
||||
<li {if $_routes[1] eq 'vpn' }class="active" {/if}><a
|
||||
href="{$_url}services/vpn">VPN</a></li>
|
||||
<li {if $_routes[1] eq 'vpn' }class="active" {/if}><a href="{$_url}services/vpn">VPN</a>
|
||||
</li>
|
||||
<li {if $_routes[1] eq 'list' }class="active" {/if}><a
|
||||
href="{$_url}bandwidth/list">Bandwidth</a></li>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
|
Loading…
x
Reference in New Issue
Block a user