RADIUSdesk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
user_guide:mikrotik:rb751_advanced [2017/02/01 13:32]
admin [Add an entry to the Mikrotik Walled Garden]
user_guide:mikrotik:rb751_advanced [2021/05/07 08:30]
admin [Add a dynamic key to a Dynamic login page entry]
Line 7: Line 7:
 ------------------- -------------------
 ===== Central Dynamic Login pages ===== ===== Central Dynamic Login pages =====
-  * RADIUSdesk ​allow you to have one centrally managed location to serve a dynamic login page to many Mikrotik devices.+  * RADIUSdesk ​allows ​you to have one centrally managed location to serve a dynamic login page to many Mikrotik devices.
   * This allows you to   * This allows you to
     * Group Mikrotik devices together and serve one common login page to them all.     * Group Mikrotik devices together and serve one common login page to them all.
Line 28: Line 28:
   * Apply the changes if there were any.   * Apply the changes if there were any.
  
-==== Fetch and replacement login pages ==== +==== Fetch Replacement Login Pages ==== 
-  * We assume you have Linux machine ​with the svn client installed where you will issue the following commands from. +  * The latest RADIUSdesk GIT code on Source Forge contains ​folder ​with the replacement login pages. 
-<WRAP center round tip 60%>+  * If you need a reminder to check out the code, or you want to check it out on another machine here is the command: 
 +<WRAP center round tip 100%>
 <code bash> <code bash>
-#From a terminal on Ubuntu try the following to install svn client: +#From a Linux machine with git client ​installed 
-sudo apt-get install subversion+sudo git clone https://​git.code.sf.net/​p/​radiusdesk/​git rd_code
 </​code>​ </​code>​
 </​WRAP>​ </​WRAP>​
  
-  * Check out the **rd_clients/mikrotik** folder from the RADIUSdesk project'​s source tree. +  * The replacement files will be under the **rd_code/cake3/rd_cake/setup/mikrotik** folder
-<code bash> +
-svn checkout svn://svn.code.sf.net/p/​radiusdesk/​code/​trunk/​rd_clients/​mikrotik/​ +
-</​code>​ +
-  * This will create a **mikrotik** folder.+
   ​   ​
  
 ==== Add a dynamic key to a Dynamic login page entry  ==== ==== Add a dynamic key to a Dynamic login page entry  ====
-  * On your local machine, change directory to the **mikrotik** folder and edit the **login.html** file to redirect to your RADIUSdesk server.+  * On your local machine, change directory to the **rd_code/​cake3/​rd_cake/​setup/​mikrotik** folder and edit the **login.html** file to redirect to your RADIUSdesk server.
   * Also ensure there is an item which you can use as a dynamic key to specify the dynamic login page's info which should be displayed.   * Also ensure there is an item which you can use as a dynamic key to specify the dynamic login page's info which should be displayed.
   * In the sample page we include the **nasid** item and give it a value of $(identity).   * In the sample page we include the **nasid** item and give it a value of $(identity).
   * This will be automatically substituted with **za-gp-pta-001**.   * This will be automatically substituted with **za-gp-pta-001**.
   * We will subsequently have to add a **Dynamic key** to one of the items in the **Dynamic login pages** applet that will tie this a item in the query string to an item in the **Dynamic login pages** applet.   * We will subsequently have to add a **Dynamic key** to one of the items in the **Dynamic login pages** applet that will tie this a item in the query string to an item in the **Dynamic login pages** applet.
-  * If we have deployed 15 of these Mikrotik devices in Striusbaai; we can simply include an item like **ssid=Struisbaai** with the login.html'​s redirect instruction and use **ssid** as a **Dynamic key**. In this way we group these 15 devices to all show the **Struisbaai** dynamic login page.+  * If we have deployed 15 of these Mikrotik devices in Gauteng; we can simply include an item like **ssid=Gauteng** with the login.html'​s redirect instruction and use **ssid** as a **Dynamic key**. In this way we group these 15 devices to all show the **Gauteng** dynamic login page.
  
-{:user_guide:mikrotik:index_html_edit.png?​nolink |}}+<code html> 
 +$(if error == ''​) 
 +<​html>​ 
 +    <​head><​title>​...</​title></​head>​ 
 +    <​body>​ 
 +        $(if chap-id) 
 +        <​noscript>​ 
 +            <​center><​b>​JavaScript required. Enable JavaScript to continue.</​b></​center>​ 
 +        </​noscript>​ 
 +        $(endif) 
 +        <​center>​If you are not redirected in a few seconds, click '​continue'​ below<​br>​ 
 +        <form name="​redirect"​ action="​http://​YOUR_RADIUSDESK_SERVER_IP/​cake3/​rd_cake/​dynamic-details/​mikrotik-browser-detect"​ method="​post">​ 
 +            <input type="​hidden"​ name="​loginlink"​ value="​$(link-login-only)">​ 
 +            <input type="​hidden"​ name="​nasid"​ value="​$(identity)">​ 
 +            <input type="​hidden"​ name="​link_status"​ value="​$(link-status)">​ 
 +            <input type="​hidden"​ name="​link_login_only"​ value="​$(link-login-only)">​ 
 +            <input type="​hidden"​ name="​link_logout"​ value="​$(link-logout)">​ 
 +            <input type="​hidden"​ name="​mac"​ value="​$(mac-esc)">​ 
 +            <input type="​hidden"​ name="​type"​ value="​mikrotik">​ 
 +            <input type="​hidden"​ name="​ssid"​ value="​Gauteng">​ 
 +            <input type="​submit"​ value="​continue">​ 
 +        </​form>​ 
 +        <script language="​JavaScript">​ 
 +        <!-- 
 +           ​document.redirect.submit();​ 
 +        //--> 
 +        </​script>​ 
 +        </​center>​ 
 +    </​body>​ 
 +</​html>​ 
 +$(else) 
 +$(var)({ 
 + '​logged_in'​     ​'​$(logged-in)',​  
 + '​link_login_only'​ '​$(link-login-only)',​ 
 + '​error_orig'​ '​$(error-orig)',​ 
 + '​error'​ :​ '​$(error)'​ 
 +}
 +$(endif) 
 +</​code>​
  
 When you are done editing the login.html page and also added the **Dynamic key** to the **Dynamic login page** which you want to serve on the Mikrotik; you can copy the replacement pages to the Mikrotik router. When you are done editing the login.html page and also added the **Dynamic key** to the **Dynamic login page** which you want to serve on the Mikrotik; you can copy the replacement pages to the Mikrotik router.