[Update] Cara Jitu Mengalihkan User Hotspot Expire ke Halaman Informasi


Cara Jitu Mengalihkan User Hotspot Expire ke Halaman Informasi[Update] Cara Jitu Mengalihkan User Hotspot Expire ke Halaman Informasi – Banyak cara yang bisa digunakan untuk mengalihkan User Hotspot MikroTik yang sudah masuk masa expire ke halaman expire atau halaman informasi yang bertujuan untuk memberikan informasi kepada user bahwa paket internet mereka sudah memasuki batas penggunaan. Yang akan saya share kali ini adalah salah satu Cara Mudah Mengalihkan User Hotspot Expire ke Halaman Informasi dengan memodifikasi sedikit pada tempalate hotspot yang digunakan, khususnya pada file login.html, yaitu dengan cara menambahkan beberapa baris script javascript dan tidak menggunakan konfigurasi tambahan seperti penambahan setingan web proxy mikrotik sebagaimana cara yang umum digunakan.

Saya asumsikan kalau file html yang berisi informasi expire kepada user (expire.html) sudah anda siapkan dalam folder template login hotpost yang anda gunakan. Jika anda belum memiliki file html yang berisi informasi expire kepada user hotspot yang sudah habis masa aktif, anda bisa gunakan kode sederhana dibawah ini dan simpan filenya dengan nama expire.html ke dalam folder template hotspot anda :



Baca Juga :

Login Page Hotspot Mikrotik Keren-Responsive-Gratis Terbaru 2019



