Pinchie / RaspiPass

RaspiPass - Homepass software for the Raspberry Pi 3
46 stars 5 forks source link

Need to be able to set timezone/locale from within WebGUI #2

Open Pinchie opened 7 years ago

Pinchie commented 7 years ago

According to this link it can be done using the --frontend=noninteractive parameter on dpkg-reconfigure command

To implement I will need to:

  1. Gather a list of locales (/usr/share/zoneinfo for areas; /user/share/zoneinfo/[area] for specific zone)
  2. Allow one to be selected from a drop-down within the Web GUI (probably two drop-downs.. one for area, one for zones populated from selected area)
  3. Create a symbolic link /etc/localtime linking to the /usr/share/zoneinfo/[area]/[zone] file
  4. Run dpkg-reconfigure --frontend=noninteractive tzdata

Method:

  1. Create new tab ("system config"? rename "configuration" to "RaspiPass config")
  2. Store directory listing under /usr/share/zoneinfo as array of areas/zones
  3. Populate drop-down boxes with areas
  4. When area is selected, populate second drop-down with zones
  5. Run dpkg-reconfigure as above
Pinchie commented 7 years ago

Added backend retrieval of directories under /usr/share/zoneinfo, and files within those directories. These are added to an array for selection from a (yet-to-be-added) drop-down. Externally called from html/scripts/locales.php

Currently testing on working branch

Pinchie commented 7 years ago

Added drop-down and call to external script - just need to write the script to set timezone now

EDIT: Script written

Pinchie commented 7 years ago

Written and in testing on working tree