diff --git a/init.php b/init.php index 1d03d95e..d3da03d8 100644 --- a/init.php +++ b/init.php @@ -134,6 +134,8 @@ if ((!empty($radius_user) && $config['radius_enable']) || _post('radius_enable') // Check if the user has selected a language if (!empty($_SESSION['user_language'])) { $config['language'] = $_SESSION['user_language']; +}else if (!empty($_COOKIE['user_language'])) { + $config['language'] = $_COOKIE['user_language']; } if (empty($_SESSION['Lang'])) { diff --git a/pages_template/vouchers/Default.html b/pages_template/vouchers/Default.html new file mode 100644 index 00000000..858176fa --- /dev/null +++ b/pages_template/vouchers/Default.html @@ -0,0 +1,27 @@ + + + + +
+
[[company_name]]
+ + + + + + + + + + + + + + + +
[[qrcode]] +
+ [[price]]
+ [[voucher_code]]
+ [[plan]] - [[counter]]
+
\ No newline at end of file diff --git a/pages_template/vouchers/Logo Header Center.html b/pages_template/vouchers/Logo Header Center.html new file mode 100644 index 00000000..22ee25e2 --- /dev/null +++ b/pages_template/vouchers/Logo Header Center.html @@ -0,0 +1,24 @@ + + + + +
+
+ + + + + + + + + + + + +
+ [[qrcode]]
+ [[voucher_code]]
+ [[plan]] [[price]]
+
[[company_name]]
+
\ No newline at end of file diff --git a/pages_template/vouchers/Logo Header.html b/pages_template/vouchers/Logo Header.html new file mode 100644 index 00000000..9e0bb6d7 --- /dev/null +++ b/pages_template/vouchers/Logo Header.html @@ -0,0 +1,28 @@ + + + + +
+
+ + + + + + + + + + + + + + + +
[[qrcode]] +
+ [[price]]
+ [[voucher_code]]
+ [[plan]] - [[counter]]
+
[[company_name]]
+
\ No newline at end of file diff --git a/system/autoload/Lang.php b/system/autoload/Lang.php index e037bf60..146b8aca 100644 --- a/system/autoload/Lang.php +++ b/system/autoload/Lang.php @@ -15,7 +15,7 @@ class Lang if (empty($lan_file)) { $lan_file = $root_path . File::pathFixer('system/lan/' . $config['language'] . '.json'); } - + if (is_array($_SESSION['Lang'])) { $_L = array_merge($_L, $_SESSION['Lang']); } diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php index 8e4414be..3803279b 100644 --- a/system/controllers/accounts.php +++ b/system/controllers/accounts.php @@ -153,8 +153,8 @@ switch ($action) { $phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt"; // expired 10 minutes - if (file_exists($otpFile) && time() - filemtime($otpFile) < 1200) { - r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ' . (1200 - (time() - filemtime($otpFile))) . ' seconds before sending another SMS')); + if (file_exists($otpFile) && time() - filemtime($otpFile) < 600) { + r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ' . (600 - (time() - filemtime($otpFile))) . ' seconds before sending another SMS')); } else { $otp = rand(100000, 999999); file_put_contents($otpFile, $otp); diff --git a/system/controllers/pages.php b/system/controllers/pages.php index 1d60dfab..6dd8e73b 100644 --- a/system/controllers/pages.php +++ b/system/controllers/pages.php @@ -31,6 +31,7 @@ if(strpos($action,"-reset")!==false){ _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); } $path = "pages/".str_replace(".","",$action).".html"; + $ui->assign("action", $action); //echo $path; run_hook('view_edit_pages'); #HOOK if(!file_exists($path)){ @@ -44,6 +45,15 @@ if(strpos($action,"-reset")!==false){ } } if(file_exists($path)){ + if($action=='Voucher'){ + if(!file_exists("pages/vouchers/")){ + mkdir("pages/vouchers/"); + if(file_exists("pages_template/vouchers/")){ + File::copyFolder("pages_template/vouchers/", "pages/vouchers/"); + } + } + $ui->assign("vouchers", scandir("pages/vouchers/")); + } $html = file_get_contents($path); $ui->assign("htmls",str_replace([""],"",$html)); $ui->assign("writeable",is_writable($path)); @@ -61,7 +71,12 @@ if(strpos($action,"-reset")!==false){ if(file_exists($path)){ $html = _post("html"); run_hook('save_pages'); #HOOK - if(file_put_contents($path, str_replace([""],"",$html))){ + if(file_put_contents($path, $html)){ + if(_post('template_save')=='yes'){ + if(!empty(_post('template_name'))){ + file_put_contents("pages/vouchers/"._post('template_name').'.html', $html); + } + } r2(U . 'pages/'.$action, 's', Lang::T("Saving page success")); }else{ r2(U . 'pages/'.$action, 'e', Lang::T("Failed to save page, make sure i can write to folder pages, chmod 664 pages/*.html")); diff --git a/system/controllers/register.php b/system/controllers/register.php index 29985801..ddbb280a 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -124,9 +124,9 @@ switch ($do) { } $otpPath .= sha1($username . $db_pass) . ".txt"; //expired 10 minutes - if (file_exists($otpPath) && time() - filemtime($otpPath) < 1200) { + if (file_exists($otpPath) && time() - filemtime($otpPath) < 600) { $ui->assign('username', $username); - $ui->assign('notify', 'Please wait ' . (1200 - (time() - filemtime($otpPath))) . ' seconds before sending another SMS'); + $ui->assign('notify', 'Please wait ' . (600 - (time() - filemtime($otpPath))) . ' seconds before sending another SMS'); $ui->assign('notify_t', 'd'); $ui->display('user-ui/register-otp.tpl'); } else { diff --git a/ui/ui/app-localisation.tpl b/ui/ui/app-localisation.tpl index 44335e18..e16e70f5 100644 --- a/ui/ui/app-localisation.tpl +++ b/ui/ui/app-localisation.tpl @@ -3,9 +3,15 @@
-
{Lang::T('Localisation')}
+
+
+ +
+ {Lang::T('Localisation')} +
+
-
diff --git a/ui/ui/app-notifications.tpl b/ui/ui/app-notifications.tpl index 94e9e299..7dc158f9 100644 --- a/ui/ui/app-notifications.tpl +++ b/ui/ui/app-notifications.tpl @@ -16,8 +16,8 @@
+ placeholder="{Lang::T('Hello')} [[name]], {Lang::T('your internet package')} [[package]] {Lang::T('has been expired')}" + rows="4">{if $_json['expired']!=''}{Lang::htmlspecialchars($_json['expired'])}{else}{Lang::T('Hello')} [[name]], {Lang::T('your internet package')} [[package]] {Lang::T('has been expired')}.{/if}

[[name]] - {Lang::T('will be replaced with Customer Name')}.
@@ -84,7 +84,7 @@

@@ -112,7 +112,7 @@

diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index 5c597a0e..146a62b1 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -755,7 +755,7 @@

- Github Authentication + Github {Lang::T('Authentication')}
@@ -776,13 +776,13 @@ onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
Create GitHub personal access token (classic), only need repo - scope + target="_blank">{Lang::T('Create GitHub personal access token')} (classic), {Lang::T('only need repo + scope')}
-
diff --git a/ui/ui/balance-add.tpl b/ui/ui/balance-add.tpl index d74efbfb..828c1d1f 100644 --- a/ui/ui/balance-add.tpl +++ b/ui/ui/balance-add.tpl @@ -10,10 +10,10 @@
diff --git a/ui/ui/balance-edit.tpl b/ui/ui/balance-edit.tpl index a8bc0ecf..2603f61c 100644 --- a/ui/ui/balance-edit.tpl +++ b/ui/ui/balance-edit.tpl @@ -11,10 +11,10 @@
diff --git a/ui/ui/bandwidth.tpl b/ui/ui/bandwidth.tpl index 078ed15a..0647747e 100644 --- a/ui/ui/bandwidth.tpl +++ b/ui/ui/bandwidth.tpl @@ -57,8 +57,8 @@ {include file="pagination.tpl"}
-

Create Bandwitdh Plan for expired Internet Plan

-

When customer expired, you can move it to Expired Internet Plan

+

{Lang::T('Create Bandwitdh Plan for expired Internet Plan')}

+

{Lang::T('When customer expired, you can move it to Expired Internet Plan')}

diff --git a/ui/ui/change-password.tpl b/ui/ui/change-password.tpl index e8e630aa..0257496e 100644 --- a/ui/ui/change-password.tpl +++ b/ui/ui/change-password.tpl @@ -28,7 +28,7 @@
- Or {Lang::T('Cancel')} + {Lang::T('Or')} {Lang::T('Cancel')}
diff --git a/ui/ui/community.tpl b/ui/ui/community.tpl index 4f96379d..894c49ee 100644 --- a/ui/ui/community.tpl +++ b/ui/ui/community.tpl @@ -10,7 +10,7 @@
-

Contributors

+

{Lang::T('Contributors')}

@@ -22,29 +22,29 @@
-

Discussions

+

{Lang::T('Discussions')}

-
Get help from community
+
{Lang::T('Get help from community')}
-

Feedback

+

{Lang::T('')}Feedback

- Feedback and Bug Report + {Lang::T('Feedback and Bug Report')}
@@ -131,19 +131,19 @@
-

Chat with me

+

{Lang::T('Chat with me')}

-
$50 Paid Support
donation confirmation?
Or ask any Donation Alternative
+
{Lang::T('$50 Paid Support')}
{Lang::T('donation confirmation?')}
{Lang::T('Or ask any Donation Alternative')}
-

Free WhatsApp Gateway and Telegram Bot creater

+

{Lang::T('Free WhatsApp Gateway and Telegram Bot creater')}

- There is a Telegram bot wizard in here + {Lang::T('There is a Telegram bot wizard in here')}
- PHPNuxBill is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate - with router. If you get more profit with this application, please donate us.
Watch project
in here + PHPNuxBill {Lang::T('is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate + with router. If you get more profit with this application, please donate us.')}
{Lang::T('Watch project')} {Lang::T('in here')}
@@ -200,4 +199,4 @@ }); }); -{include file="sections/footer.tpl"} \ No newline at end of file +{include file="sections/footer.tpl"} diff --git a/ui/ui/customers-add.tpl b/ui/ui/customers-add.tpl index e3b97517..1b0a97b6 100644 --- a/ui/ui/customers-add.tpl +++ b/ui/ui/customers-add.tpl @@ -70,7 +70,7 @@ - +
@@ -78,9 +78,9 @@
diff --git a/ui/ui/customers-edit.tpl b/ui/ui/customers-edit.tpl index 463a9564..2941898e 100644 --- a/ui/ui/customers-edit.tpl +++ b/ui/ui/customers-edit.tpl @@ -164,7 +164,7 @@ {/foreach} diff --git a/ui/ui/customers-view.tpl b/ui/ui/customers-view.tpl index 77f9632a..f1840ca9 100644 --- a/ui/ui/customers-view.tpl +++ b/ui/ui/customers-view.tpl @@ -100,8 +100,7 @@
  • {Lang::T('Coordinates')} Get - Directions + href="https://www.google.com/maps/dir//{$d['coordinates']}/" target="_blank">{Lang::T('Get Directions')}
  • diff --git a/ui/ui/page-edit.tpl b/ui/ui/page-edit.tpl index acbc7f39..a44bdd0c 100644 --- a/ui/ui/page-edit.tpl +++ b/ui/ui/page-edit.tpl @@ -1,60 +1,81 @@ {include file="sections/header.tpl"} -
    -
    -
    -
    -
    - + +
    +
    +
    +
    +
    + {if $action!='Voucher'} +
    + +
    + {/if} + {$pageHeader}
    - {$pageHeader} + + {if $writeable} + + {else} + + {/if} + {if $PageFile=='Voucher'} + + {/if}
    -
    -
    {$htmls}
    - {if $writeable} - - {else} - - {/if} - {if $PageFile=='Voucher'} - - {/if}
    + {if $action=='Voucher'} +
    + {foreach $vouchers as $v} + {if is_file("pages/vouchers/$v")} +
    +
    {str_replace(".html", '', $v)}
    +
    {include file="pages/vouchers/$v"}
    +
    + {/if} + {/foreach} +
    + {/if}
    -
    - - - {literal} {/literal} diff --git a/ui/ui/sections/footer.tpl b/ui/ui/sections/footer.tpl index 6974fbfa..413e9cec 100644 --- a/ui/ui/sections/footer.tpl +++ b/ui/ui/sections/footer.tpl @@ -12,6 +12,7 @@ + {if isset($xfooter)} diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl index cd337197..52c566fd 100644 --- a/ui/ui/sections/header.tpl +++ b/ui/ui/sections/header.tpl @@ -16,6 +16,7 @@ +