#!/bin/sh

po_domain="alterator-ahttpd"
alterator_api_version=1

l10n_dir=/etc/alterator/l10n

. alterator-sh-functions

list_locale()
{
    [ ! -d "$l10n_dir" ] ||
	find "$l10n_dir" -type f|
	sort|
	while read f; do
	    local name="${f##*/}"
	    name="${name##??-}"
	    write_enum_item "$name" "$(cat "$f")"
	done
}

authenticate()
{
    printf "%s\0%s" "$in_login" "$in_password" | /usr/sbin/alterator-chkpwd;
    [ $? -eq '0' ] || write_error "`_ "Authentication failed"`";
}

alterator_export_proc list_locale
alterator_export_proc authenticate

message_loop
