Sisyphus
: 1 2023 | : 18631 | : 37559798
en ru br
ALT
S:0.44.5-alt1
5.1: 0.10-alt2
4.1: 0.6-alt3.M41.4
4.0: 0.3-alt1.M40.2
www.altlinux.org/Changes

:: //
: alterator-auth

                   Gear   Bugs and FR  Repocop 

alterator-auth-0.3/000075500000000000000000000000001105522037600143075ustar00rootroot00000000000000alterator-auth-0.3/Makefile000064400000000000000000000006351105522037600157530ustar00rootroot00000000000000NAME=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/000075500000000000000000000000001105522037600167755ustar00rootroot00000000000000alterator-auth-0.3/applications/auth.desktop000064400000000000000000000003771105522037600213400ustar00rootroot00000000000000[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/000075500000000000000000000000001105522037600157615ustar00rootroot00000000000000alterator-auth-0.3/backend3/auth000075500000000000000000000031371105522037600166540ustar00rootroot00000000000000#!/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-auth000075500000000000000000000010061105522037600204560ustar00rootroot00000000000000#!/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/000075500000000000000000000000001105522037600152375ustar00rootroot00000000000000alterator-auth-0.3/help/ru_RU/000075500000000000000000000000001105522037600162735ustar00rootroot00000000000000alterator-auth-0.3/help/ru_RU/auth.html000064400000000000000000000040731105522037600201260ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Help - ALT Linux Console</title>
<meta http-equiv="content-type" value="text/html;charset=utf-8"/>
</head>
<body>
<h2>PAM</h2>
<p><em>Pluggable Authentication Modules (PAM)</em> &mdash;
механизм, позволяющий тонко настроить схему аутентификации
пользователей в системе. Данный модуль конфигуратора позволяет переключаться между
заранее подготовленными схемами.
</p>
<p>Для традиционной схемы
(&quot;локальная аутентификация&quot;) ничего дополнительно настраивать не
требуется.
</p>
<p>
Для схемы &quot;LDAP&quot; требуется дополнительно заполнить
следующие параметры:
<ul>
<li>
Сервер LDAP &mdash; местоположение сервера и протокол, например, &quot;ldap://localhost.localdomain&quot;.
</li>
<li>
Базовый DN &mdash; точка привязки, например, &quot;dc=example,dc=com&quot;.
</li>
</ul>
При аутентификации по этой схеме сначала происходит попытка
аутентификации пользователя с использованием локальных баз
данных. В случае, если пользователь <strong>не является системным</strong> (то
есть UID больше определённого значения, по умолчанию&nbsp;&mdash; 500) и не прошёл
аутентификацию локально, то делается повторная попытка с
использованием данных из LDAP.
</p>
</body>
</html>
alterator-auth-0.3/help/uk_UA/000075500000000000000000000000001105522037600162435ustar00rootroot00000000000000alterator-auth-0.3/help/uk_UA/auth.html000064400000000000000000000036731105522037600201030ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Help - ALT Linux Console</title>
<meta http-equiv="content-type" value="text/html;charset=utf-8"/>
</head>
<body>
<h2>PAM</h2>
<p><em>Pluggable Authentication Modules (PAM)</em> &mdash;
механізм, що дозволяє тонко налаштувати схему аутентифікації
користувачів у системі. Даний модуль конфігуратора дозволяє перемикатися між
завчасно підготовленими схемами.
</p>
<p>Для традиційної схеми
(&quot;локальна аутентифікація&quot;) нічого додатково налаштовувати не треба.
</p>
<p>
Для схеми &quot;LDAP&quot; треба додатково заповнити наступні параметри:
<ul>
<li>
Сервер LDAP &mdash; адреса сервера та протокол, наприклад, &quot;ldap://localhost.localdomain&quot;.
</li>
<li>
Базовий DN &mdash; точка прив'язування, наприклад, &quot;dc=example,dc=com&quot;.
</li>
</ul>
При аутентифікації за цією схемою спочатку має місце спроба
аутентифікації користувача із використанням локальних баз
даних. Якщо користувач <strong>не є системным</strong> (тобто
UID більше певного значення, типово&nbsp;&mdash; 500) й не пройшов
аутентифікацію локально, то буде зроблено другу спробу із
використанням даних з LDAP.
</p>
</body>
</html>
alterator-auth-0.3/html/000075500000000000000000000000001105522037600152535ustar00rootroot00000000000000alterator-auth-0.3/html/fbi/000075500000000000000000000000001105522037600160135ustar00rootroot00000000000000alterator-auth-0.3/html/fbi/auth-ldap.html000064400000000000000000000020431105522037600205570ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- authentication administration module -->
<html>
<head>
<title>Authentication - ALT Linux Console</title>
</head>
<body>
<h1><span translate="_">Authentication</span></h1>
<form method="POST">
<label for="profile"/>
<select name="profile" optionlist="avail_profile" id="auth-select"/>
<input type="submit" value="Apply" class="btn"/>
</form>
<form method="POST">
<input type="hidden" name="profile"/>
<fieldset>
<legend><span translate="_">LDAP settings</span></legend>
<table>
<tr>
<td><label for="ldap_uri"/></td>
<td><input type="text" class="text" name="ldap_uri"/></td>
</tr>
<tr>
<td><label for="ldap_basedn"/></td>
<td><input type="text" class="text" name="ldap_basedn"/></td>
</tr>
</table>
<input type="submit" value="Apply" class="btn"/>
&nbsp;
<input type="reset" value="Reset" class="btn"/>
</fieldset>
</form>
</body>
</html>
alterator-auth-0.3/html/fbi/auth-local.html000064400000000000000000000011041105522037600207260ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- authentication administration module -->
<html>
<head>
<title>Authentication - ALT Linux Console</title>
</head>
<body>
<h1><span translate="_">Authentication</span></h1>
<form method="POST">
<label for="profile"/>
<select name="profile" optionlist="avail_profile" id="auth-select"/>
<input type="submit" value="Apply" class="btn"/>
</form>
<form method="POST">
<input type="hidden" name="profile"/>
</form>
</body>
</html>
alterator-auth-0.3/po/000075500000000000000000000000001105522037600147255ustar00rootroot00000000000000alterator-auth-0.3/po/alterator-auth.pot000064400000000000000000000031441105522037600204070ustar00rootroot00000000000000# 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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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.po000064400000000000000000000036731105522037600157240ustar00rootroot00000000000000# 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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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.po000064400000000000000000000037131105522037600157100ustar00rootroot00000000000000# 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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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/000075500000000000000000000000001105522037600147245ustar00rootroot00000000000000alterator-auth-0.3/ui/auth/000075500000000000000000000000001105522037600156655ustar00rootroot00000000000000alterator-auth-0.3/ui/auth/html-messages.scm000064400000000000000000000001601105522037600211370ustar00rootroot00000000000000(_ "Authentication")
(_ "Select")
(_ "Authentication")
(_ "Select")
(_ "LDAP settings")
(_ "Apply")
(_ "Reset")
alterator-auth-0.3/ui/auth/index.scm000064400000000000000000000052701105522037600175040ustar00rootroot00000000000000(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))))))
 
: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
: Michael Shigorin