#!/usr/bin/haserl --upload-limit=100 --upload-dir=/tmp <%in p/common.cgi %> <% page_title="Interface Settings" config_file="/etc/webui/webui.conf" if [ "$REQUEST_METHOD" = "POST" ]; then case "$POST_action" in access) password_default="$POST_password_default" if [ -z "$password_default" ]; then redirect_to "$SCRIPT_NAME" "danger" "Password cannot be empty!" fi password_confirm="$POST_password_confirm" if [ "$password_default" != "$password_confirm" ]; then redirect_to "$SCRIPT_NAME" "danger" "Password does not match!" fi echo "root:${password_default}" | chpasswd update_caminfo redirect_to "/" "success" "Password updated." ;; theme) eval webui_theme=\$POST_webui_theme echo webui_theme=\"$webui_theme\" > $config_file update_caminfo redirect_back "success" "Settings updated." ;; *) redirect_to "$SCRIPT_NAME" "danger" "UNKNOWN ACTION: $POST_action" ;; esac fi ui_username="$USER" %> <%in p/header.cgi %>

Access

<% field_hidden "action" "access" %>

<% field_password "password_default" "Password" %> <% field_password "password_confirm" "Confirm Password" %> <% button_submit %>

Theme

<% field_hidden "action" "theme" %> <% field_string "webui_theme" "Theme" "eval" "dark light" %> <% button_submit %>
<%in p/footer.cgi %>