ronnyvdbr / ronnyvdbr.github.io

Raspberry Pi - Wifi Router Project
116 stars 50 forks source link

Some ideas for improvement? #20

Open s256 opened 8 years ago

s256 commented 8 years ago

First: Great Work. REALLY NICE IDEA!! 1) Right now it takes a lot of time to change every entry in every file to change username password. I'd suggest a const in one file included in the other php files.

2) I think adapting the sudoers file is not the most secure way to handle the services (see reasons for fork opnsense)

3) as routersettings.ini is your main configuration file which might contain the wifi key, it shouldn't be stored in a folder where the www-data user has access. For now you can download the file without login or anything.

4) Adapt install.sh for raspbian-lite.

5) Add support for network-traffic monitoring for Captive Portal. Using http://www.netexpertise.eu/en/freeradius/usage-graphs.html and BandwidthD. Maybe adding some functions from https://github.com/GraseHotspot/grase-www-portal/blob/master/files/usr/share/grase/src/Grase/Database/Reports.php

I added to line 316 in Advanced-CaptivePortal.php ` <div id="ContentTitle" <?php if((strcmp($configurationsettings['operationmode'],'Access Point') == 0) || (strcmp($configurationsettings['captiveportal'],'disabled') == 0)) {echo 'style="display: none;';}?>> Captive Portal User Traffic Monitor

<div id="ContentArticle" <?php if((strcmp($configurationsettings['operationmode'],'Access Point') == 0) || (strcmp($configurationsettings['captiveportal'],'disabled') == 0))  {echo 'style="display: none;';}?>>

              <?php 
                $recordset = select("select username,value from radcheck","radius");                   

                if (mysqli_num_rows($recordset) > 0) {
                  // output data of each row
                  while($row = mysqli_fetch_assoc($recordset)) {
                    echo '<a target="_blank" style="color:black;"href="https://192.168.178.50/bandwidthd/">';
                    echo '<hr /><h1 style="text-align:center; background:lightgrey;">' . $row["username"] . '</h1>';
                    echo '<img style="max-width:100%;"src="https://192.168.178.50/cgi-bin/graph.cgi?username=' .$row["username"] . '"</img>';
                    echo '</a>';

                  }
                } 
              ?>

`

If you want help, let me know. I'm very interested in this project.