Skip to content

Commit

Permalink
Display current WiFi password
Browse files Browse the repository at this point in the history
  • Loading branch information
martignoni committed Sep 18, 2016
1 parent f4b26c1 commit 6bf0137
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
$sdcardtotalspace = disk_total_space('/');
$sdcardfreespace = disk_free_space('/');
$moodleboxversion = $plugin->release . ' (' . $plugin->version . ')';
$currentwifipassword = exec('grep "wpa_passphrase" /etc/hostapd/hostapd.conf | cut -d= -f2');

class datetimeset_form extends moodleform {
function definition() {
Expand Down Expand Up @@ -152,6 +153,7 @@ function definition() {
$table->add_data(array(get_string('cputemperature', 'tool_moodlebox'), $cputemperature));
$table->add_data(array(get_string('cpufrequency', 'tool_moodlebox'), $cpufrequency));
$table->add_data(array(get_string('uptime', 'tool_moodlebox'), $uptime));
$table->add_data(array(get_string('currentwifipassword', 'tool_moodlebox'), $currentwifipassword));
$table->add_data(array(get_string('dhcpclientnumber', 'tool_moodlebox'), $dhcpclientnumber));
if ($dhcpclientnumber > 0) {
foreach($leases as $row) {
Expand Down Expand Up @@ -194,7 +196,6 @@ function definition() {

if ($data = $changepasswordform->get_data()) {
if (!empty($data->submitbutton)) {
// print_r($data);
file_put_contents(".newpassword", $data->newpassword1);
\core\notification::warning(get_string('changepasswordmessage', 'tool_moodlebox'));
}
Expand Down
1 change: 1 addition & 0 deletions lang/en/tool_moodlebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
$string['cpufrequency'] = 'CPU frequency';
$string['cpuload'] = 'CPU load';
$string['cputemperature'] = 'CPU temperature';
$string['currentwifipassword'] = 'Current Wi-Fi password';
$string['datetime'] = 'Date and time';
$string['datetimemessage'] = 'The clock of the MoodleBox was set. To get the most accuracy, it\'s recommended to connect the MoodleBox to an Internet connected network via an ethernet cable.';
$string['datetimeset'] = 'Set date and time';
Expand Down
1 change: 1 addition & 0 deletions lang/fr/tool_moodlebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
$string['cpufrequency'] = 'Fréquence du processeur';
$string['cpuload'] = 'Charge du processeur';
$string['cputemperature'] = 'Température du processeur';
$string['currentwifipassword'] = 'Mot de passe Wi-Fi actuel';
$string['datetime'] = 'Date et heure';
$string['datetimemessage'] = 'L\'horloge de la MoodleBox a été mise à l\'heure. Pour une précision encore meilleure, il est recommandé de brancher la MoodleBox à un réseau connecté à Internet, au moyen d\'un câble ethernet.';
$string['datetimeset'] = 'Changer la date et l\'heure';
Expand Down

0 comments on commit 6bf0137

Please sign in to comment.