<!DOCTYPE html> <html lang="en"> <head> <title>Informasi Masa Aktif</title> <meta charset="UTF-8" /> <meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/> <style> body { font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif; text-align:justify; } .container { max-width:800px; margin:8% auto; border:solid 1px #ddd; padding:20px; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; -moz-box-shadow:0 0 4px #aaa; -webkit-box-shadow:0 0 4px #aaa; box-shadow:0 0 4px #aaa; } </style> </head> <body> <div class="container"> <div> <h3 style="text-align:center">Informasi Masa Aktif Paket Hotspot</h3> </div> <p> Dengan berat hati kami menyampaikan informasi ini kepada anda, bahwa masa aktif paket hotspot anda sudah expire. Silahkan lakukan pengisian ulang atau membeli voucher baru untuk tetap bisa terhubung ke internet. Terima Kasih atas pengertiannya. </p> <br> <p style="text-align:center"> PENYEDIA LAYANAN </p> </div> </body> </html>

Disini saya menggunakan file “errors.txt” bawaan template yang masih original, dengan kata lain belum pernah dirubah, file ini bisa ada temukan dalam folder template anda. Jika kode error pada file errors.txt template anda sudah pernah dirubah silahkan anda sesuaikan. Jadi sebelum anda mengikuti langkah-langkah dibawah ini, ada baiknya anda periksa apakah notifikasi error hotspot pada file errors.txt masih asli (default) atau sudah pernah dirubah. Berikut ini isi file errors.txt yang masih asli (default) :



# This file contains error messages which are shown to user, when http/https # login is used. # These messages can be changed to make user interface more friendly, including # translations to different languages. # # Various variables can be used here as well. Most frequently used ones are: # $(error-orig) - original error message from hotspot # $(ip) - ip address of a client # $(username) - username of client trying to log in # internal-error # It should never happen. If it will, error page will be shown # displaying this error message (error-orig will describe what has happened) internal-error = internal error ($(error-orig)) # config-error # Should never happen if hotspot is configured properly. config-error = configuration error ($(error-orig)) # not-logged-in # Will happen, if status or logout page is requested by user, # which actually is not logged in not-logged-in = you are not logged in (ip $(ip)) # ippool-empty # IP address for user is to be assigned from ip pool, but there are no more # addresses in that pool ippool-empty = cannot assign ip address - no more free addresses from pool # shutting-down # When shutdown is executed, new clients are not accepted shutting-down = hotspot service is shutting down # user-session-limit # If user profile has limit of shared-users, then this error will be shown # after reaching this limit user-session-limit = no more sessions are allowed for user $(username) # license-session-limit # Depending on licence number of active hotspot clients is limited to # one or another amount. If this limit is reached, following error is displayed. license-session-limit = session limit reached ($(error-orig)) # wrong-mac-username # If username looks like MAC address (12:34:56:78:9a:bc), but is not # a MAC address of this client, login is rejected wrong-mac-username = invalid username ($(username)): this MAC address is not yours # chap-missing # If http-chap login method is used, but hotspot program does not receive # back encrypted password, this error message is shown. # Possible reasons of failure: # - JavaScript is not enabled in web browser; # - login.html page is not valid; # - challenge value has expired on server (more than 1h of inactivity); # - http-chap login method is recently removed; # If JavaScript is enabled and login.html page is valid, # then retrying to login usually fixes this problem. chap-missing = web browser did not send challenge response (try again, enable JavaScript) # invalid-username # Most general case of invalid username or password. If RADIUS server # has sent an error string with Access-Reject message, then it will # override this setting. invalid-username = invalid username or password # invalid-mac # Local users (on hotspot server) can be bound to some MAC address. If login # from different MAC is tried, this error message will be shown. invalid-mac = user $(username) is not allowed to log in from this MAC address # uptime-limit, traffic-limit # For local hotspot users in case if limits are reached uptime-limit = user $(username) has reached uptime limit traffic-limit = user $(username) has reached traffic limit # radius-timeout # User is authenticated by RADIUS server, but no response is received from it, # following error will be shown. radius-timeout = RADIUS server is not responding # auth-in-progress # Authorization in progress. Client already has issued an authorization request # which is not yet complete. auth-in-progress = already authorizing, retry later # radius-reply # Radius server returned some custom error message radius-reply = $(error-orig) 

Pada tutorial ini saya mengalihkan 2 jenis info error ke halaman informasi, yaitu :

  1. user $(username) has reached uptime limit, baris 86
  2. user $(username) has reached traffic limit, baris 87

Kemudian error invalid username or password (baris 75) saya ganti notifikasinya menjadi Mohon Periksa Informasi Login Anda. Silahkan anda ikuti secara teliti langkah-langkah berikut ini :

    • Anda buka dan edit file login.html dengan notepad++, lalu cari elemen html yang akan menampikan error hotspot, ini tergantung ke template yang anda gunakan karena umumnya pada template modifikasi elemen error hotspot pasti berbeda-beda. Misalkan bentuk elemen error nya seperti dibawah ini :
    • $(if error) <div class="alert alert-danger">$(error)</div> $(endif) 

      maka silahkan itu dihapus dan diganti dengan script berikut ini :

$(if error) <div style="color:blue;" class="alert alert-danger"> <script type="text/javascript"> var error ="$(error)"; var error1 ="user $(username) has reached uptime limit"; var error2 ="user $(username) has reached traffic limit"; var error3 ="invalid username or password"; if (error == error1 || error == error2){ window.location.href ="http://oasis-hotspot.net/expire.html"; } else if (error == error3){ document.write("Mohon Periksa Informasi Login Anda"); } else { document.write("$(error)"); } </script> </div> $(endif)

Silahkan anda sesuaikan bagian “http://oasis-hotspot.net/expire.html“, rubah nama domain hotspotnya dengan nama domain hotspot milik anda.

Baca Juga :

Tutorial Cara Install MikroTik di VirtualBox

Dengan dimodifikasi seperti ini, jika user hotspot mikrotik yang sudah masuk limit waktu, otomatis akan diarahkan ke halaman expire atau halaman informasi disaat mereka mencoba login. Berikut penampakan di tempat saya :

halaman expire hotspot

Silahkan anda pahami langkah-langkahnya dan dipraktekkan di tempat anda, mudah-mudahan artikel mengenai Cara Mudah Mengalihkan User Hotspot Expire ke Halaman Informasi ini bisa bermanfaat untuk yang membutuhkan, dan silahkan tinggalkan komentar jika ada pertanyaan mengenai hal ini.



Jangan lupa untuk mengunjungi terus TopSETTING.COM untuk mendapatkan tutorial dan artikel-artikel bermanfaat lainnya.

00votes
Article Rating

   
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

24 Comments
Newest
OldestMost Voted
Inline Feedbacks
View all comments
wba
wba
4 years ago

bro, tuk tambah fitur chat gimana ?
kondisi user lom login hotspot…

rizqi
rizqi
6 years ago

link youtub nya ada gan , gagal paham ….saya

Aldiansyah
6 years ago

mas. cara biar usermanager ikut ke halaman expired gimana ya? ini sudah saya coba dan bisa hanya untuk profile hotspot saja. sedangkan usermanager tidak ikut ke halaman expired.
mohon bantuannya.

Aldiansyah
6 years ago
Reply to  EF Doank

kode error yang mana? . rencana saya yg buat usermanager setelah waktu habis redirect ke halaman expired.
yg kode diatas hanya user di hotspot diatas.
masih bingung yg punya usermanager

Aldiansyah
6 years ago
Reply to  EF Doank

di dalam error.txt tidak ada kode error no valid profile found.
tapi saya coba masukkan kode “no valid profile found” di html bisa .
makasih atas waktu dan infonya.

Hidayat
Hidayat
5 years ago
Reply to  Aldiansyah

Boleh berbagi cara memasukan kode bo valid profile found tersebut. Krn sy tidak paham.

prims
prims
6 years ago

cra cek nya gmn sukses gk nya..dlam keadaan gk masuk ke mikrotik bang

jhun soo
6 years ago

punya ane kek gini gan, itu yg tutor diatas naruhnya gmn ya?
$(if error)

×
$(error)

$(endif)

jhun soo
6 years ago
Reply to  EF Doank

waduh copasnya kacau wkokow

alnet
alnet
6 years ago

trima kasih kang..sukses selalu

rahasia
rahasia
6 years ago

makasih kk ?

Gamerz
Gamerz
6 years ago

Mas mau tanya kalo di user profile ada 3 kategori 1 hari, 7 hari, 30 hari. Lah yang 30 hari biar gak login2 saya binding. Kalo ngatur biar yang paket 30 hari diarahkan ke halaman informasi pada tanggal 5, apakah bisa mas? Gimana caranya? Maaf banyak nanya mas ?

24
0
Would love your thoughts, please comment.x
()
x