alterator-auth-0.3/ 0000755 0000000 0000000 00000000000 11055220376 0014307 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/Makefile 0000644 0000000 0000000 00000000635 11055220376 0015753 0 ustar 00root root 0000000 0000000 NAME=auth
DESCRIPTION="Authentication"
INSTALL=/usr/bin/install
all:
clean:
install: install-backend install-po install-ui install-html
include /usr/share/alterator/build/po.mak
include /usr/share/alterator/build/ui2.mak
include /usr/share/alterator/build/backend.mak
include /usr/share/alterator/build/fbi.mak
include /usr/share/alterator/build/html-messages.mak
HTML_PO_TEMPLATE=ui/auth/html-messages.scm
alterator-auth-0.3/applications/ 0000755 0000000 0000000 00000000000 11055220376 0016775 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/applications/auth.desktop 0000644 0000000 0000000 00000000377 11055220376 0021340 0 ustar 00root root 0000000 0000000 [Desktop Entry]
Type=Application
Categories=X-Alterator-Users
Icon=auth
Terminal=false
Name=Authentication
Name[ru_RU]=Аутентификация
Name[uk_UA]=Аутентифікація
X-Alterator-URI=/auth
X-Alterator-Weight=20
X-Alterator-Help=auth
alterator-auth-0.3/backend3/ 0000755 0000000 0000000 00000000000 11055220376 0015761 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/backend3/auth 0000755 0000000 0000000 00000003137 11055220376 0016654 0 ustar 00root root 0000000 0000000 #!/bin/sh
po_domain="alterator-auth"
ldapfile="/etc/pam_ldap.conf"
ldap_uri_re='(ldap|ldapi|ldaps)://[a-z0-9.]+'
rdelim='[[:space:]]\+'
wdelim=' '
. alterator-sh-functions
. shell-config
#turn off auto expansion
set -f
list_profile()
{
printf '("local" label "%s")' "`_ "local"`"
[ -n "$(find /$(getconf SLIB)/security -name 'pam_ldap.*')" ] && printf '("ldap" label "%s")' "`_ "LDAP"`"
}
read_ldap()
{
shell_config_get "$ldapfile" "$1" "$rdelim"
}
write_ldap()
{
shell_config_set "$ldapfile" "$1" "$2" "$rdelim" "$wdelim"
}
#comment host option to avoid conflict with uri
sed -r 's,^(host[[:space:]]),#\1,' -i "$ldapfile"
on_message()
{
case "$in_action" in
constraints)
echo '('
printf 'profile (label "%s")' "`_ "Auth type"`"
printf 'ldap_uri (label "%s" match ("%s" "%s"))' \
"`_ "LDAP server"`" \
"$ldap_uri_re" \
"`_ "should be ldap://host or ldapi://host or ldaps://host"`"
printf 'ldap_basedn (label "%s")' "`_ "Base DN"`"
echo ')'
;;
list)
echo '('
[ "$in__objects" = "avail_profile" ] && list_profile
echo ')'
;;
read)
echo '('
local profile="$(/usr/sbin/control system-auth)"
printf 'profile "%s"' "$profile"
printf 'ldap_uri "%s"\n' "$(read_ldap uri)"
printf 'ldap_basedn "%s"\n' "$(read_ldap base)"
echo ')'
;;
write)
[ -n "$in_profile" ] && /usr/sbin/control system-auth "$in_profile"
[ -n "$in_ldap_uri" ] && write_ldap uri "$in_ldap_uri"
[ -n "$in_ldap_basedn" ] && write_ldap base "$(string_quote_remove "$in_ldap_basedn")"
write_nop
;;
*)
echo '#f'
;;
esac
}
message_loop
alterator-auth-0.3/backend3/template-auth 0000755 0000000 0000000 00000001006 11055220376 0020456 0 ustar 00root root 0000000 0000000 #!/bin/sh
#turn off auto expansion
set -f
_()
{
LANG=${in_language%%;*}.utf8 gettext "alterator-auth" "$1"
}
. /usr/share/alterator/build/backend3.sh
on_message()
{
case "$in_action" in
#information for renderer
template)
[ -n "$in_profile" ] || in_profile="$(control system-auth)"
echo '('
echo 'template "form" '
if [ "$in_profile" = "ldap" ];then
echo 'url "auth-ldap.html"'
else
echo 'url "auth-local.html"'
fi
echo ')'
;;
*)
echo '#f'
esac
}
message_loop
alterator-auth-0.3/help/ 0000755 0000000 0000000 00000000000 11055220376 0015237 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/help/ru_RU/ 0000755 0000000 0000000 00000000000 11055220376 0016273 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/help/ru_RU/auth.html 0000644 0000000 0000000 00000004073 11055220376 0020126 0 ustar 00root root 0000000 0000000
Help - ALT Linux Console
PAM
Pluggable Authentication Modules (PAM) —
механизм, позволяющий тонко настроить схему аутентификации
пользователей в системе. Данный модуль конфигуратора позволяет переключаться между
заранее подготовленными схемами.
Для традиционной схемы
("локальная аутентификация") ничего дополнительно настраивать не
требуется.
Для схемы "LDAP" требуется дополнительно заполнить
следующие параметры:
-
Сервер LDAP — местоположение сервера и протокол, например, "ldap://localhost.localdomain".
-
Базовый DN — точка привязки, например, "dc=example,dc=com".
При аутентификации по этой схеме сначала происходит попытка
аутентификации пользователя с использованием локальных баз
данных. В случае, если пользователь не является системным (то
есть UID больше определённого значения, по умолчанию — 500) и не прошёл
аутентификацию локально, то делается повторная попытка с
использованием данных из LDAP.
alterator-auth-0.3/help/uk_UA/ 0000755 0000000 0000000 00000000000 11055220376 0016243 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/help/uk_UA/auth.html 0000644 0000000 0000000 00000003673 11055220376 0020103 0 ustar 00root root 0000000 0000000
Help - ALT Linux Console
PAM
Pluggable Authentication Modules (PAM) —
механізм, що дозволяє тонко налаштувати схему аутентифікації
користувачів у системі. Даний модуль конфігуратора дозволяє перемикатися між
завчасно підготовленими схемами.
Для традиційної схеми
("локальна аутентифікація") нічого додатково налаштовувати не треба.
Для схеми "LDAP" треба додатково заповнити наступні параметри:
-
Сервер LDAP — адреса сервера та протокол, наприклад, "ldap://localhost.localdomain".
-
Базовий DN — точка прив'язування, наприклад, "dc=example,dc=com".
При аутентифікації за цією схемою спочатку має місце спроба
аутентифікації користувача із використанням локальних баз
даних. Якщо користувач не є системным (тобто
UID більше певного значення, типово — 500) й не пройшов
аутентифікацію локально, то буде зроблено другу спробу із
використанням даних з LDAP.
alterator-auth-0.3/html/ 0000755 0000000 0000000 00000000000 11055220376 0015253 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/html/fbi/ 0000755 0000000 0000000 00000000000 11055220376 0016013 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/html/fbi/auth-ldap.html 0000644 0000000 0000000 00000002043 11055220376 0020557 0 ustar 00root root 0000000 0000000
Authentication - ALT Linux Console
Authentication
alterator-auth-0.3/html/fbi/auth-local.html 0000644 0000000 0000000 00000001104 11055220376 0020726 0 ustar 00root root 0000000 0000000
Authentication - ALT Linux Console
Authentication
alterator-auth-0.3/po/ 0000755 0000000 0000000 00000000000 11055220376 0014725 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/po/alterator-auth.pot 0000644 0000000 0000000 00000003144 11055220376 0020407 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-13 19:07+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ui/auth/index.scm:50 backend3/auth:45
msgid "Auth type"
msgstr ""
#: ui/auth/index.scm:59 backend3/auth:47
msgid "LDAP server"
msgstr ""
#: ui/auth/index.scm:64 backend3/auth:50
msgid "Base DN"
msgstr ""
#. zerg's spacer
#: ui/auth/index.scm:70 ui/auth/html-messages.scm:6
msgid "Apply"
msgstr ""
#: ui/auth/index.scm:71
msgid "Quit"
msgstr ""
#: ui/auth/html-messages.scm:1 ui/auth/html-messages.scm:3
#: backend3/template-auth:34
msgid "Authentication"
msgstr ""
#: ui/auth/html-messages.scm:2 ui/auth/html-messages.scm:4
msgid "Select"
msgstr ""
#: ui/auth/html-messages.scm:5
msgid "LDAP settings"
msgstr ""
#: ui/auth/html-messages.scm:7
msgid "Reset"
msgstr ""
#: backend3/auth:7 backend3/template-auth:8
msgid "alterator-auth"
msgstr ""
#: backend3/auth:12
msgid "local"
msgstr ""
#: backend3/auth:13
msgid "LDAP"
msgstr ""
#: backend3/auth:49
msgid "should be ldap://host or ldapi://host or ldaps://host"
msgstr ""
#: backend3/template-auth:35
msgid "Authentication schema setup"
msgstr ""
#: backend3/template-auth:36
msgid "Users"
msgstr ""
alterator-auth-0.3/po/ru.po 0000644 0000000 0000000 00000003673 11055220376 0015724 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-13 19:07+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ui/auth/index.scm:50 backend3/auth:45
msgid "Auth type"
msgstr "Тип аутентификации"
#: ui/auth/index.scm:59 backend3/auth:47
msgid "LDAP server"
msgstr "Сервер LDAP"
#: ui/auth/index.scm:64 backend3/auth:50
msgid "Base DN"
msgstr "Базовый DN"
#. zerg's spacer
#: ui/auth/index.scm:70 ui/auth/html-messages.scm:6
msgid "Apply"
msgstr "Принять"
#: ui/auth/index.scm:71
msgid "Quit"
msgstr "Выход"
#: ui/auth/html-messages.scm:1 ui/auth/html-messages.scm:3
#: backend3/template-auth:34
msgid "Authentication"
msgstr "Аутентификация"
#: ui/auth/html-messages.scm:2 ui/auth/html-messages.scm:4
msgid "Select"
msgstr "Выбрать"
#: ui/auth/html-messages.scm:5
msgid "LDAP settings"
msgstr "Настройки LDAP"
#: ui/auth/html-messages.scm:7
msgid "Reset"
msgstr "Сброс"
#: backend3/auth:7 backend3/template-auth:8
msgid "alterator-auth"
msgstr ""
#: backend3/auth:12
msgid "local"
msgstr "локально"
#: backend3/auth:13
msgid "LDAP"
msgstr "через LDAP"
#: backend3/auth:49
msgid "should be ldap://host or ldapi://host or ldaps://host"
msgstr "должно быть ldap://host или ldapi://host или ldaps://host"
#: backend3/template-auth:35
msgid "Authentication schema setup"
msgstr "Настройка схемы аутентификации"
#: backend3/template-auth:36
msgid "Users"
msgstr "Пользователи"
alterator-auth-0.3/po/uk.po 0000644 0000000 0000000 00000003713 11055220376 0015710 0 ustar 00root root 0000000 0000000 # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-13 19:07+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ui/auth/index.scm:50 backend3/auth:45
msgid "Auth type"
msgstr "Тип аутентифікації"
#: ui/auth/index.scm:59 backend3/auth:47
msgid "LDAP server"
msgstr "Сервер LDAP"
#: ui/auth/index.scm:64 backend3/auth:50
msgid "Base DN"
msgstr "Базовий DN"
#. zerg's spacer
#: ui/auth/index.scm:70 ui/auth/html-messages.scm:6
msgid "Apply"
msgstr "Застосувати"
#: ui/auth/index.scm:71
msgid "Quit"
msgstr "Вихід"
#: ui/auth/html-messages.scm:1 ui/auth/html-messages.scm:3
#: backend3/template-auth:34
msgid "Authentication"
msgstr "Аутентифікація"
#: ui/auth/html-messages.scm:2 ui/auth/html-messages.scm:4
msgid "Select"
msgstr "Вибрати"
#: ui/auth/html-messages.scm:5
msgid "LDAP settings"
msgstr "Налаштування LDAP"
#: ui/auth/html-messages.scm:7
msgid "Reset"
msgstr "Скинути"
#: backend3/auth:7 backend3/template-auth:8
msgid "alterator-auth"
msgstr ""
#: backend3/auth:12
msgid "local"
msgstr "локально"
#: backend3/auth:13
msgid "LDAP"
msgstr "через LDAP"
#: backend3/auth:49
msgid "should be ldap://host or ldapi://host or ldaps://host"
msgstr "має бути ldap://host або ldapi://host або ldaps://host"
#: backend3/template-auth:35
msgid "Authentication schema setup"
msgstr "Налаштування схеми аутентифікації"
#: backend3/template-auth:36
msgid "Users"
msgstr "Користувачі"
alterator-auth-0.3/ui/ 0000755 0000000 0000000 00000000000 11055220376 0014724 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/ui/auth/ 0000755 0000000 0000000 00000000000 11055220376 0015665 5 ustar 00root root 0000000 0000000 alterator-auth-0.3/ui/auth/html-messages.scm 0000644 0000000 0000000 00000000160 11055220376 0021137 0 ustar 00root root 0000000 0000000 (_ "Authentication")
(_ "Select")
(_ "Authentication")
(_ "Select")
(_ "LDAP settings")
(_ "Apply")
(_ "Reset")
alterator-auth-0.3/ui/auth/index.scm 0000644 0000000 0000000 00000005270 11055220376 0017504 0 ustar 00root root 0000000 0000000 (document:surround "/std/base")
(document:insert "/std/functions")
(document:envelop with-translation _ "alterator-auth")
;;; functions
(define *profiles* (make-cell '()))
(define (default-profile current)
(or (list-index (lambda(x) (string=? (car x) current))
(cell-ref *profiles*))
0))
(define (current-profile)
(car (list-ref (cell-ref *profiles*)
(profile-id current))))
(define (view-profile)
(let ((profile-type (current-profile)))
(cond
((string=? profile-type "local")
(local-type visibility #t)
(ldap-type visibility #f))
((string=? profile-type "ldap")
(local-type visibility #f)
(ldap-type visibility #t)))))
(define (write-profile)
(woo-catch/message
(thunk
(let ((profile-type (current-profile)))
(cond
((string=? profile-type "local")
(woo-write "/auth" 'profile profile-type))
((string=? profile-type "ldap")
(woo-write "/auth"
'profile profile-type
'ldap_uri (ldap-uri text)
'ldap_basedn (ldap-basedn text))))))))
;;; UI
margin 10
(gridbox
columns "10;30;50;10"
max-height 30
(spacer)
(label (bold (_ "Auth type")))
(document:id profile-id (combobox rows '("ldap" "local")))
(spacer))
(document:id local-type (vbox (label "")))
(document:id ldap-type
(gridbox columns "10;30;50;10"
(spacer)
(label (bold (_ "LDAP server")))
(document:id ldap-uri (edit "b"))
(spacer)
(spacer)
(label (bold (_ "Base DN")))
(document:id ldap-basedn (edit "d"))
(spacer)))
(vbox (label "")) ;;zerg's spacer
(hbox (document:id apply-button (button (_ "Apply")))
(button (_ "Quit") (when clicked (document:end))))
;;; logic
(document:root (when loaded
(woo-catch/message
(thunk
(apply-button (when clicked (write-profile)))
(let ((avail (woo-list/name+label "/auth/avail_profile"))
(data (woo-read-first "/auth")))
;;additional ldap settings
(ldap-uri text (woo-get-option data 'ldap_uri))
(ldap-basedn text (woo-get-option data 'ldap_basedn))
(cell-set! *profiles* avail)
(profile-id rows (map cdr avail)
current (default-profile (woo-get-option data 'profile))
(when selected (view-profile))
selected))))))