diff --git a/README.md b/README.md index 1c7c5827..b3cd7294 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Most current web servers with PHP & MySQL installed will be capable of running P Minimum Requirements - Linux or Windows OS -- Minimum PHP Version 7.4 +- Minimum PHP Version 8.2 - Both PDO & MySQLi Support - PHP-GD2 Image Library - PHP-CURL diff --git a/init.php b/init.php index b6530a46..3059f859 100644 --- a/init.php +++ b/init.php @@ -266,7 +266,7 @@ function showResult($success, $message = '', $result = [], $meta = []) */ function getUrl($url) { - Text::url($url); + return Text::url($url); } function generateUniqueNumericVouchers($totalVouchers, $length = 8) diff --git a/system/autoload/Text.php b/system/autoload/Text.php index 573690b7..e11cfef9 100644 --- a/system/autoload/Text.php +++ b/system/autoload/Text.php @@ -113,7 +113,7 @@ class Text public static function url(...$data){ global $config; $url = implode("", $data); - if ($config['url_canonical'] != 'Yes') { + if ($config['url_canonical'] == 'yes') { $u = str_replace('?_route=', '', U); $pos = strpos($url, '&'); if ($pos === false) { diff --git a/system/controllers/bandwidth.php b/system/controllers/bandwidth.php index a482550c..e566a2f5 100644 --- a/system/controllers/bandwidth.php +++ b/system/controllers/bandwidth.php @@ -18,7 +18,7 @@ if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { switch ($action) { case 'list': - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/bandwidth.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/bandwidth.js"></script>'); run_hook('view_list_bandwidth'); #HOOK $name = _post('name'); if ($name != '') { diff --git a/system/controllers/plan.php b/system/controllers/plan.php index fbfaae81..f2dbba2a 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -1061,7 +1061,7 @@ switch ($action) { } break; default: - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/plan.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/plan.js"></script>'); $ui->assign('_title', Lang::T('Customer')); $search = _post('search'); $status = _req('status'); diff --git a/system/controllers/pool.php b/system/controllers/pool.php index aec8c1bc..14c44d7d 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -20,7 +20,7 @@ require_once $DEVICE_PATH . DIRECTORY_SEPARATOR . 'MikrotikPppoe' . '.php'; switch ($action) { case 'list': - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pool.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/pool.js"></script>'); $name = _post('name'); if ($name != '') { @@ -149,7 +149,7 @@ switch ($action) { } case 'port': - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pool.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/pool.js"></script>'); $name = _post('name'); if ($name != '') { diff --git a/system/controllers/routers.php b/system/controllers/routers.php index 4d121c52..ef3e1c8e 100644 --- a/system/controllers/routers.php +++ b/system/controllers/routers.php @@ -204,7 +204,7 @@ switch ($action) { break; default: - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/routers.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/routers.js"></script>'); $name = _post('name'); $name = _post('name'); diff --git a/system/controllers/services.php b/system/controllers/services.php index 8f054457..a61a7ce2 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -53,7 +53,7 @@ switch ($action) { } r2(getUrl('services/hotspot'), 'w', 'Unknown command'); case 'hotspot': - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/hotspot.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/hotspot.js"></script>'); $name = _req('name'); $type1 = _req('type1'); $type2 = _req('type2'); @@ -428,7 +428,7 @@ switch ($action) { case 'pppoe': $ui->assign('_title', Lang::T('PPPOE Plans')); - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pppoe.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/pppoe.js"></script>'); $name = _post('name'); $name = _req('name'); @@ -921,7 +921,7 @@ switch ($action) { break; case 'vpn': $ui->assign('_title', Lang::T('VPN Plans')); - $ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pppoe.js"></script>'); + $ui->assign('xfooter', '<script type="text/javascript" src="'.APP_URL.'/ui/lib/c/pppoe.js"></script>'); $name = _post('name'); $name = _req('name'); diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 57725b40..69d790fa 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -173,6 +173,7 @@ switch ($action) { _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } $csrf_token = _post('csrf_token'); + if (!Csrf::check($csrf_token)) { r2(getUrl('settings/app'), 'e', Lang::T('Invalid or Expired CSRF Token') . "."); } diff --git a/system/lan/english.json b/system/lan/english.json index da4f7cc9..93263e55 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -956,5 +956,11 @@ "in_minutes__leave_0_to_disable_this_feature_": "in minutes, leave 0 to disable this feature.", "Check_if_Router_Online_": "Check if Router Online?", "To_check_whether_the_Router_is_online_or_not__please_visit_the_following_page": "To check whether the Router is online or not, please visit the following page", - "Cek_Now": "Cek Now" + "Cek_Now": "Cek Now", + "Pretty_URL": "Pretty URL", + "rename__htaccess_firewall_to__htaccess": "rename .htaccess_firewall to .htaccess", + "Show_chart": "Show chart", + "Max_30_days": "Max 30 days", + "Information": "Information", + "Export_and_Print_will_show_all_data_without_pagination": "Export and Print will show all data without pagination" } \ No newline at end of file diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index 59f8146e..c990038b 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -104,15 +104,30 @@ {Lang::T('This used for admin to select payment in recharge, using comma for every new options')} </p> </div> - <div class="form-group"> <label class="col-md-3 control-label">{Lang::T('Income reset date')}</label> <div class="col-md-5"> <input type="number" required class="form-control" id="reset_day" placeholder="20" min="1" max="28" step="1" name="reset_day" value="{$_c['reset_day']}"> </div> - <span class="help-block col-md-4">{Lang::T('Income will reset every this - day')}</span> + <span class="help-block col-md-4">{Lang::T('Income will reset every this day')}</span> + </div> + <div class="form-group"> + <label class="col-md-3 control-label">{Lang::T('Pretty URL')}</label> + <div class="col-md-5"> + <select name="url_canonical" id="url_canonical" class="form-control"> + <option value="no" {if $_c['url_canonical']=='no' }selected="selected" {/if}> + {Lang::T('No')} + </option> + <option value="yes" {if $_c['url_canonical']=='yes' }selected="selected" {/if}> + {Lang::T('Yes')} + </option> + </select> + <p class="help-block"> + <b>?_route=settings/app&foo=bar</b> will be <b>/settings/app?foo=bar</b> + </p> + </div> + <span class="help-block col-md-4">{Lang::T('rename .htaccess_firewall to .htaccess')}</span> </div> <button class="btn btn-success btn-block" name="general" type="submit"> {Lang::T('Save Changes')} @@ -779,8 +794,8 @@ <div class="form-group"> <label class="col-md-3 control-label">{Lang::T('Mikrotik SMS Command')}</label> <div class="col-md-5"> - <input type="text" class="form-control" id="mikrotik_sms_command" name="mikrotik_sms_command" value="{$_c['mikrotik_sms_command']}" - placeholder="mikrotik_sms_command"> + <input type="text" class="form-control" id="mikrotik_sms_command" name="mikrotik_sms_command" + value="{$_c['mikrotik_sms_command']}" placeholder="mikrotik_sms_command"> </div> </div> <small id="emailHelp" class="form-text text-muted">{Lang::T('You can use')} WhatsApp diff --git a/ui/ui/customer/header.tpl b/ui/ui/customer/header.tpl index 667e8604..2f1a1543 100644 --- a/ui/ui/customer/header.tpl +++ b/ui/ui/customer/header.tpl @@ -780,7 +780,7 @@ <body class="hold-transition modern-skin-dark sidebar-mini"> <div class="wrapper"> <header class="main-header" style="position:fixed; width: 100%"> - <a href="{$_url}home" class="logo"> + <a href="{Text::url('home')}" class="logo"> <span class="logo-mini"><b>N</b>uX</span> <span class="logo-lg">{$_c['CompanyName']}</span> </a> @@ -802,7 +802,7 @@ <ul class="dropdown-menu"> <li> <!-- inner menu: contains the actual data --> - <ul class="menu" api-get-text="{$_url}autoload_user/language&select={$user_language}"></ul> + <ul class="menu" api-get-text="{Text::url('autoload_user/language&select=',$user_language)}"></ul> </li> </ul> </li> @@ -810,14 +810,14 @@ <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i class="fa fa-envelope-o"></i> <span class="label label-warning" - api-get-text="{$_url}autoload_user/inbox_unread"></span> + api-get-text="{Text::url('autoload_user/inbox_unread')}"></span> </a> <ul class="dropdown-menu"> <li> <!-- inner menu: contains the actual data --> - <ul class="menu" api-get-text="{$_url}autoload_user/inbox"></ul> + <ul class="menu" api-get-text="{Text::url('autoload_user/inbox')}"></ul> </li> - <li class="footer"><a href="{$_url}mail">{Lang::T('Inbox')}</a></li> + <li class="footer"><a href="{Text::url('mail')}">{Lang::T('Inbox')}</a></li> </ul> </li> <li class="dropdown user user-menu"> @@ -847,18 +847,18 @@ <li class="user-body"> <div class="row"> <div class="col-xs-7 text-center text-sm"> - <a href="{$_url}accounts/change-password"><i class="ion ion-settings"></i> + <a href="{Text::url('accounts/change-password')}"><i class="ion ion-settings"></i> {Lang::T('Change Password')}</a> </div> <div class="col-xs-5 text-center text-sm"> - <a href="{$_url}accounts/profile"><i class="ion ion-person"></i> + <a href="{Text::url('accounts/profile')}"><i class="ion ion-person"></i> {Lang::T('My Account')}</a> </div> </div> </li> <li class="user-footer"> <div class="pull-right"> - <a href="{$_url}logout" class="btn btn-default btn-flat"><i + <a href="{Text::url('logout')}" class="btn btn-default btn-flat"><i class="ion ion-power"></i> {Lang::T('Logout')}</a> </div> </li> @@ -873,14 +873,14 @@ <section class="sidebar"> <ul class="sidebar-menu" data-widget="tree"> <li {if $_system_menu eq 'home'}class="active" {/if}> - <a href="{$_url}home"> + <a href="{Text::url('home')}"> <i class="ion ion-monitor"></i> <span>{Lang::T('Dashboard')}</span> </a> </li> {$_MENU_AFTER_DASHBOARD} <li {if $_system_menu eq 'inbox'}class="active" {/if}> - <a href="{$_url}mail"> + <a href="{Text::url('mail')}"> <i class="fa fa-envelope"></i> <span>{Lang::T('Inbox')}</span> </a> @@ -888,7 +888,7 @@ {$_MENU_AFTER_INBOX} {if $_c['disable_voucher'] != 'yes'} <li {if $_system_menu eq 'voucher'}class="active" {/if}> - <a href="{$_url}voucher/activation"> + <a href="{Text::url('voucher/activation')}"> <i class="fa fa-ticket"></i> <span>Voucher</span> </a> @@ -897,20 +897,20 @@ {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } {if $_c['enable_balance'] == 'yes'} <li {if $_system_menu eq 'balance'}class="active" {/if}> - <a href="{$_url}order/balance"> + <a href="{Text::url('order/balance')}"> <i class="ion ion-ios-cart"></i> <span>{Lang::T('Buy Balance')}</span> </a> </li> {/if} <li {if $_system_menu eq 'package'}class="active" {/if}> - <a href="{$_url}order/package"> + <a href="{Text::url('order/package')}"> <i class="ion ion-ios-cart"></i> <span>{Lang::T('Buy Package')}</span> </a> </li> <li {if $_system_menu eq 'history'}class="active" {/if}> - <a href="{$_url}order/history"> + <a href="{Text::url('order/history')}"> <i class="fa fa-file-text"></i> <span>{Lang::T('Order History')}</span> </a> @@ -918,7 +918,7 @@ {/if} {$_MENU_AFTER_ORDER} <li {if $_system_menu eq 'list-activated'}class="active" {/if}> - <a href="{$_url}voucher/list-activated"> + <a href="{Text::url('voucher/list-activated')}"> <i class="fa fa-list-alt"></i> <span>{Lang::T('Activation History')}</span> </a> diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl index 629a26c9..45f83333 100644 --- a/ui/ui/sections/header.tpl +++ b/ui/ui/sections/header.tpl @@ -1217,7 +1217,7 @@ </li> <li class="user-footer"> <div class="pull-right"> - <a href="{$_url}logout" class="btn btn-default btn-flat"><i + <a href="{Text::url('belum')}logout" class="btn btn-default btn-flat"><i class="ion ion-power"></i> {Lang::T('Logout')}</a> </div> </li> @@ -1247,9 +1247,9 @@ </a> <ul class="treeview-menu"> <li {if $_system_menu eq 'customers' }class="active" {/if}><a - href="{$_url}customers">{Lang::T('Lists')}</a></li> + href="{Text::url('customers')}">{Lang::T('Lists')}</a></li> <li {if $_system_menu eq 'map' }class="active" {/if}><a - href="{$_url}map/customer">{Lang::T('Location')}</a></li> + href="{Text::url('map/customer')}">{Lang::T('Location')}</a></li> {$_MENU_CUSTOMERS} </ul> </li> @@ -1263,24 +1263,24 @@ </a> <ul class="treeview-menu"> <li {if $_routes[1] eq 'list' }class="active" {/if}><a - href="{$_url}plan/list">{Lang::T('Active Customers')}</a></li> + href="{Text::url('plan/list')}">{Lang::T('Active Customers')}</a></li> {if $_c['disable_voucher'] != 'yes'} <li {if $_routes[1] eq 'refill' }class="active" {/if}><a - href="{$_url}plan/refill">{Lang::T('Refill Customer')}</a></li> + href="{Text::url('plan/refill')}">{Lang::T('Refill Customer')}</a></li> {/if} {if $_c['disable_voucher'] != 'yes'} <li {if $_routes[1] eq 'voucher' }class="active" {/if}><a - href="{$_url}plan/voucher">{Lang::T('Vouchers')}</a></li> + href="{Text::url('plan/voucher')}">{Lang::T('Vouchers')}</a></li> {/if} {if $_c['enable_coupons'] == 'yes'} <li {if $_routes[0] eq 'coupons' }class="active" {/if}><a - href="{$_url}coupons">{Lang::T('Coupons')}</a></li> + href="{Text::url('coupons')}">{Lang::T('Coupons')}</a></li> {/if} <li {if $_routes[1] eq 'recharge' }class="active" {/if}><a - href="{$_url}plan/recharge">{Lang::T('Recharge Customer')}</a></li> + href="{Text::url('plan/recharge')}">{Lang::T('Recharge Customer')}</a></li> {if $_c['enable_balance'] == 'yes'} <li {if $_routes[1] eq 'deposit' }class="active" {/if}><a - href="{$_url}plan/deposit">{Lang::T('Refill Balance')}</a></li> + href="{Text::url('plan/deposit')}">{Lang::T('Refill Balance')}</a></li> {/if} {$_MENU_SERVICES} </ul> @@ -1297,16 +1297,16 @@ </a> <ul class="treeview-menu"> <li {if $_routes[1] eq 'hotspot' }class="active" {/if}><a - href="{$_url}services/hotspot">Hotspot</a></li> + href="{Text::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> + href="{Text::url('services/pppoe')}">PPPOE</a></li> + <li {if $_routes[1] eq 'vpn' }class="active" {/if}><a href="{Text::url('services/vpn')}">VPN</a> </li> <li {if $_routes[1] eq 'list' }class="active" {/if}><a - href="{$_url}bandwidth/list">Bandwidth</a></li> + href="{Text::url('bandwidth/list')}">Bandwidth</a></li> {if $_c['enable_balance'] == 'yes'} <li {if $_routes[1] eq 'balance' }class="active" {/if}><a - href="{$_url}services/balance">{Lang::T('Customer Balance')}</a></li> + href="{Text::url('services/balance')}">{Lang::T('Customer Balance')}</a></li> {/if} {$_MENU_PLANS} </ul> @@ -1324,9 +1324,9 @@ {/if} <ul class="treeview-menu"> <li {if $_routes[1] eq 'reports' }class="active" {/if}><a - href="{$_url}reports">{Lang::T('Daily Reports')}</a></li> + href="{Text::url('reports')}">{Lang::T('Daily Reports')}</a></li> <li {if $_routes[1] eq 'activation' }class="active" {/if}><a - href="{$_url}reports/activation">{Lang::T('Activation History')}</a></li> + href="{Text::url('reports/activation')}">{Lang::T('Activation History')}</a></li> {$_MENU_REPORTS} </ul> </li> @@ -1340,9 +1340,9 @@ </a> <ul class="treeview-menu"> <li {if $_routes[1] eq 'send' }class="active" {/if}><a - href="{$_url}message/send">{Lang::T('Single Customer')}</a></li> + href="{Text::url('message/send')}">{Lang::T('Single Customer')}</a></li> <li {if $_routes[1] eq 'send_bulk' }class="active" {/if}><a - href="{$_url}message/send_bulk">{Lang::T('Bulk Customers')}</a></li> + href="{Text::url('message/send_bulk')}">{Lang::T('Bulk Customers')}</a></li> {$_MENU_MESSAGE} </ul> </li> @@ -1357,13 +1357,13 @@ </a> <ul class="treeview-menu"> <li {if $_routes[0] eq 'routers' and $_routes[1] eq '' }class="active" {/if}><a - href="{$_url}routers">Routers</a></li> + href="{Text::url('routers')}">Routers</a></li> <li {if $_routes[0] eq 'pool' and $_routes[1] eq 'list' }class="active" {/if}><a - href="{$_url}pool/list">IP Pool</a></li> + href="{Text::url('pool/list')}">IP Pool</a></li> <li {if $_routes[0] eq 'pool' and $_routes[1] eq 'port' }class="active" {/if}><a - href="{$_url}pool/port">Port Pool</a></li> + href="{Text::url('pool/port')}">Port Pool</a></li> <li {if $_routes[0] eq 'routers' and $_routes[1] eq 'maps' }class="active" {/if}><a - href="{$_url}routers/maps">{Lang::T('Routers Maps')}</a></li> + href="{Text::url('routers/maps')}">{Lang::T('Routers Maps')}</a></li> {$_MENU_NETWORK} </ul> </li> @@ -1378,7 +1378,7 @@ </a> <ul class="treeview-menu"> <li {if $_routes[0] eq 'radius' and $_routes[1] eq 'nas-list' }class="active" {/if}><a - href="{$_url}radius/nas-list">{Lang::T('Radius NAS')}</a></li> + href="{Text::url('radius/nas-list')}">{Lang::T('Radius NAS')}</a></li> {$_MENU_RADIUS} </ul> </li> @@ -1393,22 +1393,22 @@ </a> <ul class="treeview-menu"> <li {if $_routes[1] eq 'Order_Voucher' }class="active" {/if}><a - href="{$_url}pages/Order_Voucher">{Lang::T('Order Voucher')}</a></li> + href="{Text::url('pages/Order_Voucher')}">{Lang::T('Order Voucher')}</a></li> <li {if $_routes[1] eq 'Voucher' }class="active" {/if}><a - href="{$_url}pages/Voucher">{Lang::T('Theme Voucher')}</a></li> + href="{Text::url('pages/Voucher')}">{Lang::T('Theme Voucher')}</a></li> <li {if $_routes[1] eq 'Announcement' }class="active" {/if}><a - href="{$_url}pages/Announcement">{Lang::T('Announcement')}</a></li> + href="{Text::url('pages/Announcement')}">{Lang::T('Announcement')}</a></li> <li {if $_routes[1] eq 'Announcement_Customer' }class="active" {/if}><a - href="{$_url}pages/Announcement_Customer">{Lang::T('Customer Announcement')}</a> + href="{Text::url('pages/Announcement_Customer')}">{Lang::T('Customer Announcement')}</a> </li> <li {if $_routes[1] eq 'Registration_Info' }class="active" {/if}><a - href="{$_url}pages/Registration_Info">{Lang::T('Registration Info')}</a></li> + href="{Text::url('pages/Registration_Info')}">{Lang::T('Registration Info')}</a></li> <li {if $_routes[1] eq 'Payment_Info' }class="active" {/if}><a - href="{$_url}pages/Payment_Info">{Lang::T('Payment Info')}</a></li> + href="{Text::url('pages/Payment_Info')}">{Lang::T('Payment Info')}</a></li> <li {if $_routes[1] eq 'Privacy_Policy' }class="active" {/if}><a - href="{$_url}pages/Privacy_Policy">{Lang::T('Privacy Policy')}</a></li> + href="{Text::url('pages/Privacy_Policy')}">{Lang::T('Privacy Policy')}</a></li> <li {if $_routes[1] eq 'Terms_and_Conditions' }class="active" {/if}><a - href="{$_url}pages/Terms_and_Conditions">{Lang::T('Terms and Conditions')}</a></li> + href="{Text::url('pages/Terms_and_Conditions')}">{Lang::T('Terms and Conditions')}</a></li> {$_MENU_PAGES} </ul> </li> @@ -1425,35 +1425,35 @@ <ul class="treeview-menu"> {if in_array($_admin['user_type'],['SuperAdmin','Admin'])} <li {if $_routes[1] eq 'app' }class="active" {/if}><a - href="{$_url}settings/app">{Lang::T('General Settings')}</a></li> + href="{Text::url('settings/app')}">{Lang::T('General Settings')}</a></li> <li {if $_routes[1] eq 'localisation' }class="active" {/if}><a - href="{$_url}settings/localisation">{Lang::T('Localisation')}</a></li> + href="{Text::url('settings/localisation')}">{Lang::T('Localisation')}</a></li> <li {if $_routes[0] eq 'customfield' }class="active" {/if}><a - href="{$_url}customfield">{Lang::T('Custom Fields')}</a></li> + href="{Text::url('customfield')}">{Lang::T('Custom Fields')}</a></li> <li {if $_routes[1] eq 'miscellaneous' }class="active" {/if}><a - href="{$_url}settings/miscellaneous">{Lang::T('Miscellaneous')}</a></li> + href="{Text::url('settings/miscellaneous')}">{Lang::T('Miscellaneous')}</a></li> <li {if $_routes[1] eq 'maintenance' }class="active" {/if}><a - href="{$_url}settings/maintenance">{Lang::T('Maintenance Mode')}</a></li> + href="{Text::url('settings/maintenance')}">{Lang::T('Maintenance Mode')}</a></li> <li {if $_routes[1] eq 'notifications' }class="active" {/if}><a - href="{$_url}settings/notifications">{Lang::T('User Notification')}</a></li> + href="{Text::url('settings/notifications')}">{Lang::T('User Notification')}</a></li> <li {if $_routes[1] eq 'devices' }class="active" {/if}><a - href="{$_url}settings/devices">{Lang::T('Devices')}</a></li> + href="{Text::url('settings/devices')}">{Lang::T('Devices')}</a></li> {/if} {if in_array($_admin['user_type'],['SuperAdmin','Admin','Agent'])} <li {if $_routes[1] eq 'users' }class="active" {/if}><a - href="{$_url}settings/users">{Lang::T('Administrator Users')}</a></li> + href="{Text::url('settings/users')}">{Lang::T('Administrator Users')}</a></li> {/if} {if in_array($_admin['user_type'],['SuperAdmin','Admin'])} <li {if $_routes[1] eq 'dbstatus' }class="active" {/if}><a - href="{$_url}settings/dbstatus">{Lang::T('Backup/Restore')}</a></li> + href="{Text::url('settings/dbstatus')}">{Lang::T('Backup/Restore')}</a></li> <li {if $_system_menu eq 'paymentgateway' }class="active" {/if}> - <a href="{$_url}paymentgateway"> + <a href="{Text::url('paymentgateway')}"> <span class="text">{Lang::T('Payment Gateway')}</span> </a> </li> {$_MENU_SETTINGS} <li {if $_routes[0] eq 'pluginmanager' }class="active" {/if}> - <a href="{$_url}pluginmanager"><i class="glyphicon glyphicon-tasks"></i> + <a href="{Text::url('pluginmanager')}"><i class="glyphicon glyphicon-tasks"></i> {Lang::T('Plugin Manager')}</a> </li> {/if} @@ -1470,10 +1470,10 @@ </a> <ul class="treeview-menu"> <li {if $_routes[1] eq 'list' }class="active" {/if}><a - href="{$_url}logs/phpnuxbill">PhpNuxBill</a></li> + href="{Text::url('logs/phpnuxbill')}">PhpNuxBill</a></li> {if $_c['radius_enable']} <li {if $_routes[1] eq 'radius' }class="active" {/if}><a - href="{$_url}logs/radius">Radius</a> + href="{Text::url('logs/radius')}">Radius</a> </li> {/if} {$_MENU_LOGS} @@ -1483,7 +1483,7 @@ {$_MENU_AFTER_LOGS} {if in_array($_admin['user_type'],['SuperAdmin','Admin'])} <li {if $_routes[1] eq 'docs' }class="active" {/if}> - <a href="{if $_c['docs_clicked'] != 'yes'}{$_url}settings/docs{else}./docs/{/if}"> + <a href="{if $_c['docs_clicked'] != 'yes'}{Text::url('settings/docs')}{else}{Text::url('docs')}{/if}"> <i class="ion ion-ios-bookmarks"></i> <span class="text">{Lang::T('Documentation')}</span> {if $_c['docs_clicked'] != 'yes'} @@ -1493,7 +1493,7 @@ </a> </li> <li {if $_system_menu eq 'community' }class="active" {/if}> - <a href="{$_url}community"> + <a href="{Text::url('community')}"> <i class="ion ion-chatboxes"></i> <span class="text">Community</span> </a> @@ -1508,7 +1508,7 @@ <div class="notification-top-bar"> <p>{Lang::T('The website is currently in maintenance mode, this means that some or all functionality may be unavailable to regular users during this time.')}<small> <a - href="{$_url}settings/maintenance">{Lang::T('Turn Off')}</a></small></p> + href="{Text::url('settings/maintenance')}">{Lang::T('Turn Off')}</a></small></p> </div> {/if} diff --git a/update.php b/update.php index 1e9a6087..2ce61b36 100644 --- a/update.php +++ b/update.php @@ -151,6 +151,7 @@ function pathFixer($path) function r2($to, $ntype = 'e', $msg = '') { + if ($msg == '') { header("location: $to"); die();