lat-1.2.4/0000755000175000001440000000000012052153536007275 500000000000000lat-1.2.4/install-sh0000755000175000001440000003253711650612734011236 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lat-1.2.4/lat.spec.in0000644000175000001440000000405012052127326011253 00000000000000Name: @PACKAGE@ Version: @VERSION@ Release: 1 Summary: LDAP Administration Tool Group: Applications/System License: GPL URL: https://sourceforge.net/projects/ldap-at/ BuildRoot: %{_tmppath}/%{name}-root BuildArch: noarch Source: https://sourceforge.net/projects/ldap-at/files/LAT/%{name}-%{version}.tar.gz Packager: Loren Bandiera Requires: mono-data Requires: gtk-sharp2 Requires: dbus-sharp Requires: avahi-sharp Requires(post): desktop-file-utils Requires(post): scrollkeeper Requires(postun): desktop-file-utils Requires(postun): scrollkeeper BuildRequires: mono-data BuildRequires: gtk-sharp2 BuildRequires: dbus-sharp BuildRequires: avahi-sharp BuildRequires: gnome-keyring-devel BuildRequires: scrollkeeper %description LAT stands for LDAP Administration Tool. The tool allows you to browse LDAP-based directories and add/edit/delete entries contained within. It can store profiles for quick access to different servers. There are also different views available such as Users, Groups and Hosts which allow you to easily manage objects without having to deal with the intricacies of LDAP. %prep %setup -q %build %configure %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %find_lang %name %clean rm -rf $RPM_BUILD_ROOT %post update-desktop-database &> /dev/null ||: scrollkeeper-update -q -o %{_datadir}/omf/%{name} || : %postun update-desktop-database &> /dev/null ||: scrollkeeper-update -q || : %files -f %{name}.lang %defattr(-, root, root) %doc AUTHORS COPYING ChangeLog NEWS README TODO %{_bindir}/lat %{_libdir}/%{name}/* %{_libdir}/pkgconfig/* %{_mandir}/man1/lat.1.gz %{_datadir}/locale/* %{_datadir}/gnome/help/* %{_datadir}/omf/* %{_datadir}/applications/%{name}.desktop %{_datadir}/application-registry/%{name}.applications %{_datadir}/pixmaps/* %exclude /var/scrollkeeper %changelog * Mon Sep 19 2005 Loren Bandiera - Added depend on mono-data which contains the Novell.Directory.Ldap.dll * Thu Feb 03 2005 Loren Bandiera - Initial RPM release lat-1.2.4/aclocal.m40000644000175000001440000020064712052151447011065 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.ac. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_ac,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 40 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` ] AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' _IT_SUBST(INTLTOOL_DESKTOP_RULE) _IT_SUBST(INTLTOOL_DIRECTORY_RULE) _IT_SUBST(INTLTOOL_KEYS_RULE) _IT_SUBST(INTLTOOL_PROP_RULE) _IT_SUBST(INTLTOOL_OAF_RULE) _IT_SUBST(INTLTOOL_PONG_RULE) _IT_SUBST(INTLTOOL_SERVER_RULE) _IT_SUBST(INTLTOOL_SHEET_RULE) _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) _IT_SUBST(INTLTOOL_UI_RULE) _IT_SUBST(INTLTOOL_XAM_RULE) _IT_SUBST(INTLTOOL_KBD_RULE) _IT_SUBST(INTLTOOL_XML_RULE) _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) _IT_SUBST(INTLTOOL_CAVES_RULE) _IT_SUBST(INTLTOOL_SCHEMAS_RULE) _IT_SUBST(INTLTOOL_THEME_RULE) _IT_SUBST(INTLTOOL_SERVICE_RULE) _IT_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found]) fi AC_MSG_CHECKING([for perl >= 5.8.1]) $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_ERROR([perl 5.8.1 is required for intltool]) else IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" AC_MSG_RESULT([$IT_PERL_VERSION]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) # Set DATADIRNAME correctly if it is not set yet # (copied from glib-gettext.m4) if test -z "$DATADIRNAME"; then AC_LINK_IFELSE( [AC_LANG_PROGRAM([[]], [[extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr]])], [DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share dnl in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [DATADIRNAME=share], [DATADIRNAME=lib]) ;; *) [DATADIRNAME=lib] ;; esac]) fi AC_SUBST(DATADIRNAME) IT_PO_SUBDIR([po]) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # _IT_SUBST(VARIABLE) # ------------------- # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST # AC_DEFUN([_IT_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR lat-1.2.4/Makefile.in0000644000175000001440000005502712052151451011265 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/lat.spec.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO install-sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = lat.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = gnome-keyring-glue network-manager lat po desktop \ resources help DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @BUILD_NETWORKMANAGER_FALSE@NM_DIR = @BUILD_NETWORKMANAGER_TRUE@NM_DIR = network-manager SUBDIRS = gnome-keyring-glue $(NM_DIR) lat po desktop resources help EXTRA_DIST = \ README \ COPYING \ COPYING-DOCS \ AUTHORS \ ChangeLog \ INSTALL \ NEWS \ TODO \ lat.spec.in \ lat.spec \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ omf.make \ xmldocs.make DISTCLEANFILES = \ intltool-extract \ intltool-merge \ intltool-update distuninstallcheck_listfiles = \ find -path ./var/scrollkeeper/\* -prune -or -type f -print \ find -path $(prefix)/var/scrollkeeper/\* -prune -or -type f -print all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): lat.spec: $(top_builddir)/config.status $(srcdir)/lat.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/omf.make0000644000175000001440000000435011650607104010635 00000000000000# # No modifications of this Makefile should be necessary. # # This file contains the build instructions for installing OMF files. It is # generally called from the makefiles for particular formats of documentation. # # Note that you must configure your package with --localstatedir=/var # so that the scrollkeeper-update command below will update the database # in the standard scrollkeeper directory. # # If it is impossible to configure with --localstatedir=/var, then # modify the definition of scrollkeeper_localstate_dir so that # it points to the correct location. Note that you must still use # $(localstatedir) in this or when people build RPMs it will update # the real database on their system instead of the one under RPM_BUILD_ROOT. # # Note: This make file is not incorporated into xmldocs.make because, in # general, there will be other documents install besides XML documents # and the makefiles for these formats should also include this file. # # About this file: # This file was derived from scrollkeeper_example2, a package # illustrating how to install documentation and OMF files for use with # ScrollKeeper 0.3.x and 0.4.x. For more information, see: # http://scrollkeeper.sourceforge.net/ # Version: 0.1.3 (last updated: March 20, 2002) # omf_dest_dir=$(datadir)/omf/@PACKAGE@ scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper # At some point, it may be wise to change to something like this: # scrollkeeper_localstate_dir = @SCROLLKEEPER_STATEDIR@ omf: omf_timestamp omf_timestamp: $(omffile) -for file in $(omffile); do \ scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \ done; \ touch omf_timestamp install-data-hook-omf: $(mkinstalldirs) $(DESTDIR)$(omf_dest_dir) for file in $(omffile); do \ $(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \ done -scrollkeeper-update -p $(DESTDIR)$(scrollkeeper_localstate_dir) -o $(DESTDIR)$(omf_dest_dir) uninstall-local-omf: -for file in $(srcdir)/*.omf; do \ basefile=`basename $$file`; \ rm -f $(DESTDIR)$(omf_dest_dir)/$$basefile; \ done -rmdir $(DESTDIR)$(omf_dest_dir) -scrollkeeper-update -p $(DESTDIR)$(scrollkeeper_localstate_dir) clean-local-omf: -for file in $(omffile); do \ rm -f $$file.out; \ done lat-1.2.4/NEWS0000644000175000001440000000000011702646352007706 00000000000000lat-1.2.4/mkinstalldirs0000755000175000001440000000672211704514465012037 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: lat-1.2.4/lat/0000755000175000001440000000000012052153537010056 500000000000000lat-1.2.4/lat/ViewDialog.cs0000644000175000001440000000322311702646352012362 00000000000000// // lat - ViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Gtk; using Novell.Directory.Ldap; namespace lat { public class ViewDialog { protected Connection conn; protected Gtk.Dialog viewDialog; protected bool missingValues = false; protected bool errorOccured = false; protected string defaultNewContainer = null; public ViewDialog (Connection connection, string newContainer) { conn = connection; defaultNewContainer = newContainer; } public void missingAlert (string[] missing) { string msg = String.Format ( Mono.Unix.Catalog.GetString ("You must provide values for the following attributes:\n\n")); foreach (string m in missing) msg += String.Format ("{0}\n", m); HIGMessageDialog dialog = new HIGMessageDialog ( viewDialog, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, "Attributes missing", msg); dialog.Run (); dialog.Destroy (); } } } lat-1.2.4/lat/NewEntryDialog.cs0000644000175000001440000000463511702646352013233 00000000000000// // lat - NewEntryDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using Novell.Directory.Ldap; namespace lat { public class NewEntryDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newEntryDialog; [Glade.Widget] Gtk.HBox comboHBox; [Glade.Widget] Gtk.RadioButton templateRadioButton; [Glade.Widget] Gtk.RadioButton entryRadioButton; Connection conn; ComboBox templateComboBox; string _dn; public NewEntryDialog (Connection connection, string dn) { conn = connection; _dn = dn; ui = new Glade.XML (null, "lat.glade", "newEntryDialog", null); ui.Autoconnect (this); entryRadioButton.Label += String.Format ("\n({0})", _dn); createCombos (); newEntryDialog.Icon = Global.latIcon; newEntryDialog.Run (); newEntryDialog.Destroy (); } private void createCombos () { templateComboBox = ComboBox.NewText (); string[] templates = Global.Templates.GetTemplateNames (); foreach (string s in templates) templateComboBox.AppendText (s); templateComboBox.Active = 0; templateComboBox.Show (); comboHBox.PackStart (templateComboBox, true, true, 0); } public void OnOkClicked (object o, EventArgs args) { if (templateRadioButton.Active) { TreeIter iter; if (!templateComboBox.GetActiveIter (out iter)) return; string name = (string) templateComboBox.Model.GetValue (iter, 0); Template t = Global.Templates.Lookup (name); new CreateEntryDialog (conn, t); } else { if (_dn == conn.Settings.Host) return; new CreateEntryDialog (conn, conn.Data.GetEntry (_dn)); } newEntryDialog.HideAll (); } public void OnCancelClicked (object o, EventArgs args) { newEntryDialog.HideAll (); } } } lat-1.2.4/lat/LDIF.cs0000644000175000001440000000742711702646352011060 00000000000000// // lat - LDIF.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using System.IO; using Novell.Directory.Ldap; namespace lat { public class LDIF { LdapEntry _le = null; Connection conn = null; int _numEntries = 0; public LDIF (Connection connection) { conn = connection; } public LDIF (LdapEntry le) { this._le = le; } public string Export () { string retVal = null; if (_le == null) return retVal; retVal = String.Format ("dn: {0}\n", _le.DN); LdapAttributeSet las = _le.getAttributeSet (); foreach (LdapAttribute attr in las) { // FIXME: handle binary value exports; see Base64.IsLDIFSafe (attributeValue) // SupportClass.ToByteArray(attributeValue); // Base64.encode(SupportClass.ToSByteArray(byte[] from above) try { foreach (string v in attr.StringValueArray) { string tmp = v.Replace ("\n", "\n "); retVal += String.Format ("{0}: {1}\n", attr.Name, tmp.Trim()); } } catch {} } return retVal; } public void createEntry (Dictionary ldap_info) { LdapAttribute dnAttr = ldap_info["dn"]; string dn = dnAttr.StringValue.Trim(); List attrList = new List (); foreach (KeyValuePair kvp in ldap_info) { if (!kvp.Value.Name.Equals ("dn")) attrList.Add (kvp.Value); } try { conn.Data.Add (dn, attrList); _numEntries++; } catch {} } void ldifParse (Dictionary ldap_info, string buf) { char[] delim = {':'}; string[] pairs = buf.Split (delim, 2); if (!ldap_info.ContainsKey (pairs[0])) { LdapAttribute attr = new LdapAttribute (pairs[0], pairs[1].Trim()); ldap_info.Add (pairs[0], attr); } else { LdapAttribute attr = ldap_info[pairs[0]]; List newValues = new List (); newValues.Add (pairs[1].Trim()); foreach (string v in attr.StringValueArray) newValues.Add (v); LdapAttribute newAttr = new LdapAttribute (pairs[0], newValues.ToArray ()); ldap_info.Remove (pairs[0]); ldap_info.Add (pairs[0], newAttr); } } void readEntry (string dn, TextReader tr) { string line = null; Dictionary ldapInfo = new Dictionary (); ldifParse (ldapInfo, dn); try { while ((line = tr.ReadLine()) != null) { if (line.Equals ("")) break; ldifParse (ldapInfo, line); } createEntry (ldapInfo); } catch {} } public int Import (Uri uri) { string line = null; try { StreamReader sr = new StreamReader (uri.LocalPath); while ((line = sr.ReadLine()) != null) { if (line.StartsWith ("dn:")) readEntry (line, sr); } return _numEntries; } catch { return 0; } } public int Import (string textBuffer) { string line = null; try { StringReader sr = new StringReader (textBuffer); while ((line = sr.ReadLine()) != null) { if (line.StartsWith ("dn:")) readEntry (line, sr); } return _numEntries; } catch { return 0; } } } } lat-1.2.4/lat/SchemaTreeView.cs0000644000175000001440000001761611702646352013216 00000000000000// // lat - SchemaTreeView.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Utilclass; namespace lat { public class schemaSelectedEventArgs : EventArgs { string _name; string _parent; string _server; public schemaSelectedEventArgs (string name, string parent, string server) { _name = name; _parent = parent; _server = server; } public string Name { get { return _name; } } public string Parent { get { return _parent; } } public string Server { get { return _server; } } } public delegate void schemaSelectedHandler (object o, schemaSelectedEventArgs args); public class SchemaTreeView : Gtk.TreeView { Gtk.Window parentWindow; TreeStore schemaStore; TreeIter rootIter; enum TreeCols { Icon, ObjectName }; public event schemaSelectedHandler schemaSelected; public SchemaTreeView (Gtk.Window parent) : base () { parentWindow = parent; schemaStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string)); this.Model = schemaStore; this.HeadersVisible = false; this.RowActivated += new RowActivatedHandler (OnRowActivated); this.RowExpanded += new RowExpandedHandler (OnRowExpanded); this.AppendColumn ("icon", new CellRendererPixbuf (), "pixbuf", (int)TreeCols.Icon); this.AppendColumn ("ldapRoot", new CellRendererText (), "text", (int)TreeCols.ObjectName); Gdk.Pixbuf dirIcon = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server.png"); Gdk.Pixbuf folderIcon = Gdk.Pixbuf.LoadFromResource ("x-directory-normal.png"); rootIter = schemaStore.AppendValues (dirIcon, "Servers"); foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = schemaStore.AppendValues (rootIter, dirIcon, n); TreeIter objIter; TreeIter attrIter; TreeIter matIter; TreeIter synIter; objIter = schemaStore.AppendValues (iter, folderIcon, "Object Classes"); schemaStore.AppendValues (objIter, null, ""); attrIter = schemaStore.AppendValues (iter, folderIcon, "Attribute Types"); schemaStore.AppendValues (attrIter, null, ""); matIter = schemaStore.AppendValues (iter, folderIcon, "Matching Rules"); schemaStore.AppendValues (matIter, null, ""); synIter = schemaStore.AppendValues (iter, folderIcon, "LDAP Syntaxes"); schemaStore.AppendValues (synIter, null, ""); } TreePath path = schemaStore.GetPath (rootIter); this.ExpandRow (path, false); this.ShowAll (); } public void Refresh () { schemaStore.Clear (); Gdk.Pixbuf dirIcon = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server.png"); Gdk.Pixbuf folderIcon = Gdk.Pixbuf.LoadFromResource ("x-directory-normal.png"); rootIter = schemaStore.AppendValues (dirIcon, "Servers"); TreePath path = schemaStore.GetPath (rootIter); foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = schemaStore.AppendValues (rootIter, dirIcon, n); TreeIter objIter; TreeIter attrIter; TreeIter matIter; TreeIter synIter; objIter = schemaStore.AppendValues (iter, folderIcon, "Object Classes"); schemaStore.AppendValues (objIter, null, ""); attrIter = schemaStore.AppendValues (iter, folderIcon, "Attribute Types"); schemaStore.AppendValues (attrIter, null, ""); matIter = schemaStore.AppendValues (iter, folderIcon, "Matching Rules"); schemaStore.AppendValues (matIter, null, ""); synIter = schemaStore.AppendValues (iter, folderIcon, "LDAP Syntaxes"); schemaStore.AppendValues (synIter, null, ""); } this.ExpandRow (path, false); } public void AddConnection (string name) { Gdk.Pixbuf dirIcon = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server.png"); TreeIter iter = schemaStore.AppendValues (rootIter, dirIcon, name); schemaStore.AppendValues (iter, null, ""); } void DispatchDNSelectedEvent (string name, string parent, string server) { if (schemaSelected != null) schemaSelected (this, new schemaSelectedEventArgs (name, parent, server)); } void OnRowActivated (object o, RowActivatedArgs args) { TreePath path = args.Path; TreeIter iter; if (schemaStore.GetIter (out iter, path)) { string name = null; name = (string) schemaStore.GetValue (iter, (int)TreeCols.ObjectName); TreeIter parent; schemaStore.IterParent (out parent, iter); string parentName = (string) schemaStore.GetValue (parent, (int)TreeCols.ObjectName); string serverName = FindServerName (iter, schemaStore); if (name.Equals (serverName)) { DispatchDNSelectedEvent (name, parentName, serverName); return; } DispatchDNSelectedEvent (name, parentName, serverName); } } string[] GetChildren (string parentName, Connection conn) { string[] childValues = null; switch (parentName) { case "Object Classes": childValues = conn.Data.ObjectClasses; break; case "Attribute Types": childValues = conn.Data.GetAttributeTypes (); break; case "Matching Rules": childValues = conn.Data.GetMatchingRules (); break; case "LDAP Syntaxes": childValues = conn.Data.GetLdapSyntaxes (); break; default: break; } return childValues; } public string GetActiveServerName () { TreeModel model; TreeIter iter; if (this.Selection.GetSelected (out model, out iter)) return FindServerName (iter, model); return null; } string FindServerName (TreeIter iter, TreeModel model) { TreeIter parent; schemaStore.IterParent (out parent, iter); if (!schemaStore.IterIsValid (parent)) return null; string parentName = (string)model.GetValue (parent, (int)TreeCols.ObjectName); if (parentName == "Servers") return (string)model.GetValue (iter, (int)TreeCols.ObjectName); return FindServerName (parent, model); } void OnRowExpanded (object o, RowExpandedArgs args) { string name = null; name = (string) schemaStore.GetValue (args.Iter, (int)TreeCols.ObjectName); if (name == "Servers") return; TreeIter child; schemaStore.IterChildren (out child, args.Iter); string childName = (string) schemaStore.GetValue (child, (int)TreeCols.ObjectName); if (childName != "") return; schemaStore.Remove (ref child); Log.Debug ("Row expanded {0}", name); string serverName = FindServerName (args.Iter, schemaStore); Connection conn = Global.Connections [serverName]; try { Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("text-x-generic.png"); string[] kids = GetChildren (name, conn); foreach (string s in kids) { schemaStore.AppendValues (args.Iter, pb, s); } TreePath path = schemaStore.GetPath (args.Iter); this.ExpandRow (path, false); } catch (Exception e) { schemaStore.AppendValues (args.Iter, null, ""); Log.Debug (e); string msg = Mono.Unix.Catalog.GetString ( "Unable to read schema information from server"); HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Server error", msg); dialog.Run (); dialog.Destroy (); } } } } lat-1.2.4/lat/Defines.cs.in0000644000175000001440000000213111702646352012307 00000000000000// // lat - Defines.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Xml; namespace lat { public struct Defines { public static string PACKAGE = "@PACKAGE@"; public static string VERSION = "@VERSION@"; public static string LOCALE_DIR = "@prefix@/share/locale"; public static string SYS_PLUGIN_DIR = "@prefix@/lib/lat/plugins"; } } lat-1.2.4/lat/lat.in0000644000175000001440000000007411702646352011112 00000000000000#!/bin/sh @MONO@ @MONO_FLAGS@ @prefix@/lib/lat/lat.exe "$@" lat-1.2.4/lat/CreateEntryDialog.cs0000644000175000001440000001271012052122166013665 00000000000000// // lat - CreateEntryDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Novell.Directory.Ldap; using Gtk; namespace lat { public class CreateEntryDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog createEntryDialog; [Glade.Widget] Gtk.Entry rdnEntry; [Glade.Widget] Gtk.Button browseButton; [Glade.Widget] Gtk.TreeView attrTreeView; Connection conn; ListStore attrListStore; List _objectClass; LdapAttribute objAttr = null; Template t; bool isTemplate = false; bool errorOccured = false; public CreateEntryDialog (Connection connection, Template theTemplate) { if (connection == null) throw new ArgumentNullException("connection"); if (theTemplate == null) throw new ArgumentNullException("theTemplate"); conn = connection; t = theTemplate; isTemplate = true; Init (); foreach (string s in t.Classes) { attrListStore.AppendValues ("objectClass", s, "Optional"); _objectClass.Add (s); } showAttributes (); createEntryDialog.Icon = Global.latIcon; createEntryDialog.Run (); createEntryDialog.Run (); createEntryDialog.Destroy (); } public CreateEntryDialog (Connection connection, LdapEntry le) { if (connection == null) throw new ArgumentNullException("connection"); if (le == null) throw new ArgumentNullException("le"); conn = connection; Init (); LdapAttribute la = le.getAttribute ("objectClass"); foreach (string s in la.StringValueArray) { attrListStore.AppendValues ("objectClass", s, "Optional"); _objectClass.Add (s); } showAttributes (); createEntryDialog.Run (); while (errorOccured) createEntryDialog.Run (); createEntryDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "lat.glade", "createEntryDialog", null); ui.Autoconnect (this); _objectClass = new List (); setupTreeViews (); browseButton.Label = conn.DirectoryRoot; createEntryDialog.Resize (320, 200); } void insertValues (string[] values, string valueType) { foreach (string s in values) { if (s == "objectClass") continue; if (isTemplate) attrListStore.AppendValues (s, t.GetAttributeDefaultValue (s), valueType); else attrListStore.AppendValues (s, "", valueType); } } void showAttributes () { string[] required, optional; conn.Data.GetAllAttributes (_objectClass, out required, out optional); insertValues (required, "Required"); insertValues (optional, "Optional"); } void setupTreeViews () { // Attributes attrListStore = new ListStore (typeof (string), typeof (string), typeof (string)); attrTreeView.Model = attrListStore; TreeViewColumn col; col = attrTreeView.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; CellRendererText cell = new CellRendererText (); cell.Editable = true; cell.Edited += new EditedHandler (OnAttributeEdit); col = attrTreeView.AppendColumn ("Value", cell, "text", 1); col.SortColumnId = 1; col = attrTreeView.AppendColumn ("Type", new CellRendererText (), "text", 2); col.SortColumnId = 2; attrListStore.SetSortColumnId (0, SortType.Ascending); } void OnAttributeEdit (object o, EditedArgs args) { TreeIter iter; if (!attrListStore.GetIterFromString (out iter, args.Path)) return; attrListStore.SetValue (iter, 1, args.NewText); } public void OnBrowseClicked (object o, EventArgs args) { SelectContainerDialog scd = new SelectContainerDialog (conn, createEntryDialog); scd.Message = String.Format ( Mono.Unix.Catalog.GetString ( "Where in the directory would\nyou like to save the entry?")); scd.Title = Mono.Unix.Catalog.GetString ("Select entry base"); scd.Run (); if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host)) browseButton.Label = scd.DN; } public void OnOkClicked (object o, EventArgs args) { string dn = String.Format ("{0},{1}", rdnEntry.Text, browseButton.Label); LdapAttributeSet lset = new LdapAttributeSet (); foreach (object[] row in attrListStore) { string n = (string) row[0]; string v = (string) row[1]; if (n == null || v == null || v == "") continue; if (n.ToLower() == "objectclass") { if (objAttr == null) objAttr = new LdapAttribute (n, v); else objAttr.addValue (v); } else { LdapAttribute attr = new LdapAttribute (n, v); lset.Add (attr); } } lset.Add (objAttr); LdapEntry entry = new LdapEntry (dn, lset); if (!Util.AddEntry (conn, entry)) errorOccured = true; else errorOccured = false; } public void OnCancelClicked (object o, EventArgs args) { errorOccured = false; createEntryDialog.HideAll (); } } } lat-1.2.4/lat/plugins/0000755000175000001440000000000012052153537011537 500000000000000lat-1.2.4/lat/plugins/PasswordAttributeViewer/0000755000175000001440000000000012052153537016407 500000000000000lat-1.2.4/lat/plugins/PasswordAttributeViewer/Makefile.in0000644000175000001440000003121112052151450020362 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat/plugins/PasswordAttributeViewer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(ASSEMBLYlibdir)" DATA = $(ASSEMBLYlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = PasswordAttributeViewer CSFILES = \ PasswordAttributeViewer.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) @BUILD_AVAHI_TRUE@AVAHI_REFERENCES = $(AVAHI_LIBS) @BUILD_NETWORKMANAGER_TRUE@NM_REFERENCES = \ @BUILD_NETWORKMANAGER_TRUE@ $(top_builddir)/network-manager/network-manager.dll REFERENCES = \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/plugins/PasswordAttributeViewer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/plugins/PasswordAttributeViewer/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-ASSEMBLYlibDATA: $(ASSEMBLYlib_DATA) @$(NORMAL_INSTALL) test -z "$(ASSEMBLYlibdir)" || $(MKDIR_P) "$(DESTDIR)$(ASSEMBLYlibdir)" @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ASSEMBLYlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ASSEMBLYlibdir)" || exit $$?; \ done uninstall-ASSEMBLYlibDATA: @$(NORMAL_UNINSTALL) @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ASSEMBLYlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ASSEMBLYlibdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ASSEMBLYlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ASSEMBLYlibDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ASSEMBLYlibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-ASSEMBLYlibDATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-ASSEMBLYlibDATA \ uninstall-am $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/plugins/PasswordAttributeViewer/Makefile.am0000644000175000001440000000140511702646352020366 00000000000000CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = PasswordAttributeViewer CSFILES = \ PasswordAttributeViewer.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) if BUILD_AVAHI AVAHI_REFERENCES = $(AVAHI_LIBS) endif if BUILD_NETWORKMANAGER NM_REFERENCES = \ $(top_builddir)/network-manager/network-manager.dll endif REFERENCES = \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb lat-1.2.4/lat/plugins/PasswordAttributeViewer/PasswordAttributeViewer.cs0000644000175000001440000000457311702646352023542 00000000000000// // lat - PasswordAttributeViewer.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; namespace lat { public class PassswordAttributeViewPlugin : AttributeViewPlugin { string passwordData = null; public PassswordAttributeViewPlugin () : base () { } public override void OnActivate (string attributeName, string attributeData) { passwordData = null; PasswordDialog pd = new PasswordDialog (); if (pd.UnixPassword == null) return; switch (attributeName.ToLower()) { case "userpassword": passwordData = pd.UnixPassword; break; case "sambalmpassword": passwordData = pd.LMPassword; break; case "sambantpassword": passwordData = pd.NTPassword; break; default: break; } } public override void OnActivate (string attributeName, byte[] attributeData) { } public override ViewerDataType DataType { get { return ViewerDataType.String; } } public override string[] AttributeNames { get { return new string[] { "userPassword", "sambaLMPassword", "sambaNTPassword" }; } } public override string StringValue { get { return passwordData; } } public override byte[] ByteValue { get { return null; } } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "Password Attribute Viewer"; } } public override string Name { get { return "Password Attribute Viewer"; } } public override string Version { get { return Defines.VERSION; } } } }lat-1.2.4/lat/plugins/Makefile.in0000644000175000001440000004161212052151450013520 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat/plugins DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ PosixCoreViews \ ActiveDirectoryCoreViews \ JpegAttributeViewer \ PasswordAttributeViewer all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/plugins/Makefile.am0000644000175000001440000000015211702646352013514 00000000000000SUBDIRS = \ PosixCoreViews \ ActiveDirectoryCoreViews \ JpegAttributeViewer \ PasswordAttributeViewer lat-1.2.4/lat/plugins/JpegAttributeViewer/0000755000175000001440000000000012052153537015472 500000000000000lat-1.2.4/lat/plugins/JpegAttributeViewer/Makefile.in0000644000175000001440000003136012052151450017452 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat/plugins/JpegAttributeViewer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(ASSEMBLYlibdir)" DATA = $(ASSEMBLYlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = JpegAttributeViewer CSFILES = \ JpegAttributeViewer.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) @BUILD_AVAHI_TRUE@AVAHI_REFERENCES = $(AVAHI_LIBS) @BUILD_NETWORKMANAGER_TRUE@NM_REFERENCES = \ @BUILD_NETWORKMANAGER_TRUE@ $(top_builddir)/network-manager/network-manager.dll REFERENCES = \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialog.glade RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialog.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/plugins/JpegAttributeViewer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/plugins/JpegAttributeViewer/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-ASSEMBLYlibDATA: $(ASSEMBLYlib_DATA) @$(NORMAL_INSTALL) test -z "$(ASSEMBLYlibdir)" || $(MKDIR_P) "$(DESTDIR)$(ASSEMBLYlibdir)" @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ASSEMBLYlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ASSEMBLYlibdir)" || exit $$?; \ done uninstall-ASSEMBLYlibDATA: @$(NORMAL_UNINSTALL) @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ASSEMBLYlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ASSEMBLYlibdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ASSEMBLYlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ASSEMBLYlibDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ASSEMBLYlibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-ASSEMBLYlibDATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-ASSEMBLYlibDATA \ uninstall-am $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/plugins/JpegAttributeViewer/Makefile.am0000644000175000001440000000157111702646352017455 00000000000000CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = JpegAttributeViewer CSFILES = \ JpegAttributeViewer.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) if BUILD_AVAHI AVAHI_REFERENCES = $(AVAHI_LIBS) endif if BUILD_NETWORKMANAGER NM_REFERENCES = \ $(top_builddir)/network-manager/network-manager.dll endif REFERENCES = \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialog.glade RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialog.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb lat-1.2.4/lat/plugins/JpegAttributeViewer/JpegAttributeViewer.cs0000644000175000001440000000766011702646352021710 00000000000000// // lat - JpegAttributeViewer.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.IO; using Gtk; using Gdk; namespace lat { public class JpegAttributeViewPlugin : AttributeViewPlugin { byte[] jpegData = null; public JpegAttributeViewPlugin () : base () { } public override void OnActivate (string attributeName, string attributeData) { } public override void OnActivate (string attributeName, byte[] attributeData) { jpegData = null; ViewerDialog vd = new ViewerDialog (attributeData); jpegData = vd.RawFileBytes; } public override ViewerDataType DataType { get { return ViewerDataType.Binary; } } public override string StringValue { get { return null; } } public override byte[] ByteValue { get { return jpegData; } } public override string[] AttributeNames { get { return new string[] { "jpegPhoto"}; } } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "JPEG Attribute Viewer"; } } public override string Name { get { return "JPEG Attribute Viewer"; } } public override string Version { get { return Defines.VERSION; } } } public class ViewerDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog jpegAttributeViewDialog; [Glade.Widget] Gtk.Image jpegImage; [Glade.Widget] Gtk.Entry filenameEntry; byte[] rawBytes = null; public ViewerDialog (byte[] imageData) { ui = new Glade.XML (null, "dialog.glade", "jpegAttributeViewDialog", null); ui.Autoconnect (this); if (imageData != null) { try { Gdk.Pixbuf pb = new Gdk.Pixbuf (imageData); jpegImage.Pixbuf = pb; } catch {} } jpegAttributeViewDialog.Resize (300, 400); jpegAttributeViewDialog.Run (); jpegAttributeViewDialog.Destroy (); } public void OnBrowseClicked (object o, EventArgs args) { FileChooserDialog fcd = new FileChooserDialog ( "Choose an image", Gtk.Stock.Open, null, FileChooserAction.Open); fcd.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel); fcd.AddButton (Gtk.Stock.Open, ResponseType.Ok); fcd.SelectMultiple = false; ResponseType response = (ResponseType) fcd.Run(); if (response == ResponseType.Ok) { filenameEntry.Text = fcd.Filename; try { Gdk.Pixbuf pb = new Gdk.Pixbuf (fcd.Filename); jpegImage.Pixbuf = pb; } catch {} } fcd.Destroy(); } static byte[] ReadFile (Stream stream) { byte[] buffer = new byte[32768]; using (MemoryStream ms = new MemoryStream()) { while (true) { int read = stream.Read (buffer, 0, buffer.Length); if (read <= 0) return ms.ToArray(); ms.Write (buffer, 0, read); } } } public void OnOkClicked (object o, EventArgs args) { if (filenameEntry.Text == null || filenameEntry.Text == "") return; try { FileStream fs = File.OpenRead(filenameEntry.Text); rawBytes = ReadFile (fs); } catch (Exception e) { Log.Debug (e.ToString()); } } public byte[] RawFileBytes { get { return rawBytes; } } } }lat-1.2.4/lat/plugins/JpegAttributeViewer/dialog.glade0000644000175000001440000002704711702646352017664 00000000000000 True JPEG Photo GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False False True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True <b>Current image:</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 10 False False True False 0 True 0.5 0.5 0 0 10 True True 0 True True True False 0 True <b>Set a new image:</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 10 False False 0 True True True False 0 True Filename: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Browse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 False False 10 False False lat-1.2.4/lat/plugins/PosixCoreViews/0000755000175000001440000000000012052153537014470 500000000000000lat-1.2.4/lat/plugins/PosixCoreViews/PosixContactsViewPlugin.cs0000644000175000001440000000453611702646352021565 00000000000000// // lat - PosixContactsViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class PosixContactsViewPlugin : ViewPlugin { public PosixContactsViewPlugin () : base () { config.ColumnAttributes = new string[] { "cn", "mail", "telephoneNumber", "homePhone", "mobile" }; config.ColumnNames = new string[] { "Name", "Email", "Work", "Home", "Mobile" }; config.Filter = "(objectClass=inetOrgPerson)"; } public override void Init () { } public override void OnAddEntry (Connection conn) { new NewContactsViewDialog (conn, this.DefaultNewContainer); } public override void OnEditEntry (Connection conn, LdapEntry le) { new EditContactsViewDialog (conn, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "POSIX Contact View"; } } public override string Name { get { return "Contacts"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "Contact"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_2, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("contact-new.png"); } } } }lat-1.2.4/lat/plugins/PosixCoreViews/Makefile.in0000644000175000001440000003256512052151450016460 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat/plugins/PosixCoreViews DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(ASSEMBLYlibdir)" DATA = $(ASSEMBLYlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = PosixCoreViews CSFILES = \ EditContactsViewDialog.cs \ EditUserViewDialog.cs \ GroupsViewDialog.cs \ HostsViewDialog.cs \ NewContactsViewDialog.cs \ NewUserViewDialog.cs \ PosixComputerViewPlugin.cs \ PosixContactsViewPlugin.cs \ PosixGroupViewPlugin.cs \ PosixUserViewPlugin.cs \ UserDefaultValuesDialog.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) @BUILD_AVAHI_TRUE@AVAHI_REFERENCES = $(AVAHI_LIBS) @BUILD_NETWORKMANAGER_TRUE@NM_REFERENCES = \ @BUILD_NETWORKMANAGER_TRUE@ $(top_builddir)/network-manager/network-manager.dll REFERENCES = \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialogs.glade \ $(top_srcdir)/resources/contact-new-48x48.png \ $(top_srcdir)/resources/x-directory-remote-server-48x48.png \ $(top_srcdir)/resources/x-directory-remote-workgroup.png \ $(top_srcdir)/resources/contact-new.png \ $(top_srcdir)/resources/users.png \ $(top_srcdir)/resources/locked16x16.png \ $(top_srcdir)/resources/stock_person.png RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialogs.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/plugins/PosixCoreViews/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/plugins/PosixCoreViews/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-ASSEMBLYlibDATA: $(ASSEMBLYlib_DATA) @$(NORMAL_INSTALL) test -z "$(ASSEMBLYlibdir)" || $(MKDIR_P) "$(DESTDIR)$(ASSEMBLYlibdir)" @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ASSEMBLYlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ASSEMBLYlibdir)" || exit $$?; \ done uninstall-ASSEMBLYlibDATA: @$(NORMAL_UNINSTALL) @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ASSEMBLYlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ASSEMBLYlibdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ASSEMBLYlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ASSEMBLYlibDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ASSEMBLYlibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-ASSEMBLYlibDATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-ASSEMBLYlibDATA \ uninstall-am $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/plugins/PosixCoreViews/PosixComputerViewPlugin.cs0000644000175000001440000000451111702646352021576 00000000000000// // lat - PosixComputerViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class PosixComputerViewPlugin : ViewPlugin { public PosixComputerViewPlugin () : base () { config.ColumnAttributes = new string[] { "cn", "ipHostNumber", "description" }; config.ColumnNames = new string[] { "Hostname", "IP Address", "Description" }; config.Filter = "(objectclass=ipHost)"; } public override void Init () { } public override void OnAddEntry (Connection conn) { new HostsViewDialog (conn, this.DefaultNewContainer); } public override void OnEditEntry (Connection conn, LdapEntry le) { new HostsViewDialog (conn, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "POSIX Computer View"; } } public override string Name { get { return "Computers"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "Computer"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_1, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("x-directory-remote-workgroup.png"); } } } }lat-1.2.4/lat/plugins/PosixCoreViews/PosixGroupViewPlugin.cs0000644000175000001440000000442411702646352021077 00000000000000// // lat - PosixGroupViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class PosixGroupViewPlugin : ViewPlugin { public PosixGroupViewPlugin () : base () { config.ColumnAttributes = new string[] { "gidNumber", "cn", "description" }; config.ColumnNames = new string[] { "Group ID", "Name", "Description" }; config.Filter = "(objectclass=posixGroup)"; } public override void Init () { } public override void OnAddEntry (Connection conn) { new GroupsViewDialog (conn, this.DefaultNewContainer); } public override void OnEditEntry (Connection conn, LdapEntry le) { new GroupsViewDialog (conn, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "POSIX Group View"; } } public override string Name { get { return "Groups"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "Group"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_3, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("users.png"); } } } }lat-1.2.4/lat/plugins/PosixCoreViews/PosixUserViewPlugin.cs0000644000175000001440000000473311702646352020724 00000000000000// // lat - PosixUserViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class PosixUserViewPlugin : ViewPlugin { public PosixUserViewPlugin () : base () { config.ColumnAttributes = new string[] { "uid", "cn" }; config.ColumnNames = new string[] { "Username", "Real name" }; config.Filter = "(&(objectclass=posixAccount)(objectclass=shadowAccount))"; } public override void Init () { } public override void OnAddEntry (Connection conn) { new NewUserViewDialog (conn, this.DefaultNewContainer, this.PluginConfiguration.Defaults); } public override void OnEditEntry (Connection conn, LdapEntry le) { new EditUserViewDialog (conn, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { new UserDefaultValuesDialog (this, conn); Log.Debug ("this.PluginConfiguration.Defaults.Count: {0}", this.PluginConfiguration.Defaults.Count); } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "POSIX User View"; } } public override string Name { get { return "Users"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "User"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_4, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("stock_person.png"); } } } }lat-1.2.4/lat/plugins/PosixCoreViews/EditContactsViewDialog.cs0000644000175000001440000001614111702646352021304 00000000000000// // lat - EditContactsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class EditContactsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog editContactDialog; [Glade.Widget] Gtk.Label gnNameLabel; [Glade.Widget] Gtk.Entry gnFirstNameEntry; [Glade.Widget] Gtk.Entry gnInitialsEntry; [Glade.Widget] Gtk.Entry gnLastNameEntry; [Glade.Widget] Gtk.Entry gnDisplayName; [Glade.Widget] Gtk.Entry gnDescriptionEntry; [Glade.Widget] Gtk.Entry gnOfficeEntry; [Glade.Widget] Gtk.Entry gnTelephoneNumberEntry; [Glade.Widget] Gtk.Entry gnEmailEntry; [Glade.Widget] Gtk.Entry gnWebPageEntry; [Glade.Widget] Gtk.TextView adStreetTextView; [Glade.Widget] Gtk.Entry adPOBoxEntry; [Glade.Widget] Gtk.Entry adCityEntry; [Glade.Widget] Gtk.Entry adStateEntry; [Glade.Widget] Gtk.Entry adZipEntry; [Glade.Widget] Gtk.Entry adCountryEntry; [Glade.Widget] Gtk.Entry tnHomeEntry; [Glade.Widget] Gtk.Entry tnPagerEntry; [Glade.Widget] Gtk.Entry tnMobileEntry; [Glade.Widget] Gtk.Entry tnFaxEntry; [Glade.Widget] Gtk.Entry tnIPPhoneEntry; [Glade.Widget] Gtk.TextView tnNotesTextView; [Glade.Widget] Gtk.Entry ozTitleEntry; [Glade.Widget] Gtk.Entry ozDeptEntry; [Glade.Widget] Gtk.Entry ozCompanyEntry; [Glade.Widget] Gtk.Image image180; LdapEntry currentEntry; public EditContactsViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; Init (); string displayName = conn.Data.GetAttributeValueFromEntry (currentEntry, "displayName"); gnNameLabel.Text = displayName; gnFirstNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "givenName"); gnInitialsEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "initials"); gnLastNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sn"); gnDisplayName.Text = displayName; gnDescriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); gnOfficeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "physicalDeliveryOfficeName"); gnTelephoneNumberEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "telephoneNumber"); gnEmailEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mail"); adPOBoxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postOfficeBox"); adCityEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "l"); adStateEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "st"); adZipEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postalCode"); tnHomeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homePhone"); tnPagerEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "pager"); tnMobileEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mobile"); tnFaxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "facsimileTelephoneNumber"); ozTitleEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "title"); string contactName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); editContactDialog.Title = contactName + " Properties"; conn.Data.GetAttributeValueFromEntry (currentEntry, "street"); editContactDialog.Icon = Global.latIcon; editContactDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; editContactDialog.Run (); } editContactDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "dialogs.glade", "editContactDialog", null); ui.Autoconnect (this); viewDialog = editContactDialog; tnNotesTextView.Sensitive = false; ozDeptEntry.Sensitive = false; ozCompanyEntry.Sensitive = false; gnWebPageEntry.Sensitive = false; tnIPPhoneEntry.Sensitive = false; adCountryEntry.Sensitive = false; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("contact-new-48x48.png"); image180.Pixbuf = pb; } public void OnNameChanged (object o, EventArgs args) { gnNameLabel.Text = gnDisplayName.Text; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "inetOrgPerson" })); aset.Add (new LdapAttribute ("givenName", gnFirstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", gnInitialsEntry.Text)); aset.Add (new LdapAttribute ("sn", gnLastNameEntry.Text)); aset.Add (new LdapAttribute ("displayName", gnDisplayName.Text)); aset.Add (new LdapAttribute ("cn", gnDisplayName.Text)); aset.Add (new LdapAttribute ("wWWHomePage", gnWebPageEntry.Text)); aset.Add (new LdapAttribute ("physicalDeliveryOfficeName", gnOfficeEntry.Text)); aset.Add (new LdapAttribute ("mail", gnEmailEntry.Text)); aset.Add (new LdapAttribute ("description", gnDescriptionEntry.Text)); aset.Add (new LdapAttribute ("street", adStreetTextView.Buffer.Text)); aset.Add (new LdapAttribute ("l", adCityEntry.Text)); aset.Add (new LdapAttribute ("st", adStateEntry.Text)); aset.Add (new LdapAttribute ("postalCode", adZipEntry.Text)); aset.Add (new LdapAttribute ("postOfficeBox", adPOBoxEntry.Text)); aset.Add (new LdapAttribute ("co", adCountryEntry.Text)); aset.Add (new LdapAttribute ("telephoneNumber", gnTelephoneNumberEntry.Text)); aset.Add (new LdapAttribute ("facsimileTelephoneNumber", tnFaxEntry.Text)); aset.Add (new LdapAttribute ("pager", tnPagerEntry.Text)); aset.Add (new LdapAttribute ("mobile", tnMobileEntry.Text)); aset.Add (new LdapAttribute ("homePhone", tnHomeEntry.Text)); aset.Add (new LdapAttribute ("ipPhone", tnIPPhoneEntry.Text)); aset.Add (new LdapAttribute ("title", ozTitleEntry.Text)); aset.Add (new LdapAttribute ("department", ozDeptEntry.Text)); aset.Add (new LdapAttribute ("company", ozCompanyEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } } } lat-1.2.4/lat/plugins/PosixCoreViews/HostsViewDialog.cs0000644000175000001440000000755011702646352020024 00000000000000// // lat - HostsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class HostsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog hostDialog; [Glade.Widget] Gtk.Entry hostNameEntry; [Glade.Widget] Gtk.Entry ipEntry; [Glade.Widget] Gtk.Entry descriptionEntry; [Glade.Widget] Gtk.Image image31; LdapEntry currentEntry; bool isEdit; public HostsViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); hostDialog.Icon = Global.latIcon; hostDialog.Title = "Add Computer"; hostDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; hostDialog.Run (); } hostDialog.Destroy (); } public HostsViewDialog (Connection connection, LdapEntry le) : base (connection, null) { isEdit = true; currentEntry = le; Init (); string hostName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); hostDialog.Title = hostName + " Properties"; hostNameEntry.Text = hostName; ipEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "ipHostNumber"); descriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); hostDialog.Run (); hostDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "dialogs.glade", "hostDialog", null); ui.Autoconnect (this); viewDialog = hostDialog; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server-48x48.png"); image31.Pixbuf = pb; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "ipHost", "device"})); aset.Add (new LdapAttribute ("cn", hostNameEntry.Text)); aset.Add (new LdapAttribute ("ipHostNumber", ipEntry.Text)); aset.Add (new LdapAttribute ("description", descriptionEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; if (isEdit) { entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } else { SelectContainerDialog scd = new SelectContainerDialog (conn, hostDialog); scd.Title = "Save Host"; scd.Message = String.Format ("Where in the directory would\nyou like save the host\n{0}?", hostNameEntry.Text); scd.Run (); if (scd.DN == "") return; string userDN = String.Format ("cn={0},{1}", hostNameEntry.Text, scd.DN); entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } } lat-1.2.4/lat/plugins/PosixCoreViews/EditUserViewDialog.cs0000644000175000001440000004720011702646352020444 00000000000000// // lat - EditUserViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using Novell.Directory.Ldap; namespace lat { public class EditUserViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog editUserDialog; // General [Glade.Widget] Gtk.Label usernameLabel; [Glade.Widget] Gtk.Label fullnameLabel; [Glade.Widget] Gtk.Entry firstNameEntry; [Glade.Widget] Gtk.Entry initialsEntry; [Glade.Widget] Gtk.Entry lastNameEntry; [Glade.Widget] Gtk.Entry descriptionEntry; [Glade.Widget] Gtk.Entry officeEntry; [Glade.Widget] Gtk.Entry mailEntry; [Glade.Widget] Gtk.Entry phoneEntry; // Account [Glade.Widget] Gtk.Entry usernameEntry; [Glade.Widget] Gtk.SpinButton uidSpinButton; [Glade.Widget] Gtk.Entry homeDirEntry; [Glade.Widget] Gtk.Entry shellEntry; [Glade.Widget] Gtk.CheckButton smbEnableSambaButton; [Glade.Widget] Gtk.Entry smbLoginScriptEntry; [Glade.Widget] Gtk.Entry smbProfilePathEntry; [Glade.Widget] Gtk.Entry smbHomePathEntry; [Glade.Widget] Gtk.Entry smbHomeDriveEntry; [Glade.Widget] Gtk.Entry smbExpireEntry; [Glade.Widget] Gtk.Entry smbCanChangePwdEntry; [Glade.Widget] Gtk.Entry smbMustChangePwdEntry; [Glade.Widget] Gtk.Button smbSetExpireButton; [Glade.Widget] Gtk.Button smbSetCanButton; [Glade.Widget] Gtk.Button smbSetMustButton; // Groups [Glade.Widget] Gtk.Label primaryGroupLabel; [Glade.Widget] Gtk.TreeView memberOfTreeview; // Address [Glade.Widget] Gtk.TextView adStreetTextView; [Glade.Widget] Gtk.Entry adPOBoxEntry; [Glade.Widget] Gtk.Entry adCityEntry; [Glade.Widget] Gtk.Entry adStateEntry; [Glade.Widget] Gtk.Entry adZipEntry; // Telephones [Glade.Widget] Gtk.Entry tnHomeEntry; [Glade.Widget] Gtk.Entry tnPagerEntry; [Glade.Widget] Gtk.Entry tnMobileEntry; [Glade.Widget] Gtk.Entry tnFaxEntry; [Glade.Widget] Gtk.Entry tnIPPhoneEntry; // Organization [Glade.Widget] Gtk.Entry ozTitleEntry; [Glade.Widget] Gtk.Entry ozDeptEntry; [Glade.Widget] Gtk.Entry ozCompanyEntry; bool isSamba = false; bool firstTimeSamba = false; string pass = ""; string smbLM = ""; string smbNT = ""; string smbSID = ""; bool passChanged = false; LdapEntry currentEntry; Dictionary _allGroups; Dictionary _allGroupGids; Dictionary _modsGroup; Dictionary _memberOfGroups; ListStore _memberOfStore; public EditUserViewDialog (Connection conn, LdapEntry le) : base (conn, null) { currentEntry = le; Init (); isSamba = Util.CheckSamba (currentEntry); if (!isSamba) firstTimeSamba = true; try { getGroups (currentEntry); } catch (Exception e) { Log.Debug (e); } string userName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); editUserDialog.Title = userName + " Properties"; // General usernameLabel.UseMarkup = true; usernameLabel.Markup = String.Format ("{0}", conn.Data.GetAttributeValueFromEntry (currentEntry, "uid")); fullnameLabel.Text = String.Format ("{0} {1}", conn.Data.GetAttributeValueFromEntry (currentEntry, "givenName"), conn.Data.GetAttributeValueFromEntry (currentEntry, "sn")); firstNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "givenName"); initialsEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "initials"); lastNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sn"); descriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); officeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "physicalDeliveryOfficeName"); mailEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mail"); phoneEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "telephoneNumber"); // Account usernameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "uid"); uidSpinButton.Value = int.Parse (conn.Data.GetAttributeValueFromEntry (currentEntry, "uidNumber")); shellEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "loginShell");; homeDirEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homeDirectory"); if (isSamba) { toggleSambaWidgets (true); smbEnableSambaButton.Hide (); smbLoginScriptEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaLogonScript"); smbProfilePathEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaProfilePath"); smbHomePathEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaHomePath"); smbHomeDriveEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaHomeDrive"); smbExpireEntry.Text = GetStringDate (conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaKickoffTime")); smbCanChangePwdEntry.Text = GetStringDate (conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaPwdCanChange")); smbMustChangePwdEntry.Text = GetStringDate (conn.Data.GetAttributeValueFromEntry (currentEntry, "sambaPwdMustChange")); } else { smbEnableSambaButton.Toggled += new EventHandler (OnSambaChanged); toggleSambaWidgets (false); } // Groups string pgid = conn.Data.GetAttributeValueFromEntry (currentEntry, "gidNumber"); if (_allGroupGids.ContainsKey (pgid)) primaryGroupLabel.Text = _allGroupGids [pgid]; // Address adStreetTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "street"); adPOBoxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postOfficeBox"); adCityEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "l"); adStateEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "st"); adZipEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postalCode"); // Telephones tnHomeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homePhone"); tnPagerEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "pager"); tnMobileEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mobile"); tnFaxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "facsimileTelephoneNumber"); // Organization ozTitleEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "title"); ozDeptEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "departmentNumber"); ozCompanyEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "o"); editUserDialog.Icon = Global.latIcon; editUserDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; editUserDialog.Run (); } editUserDialog.Destroy (); } string GetStringDate (string unixTime) { try { double d = double.Parse (unixTime); DateTime dt = Util.GetDateTime (d); return dt.ToString (); } catch { return ""; } } void OnSambaChanged (object o, EventArgs args) { if (smbEnableSambaButton.Active) { smbSID = conn.Data.GetLocalSID (); if (smbSID == null) { Util.DisplaySambaSIDWarning (editUserDialog); smbEnableSambaButton.Active = false; return; } toggleSambaWidgets (true); } else { toggleSambaWidgets (false); } } bool checkMemberOf (string user, string[] members) { foreach (string s in members) if (s.Equals (user)) return true; return false; } void getGroups (LdapEntry le) { LdapEntry[] grps = conn.Data.SearchByClass ("posixGroup"); foreach (LdapEntry e in grps) { LdapAttribute nameAttr, gidAttr; nameAttr = e.getAttribute ("cn"); gidAttr = e.getAttribute ("gidNumber"); if (le != null && nameAttr != null) { LdapAttribute a; a = e.getAttribute ("memberUid"); if (a != null) { if (checkMemberOf (conn.Data.GetAttributeValueFromEntry (currentEntry, "uid"), a.StringValueArray) && !_memberOfGroups.ContainsKey (nameAttr.StringValue)) { _memberOfGroups.Add (nameAttr.StringValue,"memeberUid"); _memberOfStore.AppendValues (nameAttr.StringValue); } } } if (!_allGroups.ContainsKey (nameAttr.StringValue)) _allGroups.Add (nameAttr.StringValue, e); if (gidAttr != null) if (!_allGroupGids.ContainsKey (gidAttr.StringValue)) _allGroupGids.Add (gidAttr.StringValue, nameAttr.StringValue); } } void Init () { _memberOfGroups = new Dictionary (); _allGroups = new Dictionary (); _allGroupGids = new Dictionary (); _modsGroup = new Dictionary (); ui = new Glade.XML (null, "dialogs.glade", "editUserDialog", null); ui.Autoconnect (this); viewDialog = editUserDialog; TreeViewColumn col; _memberOfStore = new ListStore (typeof (string)); memberOfTreeview.Model = _memberOfStore; memberOfTreeview.Selection.Mode = SelectionMode.Multiple; col = memberOfTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; _memberOfStore.SetSortColumnId (0, SortType.Ascending); } void toggleSambaWidgets (bool state) { if (state && firstTimeSamba) { string msg = Mono.Unix.Catalog.GetString ( "You must reset the password for this account in order to set a samba password."); HIGMessageDialog dialog = new HIGMessageDialog ( editUserDialog, 0, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, "Setting a samba password", msg); dialog.Run (); dialog.Destroy (); } smbLoginScriptEntry.Sensitive = state; smbProfilePathEntry.Sensitive = state; smbHomePathEntry.Sensitive = state; smbHomeDriveEntry.Sensitive = state; smbExpireEntry.Sensitive = state; smbCanChangePwdEntry.Sensitive = state; smbMustChangePwdEntry.Sensitive = state; smbSetExpireButton.Sensitive = state; smbSetCanButton.Sensitive = state; smbSetMustButton.Sensitive = state; } public void OnAddGroupClicked (object o, EventArgs args) { List tmp = new List (); foreach (KeyValuePair kvp in _allGroups) { if (kvp.Key == primaryGroupLabel.Text || _memberOfGroups.ContainsKey (kvp.Key)) continue; tmp.Add (kvp.Key); } SelectGroupsDialog sgd = new SelectGroupsDialog (tmp.ToArray ()); foreach (string name in sgd.SelectedGroupNames) { _memberOfStore.AppendValues (name); if (!_memberOfGroups.ContainsKey (name)) _memberOfGroups.Add (name, "memberUid"); LdapAttribute attr = new LdapAttribute ("memberUid", conn.Data.GetAttributeValueFromEntry (currentEntry, "uid")); LdapModification lm = new LdapModification (LdapModification.ADD, attr); _modsGroup.Add (name, lm); updateGroupMembership (); _modsGroup.Clear (); } } public void OnRemoveGroupClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = memberOfTreeview.Selection.GetSelectedRows (out model); for (int i = tp.Length; i > 0; i--) { _memberOfStore.GetIter (out iter, tp[(i - 1)]); string name = (string) _memberOfStore.GetValue (iter, 0); _memberOfStore.Remove (ref iter); if (_memberOfGroups.ContainsKey (name)) _memberOfGroups.Remove (name); LdapAttribute attr = new LdapAttribute ("memberUid", conn.Data.GetAttributeValueFromEntry (currentEntry, "uid")); LdapModification lm = new LdapModification (LdapModification.DELETE, attr); _modsGroup.Add (name, lm); updateGroupMembership (); _modsGroup.Clear (); } } public void OnNameChanged (object o, EventArgs args) { usernameLabel.Markup = String.Format ("{0}", usernameEntry.Text); fullnameLabel.Text = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); } public void OnPasswordClicked (object o, EventArgs args) { PasswordDialog pd = new PasswordDialog (); if (pd.UnixPassword.Equals ("")) return; pass = pd.UnixPassword; smbLM = pd.LMPassword; smbNT = pd.NTPassword; passChanged = true; } public void OnSetPrimaryGroupClicked (object o, EventArgs args) { List tmp = new List (); foreach (KeyValuePair kvp in _allGroups) { if (kvp.Key == primaryGroupLabel.Text) continue; tmp.Add (kvp.Key); } SelectGroupsDialog sgd = new SelectGroupsDialog (tmp.ToArray()); if (sgd.SelectedGroupNames.Length > 0) primaryGroupLabel.Text = sgd.SelectedGroupNames[0]; } public void OnSetExpireClicked (object o, EventArgs args) { TimeDateDialog td = new TimeDateDialog (); if (td.UnixTime != 0) { DateTime dt = Util.GetDateTime (td.UnixTime); smbExpireEntry.Text = dt.ToString (); } } public void OnSetCanClicked (object o, EventArgs args) { TimeDateDialog td = new TimeDateDialog (); if (td.UnixTime != 0) { DateTime dt = Util.GetDateTime (td.UnixTime); smbCanChangePwdEntry.Text = dt.ToString (); } } public void OnSetMustClicked (object o, EventArgs args) { TimeDateDialog td = new TimeDateDialog (); if (td.UnixTime != 0) { DateTime dt = Util.GetDateTime (td.UnixTime); smbMustChangePwdEntry.Text = dt.ToString (); } } void modifyGroup (LdapEntry groupEntry, LdapModification[] mods) { if (groupEntry == null) return; try { conn.Data.Modify (groupEntry.DN, mods); } catch (Exception e) { string errorMsg = Mono.Unix.Catalog.GetString ("Unable to modify group ") + groupEntry.DN; errorMsg += "\nError: " + e.Message; HIGMessageDialog dialog = new HIGMessageDialog ( editUserDialog, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Error", errorMsg); dialog.Run (); dialog.Destroy (); } } void updateGroupMembership () { Log.Debug ("START updateGroupMembership ()"); LdapEntry groupEntry = null; LdapModification[] mods = new LdapModification [_modsGroup.Count]; int count = 0; foreach (string key in _modsGroup.Keys) { Log.Debug ("group: {0}", key); LdapModification lm = (LdapModification) _modsGroup[key]; groupEntry = (LdapEntry) _allGroups [key]; mods[count] = lm; count++; } modifyGroup (groupEntry, mods); Log.Debug ("END updateGroupMembership ()"); } string getGidNumber (string name) { if (name == null || name == string.Empty) return null; if (_allGroups.ContainsKey (name)) { LdapEntry le = (LdapEntry) _allGroups [name]; LdapAttribute attr = le.getAttribute ("gidNumber"); if (attr != null) return attr.StringValue; } return null; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); // General aset.Add (new LdapAttribute ("cn", fullnameLabel.Text)); aset.Add (new LdapAttribute ("displayName", fullnameLabel.Text)); aset.Add (new LdapAttribute ("gecos", fullnameLabel.Text)); aset.Add (new LdapAttribute ("givenName", firstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", initialsEntry.Text)); aset.Add (new LdapAttribute ("sn", lastNameEntry.Text)); aset.Add (new LdapAttribute ("description", descriptionEntry.Text)); aset.Add (new LdapAttribute ("physicalDeliveryOfficeName", officeEntry.Text)); aset.Add (new LdapAttribute ("mail", mailEntry.Text)); aset.Add (new LdapAttribute ("telephoneNumber", phoneEntry.Text)); // Account aset.Add (new LdapAttribute ("uid", usernameEntry.Text)); aset.Add (new LdapAttribute ("uidNumber", uidSpinButton.Value.ToString())); aset.Add (new LdapAttribute ("homeDirectory", homeDirEntry.Text)); aset.Add (new LdapAttribute ("loginShell", shellEntry.Text)); if (passChanged) aset.Add (new LdapAttribute ("userPassword", pass)); else { aset.Add (new LdapAttribute ("userPassword", conn.Data.GetAttributeValueFromEntry (currentEntry, "userPassword"))); } if (smbEnableSambaButton.Active || isSamba) { aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixaccount", "shadowaccount","inetorgperson", "person", "sambaSAMAccount"})); int user_rid = Convert.ToInt32 (uidSpinButton.Value) * 2 + 1000; LdapAttribute[] tmp = Util.CreateSambaAttributes (user_rid, conn.Data.GetLocalSID (), smbLM, smbNT); foreach (LdapAttribute a in tmp) aset.Add (a); aset.Add (new LdapAttribute ("sambaProfilePath", smbProfilePathEntry.Text)); aset.Add (new LdapAttribute ("sambaHomePath", smbHomePathEntry.Text)); aset.Add (new LdapAttribute ("sambaHomeDrive", smbHomeDriveEntry.Text)); aset.Add (new LdapAttribute ("sambaLogonScript", smbLoginScriptEntry.Text)); double d = 0; if (smbExpireEntry.Text != "") { d = Util.GetDateTime (smbExpireEntry.Text); aset.Add (new LdapAttribute ("sambaKickoffTime", d.ToString())); } if (smbCanChangePwdEntry.Text != "") { d = Util.GetDateTime (smbCanChangePwdEntry.Text); aset.Add (new LdapAttribute ("sambaPwdCanChange", d.ToString())); } if (smbMustChangePwdEntry.Text != "") { d = Util.GetDateTime (smbMustChangePwdEntry.Text); aset.Add (new LdapAttribute ("sambaPwdMustChange", d.ToString())); } } else { aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixaccount", "shadowaccount","inetorgperson", "person"})); } // Groups string gid = getGidNumber(primaryGroupLabel.Text); if (gid != null) { aset.Add (new LdapAttribute ("gidNumber", gid)); } else { LdapAttribute la = currentEntry.getAttribute ("gidNumber"); aset.Add (new LdapAttribute ("gidNumber", la.StringValue)); } // Address aset.Add (new LdapAttribute ("street", adStreetTextView.Buffer.Text)); aset.Add (new LdapAttribute ("l", adCityEntry.Text)); aset.Add (new LdapAttribute ("st", adStateEntry.Text)); aset.Add (new LdapAttribute ("postalCode", adZipEntry.Text)); aset.Add (new LdapAttribute ("postOfficeBox", adPOBoxEntry.Text)); // Telephones aset.Add (new LdapAttribute ("facsimileTelephoneNumber", tnFaxEntry.Text)); aset.Add (new LdapAttribute ("pager", tnPagerEntry.Text)); aset.Add (new LdapAttribute ("mobile", tnMobileEntry.Text)); aset.Add (new LdapAttribute ("homePhone", tnHomeEntry.Text)); aset.Add (new LdapAttribute ("ipPhone", tnIPPhoneEntry.Text)); // Organization aset.Add (new LdapAttribute ("title", ozTitleEntry.Text)); aset.Add (new LdapAttribute ("departmentNumber", ozDeptEntry.Text)); aset.Add (new LdapAttribute ("o", ozCompanyEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } } } lat-1.2.4/lat/plugins/PosixCoreViews/NewUserViewDialog.cs0000644000175000001440000003177111702646352020316 00000000000000// // lat - NewUserViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using Mono.Security.Protocol.Ntlm; using Novell.Directory.Ldap; namespace lat { public class NewUserViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newUserDialog; // General [Glade.Widget] Gtk.Label usernameLabel; [Glade.Widget] Gtk.Label fullnameLabel; [Glade.Widget] Gtk.Entry usernameEntry; [Glade.Widget] Gtk.SpinButton uidSpinButton; [Glade.Widget] Gtk.Entry firstNameEntry; [Glade.Widget] Gtk.Entry initialsEntry; [Glade.Widget] Gtk.Entry lastNameEntry; [Glade.Widget] Gtk.Entry displayNameEntry; [Glade.Widget] Gtk.Entry homeDirEntry; [Glade.Widget] Gtk.Entry shellEntry; [Glade.Widget] Gtk.Entry passwordEntry; [Glade.Widget] Gtk.HBox comboHbox; [Glade.Widget] Gtk.CheckButton enableSambaButton; Dictionary _allGroups; Dictionary _allGroupGids; Dictionary _memberOfGroups; string smbSID = ""; string smbLM = ""; string smbNT = ""; ComboBox primaryGroupComboBox; Dictionary defaultValues; bool dontRequirePasswords; public NewUserViewDialog (Connection connection, string newContainer, Dictionary defaultValues) : base (connection, newContainer) { this.defaultValues = defaultValues; Init (); getGroups (); createCombo (); SetDefaults (); uidSpinButton.Value = conn.Data.GetNextUID (); enableSambaButton.Toggled += new EventHandler (OnSambaChanged); newUserDialog.Icon = Global.latIcon; newUserDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; newUserDialog.Run (); } newUserDialog.Destroy (); } void SetDefaults () { if (defaultValues == null) return; if (defaultValues.ContainsKey ("userPassword")) passwordEntry.Text = defaultValues ["userPassword"]; if (defaultValues.ContainsKey ("sambaLMPassword")) smbLM = defaultValues["sambaLMPassword"]; if (defaultValues.ContainsKey ("sambaNTPassword")) smbNT = defaultValues["sambaNTPassword"]; if (defaultValues.ContainsKey ("loginShell")) shellEntry.Text = defaultValues ["loginShell"]; if (defaultValues.ContainsKey ("enableSamba")) { bool enableSamba = bool.Parse (defaultValues ["enableSamba"]); enableSambaButton.Active = enableSamba; } if (defaultValues.ContainsKey("dontRequirePasswords")) dontRequirePasswords = bool.Parse (defaultValues ["dontRequirePasswords"]); } void OnSambaChanged (object o, EventArgs args) { if (enableSambaButton.Active) { smbSID = conn.Data.GetLocalSID (); if (smbSID == null) { Util.DisplaySambaSIDWarning (newUserDialog); enableSambaButton.Active = false; return; } } } void getGroups () { LdapEntry[] grps = conn.Data.SearchByClass ("posixGroup"); foreach (LdapEntry e in grps) { LdapAttribute nameAttr, gidAttr; nameAttr = e.getAttribute ("cn"); gidAttr = e.getAttribute ("gidNumber"); if (!_allGroups.ContainsKey (nameAttr.StringValue)) { _allGroups.Add (nameAttr.StringValue, e); _allGroupGids.Add (gidAttr.StringValue, nameAttr.StringValue); } } } void createCombo () { if (primaryGroupComboBox != null) { primaryGroupComboBox.Changed -= OnPrimaryGroupChanged; primaryGroupComboBox.Destroy (); primaryGroupComboBox = null; } primaryGroupComboBox = ComboBox.NewText (); string defaultGroup = "None"; if (defaultValues != null && defaultValues.ContainsKey ("defaultGroup")) { defaultGroup = defaultValues["defaultGroup"]; primaryGroupComboBox.AppendText (defaultGroup); } foreach (string key in _allGroups.Keys) { if (key.ToLower() == defaultGroup.ToLower()) continue; primaryGroupComboBox.AppendText (key); } primaryGroupComboBox.AppendText ("Create new group..."); primaryGroupComboBox.Active = 0; primaryGroupComboBox.Changed += OnPrimaryGroupChanged; primaryGroupComboBox.Show (); comboHbox.Add (primaryGroupComboBox); } void OnPrimaryGroupChanged (object o, EventArgs args) { ComboBox combo = o as ComboBox; if (o == null) return; TreeIter iter; if (combo.GetActiveIter (out iter)) { string selection = (string) combo.Model.GetValue (iter, 0); if (selection == "Create new group...") { new GroupsViewDialog (conn, ""); _allGroups.Clear(); _allGroupGids.Clear(); getGroups (); createCombo (); } } } void Init () { _memberOfGroups = new Dictionary (); _allGroups = new Dictionary (); _allGroupGids = new Dictionary (); ui = new Glade.XML (null, "dialogs.glade", "newUserDialog", null); ui.Autoconnect (this); viewDialog = newUserDialog; passwordEntry.Sensitive = false; displayNameEntry.FocusInEvent += new FocusInEventHandler (OnDisplayNameFocusIn); } public void OnNameChanged (object o, EventArgs args) { usernameLabel.Markup = String.Format ("{0}", usernameEntry.Text); fullnameLabel.Text = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); } public void OnPasswordClicked (object o, EventArgs args) { PasswordDialog pd = new PasswordDialog (); if (!passwordEntry.Text.Equals ("") && pd.UnixPassword.Equals ("")) return; passwordEntry.Text = pd.UnixPassword; smbLM = pd.LMPassword; smbNT = pd.NTPassword; } void OnDisplayNameFocusIn (object o, EventArgs args) { string suid = Util.SuggestUserName ( firstNameEntry.Text, lastNameEntry.Text); usernameEntry.Text = suid; if (displayNameEntry.Text != "") return; if (initialsEntry.Text.Equals("")) { displayNameEntry.Text = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); } else { String format = ""; if (initialsEntry.Text.EndsWith(".")) format = "{0} {1} {2}"; else format = "{0} {1}. {2}"; displayNameEntry.Text = String.Format (format, firstNameEntry.Text, initialsEntry.Text, lastNameEntry.Text); } if (homeDirEntry.Text.Equals("") && !usernameEntry.Text.Equals("")) { string defaultDir = "/home"; if (defaultValues != null && defaultValues.ContainsKey ("homeDirectory")) defaultDir = defaultValues["homeDirectory"]; homeDirEntry.Text = System.IO.Path.Combine (defaultDir, usernameEntry.Text); } } void modifyGroup (LdapEntry groupEntry, LdapModification[] mods) { if (groupEntry == null) return; try { conn.Data.Modify (groupEntry.DN, mods); } catch (Exception e) { string errorMsg = Mono.Unix.Catalog.GetString ("Unable to modify group ") + groupEntry.DN; errorMsg += "\nError: " + e.Message; HIGMessageDialog dialog = new HIGMessageDialog ( newUserDialog, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Modify error", errorMsg); dialog.Run (); dialog.Destroy (); } } void updateGroupMembership () { LdapEntry groupEntry = null; LdapModification[] mods = new LdapModification [1]; foreach (string key in _memberOfGroups.Keys) { LdapAttribute attr = new LdapAttribute ("memberUid", usernameEntry.Text); LdapModification lm = new LdapModification (LdapModification.ADD, attr); groupEntry = (LdapEntry) _allGroups[key]; mods[0] = lm; } modifyGroup (groupEntry, mods); } string getGidNumber (string name) { if (name == null) return null; if (!_allGroups.ContainsKey(name)) return null; LdapEntry le = (LdapEntry) _allGroups [name]; LdapAttribute attr = le.getAttribute ("gidNumber"); if (attr != null) return attr.StringValue; return null; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); TreeIter iter; if (primaryGroupComboBox.GetActiveIter (out iter)) { string pg = (string) primaryGroupComboBox.Model.GetValue (iter, 0); string gid = getGidNumber(pg); if (gid != null) aset.Add (new LdapAttribute ("gidNumber", gid)); } aset.Add (new LdapAttribute ("givenName", firstNameEntry.Text)); aset.Add (new LdapAttribute ("sn", lastNameEntry.Text)); aset.Add (new LdapAttribute ("uid", usernameEntry.Text)); aset.Add (new LdapAttribute ("uidNumber", uidSpinButton.Value.ToString())); if (!dontRequirePasswords) aset.Add (new LdapAttribute ("userPassword", passwordEntry.Text)); aset.Add (new LdapAttribute ("loginShell", shellEntry.Text)); aset.Add (new LdapAttribute ("homeDirectory", homeDirEntry.Text)); aset.Add (new LdapAttribute ("displayName", displayNameEntry.Text)); aset.Add (new LdapAttribute ("cn", displayNameEntry.Text)); aset.Add (new LdapAttribute ("gecos", displayNameEntry.Text)); if (initialsEntry.Text != "") aset.Add (new LdapAttribute ("initials", initialsEntry.Text)); if (enableSambaButton.Active) { aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixaccount", "shadowaccount","inetorgperson", "person", "sambaSAMAccount"})); int user_rid = Convert.ToInt32 (uidSpinButton.Value) * 2 + 1000; LdapAttribute[] tmp = Util.CreateSambaAttributes (user_rid, smbSID, smbLM, smbNT); foreach (LdapAttribute a in tmp) aset.Add (a); } else { if (dontRequirePasswords) aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixaccount", "inetorgperson", "person"})); else aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixaccount", "shadowaccount","inetorgperson", "person"})); } LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } bool IsUserNameAvailable () { if (!Util.CheckUserName (conn, usernameEntry.Text)) { string format = Mono.Unix.Catalog.GetString ( "A user with the username '{0}' already exists!"); string msg = String.Format (format, usernameEntry.Text); HIGMessageDialog dialog = new HIGMessageDialog ( newUserDialog, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, "User error", msg); dialog.Run (); dialog.Destroy (); return false; } return true; } bool IsUIDAvailable () { if (!Util.CheckUID (conn, Convert.ToInt32 (uidSpinButton.Value))) { string msg = Mono.Unix.Catalog.GetString ( "The UID you have selected is already in use!"); HIGMessageDialog dialog = new HIGMessageDialog ( newUserDialog, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, "User error", msg); dialog.Run (); dialog.Destroy (); return false; } return true; } bool IsPasswordEmpty () { if (passwordEntry.Text == "" || passwordEntry.Text == null) { string msg = Mono.Unix.Catalog.GetString ( "You must set a password for the new user"); HIGMessageDialog dialog = new HIGMessageDialog ( newUserDialog, 0, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, "User error", msg); dialog.Run (); dialog.Destroy (); return true; } return false; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; string userDN = null; if (!IsUserNameAvailable() || !IsUIDAvailable() || (IsPasswordEmpty() && dontRequirePasswords == false)) { errorOccured = true; return; } if (this.defaultNewContainer == null) { SelectContainerDialog scd = new SelectContainerDialog (conn, newUserDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the user\n{0}", displayNameEntry.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", displayNameEntry.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", displayNameEntry.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } updateGroupMembership (); if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } lat-1.2.4/lat/plugins/PosixCoreViews/GroupsViewDialog.cs0000644000175000001440000002017711703103564020175 00000000000000// // lat - GroupsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class GroupsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog groupDialog; [Glade.Widget] Gtk.Entry groupNameEntry; [Glade.Widget] Gtk.Entry descriptionEntry; [Glade.Widget] Gtk.SpinButton groupIDSpinButton; [Glade.Widget] Gtk.TreeView allUsersTreeview; [Glade.Widget] Gtk.TreeView currentMembersTreeview; [Glade.Widget] Gtk.CheckButton enableSambaButton; ListStore allUserStore; ListStore currentMemberStore; LdapEntry currentEntry; List currentMembers = new List (); bool isEdit; bool isSamba = false; string smbSID = ""; public GroupsViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); populateUsers (); groupDialog.Title = "Add Group"; groupIDSpinButton.Value = conn.Data.GetNextGID (); groupDialog.Icon = Global.latIcon; groupDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; groupDialog.Run (); } groupDialog.Destroy (); } public GroupsViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; isEdit = true; isSamba = checkSamba (currentEntry); Init (); string groupName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); groupDialog.Title = groupName + " Properties"; groupNameEntry.Text = groupName; descriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); try { groupIDSpinButton.Value = int.Parse (conn.Data.GetAttributeValueFromEntry (currentEntry, "gidNumber")); } catch {} LdapAttribute attr = currentEntry.getAttribute ("memberuid"); if (attr != null) { foreach (string s in attr.StringValueArray) { currentMemberStore.AppendValues (s); currentMembers.Add (s); } } populateUsers (); groupDialog.Run (); while (missingValues || errorOccured){ if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; groupDialog.Run (); } groupDialog.Destroy (); } void OnSambaChanged (object o, EventArgs args) { if (enableSambaButton.Active) { smbSID = conn.Data.GetLocalSID (); if (smbSID == null) { Util.DisplaySambaSIDWarning (groupDialog); enableSambaButton.Active = false; return; } } } void populateUsers () { LdapEntry[] _users = conn.Data.SearchByClass ("posixAccount"); foreach (LdapEntry le in _users) { LdapAttribute nameAttr = le.getAttribute ("uid"); if (nameAttr != null && !currentMembers.Contains (nameAttr.StringValue) ) allUserStore.AppendValues (nameAttr.StringValue); } } void Init () { ui = new Glade.XML (null, "dialogs.glade", "groupDialog", null); ui.Autoconnect (this); viewDialog = groupDialog; TreeViewColumn col; allUserStore = new ListStore (typeof (string)); allUsersTreeview.Model = allUserStore; allUsersTreeview.Selection.Mode = SelectionMode.Multiple; col = allUsersTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; allUserStore.SetSortColumnId (0, SortType.Ascending); currentMemberStore = new ListStore (typeof (string)); currentMembersTreeview.Model = currentMemberStore; currentMembersTreeview.Selection.Mode = SelectionMode.Multiple; col = currentMembersTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; currentMemberStore.SetSortColumnId (0, SortType.Ascending); if (isSamba) enableSambaButton.Hide (); else enableSambaButton.Toggled += new EventHandler (OnSambaChanged); groupDialog.Resize (350, 400); } public void OnAddClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = allUsersTreeview.Selection.GetSelectedRows (out model); for (int i = tp.Length; i > 0; i--) { allUserStore.GetIter (out iter, tp[(i - 1)]); string user = (string) allUserStore.GetValue (iter, 0); currentMembers.Add (user); currentMemberStore.AppendValues (user); allUserStore.Remove (ref iter); } } public void OnRemoveClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = currentMembersTreeview.Selection.GetSelectedRows (out model); for (int i = tp.Length; i > 0; i--) { currentMemberStore.GetIter (out iter, tp[(i - 1)]); string user = (string) currentMemberStore.GetValue (iter, 0); currentMemberStore.Remove (ref iter); if (currentMembers.Contains (user)) currentMembers.Remove (user); allUserStore.AppendValues (user); } } bool checkSamba (LdapEntry le) { bool retVal = false; LdapAttribute la = le.getAttribute ("objectClass"); if (la == null) return retVal; foreach (string s in la.StringValueArray) if (s.ToLower() == "sambagroupmapping") retVal = true; return retVal; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("cn", groupNameEntry.Text)); aset.Add (new LdapAttribute ("description", descriptionEntry.Text)); aset.Add (new LdapAttribute ("gidNumber", groupIDSpinButton.Value.ToString())); if (currentMembers.Count >= 1) aset.Add (new LdapAttribute ("memberuid", currentMembers.ToArray())); if (enableSambaButton.Active || isSamba) { aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixGroup", "sambaGroupMapping"})); aset.Add (new LdapAttribute ("sambaGroupType", "2")); int grid = Convert.ToInt32 (groupIDSpinButton.Value) * 2 + 1001; smbSID = conn.Data.GetLocalSID (); aset.Add (new LdapAttribute ("sambaSID", String.Format ("{0}-{1}", conn.Data.GetLocalSID (), grid))); } else { aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "posixGroup"})); } LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; if (isEdit) { entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } else { string userDN = null; if (string.IsNullOrEmpty(this.defaultNewContainer)) { SelectContainerDialog scd = new SelectContainerDialog (conn, groupDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the group\n{0}?", groupNameEntry.Text); scd.Run (); if (string.IsNullOrEmpty(scd.DN)) return; userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } } lat-1.2.4/lat/plugins/PosixCoreViews/Makefile.am0000644000175000001440000000301511702646352016446 00000000000000CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = PosixCoreViews CSFILES = \ EditContactsViewDialog.cs \ EditUserViewDialog.cs \ GroupsViewDialog.cs \ HostsViewDialog.cs \ NewContactsViewDialog.cs \ NewUserViewDialog.cs \ PosixComputerViewPlugin.cs \ PosixContactsViewPlugin.cs \ PosixGroupViewPlugin.cs \ PosixUserViewPlugin.cs \ UserDefaultValuesDialog.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) if BUILD_AVAHI AVAHI_REFERENCES = $(AVAHI_LIBS) endif if BUILD_NETWORKMANAGER NM_REFERENCES = \ $(top_builddir)/network-manager/network-manager.dll endif REFERENCES = \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialogs.glade \ $(top_srcdir)/resources/contact-new-48x48.png \ $(top_srcdir)/resources/x-directory-remote-server-48x48.png \ $(top_srcdir)/resources/x-directory-remote-workgroup.png \ $(top_srcdir)/resources/contact-new.png \ $(top_srcdir)/resources/users.png \ $(top_srcdir)/resources/locked16x16.png \ $(top_srcdir)/resources/stock_person.png RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialogs.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb lat-1.2.4/lat/plugins/PosixCoreViews/NewContactsViewDialog.cs0000644000175000001440000000702111702646352021145 00000000000000// // lat - NewContactsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class NewContactsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newContactDialog; [Glade.Widget] Gtk.Label gnNameLabel; [Glade.Widget] Gtk.Entry gnFirstNameEntry; [Glade.Widget] Gtk.Entry gnInitialsEntry; [Glade.Widget] Gtk.Entry gnLastNameEntry; [Glade.Widget] Gtk.Entry gnDisplayName; [Glade.Widget] Gtk.Image image181; public NewContactsViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); newContactDialog.Icon = Global.latIcon; newContactDialog.Title = "New Contact"; newContactDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; newContactDialog.Run (); } newContactDialog.Destroy (); } private void Init () { ui = new Glade.XML (null, "dialogs.glade", "newContactDialog", null); ui.Autoconnect (this); viewDialog = newContactDialog; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("contact-new-48x48.png"); image181.Pixbuf = pb; } public void OnNameChanged (object o, EventArgs args) { gnNameLabel.Text = gnDisplayName.Text; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "inetOrgPerson" })); aset.Add (new LdapAttribute ("givenName", gnFirstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", gnInitialsEntry.Text)); aset.Add (new LdapAttribute ("sn", gnLastNameEntry.Text)); aset.Add (new LdapAttribute ("displayName", gnDisplayName.Text)); aset.Add (new LdapAttribute ("cn", gnDisplayName.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; string userDN = null; if (this.defaultNewContainer == null) { SelectContainerDialog scd = new SelectContainerDialog (conn, newContactDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the contact\n{0}?", gnDisplayName.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", gnDisplayName.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", gnDisplayName.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } lat-1.2.4/lat/plugins/PosixCoreViews/UserDefaultValuesDialog.cs0000644000175000001440000001221311702646352021464 00000000000000// // lat - UserDefaultValuesDialog.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using Novell.Directory.Ldap; namespace lat { public class UserDefaultValuesDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog defaultValuesDialog; // General [Glade.Widget] Gtk.HBox hbox417; [Glade.Widget] Gtk.Entry passwordEntry; [Glade.Widget] Gtk.Entry homeEntry; [Glade.Widget] Gtk.Entry shellEntry; [Glade.Widget] Gtk.CheckButton sambaCheckButton; [Glade.Widget] Gtk.CheckButton noPasswordsButton; ComboBox primaryGroupComboBox; ViewPlugin vp; Connection conn; string smbLM = ""; string smbNT = ""; public UserDefaultValuesDialog (ViewPlugin plugin, Connection connection) { vp = plugin; conn = connection; ui = new Glade.XML (null, "dialogs.glade", "defaultValuesDialog", null); ui.Autoconnect (this); passwordEntry.Sensitive = false; SetDefaultValues (); defaultValuesDialog.Run (); defaultValuesDialog.Destroy (); } void CreateCombo (string defaultGroup) { if (primaryGroupComboBox != null) { primaryGroupComboBox.Destroy (); primaryGroupComboBox = null; } primaryGroupComboBox = ComboBox.NewText (); primaryGroupComboBox.AppendText (defaultGroup); LdapEntry[] grps = conn.Data.SearchByClass ("posixGroup"); foreach (LdapEntry e in grps) { LdapAttribute nameAttr = e.getAttribute ("cn"); if (nameAttr.StringValue.ToLower() == defaultGroup.ToLower()) continue; primaryGroupComboBox.AppendText (nameAttr.StringValue); } primaryGroupComboBox.Active = 0; primaryGroupComboBox.Show (); hbox417.Add (primaryGroupComboBox); } void SetDefaultValues () { Log.Debug ("vp.PluginConfiguration.Defaults.Count: {0}", vp.PluginConfiguration.Defaults.Count); if (vp.PluginConfiguration.Defaults.ContainsKey ("userPassword")) passwordEntry.Text = vp.PluginConfiguration.Defaults ["userPassword"]; if (vp.PluginConfiguration.Defaults.ContainsKey ("sambaLMPassword")) smbLM = vp.PluginConfiguration.Defaults["sambaLMPassword"]; if (vp.PluginConfiguration.Defaults.ContainsKey ("sambaNTPassword")) smbNT = vp.PluginConfiguration.Defaults["sambaNTPassword"]; if (vp.PluginConfiguration.Defaults.ContainsKey ("homeDirectory")) homeEntry.Text = vp.PluginConfiguration.Defaults ["homeDirectory"]; if (vp.PluginConfiguration.Defaults.ContainsKey ("loginShell")) shellEntry.Text = vp.PluginConfiguration.Defaults ["loginShell"]; if (vp.PluginConfiguration.Defaults.ContainsKey ("enableSamba")) { bool enableSamba = bool.Parse (vp.PluginConfiguration.Defaults ["enableSamba"]); sambaCheckButton.Active = enableSamba; } if (vp.PluginConfiguration.Defaults.ContainsKey ("dontRequirePasswords")) { bool noPasswords = bool.Parse (vp.PluginConfiguration.Defaults ["dontRequirePasswords"]); noPasswordsButton.Active = noPasswords; } if (vp.PluginConfiguration.Defaults.ContainsKey ("defaultGroup")) CreateCombo (vp.PluginConfiguration.Defaults["defaultGroup"]); else CreateCombo ("None"); } public void OnSetPasswordClicked (object o, EventArgs args) { PasswordDialog pd = new PasswordDialog (); if (!passwordEntry.Text.Equals ("") && pd.UnixPassword.Equals ("")) return; passwordEntry.Text = pd.UnixPassword; smbLM = pd.LMPassword; smbNT = pd.NTPassword; } public void OnOkClicked (object o, EventArgs args) { TreeIter iter; if (primaryGroupComboBox.GetActiveIter (out iter)) { string pg = (string) primaryGroupComboBox.Model.GetValue (iter, 0); if (pg != "None") vp.PluginConfiguration.Defaults["defaultGroup"] = pg; } vp.PluginConfiguration.Defaults["dontRequirePasswords"] = noPasswordsButton.Active.ToString(); if (passwordEntry.Text != "" && noPasswordsButton.Active == false) { vp.PluginConfiguration.Defaults["userPassword"] = passwordEntry.Text; if (sambaCheckButton.Active) { vp.PluginConfiguration.Defaults["sambaLMPassword"] = smbLM; vp.PluginConfiguration.Defaults["sambaNTPassword"] = smbNT; } } if (homeEntry.Text != "") vp.PluginConfiguration.Defaults["homeDirectory"] = homeEntry.Text; if (shellEntry.Text != "") vp.PluginConfiguration.Defaults["loginShell"] = shellEntry.Text; vp.PluginConfiguration.Defaults["enableSamba"] = sambaCheckButton.Active.ToString(); Log.Debug ("vp.PluginConfiguration.Defaults.Count: {0}", vp.PluginConfiguration.Defaults.Count); } } }lat-1.2.4/lat/plugins/PosixCoreViews/dialogs.glade0000644000175000001440000100645511702646352017046 00000000000000 True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True True True True GTK_POS_TOP False False True False 0 True False 0 True 6 stock_contact 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False 0 True True True False 0 True 10 True True 0 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Display Name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Office: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True 10 True True 0 True True True False 0 True Telephone number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True E-mail: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Web page: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True General False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Street: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 10 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True True False 0 True P.O. Box: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True City: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True State/province: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Zip/Postal Code: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Country/region: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True False True True Address False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Home: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Pager: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Mobile: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Fax: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True IP phone: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True <b>Telephone numbers</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 5 True True True False 0 True False 0 True <b>Notes:</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 0 True True True False 0 True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True 0 True True False True True Telephones False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Title: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Department: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Company: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True 0 True True False True True Organization False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True True True True GTK_POS_TOP False False True False 0 True False 0 True 6 stock_person 0.5 0.5 0 0 10 False False True False 0 True False 0 True False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 True True True False 0 True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 True True 10 False False 0 True True True False 0 True 10 True True 0 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Office: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True 10 True True 0 True True True False 0 True Telephone number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True E-mail: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True General False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True User name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True True UID: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True 1 0 False GTK_UPDATE_ALWAYS False False 1 1 65535 1 10 10 5 True True 5 True True True False 0 True Password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True GTK_BUTTONBOX_DEFAULT_STYLE 0 True True True Set password True GTK_RELIEF_NORMAL True 5 False False 5 True True True False 0 True Home directory: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Login shell: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True 5 True True 5 True True True False 0 True True Enable Samba support for this user True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True True False 0 True Home drive: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 0 True True True Home path: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Login script: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Profile path: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Expire account: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 0 True True True True Set True GTK_RELIEF_NORMAL True 5 False False 5 True True True False 0 True Can change password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 0 True True True True Set True GTK_RELIEF_NORMAL True 5 False False 5 True True True False 0 True Must change password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 20 False False True True True True 0 True * False 0 True True True True Set True GTK_RELIEF_NORMAL True 5 False False 5 True True False True True Account False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Member of: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False 5 False False True False 0 True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False False True False False False 10 True True 0 True True True False 0 True GTK_BUTTONBOX_START 5 True True True gtk-add True GTK_RELIEF_NORMAL True True True True gtk-remove True GTK_RELIEF_NORMAL True 10 True True 5 False False 0 True True True False 0 True False 0 True 0 True True 0 True True True False 0 True Primary group: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True GTK_BUTTONBOX_START 0 True True True Set primary group True GTK_RELIEF_NORMAL True 10 True True 5 True True 0 False False False True True Groups False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Street: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 10 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True True False 0 True P.O. Box: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True City: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True State/province: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Zip/Postal Code: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True False True True Address False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Home: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Pager: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Mobile: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Fax: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True IP phone: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True <b>Telephone numbers</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 5 True True False True True Telephones False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Title: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Department: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Company: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True 0 True True False True True Organization False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True False 0 True <b>General</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Group name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Group ID: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True 1 0 False GTK_UPDATE_ALWAYS False False 0 0 65535 1 10 10 5 True True 5 True True True False 0 True True Enable Samba support for this group True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True 0 False True True False 0 True False 0 True <b>Members</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 False True True False 0 True False 0 True False 0 True All users: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True False False False True False False False 5 True True 5 True True True GTK_BUTTONBOX_SPREAD 0 True True True gtk-add True GTK_RELIEF_NORMAL True True True True gtk-remove True GTK_RELIEF_NORMAL True 10 False True True False 0 True False 0 True Current members: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True False False False True False False False 5 True True 5 True True 5 True True 5 True True 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True gtk-network 6 0.5 0.5 0 0 5 False True True False 0 True False 0 True Hostname: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True IP Address: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True 0 True True 0 True True 0 True True True New Contact GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True 6 stock_contact 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 5 True True True False 0 True 5 True True 5 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 False False True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 0 True True 5 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True True False 0 True Display name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True 0 True True True New User GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True 6 stock_person 0.5 0.5 0 0 10 False False True False 0 True False 0 True False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True 5 False False 5 True True True False 0 True 5 True True 5 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 False False True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Display name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True 5 True True 5 True True True False 0 True User name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True True UID: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True 1 0 False GTK_UPDATE_ALWAYS False False 0 0 65535 1 10 10 5 True True 5 True True True False 0 True Primary Group: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False 0 5 True True 5 True True True False 0 True Password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True False 0 True * False 0 True True True True Set password True GTK_RELIEF_NORMAL True 5 False False 5 True True True False 0 True Home directory: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Login shell: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True True Enable Samba support for this account True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True 0 True True True Default values GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False False True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True Primary Group: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False 5 True True True False 0 True Password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True False False 0 True * False 0 True True True True Set password True GTK_RELIEF_NORMAL True 5 False False 5 True True True False 0 True Home directory: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Login shell: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True True Enable Samba support True GTK_RELIEF_NORMAL True False False True 10 False False 5 False False True False 0 True True Don't require passwords True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True 0 True True lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/0000755000175000001440000000000012052153537016466 500000000000000lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/ActiveDirectoryGroupViewPlugin.cs0000644000175000001440000000465511702646352025101 00000000000000// // lat - ActiveDirectoryGroupViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class ActiveDirectoryGroupViewPlugin : ViewPlugin { public ActiveDirectoryGroupViewPlugin () : base () { config.ColumnAttributes = new string[] { "name", "description" }; config.ColumnNames = new string[] { "Name", "Description" }; config.Filter = "(objectclass=group)"; } public override void Init () { } public override void OnAddEntry (Connection connection) { new GroupsViewDialog (connection, this.DefaultNewContainer); } public override void OnEditEntry (Connection connection, LdapEntry le) { // FIXME: Can't get current memebers of built-in groups, might require SSL new GroupsViewDialog (connection, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "Active Directory Group View"; } } public override string Name { get { return "Active Directory Groups"; } } public override string Version { get { return "0.1"; } } public override string MenuLabel { get { return "Active Directory Group"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_7, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("users.png"); } } } }lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/Makefile.in0000644000175000001440000003255312052151450020453 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat/plugins/ActiveDirectoryCoreViews DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(ASSEMBLYlibdir)" DATA = $(ASSEMBLYlib_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = ActiveDirectoryCoreViews CSFILES = \ ActiveDirectoryComputerViewPlugin.cs \ ActiveDirectoryContactsViewPlugin.cs \ ActiveDirectoryGroupViewPlugin.cs \ ActiveDirectoryUserViewPlugin.cs \ EditAdComputerViewDialog.cs \ EditAdUserViewDialog.cs \ EditContactsViewDialog.cs \ GroupsViewDialog.cs \ NewAdComputerViewDialog.cs \ NewAdUserViewDialog.cs \ NewContactsViewDialog.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) @BUILD_AVAHI_TRUE@AVAHI_REFERENCES = $(AVAHI_LIBS) @BUILD_NETWORKMANAGER_TRUE@NM_REFERENCES = \ @BUILD_NETWORKMANAGER_TRUE@ $(top_builddir)/network-manager/network-manager.dll REFERENCES = \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialogs.glade \ $(top_srcdir)/resources/users.png \ $(top_srcdir)/resources/contact-new.png \ $(top_srcdir)/resources/contact-new-48x48.png \ $(top_srcdir)/resources/stock_person.png \ $(top_srcdir)/resources/x-directory-remote-server-48x48.png RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialogs.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/plugins/ActiveDirectoryCoreViews/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/plugins/ActiveDirectoryCoreViews/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-ASSEMBLYlibDATA: $(ASSEMBLYlib_DATA) @$(NORMAL_INSTALL) test -z "$(ASSEMBLYlibdir)" || $(MKDIR_P) "$(DESTDIR)$(ASSEMBLYlibdir)" @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ASSEMBLYlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ASSEMBLYlibdir)" || exit $$?; \ done uninstall-ASSEMBLYlibDATA: @$(NORMAL_UNINSTALL) @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ASSEMBLYlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ASSEMBLYlibdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ASSEMBLYlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ASSEMBLYlibDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ASSEMBLYlibDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-ASSEMBLYlibDATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-ASSEMBLYlibDATA \ uninstall-am $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/NewAdUserViewDialog.cs0000644000175000001440000001520311702646352022551 00000000000000// // lat - NewAdUserViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using Mono.Security.Protocol.Ntlm; using Novell.Directory.Ldap; namespace lat { public class NewAdUserViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newAdUserDialog; [Glade.Widget] Gtk.Label usernameLabel; [Glade.Widget] Gtk.Label fullnameLabel; [Glade.Widget] Gtk.Entry upnEntry; [Glade.Widget] Gtk.Entry usernameEntry; [Glade.Widget] Gtk.Entry firstNameEntry; [Glade.Widget] Gtk.Entry initialsEntry; [Glade.Widget] Gtk.Entry lastNameEntry; [Glade.Widget] Gtk.Entry displayNameEntry; [Glade.Widget] Gtk.Entry passwordEntry; [Glade.Widget] Gtk.HBox comboHbox; [Glade.Widget] Gtk.CheckButton mustChangePwdCheckButton; [Glade.Widget] Gtk.CheckButton cantChangePwdCheckButton; [Glade.Widget] Gtk.CheckButton pwdNeverExpiresCheckButton; [Glade.Widget] Gtk.CheckButton accountDisabledCheckButton; // ACCOUNT_DISABLE|NORMAL_ACCOUNT|DONT_EXPIRE_PASSWORD int userAC = 66050; string[] groupList; ComboBox primaryGroupComboBox; public NewAdUserViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); groupList = GetGroups (); createCombo (); newAdUserDialog.Icon = Global.latIcon; newAdUserDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; newAdUserDialog.Run (); } newAdUserDialog.Destroy (); } public void OnMustChangePwdToggled (object o, EventArgs args) { cantChangePwdCheckButton.Active = false; } public void OnCantChangePwdToggled (object o, EventArgs args) { mustChangePwdCheckButton.Active = false; } public void OnPwdNeverExpiresToggled (object o, EventArgs args) { mustChangePwdCheckButton.Active = false; } public void OnAccountDisabledToggled (object o, EventArgs args) { } private string[] GetGroups () { LdapEntry[] grps = conn.Data.SearchByClass ("group"); List glist = new List (); foreach (LdapEntry e in grps) { LdapAttribute nameAttr; nameAttr = e.getAttribute ("cn"); glist.Add (nameAttr.StringValue); } return glist.ToArray (); } private void createCombo () { primaryGroupComboBox = ComboBox.NewText (); foreach (string n in groupList) primaryGroupComboBox.AppendText (n); primaryGroupComboBox.Active = 0; primaryGroupComboBox.Show (); // FIXME: primary group primaryGroupComboBox.Sensitive = false; comboHbox.Add (primaryGroupComboBox); } private void Init () { ui = new Glade.XML (null, "dialogs.glade", "newAdUserDialog", null); ui.Autoconnect (this); viewDialog = newAdUserDialog; // FIXME: need SSL to set the password passwordEntry.Sensitive = false; mustChangePwdCheckButton.Sensitive = false; cantChangePwdCheckButton.Sensitive = false; pwdNeverExpiresCheckButton.Sensitive = false; accountDisabledCheckButton.Sensitive = false; displayNameEntry.FocusInEvent += new FocusInEventHandler (OnDisplayNameFocusIn); } public void OnNameChanged (object o, EventArgs args) { usernameLabel.Markup = String.Format ("{0}", usernameEntry.Text); fullnameLabel.Text = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); } private void OnDisplayNameFocusIn (object o, EventArgs args) { string suid = Util.SuggestUserName ( firstNameEntry.Text, lastNameEntry.Text); usernameEntry.Text = suid; if (displayNameEntry.Text != "") return; if (initialsEntry.Text.Equals("")) { displayNameEntry.Text = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); } else { String format = ""; if (initialsEntry.Text.EndsWith(".")) format = "{0} {1} {2}"; else format = "{0} {1}. {2}"; displayNameEntry.Text = String.Format (format, firstNameEntry.Text, initialsEntry.Text, lastNameEntry.Text); } } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); string fullName = String.Format ("{0} {1}", firstNameEntry.Text, lastNameEntry.Text); aset.Add (new LdapAttribute ("cn", fullName)); aset.Add (new LdapAttribute ("gecos", fullName)); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "organizationalPerson","user"})); aset.Add (new LdapAttribute ("givenName", firstNameEntry.Text)); aset.Add (new LdapAttribute ("sn", lastNameEntry.Text)); aset.Add (new LdapAttribute ("userPrincipalName", upnEntry.Text)); aset.Add (new LdapAttribute ("sAMAccountName", usernameEntry.Text)); aset.Add (new LdapAttribute ("userAccountControl", userAC.ToString())); aset.Add (new LdapAttribute ("displayName", displayNameEntry.Text)); aset.Add (new LdapAttribute ("initials", initialsEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; string userDN = null; if (this.defaultNewContainer == string.Empty) { SelectContainerDialog scd = new SelectContainerDialog (conn, newAdUserDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the user\n{0}?", displayNameEntry.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", displayNameEntry.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", displayNameEntry.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/ActiveDirectoryContactsViewPlugin.cs0000644000175000001440000000465211702646352025560 00000000000000// // lat - ActiveDirectoryContactsViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class ActiveDirectoryContactsViewPlugin : ViewPlugin { public ActiveDirectoryContactsViewPlugin () : base () { config.ColumnAttributes = new string[] { "name", "mail", "telephoneNumber", "wWWHomePage" }; config.ColumnNames = new string[] { "Name", "Email", "Work", "Home" }; config.Filter = "(objectClass=contact)"; } public override void Init () { } public override void OnAddEntry (Connection connection) { new NewContactsViewDialog (connection, this.DefaultNewContainer); } public override void OnEditEntry (Connection connection, LdapEntry le) { new EditContactsViewDialog (connection, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "Active Directory Contact View"; } } public override string Name { get { return "Active Directory Contacts"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "Active Directory Contact"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_6, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("contact-new.png"); } } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/EditAdUserViewDialog.cs0000644000175000001440000002022511702646352022705 00000000000000// // lat - EditAdUserViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class EditAdUserViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog adUserDialog; [Glade.Widget] Gtk.Label gnNameLabel; [Glade.Widget] Gtk.Entry gnFirstNameEntry; [Glade.Widget] Gtk.Entry gnInitialsEntry; [Glade.Widget] Gtk.Entry gnLastNameEntry; [Glade.Widget] Gtk.Entry gnDisplayName; [Glade.Widget] Gtk.Entry gnDescriptionEntry; [Glade.Widget] Gtk.Entry gnOfficeEntry; [Glade.Widget] Gtk.Entry gnTelephoneNumberEntry; [Glade.Widget] Gtk.Entry gnEmailEntry; [Glade.Widget] Gtk.Entry gnWebPageEntry; [Glade.Widget] Gtk.TextView adStreetTextView; [Glade.Widget] Gtk.Entry adPOBoxEntry; [Glade.Widget] Gtk.Entry adCityEntry; [Glade.Widget] Gtk.Entry adStateEntry; [Glade.Widget] Gtk.Entry adZipEntry; [Glade.Widget] Gtk.Entry adCountryEntry; [Glade.Widget] Gtk.Entry tnHomeEntry; [Glade.Widget] Gtk.Entry tnPagerEntry; [Glade.Widget] Gtk.Entry tnMobileEntry; [Glade.Widget] Gtk.Entry tnFaxEntry; [Glade.Widget] Gtk.Entry tnIPPhoneEntry; [Glade.Widget] Gtk.TextView tnNotesTextView; [Glade.Widget] Gtk.Entry ozTitleEntry; [Glade.Widget] Gtk.Entry ozDeptEntry; [Glade.Widget] Gtk.Entry ozCompanyEntry; [Glade.Widget] Gtk.Entry accLoginNameEntry; [Glade.Widget] Gtk.Entry proPathEntry; [Glade.Widget] Gtk.Entry proLogonScriptEntry; [Glade.Widget] Gtk.Entry proLocalPathEntry; LdapEntry currentEntry; public EditAdUserViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; Init (); string displayName = conn.Data.GetAttributeValueFromEntry (currentEntry, "displayName"); gnNameLabel.Text = displayName; gnFirstNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "givenName"); gnInitialsEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "initials"); gnLastNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sn"); gnDisplayName.Text = displayName; gnDescriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); gnOfficeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "physicalDeliveryOfficeName"); gnTelephoneNumberEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "telephoneNumber"); gnEmailEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mail"); gnWebPageEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "wWWHomePage"); adStreetTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "streetAddress"); adPOBoxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postOfficeBox"); adCityEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "l"); adStateEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "st"); adZipEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postalCode"); adCountryEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "co"); tnHomeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homePhone"); tnPagerEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "pager"); tnMobileEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mobile"); tnFaxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "facsimileTelephoneNumber"); tnIPPhoneEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "ipPhone"); tnNotesTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "info"); ozTitleEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "title"); ozDeptEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "department"); ozCompanyEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "company"); accLoginNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "userPrincipalName"); proPathEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "profilePath"); proLogonScriptEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "scriptPath"); proLocalPathEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homeDirectory"); adUserDialog.Title = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn") + " Properties"; adUserDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; adUserDialog.Run (); } adUserDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "dialogs.glade", "adUserDialog", null); ui.Autoconnect (this); viewDialog = adUserDialog; adUserDialog.Icon = Global.latIcon; } public void OnNameChanged (object o, EventArgs args) { gnNameLabel.Text = gnDisplayName.Text; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "organizationalPerson", "user"})); aset.Add (new LdapAttribute ("cn", gnDisplayName.Text)); aset.Add (new LdapAttribute ("givenName", gnFirstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", gnInitialsEntry.Text)); aset.Add (new LdapAttribute ("sn", gnLastNameEntry.Text)); aset.Add (new LdapAttribute ("displayName", gnDisplayName.Text)); aset.Add (new LdapAttribute ("wWWHomePage", gnWebPageEntry.Text)); aset.Add (new LdapAttribute ("physicalDeliveryOfficeName", gnOfficeEntry.Text)); aset.Add (new LdapAttribute ("mail", gnEmailEntry.Text)); aset.Add (new LdapAttribute ("description", gnDescriptionEntry.Text)); aset.Add (new LdapAttribute ("streetAddress", adStreetTextView.Buffer.Text)); aset.Add (new LdapAttribute ("l", adCityEntry.Text)); aset.Add (new LdapAttribute ("st", adStateEntry.Text)); aset.Add (new LdapAttribute ("postalCode", adZipEntry.Text)); aset.Add (new LdapAttribute ("postOfficeBox", adPOBoxEntry.Text)); aset.Add (new LdapAttribute ("co", adCountryEntry.Text)); aset.Add (new LdapAttribute ("telephoneNumber", gnTelephoneNumberEntry.Text)); aset.Add (new LdapAttribute ("facsimileTelephoneNumber", tnFaxEntry.Text)); aset.Add (new LdapAttribute ("pager", tnPagerEntry.Text)); aset.Add (new LdapAttribute ("mobile", tnMobileEntry.Text)); aset.Add (new LdapAttribute ("homePhone", tnHomeEntry.Text)); aset.Add (new LdapAttribute ("ipPhone", tnIPPhoneEntry.Text)); aset.Add (new LdapAttribute ("info", tnNotesTextView.Buffer.Text)); aset.Add (new LdapAttribute ("title", ozTitleEntry.Text)); aset.Add (new LdapAttribute ("department", ozDeptEntry.Text)); aset.Add (new LdapAttribute ("company", ozCompanyEntry.Text)); aset.Add (new LdapAttribute ("userPrincipalName", accLoginNameEntry.Text)); aset.Add (new LdapAttribute ("profilePath", proPathEntry.Text)); aset.Add (new LdapAttribute ("scriptPath", proLogonScriptEntry.Text)); aset.Add (new LdapAttribute ("homeDirectory", proLocalPathEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/EditContactsViewDialog.cs0000644000175000001440000001715211702646352023305 00000000000000// // lat - EditContactsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class EditContactsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog editContactDialog; [Glade.Widget] Gtk.Label gnNameLabel; [Glade.Widget] Gtk.Entry gnFirstNameEntry; [Glade.Widget] Gtk.Entry gnInitialsEntry; [Glade.Widget] Gtk.Entry gnLastNameEntry; [Glade.Widget] Gtk.Entry gnDisplayName; [Glade.Widget] Gtk.Entry gnDescriptionEntry; [Glade.Widget] Gtk.Entry gnOfficeEntry; [Glade.Widget] Gtk.Entry gnTelephoneNumberEntry; [Glade.Widget] Gtk.Entry gnEmailEntry; [Glade.Widget] Gtk.Entry gnWebPageEntry; [Glade.Widget] Gtk.TextView adStreetTextView; [Glade.Widget] Gtk.Entry adPOBoxEntry; [Glade.Widget] Gtk.Entry adCityEntry; [Glade.Widget] Gtk.Entry adStateEntry; [Glade.Widget] Gtk.Entry adZipEntry; [Glade.Widget] Gtk.Entry adCountryEntry; [Glade.Widget] Gtk.Entry tnHomeEntry; [Glade.Widget] Gtk.Entry tnPagerEntry; [Glade.Widget] Gtk.Entry tnMobileEntry; [Glade.Widget] Gtk.Entry tnFaxEntry; [Glade.Widget] Gtk.Entry tnIPPhoneEntry; [Glade.Widget] Gtk.TextView tnNotesTextView; [Glade.Widget] Gtk.Entry ozTitleEntry; [Glade.Widget] Gtk.Entry ozDeptEntry; [Glade.Widget] Gtk.Entry ozCompanyEntry; [Glade.Widget] Gtk.Image image180; LdapEntry currentEntry; public EditContactsViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; Init (); string displayName = conn.Data.GetAttributeValueFromEntry (currentEntry, "displayName"); gnNameLabel.Text = displayName; gnFirstNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "givenName"); gnInitialsEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "initials"); gnLastNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "sn"); gnDisplayName.Text = displayName; gnDescriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); gnOfficeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "physicalDeliveryOfficeName"); gnTelephoneNumberEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "telephoneNumber"); gnEmailEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mail"); adPOBoxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postOfficeBox"); adCityEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "l"); adStateEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "st"); adZipEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "postalCode"); tnHomeEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "homePhone"); tnPagerEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "pager"); tnMobileEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "mobile"); tnFaxEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "facsimileTelephoneNumber"); ozTitleEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "title"); string contactName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); editContactDialog.Title = contactName + " Properties"; gnWebPageEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "wWWHomePage"); adStreetTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "streetAddress"); adCountryEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "co"); tnIPPhoneEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "ipPhone"); tnNotesTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "info"); ozDeptEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "department"); ozCompanyEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "company"); editContactDialog.Icon = Global.latIcon; editContactDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; editContactDialog.Run (); } editContactDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "dialogs.glade", "editContactDialog", null); ui.Autoconnect (this); viewDialog = editContactDialog; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("contact-new-48x48.png"); image180.Pixbuf = pb; } public void OnNameChanged (object o, EventArgs args) { gnNameLabel.Text = gnDisplayName.Text; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "organizationalPerson", "contact" })); aset.Add (new LdapAttribute ("givenName", gnFirstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", gnInitialsEntry.Text)); aset.Add (new LdapAttribute ("sn", gnLastNameEntry.Text)); aset.Add (new LdapAttribute ("displayName", gnDisplayName.Text)); aset.Add (new LdapAttribute ("cn", gnDisplayName.Text)); aset.Add (new LdapAttribute ("wWWHomePage", gnWebPageEntry.Text)); aset.Add (new LdapAttribute ("physicalDeliveryOfficeName", gnOfficeEntry.Text)); aset.Add (new LdapAttribute ("mail", gnEmailEntry.Text)); aset.Add (new LdapAttribute ("description", gnDescriptionEntry.Text)); aset.Add (new LdapAttribute ("street", adStreetTextView.Buffer.Text)); aset.Add (new LdapAttribute ("l", adCityEntry.Text)); aset.Add (new LdapAttribute ("st", adStateEntry.Text)); aset.Add (new LdapAttribute ("postalCode", adZipEntry.Text)); aset.Add (new LdapAttribute ("postOfficeBox", adPOBoxEntry.Text)); aset.Add (new LdapAttribute ("co", adCountryEntry.Text)); aset.Add (new LdapAttribute ("telephoneNumber", gnTelephoneNumberEntry.Text)); aset.Add (new LdapAttribute ("facsimileTelephoneNumber", tnFaxEntry.Text)); aset.Add (new LdapAttribute ("pager", tnPagerEntry.Text)); aset.Add (new LdapAttribute ("mobile", tnMobileEntry.Text)); aset.Add (new LdapAttribute ("homePhone", tnHomeEntry.Text)); aset.Add (new LdapAttribute ("ipPhone", tnIPPhoneEntry.Text)); aset.Add (new LdapAttribute ("title", ozTitleEntry.Text)); aset.Add (new LdapAttribute ("department", ozDeptEntry.Text)); aset.Add (new LdapAttribute ("company", ozCompanyEntry.Text)); aset.Add (new LdapAttribute ("streetAddress", adStreetTextView.Buffer.Text)); aset.Add (new LdapAttribute ("info", tnNotesTextView.Buffer.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/NewAdComputerViewDialog.cs0000644000175000001440000000656211702646352023441 00000000000000// // lat - NewAdComputerViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class NewAdComputerViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newAdComputerDialog; // [Glade.Widget] Gtk.Label computerNameLabel; [Glade.Widget] Gtk.Entry computerNameEntry; [Glade.Widget] Gtk.Entry dnsNameEntry; [Glade.Widget] Gtk.Image image182; public NewAdComputerViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); newAdComputerDialog.Icon = Global.latIcon; newAdComputerDialog.Title = "Add Computer"; newAdComputerDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; newAdComputerDialog.Run (); } newAdComputerDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "dialogs.glade", "newAdComputerDialog", null); ui.Autoconnect (this); viewDialog = newAdComputerDialog; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server-48x48.png"); image182.Pixbuf = pb; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "computer", "organizationalPerson", "person", "user"})); aset.Add (new LdapAttribute ("cn", computerNameEntry.Text)); aset.Add (new LdapAttribute ("dNSHostName", dnsNameEntry.Text)); aset.Add (new LdapAttribute ("sAMAccountName", computerNameEntry.Text)); aset.Add (new LdapAttribute ("userAccountControl", "4128")); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; string userDN = null; if (this.defaultNewContainer == string.Empty) { SelectContainerDialog scd = new SelectContainerDialog (conn, newAdComputerDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the computer\n{0}?", computerNameEntry.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", computerNameEntry.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", computerNameEntry.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/GroupsViewDialog.cs0000644000175000001440000001564611702646352022206 00000000000000// // lat - GroupsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class GroupsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog groupDialog; [Glade.Widget] Gtk.Entry groupNameEntry; [Glade.Widget] Gtk.Entry descriptionEntry; [Glade.Widget] Gtk.TreeView allUsersTreeview; [Glade.Widget] Gtk.TreeView currentMembersTreeview; ListStore allUserStore; ListStore currentMemberStore; LdapEntry currentEntry; List currentMembers = new List (); bool isEdit; public GroupsViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); isEdit = false; populateUsers (); groupDialog.Title = "Add Group"; groupDialog.Icon = Global.latIcon; groupDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; groupDialog.Run (); } groupDialog.Destroy (); } public GroupsViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; isEdit = true; Init (); string groupName = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); groupDialog.Title = groupName + " Properties"; groupNameEntry.Text = groupName; descriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); LdapAttribute attr = currentEntry.getAttribute ("member"); if (attr != null) { foreach (string s in attr.StringValueArray) { LdapEntry userEntry = conn.Data.GetEntry (s); LdapAttribute userNameAttribute = userEntry.getAttribute ("name"); currentMemberStore.AppendValues (userNameAttribute.StringValue); currentMembers.Add (userNameAttribute.StringValue); } } populateUsers (); groupDialog.Run (); while (missingValues || errorOccured){ if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; groupDialog.Run (); } groupDialog.Destroy (); } void populateUsers () { LdapEntry[] _users = conn.Data.Search ("(&(objectclass=user)(objectcategory=Person))"); foreach (LdapEntry le in _users) { LdapAttribute nameAttr = le.getAttribute ("name"); if (nameAttr != null && !currentMembers.Contains (nameAttr.StringValue) ) allUserStore.AppendValues (nameAttr.StringValue); } } void Init () { ui = new Glade.XML (null, "dialogs.glade", "groupDialog", null); ui.Autoconnect (this); viewDialog = groupDialog; TreeViewColumn col; allUserStore = new ListStore (typeof (string)); allUsersTreeview.Model = allUserStore; allUsersTreeview.Selection.Mode = SelectionMode.Multiple; col = allUsersTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; allUserStore.SetSortColumnId (0, SortType.Ascending); currentMemberStore = new ListStore (typeof (string)); currentMembersTreeview.Model = currentMemberStore; currentMembersTreeview.Selection.Mode = SelectionMode.Multiple; col = currentMembersTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; currentMemberStore.SetSortColumnId (0, SortType.Ascending); groupDialog.Resize (350, 400); } public void OnAddClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = allUsersTreeview.Selection.GetSelectedRows (out model); for (int i = tp.Length; i > 0; i--) { allUserStore.GetIter (out iter, tp[(i - 1)]); string user = (string) allUserStore.GetValue (iter, 0); currentMembers.Add (user); currentMemberStore.AppendValues (user); allUserStore.Remove (ref iter); } } public void OnRemoveClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = currentMembersTreeview.Selection.GetSelectedRows (out model); for (int i = tp.Length; i > 0; i--) { currentMemberStore.GetIter (out iter, tp[(i - 1)]); string user = (string) currentMemberStore.GetValue (iter, 0); currentMemberStore.Remove (ref iter); if (currentMembers.Contains (user)) currentMembers.Remove (user); allUserStore.AppendValues (user); } } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "group"})); aset.Add (new LdapAttribute ("cn", groupNameEntry.Text)); aset.Add (new LdapAttribute ("description", descriptionEntry.Text)); aset.Add (new LdapAttribute ("sAMAccountName", groupNameEntry.Text)); aset.Add (new LdapAttribute ("groupType", "-2147483646")); if (currentMembers.Count >= 1) aset.Add (new LdapAttribute ("member", currentMembers.ToArray())); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; if (isEdit) { entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } else { string userDN = null; if (this.defaultNewContainer == string.Empty || this.defaultNewContainer == null) { SelectContainerDialog scd = new SelectContainerDialog (conn, groupDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the group\n{0}?", groupNameEntry.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", groupNameEntry.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/Makefile.am0000644000175000001440000000274511702646352020455 00000000000000CSC = $(MCS) -codepage:utf8 -target:library $(MCS_FLAGS) ASSEMBLY = ActiveDirectoryCoreViews CSFILES = \ ActiveDirectoryComputerViewPlugin.cs \ ActiveDirectoryContactsViewPlugin.cs \ ActiveDirectoryGroupViewPlugin.cs \ ActiveDirectoryUserViewPlugin.cs \ EditAdComputerViewDialog.cs \ EditAdUserViewDialog.cs \ EditContactsViewDialog.cs \ GroupsViewDialog.cs \ NewAdComputerViewDialog.cs \ NewAdUserViewDialog.cs \ NewContactsViewDialog.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) if BUILD_AVAHI AVAHI_REFERENCES = $(AVAHI_LIBS) endif if BUILD_NETWORKMANAGER NM_REFERENCES = \ $(top_builddir)/network-manager/network-manager.dll endif REFERENCES = \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap \ $(NM_REFERENCES) \ $(top_builddir)/lat/lat.exe REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ $(srcdir)/dialogs.glade \ $(top_srcdir)/resources/users.png \ $(top_srcdir)/resources/contact-new.png \ $(top_srcdir)/resources/contact-new-48x48.png \ $(top_srcdir)/resources/stock_person.png \ $(top_srcdir)/resources/x-directory-remote-server-48x48.png RESOURCES_BUILD = $(addprefix /resource:, $(RESOURCES)) $(ASSEMBLY).dll: $(SOURCES_BUILD) $(CSC) -out:$@ $(SOURCES_BUILD) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).dll ASSEMBLYlibdir = $(pkglibdir)/plugins ASSEMBLYlib_DATA = $(ASSEMBLY).dll EXTRA_DIST = \ $(CSFILES) \ dialogs.glade CLEANFILES = \ $(ASSEMBLY).dll \ $(ASSEMBLY).dll.mdb lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/ActiveDirectoryComputerViewPlugin.cs0000644000175000001440000000471111702646352025574 00000000000000// // lat - ActiveDirectoryComputerViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class ActiveDirectoryComputerViewPlugin : ViewPlugin { public ActiveDirectoryComputerViewPlugin () : base () { config.ColumnAttributes = new string[] { "name", "description", "operatingSystem" }; config.ColumnNames = new string[] { "Name", "Description", "Operating System" }; config.Filter = "(&(objectclass=user)(objectcategory=Computer))"; } public override void Init () { } public override void OnAddEntry (Connection connection) { new NewAdComputerViewDialog (connection, this.DefaultNewContainer); } public override void OnEditEntry (Connection connection, LdapEntry le) { new EditAdComputerViewDialog (connection, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "Active Directory Computer View"; } } public override string Name { get { return "Active Directory Computers"; } } public override string Version { get { return Defines.VERSION; } } public override string MenuLabel { get { return "Active Directory Computer"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_5, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("users.png"); } } } }lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/ActiveDirectoryUserViewPlugin.cs0000644000175000001440000000461111702646352024713 00000000000000// // lat - ActiveDirectoryUserViewPlugin.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; using Gdk; using Novell.Directory.Ldap; namespace lat { public class ActiveDirectoryUserViewPlugin : ViewPlugin { public ActiveDirectoryUserViewPlugin () : base () { config.ColumnAttributes = new string[] { "sAMAccountName", "cn" }; config.ColumnNames = new string[] { "Account name", "Real name" }; config.Filter = "(&(objectclass=user)(objectcategory=Person))"; } public override void Init () { } public override void OnAddEntry (Connection connection) { new NewAdUserViewDialog (connection, this.DefaultNewContainer); } public override void OnEditEntry (Connection connection, LdapEntry le) { new EditAdUserViewDialog (connection, le); } public override void OnPopupShow (Menu popup) { } public override void OnSetDefaultValues (Connection conn) { } public override string[] Authors { get { string[] cols = { "Loren Bandiera" }; return cols; } } public override string Copyright { get { return "MMG Security, Inc."; } } public override string Description { get { return "Active Directory User View"; } } public override string Name { get { return "Active Directory Users"; } } public override string Version { get { return "0.1"; } } public override string MenuLabel { get { return "Active Directory User"; } } public override AccelKey MenuKey { get { return new AccelKey (Gdk.Key.Key_8, Gdk.ModifierType.ControlMask, AccelFlags.Visible); } } public override Gdk.Pixbuf Icon { get { return Pixbuf.LoadFromResource ("stock_person.png"); } } } }lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/NewContactsViewDialog.cs0000644000175000001440000000703611702646352023151 00000000000000// // lat - NewContactsViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class NewContactsViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog newContactDialog; [Glade.Widget] Gtk.Label gnNameLabel; [Glade.Widget] Gtk.Entry gnFirstNameEntry; [Glade.Widget] Gtk.Entry gnInitialsEntry; [Glade.Widget] Gtk.Entry gnLastNameEntry; [Glade.Widget] Gtk.Entry gnDisplayName; [Glade.Widget] Gtk.Image image181; public NewContactsViewDialog (Connection connection, string newContainer) : base (connection, newContainer) { Init (); newContactDialog.Icon = Global.latIcon; newContactDialog.Title = "New Contact"; newContactDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; newContactDialog.Run (); } newContactDialog.Destroy (); } private void Init () { ui = new Glade.XML (null, "dialogs.glade", "newContactDialog", null); ui.Autoconnect (this); viewDialog = newContactDialog; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("contact-new-48x48.png"); image181.Pixbuf = pb; } public void OnNameChanged (object o, EventArgs args) { gnNameLabel.Text = gnDisplayName.Text; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"top", "person", "organizationalPerson", "contact" })); aset.Add (new LdapAttribute ("givenName", gnFirstNameEntry.Text)); aset.Add (new LdapAttribute ("initials", gnInitialsEntry.Text)); aset.Add (new LdapAttribute ("sn", gnLastNameEntry.Text)); aset.Add (new LdapAttribute ("displayName", gnDisplayName.Text)); aset.Add (new LdapAttribute ("cn", gnDisplayName.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; string userDN = null; if (this.defaultNewContainer == null) { SelectContainerDialog scd = new SelectContainerDialog (conn, newContactDialog); scd.Title = "Save Group"; scd.Message = String.Format ("Where in the directory would\nyou like save the contact\n{0}?", gnDisplayName.Text); scd.Run (); if (scd.DN == "") return; userDN = String.Format ("cn={0},{1}", gnDisplayName.Text, scd.DN); } else { userDN = String.Format ("cn={0},{1}", gnDisplayName.Text, this.defaultNewContainer); } entry = CreateEntry (userDN); string[] missing = LdapEntryAnalyzer.CheckRequiredAttributes (conn, entry); if (missing.Length != 0) { missingAlert (missing); missingValues = true; return; } if (!Util.AddEntry (conn, entry)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/EditAdComputerViewDialog.cs0000644000175000001440000001507711702646352023576 00000000000000// // lat - EditAdComputerViewDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class EditAdComputerViewDialog : ViewDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog editAdComputerDialog; [Glade.Widget] Gtk.Label computerNameLabel; [Glade.Widget] Gtk.Entry computerNameEntry; [Glade.Widget] Gtk.Entry dnsNameEntry; [Glade.Widget] Gtk.Entry descriptionEntry; [Glade.Widget] Gtk.Entry osNameEntry; [Glade.Widget] Gtk.Entry osVersionEntry; [Glade.Widget] Gtk.Entry osServicePackEntry; [Glade.Widget] Gtk.Entry locationEntry; [Glade.Widget] Gtk.Entry manNameEntry; [Glade.Widget] Gtk.Label manOfficeLabel; [Glade.Widget] Gtk.TextView manStreetTextView; [Glade.Widget] Gtk.Label manCityLabel; [Glade.Widget] Gtk.Label manStateLabel; [Glade.Widget] Gtk.Label manCountryLabel; [Glade.Widget] Gtk.Label manTelephoneNumberLabel; [Glade.Widget] Gtk.Label manFaxNumberLabel; [Glade.Widget] Gtk.Image image178; LdapEntry currentEntry; public EditAdComputerViewDialog (Connection connection, LdapEntry le) : base (connection, null) { currentEntry = le; Init (); computerNameLabel.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); string cpName = (string) conn.Data.GetAttributeValueFromEntry (currentEntry, "cn"); computerNameEntry.Text = cpName.ToUpper(); editAdComputerDialog.Title = cpName + " Properties"; dnsNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "dNSHostName"); descriptionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "description"); osNameEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "operatingSystem"); osVersionEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "operatingSystemVersion"); osServicePackEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "operatingSystemServicePack"); locationEntry.Text = conn.Data.GetAttributeValueFromEntry (currentEntry, "location"); string manName = conn.Data.GetAttributeValueFromEntry (currentEntry, "managedBy"); manNameEntry.Text = manName; if (manName != "" || manName != null) updateManagedBy (manName); editAdComputerDialog.Icon = Global.latIcon; editAdComputerDialog.Run (); while (missingValues || errorOccured) { if (missingValues) missingValues = false; else if (errorOccured) errorOccured = false; editAdComputerDialog.Run (); } editAdComputerDialog.Destroy (); } void updateManagedBy (string dn) { try { LdapEntry leMan = conn.Data.GetEntry (dn); manOfficeLabel.Text = conn.Data.GetAttributeValueFromEntry ( leMan, "physicalDeliveryOfficeName"); manStreetTextView.Buffer.Text = conn.Data.GetAttributeValueFromEntry (leMan, "streetAddress"); manCityLabel.Text = conn.Data.GetAttributeValueFromEntry ( leMan, "l"); manStateLabel.Text = conn.Data.GetAttributeValueFromEntry ( leMan, "st"); manCountryLabel.Text = conn.Data.GetAttributeValueFromEntry ( leMan, "c"); manTelephoneNumberLabel.Text = conn.Data.GetAttributeValueFromEntry (leMan, "telephoneNumber"); manFaxNumberLabel.Text = conn.Data.GetAttributeValueFromEntry ( leMan, "facsimileTelephoneNumber"); } catch { manOfficeLabel.Text = ""; manStreetTextView.Buffer.Text = ""; manCityLabel.Text = ""; manStateLabel.Text = ""; manCountryLabel.Text = ""; manTelephoneNumberLabel.Text = ""; manFaxNumberLabel.Text = ""; } } void Init () { ui = new Glade.XML (null, "dialogs.glade", "editAdComputerDialog", null); ui.Autoconnect (this); viewDialog = editAdComputerDialog; computerNameEntry.Sensitive = false; // computerNameEntry.IsEditable = false; dnsNameEntry.Sensitive = false; // dnsNameEntry.IsEditable = false; osNameEntry.Sensitive = false; osVersionEntry.Sensitive = false; osServicePackEntry.Sensitive = false; manNameEntry.Sensitive = false; manStreetTextView.Sensitive = false; Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server-48x48.png"); image178.Pixbuf = pb; } LdapEntry CreateEntry (string dn) { LdapAttributeSet aset = new LdapAttributeSet(); aset.Add (new LdapAttribute ("objectClass", new string[] {"computer"})); aset.Add (new LdapAttribute ("cn", computerNameLabel.Text)); aset.Add (new LdapAttribute ("description", descriptionEntry.Text)); aset.Add (new LdapAttribute ("dNSHostName", dnsNameEntry.Text)); aset.Add (new LdapAttribute ("operatingSystem", osNameEntry.Text)); aset.Add (new LdapAttribute ("operatingSystemVersion", osVersionEntry.Text)); aset.Add (new LdapAttribute ("operatingSystemServicePack", osServicePackEntry.Text)); aset.Add (new LdapAttribute ("location", locationEntry.Text)); aset.Add (new LdapAttribute ("managedBy", manNameEntry.Text)); LdapEntry newEntry = new LdapEntry (dn, aset); return newEntry; } public void OnManClearClicked (object o, EventArgs args) { manNameEntry.Text = ""; updateManagedBy ("none"); } public void OnManChangeClicked (object o, EventArgs args) { SelectContainerDialog scd = new SelectContainerDialog (conn, editAdComputerDialog); scd.Title = "Save Computer"; scd.Message = Mono.Unix.Catalog.GetString ( "Select a user who will manage ") + computerNameLabel.Text; scd.Run (); if (scd.DN == "") { return; } else { manNameEntry.Text = scd.DN; updateManagedBy (scd.DN); } } public void OnOkClicked (object o, EventArgs args) { LdapEntry entry = null; entry = CreateEntry (currentEntry.DN); LdapEntryAnalyzer lea = new LdapEntryAnalyzer (); lea.Run (currentEntry, entry); if (lea.Differences.Length == 0) return; if (!Util.ModifyEntry (conn, entry.DN, lea.Differences)) errorOccured = true; } } } lat-1.2.4/lat/plugins/ActiveDirectoryCoreViews/dialogs.glade0000644000175000001440000107015111702646352021036 00000000000000 True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True True True True GTK_POS_TOP False False True False 0 True False 0 True gtk-network 6 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True 0 True True 5 True True True False 0 True Computer name (pre-Windows 2000): False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True DNS name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True False True True General False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True Name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Version: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Service pack: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True Operating System False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True 6 stock_internet 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 True True True False 0 True Location: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True Location False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True Name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False 0 True GTK_BUTTONBOX_END 5 True True True gtk-clear True GTK_RELIEF_NORMAL True True True True Change... True GTK_RELIEF_NORMAL True 5 True True 0 True True 5 True True True False 0 True Office: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Street: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True True False 0 True City: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True State/Province: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Country/region: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True 0 True True True False 0 True Telephone number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Fax Number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True False True True Managed By False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True True True True GTK_POS_TOP False False True False 0 True False 0 True 6 stock_person 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False 0 True True True False 0 True 10 True True 0 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Display Name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Office: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True 10 True True 0 True True True False 0 True Telephone number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True E-mail: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Web page: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True General False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Street: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 10 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True True False 0 True P.O. Box: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True City: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True State/province: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Zip/Postal Code: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Country/region: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True False True True Address False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Home: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Pager: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Mobile: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Fax: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True IP phone: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True <b>Telephone numbers</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 5 True True True False 0 True False 0 True <b>Notes:</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 0 True True True False 0 True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True 0 True True False True True Telephones False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Title: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Department: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Company: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True 0 True True False True True Organization False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True User logon name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True 0 True True False True True Account False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Profile path: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Logon script: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True True True True 0 True * False 5 True True 5 True True True <b>User profile</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 0 True True True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Local path: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 0 True True True <b>Home folder</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 0 True True False True True Profile False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab 0 True True True New Computer GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True gtk-network 6 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 5 True True True False 0 True 5 True True 5 True True True False 0 True Computer name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True True False 0 True Computer name (pre-Windows 2000): False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True False 0 True <b>General</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Group name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True 0 False True 0 True True True New User GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True 6 stock_person 0.5 0.5 0 0 10 False False True False 0 True False 0 True False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True 5 False False 5 True True True False 0 True 5 True True 5 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 False False True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Full name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True 5 True True 5 True True True False 0 True User logon name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True 0 True True True False 0 True User logon name (pre-Windows 2000): False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Primary Group: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True False 0 5 True True 5 True True True False 0 True Password: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True False 0 True * False 5 True True 5 True True True False 0 True True User must change password at next logon True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True True False 0 True True User cannont change password True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True True False 0 True True Password never expires True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True True False 0 True True Account is disabled True GTK_RELIEF_NORMAL True False False True 10 False False 5 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True False 0 True <b>General</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 True True True False 0 True Group name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True 0 False True True False 0 True False 0 True <b>Members</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 5 False True True False 0 True False 0 True False 0 True All users: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True False False False True False False False 5 True True 5 True True True GTK_BUTTONBOX_SPREAD 0 True True True gtk-add True GTK_RELIEF_NORMAL True True True True gtk-remove True GTK_RELIEF_NORMAL True 10 False True True False 0 True False 0 True Current members: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 0 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True False False False True False False False 5 True True 5 True True 5 True True 5 True True 0 True True True GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True True True True GTK_POS_TOP False False True False 0 True False 0 True 6 stock_contact 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False 0 True True True False 0 True 10 True True 0 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Display Name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Description: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Office: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True 10 True True 0 True True True False 0 True Telephone number: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True E-mail: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Web page: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True False True True General False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Street: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 0 False False 10 False False True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True True False 0 True P.O. Box: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True City: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True State/province: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Zip/Postal Code: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Country/region: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 5 True True False True True Address False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True 0 0.5 GTK_SHADOW_NONE True 0.5 0.5 1 1 0 0 12 0 True False 0 True False 0 True Home: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Pager: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Mobile: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True Fax: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True False 0 True IP phone: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 5 True True 5 True True True <b>Telephone numbers</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 label_item 5 True True True False 0 True False 0 True <b>Notes:</b> False True GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 0 True True True False 0 True True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC GTK_SHADOW_IN GTK_CORNER_TOP_LEFT True True True False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 5 True True 5 True True 0 True True False True True Telephones False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab True False 0 True False 0 True False 0 True Title: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Department: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True True False 0 True Company: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 5 True True 0 True True 0 True True False True True Organization False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 tab 0 True True True New Contact GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False False False True False False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False True True False 0 True GTK_BUTTONBOX_END True True True gtk-cancel True GTK_RELIEF_NORMAL True -6 True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END True False 0 True False 0 True 6 stock_contact 0.5 0.5 0 0 10 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False 5 True True True False 0 True 5 True True 5 True True True False 0 True First name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 False False True Initials: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 5 False False True True True True 0 True * False 0 True True 5 True True True False 0 True Last name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True True False 0 True Display name: False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 PANGO_ELLIPSIZE_NONE -1 False 0 10 False False True True True True 0 True * False 0 True True 5 True True 0 True True lat-1.2.4/lat/AssemblyInfo.cs0000644000175000001440000000154412052151626012721 00000000000000using System.Reflection; using System.Runtime.CompilerServices; // // AssemblyInfo.cs.in // [assembly: AssemblyTitle("lat")] [assembly: AssemblyDescription("LDAP Administration Tool")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("MMG Security, Inc.")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("1.2.4")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] lat-1.2.4/lat/LdapSearch.cs0000644000175000001440000000345611702646352012346 00000000000000// // lat - LdapSearch.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; public class LdapSearch { // FIXME: look into using RfcFilter() class for this private string _filter = ""; public LdapSearch () { } public void addCondition (string attr, string op, string val) { switch (op) { case "begins with": _filter += String.Format ("({0}={1}*)", attr, val); break; case "ends with": _filter += String.Format ("({0}=*{1})", attr, val); break; case "equals": _filter += String.Format ("({0}={1})", attr, val); break; case "contains": _filter += String.Format ("({0}=*{1}*)", attr, val); break; case "is present": _filter += String.Format ("({0}=*)", attr); break; default: break; } } public void addBool (string opBool) { switch (opBool) { case "AND": _filter = String.Format ("(&{0}", _filter); break; case "OR": _filter = String.Format ("(|{0}", _filter); break; default: break; } } public void endBool () { if (_filter.StartsWith("(&") || _filter.StartsWith("(|")) _filter += ")"; } public string Filter { get { return _filter; } } } lat-1.2.4/lat/Makefile.in0000644000175000001440000006374112052151450012046 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lat DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Defines.cs.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in $(srcdir)/lat.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = AssemblyInfo.cs Defines.cs lat CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(ASSEMBLYlibdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(ASSEMBLYlib_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVAHI_CFLAGS = @AVAHI_CFLAGS@ AVAHI_LIBS = @AVAHI_LIBS@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOME_KEYRING_CFLAGS = @GNOME_KEYRING_CFLAGS@ GNOME_KEYRING_LIBS = @GNOME_KEYRING_LIBS@ GREP = @GREP@ GTKSHARP_CFLAGS = @GTKSHARP_CFLAGS@ GTKSHARP_LIBS = @GTKSHARP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MCS = @MCS@ MCS_FLAGS = @MCS_FLAGS@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MONO = @MONO@ MONO_CFLAGS = @MONO_CFLAGS@ MONO_FLAGS = @MONO_FLAGS@ MONO_LIBS = @MONO_LIBS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NETWORKMANAGER_ALT_CFLAGS = @NETWORKMANAGER_ALT_CFLAGS@ NETWORKMANAGER_ALT_LIBS = @NETWORKMANAGER_ALT_LIBS@ NETWORKMANAGER_CFLAGS = @NETWORKMANAGER_CFLAGS@ NETWORKMANAGER_LIBS = @NETWORKMANAGER_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . plugins @BUILD_AVAHI_TRUE@AVAHI_CSFLAGS = -define:ENABLE_AVAHI @BUILD_AVAHI_TRUE@AVAHI_CSFILES = \ @BUILD_AVAHI_TRUE@ $(srcdir)/ServiceFinder.cs @BUILD_AVAHI_TRUE@AVAHI_REFERENCES = $(AVAHI_LIBS) @BUILD_NETWORKMANAGER_TRUE@NETWORKMANAGER_CSFLAGS = -define:ENABLE_NETWORKMANAGER @BUILD_NETWORKMANAGER_TRUE@NETWORKMANAGER_REFERENCES = \ @BUILD_NETWORKMANAGER_TRUE@ $(top_builddir)/network-manager/network-manager.dll CSC = $(MCS) -codepage:utf8 $(MCS_FLAGS) $(AVAHI_CSFLAGS) $(NETWORKMANAGER_CSFLAGS) ASSEMBLY = lat CSFILES = \ AboutDialog.cs \ AddObjectClassDialog.cs \ AssemblyInfo.cs \ AttributeEditorWidget.cs \ ConnectDialog.cs \ ConnectionManager.cs \ CreateEntryDialog.cs \ Defines.cs \ LDIF.cs \ LdapEntryAnalyzer.cs \ LdapSearch.cs \ LdapServer.cs \ LdapTreeView.cs \ Log.cs \ LoginDialog.cs \ Main.cs \ MassEditDialog.cs \ NewEntryDialog.cs \ PasswordDialog.cs \ Preferences.cs \ ProfileDialog.cs \ RenameEntryDialog.cs \ SMBPassword.cs \ SambaPopulateDialog.cs \ SchemaTreeView.cs \ SearchBuilderDialog.cs \ SearchResultsTreeView.cs \ SelectContainerDialog.cs \ SelectGroupsDialog.cs \ ServerData.cs \ Templates.cs \ TemplatesDialog.cs \ TemplateEditorDialog.cs \ TimeDateDialog.cs \ Util.cs \ ViewDataTreeView.cs \ ViewDialog.cs \ ViewPluginManager.cs \ ViewsTreeView.cs \ Window.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) REFERENCES = \ ../gnome-keyring-glue/gnome-keyring-glue.dll \ $(NETWORKMANAGER_REFERENCES) \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ lat.glade \ lat.png \ contact-new.png \ contact-new-48x48.png \ edit-find.png \ edit-find-48x48.png \ locked16x16.png \ locked-48x48.png \ stock_person.png \ text-x-generic.png \ unlocked16x16.png \ users.png \ x-directory-normal.png \ x-directory-remote-server.png \ x-directory-remote-workgroup.png \ mail-message-new.png \ document-save.png \ go-home.png \ x-directory-remote-server-48x48.png RESOURCES_BUILD = $(addprefix /resource:$(top_srcdir)/resources/, $(RESOURCES)) ASSEMBLYlibdir = $(pkglibdir) ASSEMBLYlib_DATA = $(ASSEMBLY).exe man_MANS = \ $(ASSEMBLY).1 bin_SCRIPTS = $(ASSEMBLY) EXTRA_DIST = \ $(CSFILES) \ ServiceFinder.cs \ $(man_MANS) \ AssemblyInfo.cs.in \ Defines.cs.in \ $(ASSEMBLY).in CLEANFILES = \ $(ASSEMBLY).exe \ $(ASSEMBLY).exe.mdb DISTCLEANFILES = \ AssemblyInfo.cs \ Defines.cs \ $(ASSEMBLY) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lat/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lat/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ Defines.cs: $(top_builddir)/config.status $(srcdir)/Defines.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ lat: $(top_builddir)/config.status $(srcdir)/lat.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } install-ASSEMBLYlibDATA: $(ASSEMBLYlib_DATA) @$(NORMAL_INSTALL) test -z "$(ASSEMBLYlibdir)" || $(MKDIR_P) "$(DESTDIR)$(ASSEMBLYlibdir)" @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ASSEMBLYlibdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ASSEMBLYlibdir)" || exit $$?; \ done uninstall-ASSEMBLYlibDATA: @$(NORMAL_UNINSTALL) @list='$(ASSEMBLYlib_DATA)'; test -n "$(ASSEMBLYlibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ASSEMBLYlibdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ASSEMBLYlibdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(ASSEMBLYlibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-ASSEMBLYlibDATA install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-ASSEMBLYlibDATA uninstall-binSCRIPTS \ uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-ASSEMBLYlibDATA install-am install-binSCRIPTS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-ASSEMBLYlibDATA \ uninstall-am uninstall-binSCRIPTS uninstall-man uninstall-man1 $(ASSEMBLY).exe: $(SOURCES_BUILD) $(AVAHI_CSFILES) $(CSC) -out:$@ $(SOURCES_BUILD) $(AVAHI_CSFILES) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).exe # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lat-1.2.4/lat/LoginDialog.cs0000644000175000001440000000616511702646352012530 00000000000000// // lat - LoginDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using Novell.Directory.Ldap; namespace lat { public class LoginDialog { [Glade.Widget] Gtk.Dialog loginDialog; [Glade.Widget] Gtk.Label msgLabel; [Glade.Widget] Gtk.Entry userEntry; [Glade.Widget] Gtk.Entry passEntry; [Glade.Widget] Gtk.CheckButton useSSLCheckButton; [Glade.Widget] Gtk.Image image455; Glade.XML ui; Connection conn; bool isRelogin = false; string userName; string userPass; public LoginDialog (string user) { Init (); useSSLCheckButton.HideAll (); msgLabel.Text = Mono.Unix.Catalog.GetString ("Enter your password"); userEntry.Text = user; } public LoginDialog (string msg, string user) { Init (); useSSLCheckButton.HideAll (); msgLabel.Text = msg; userEntry.Text = user; } public LoginDialog (Connection connection, string msg) { Init (); conn = connection; msgLabel.Text = msg; isRelogin = true; } public bool Run () { ResponseType res = (ResponseType) loginDialog.Run (); loginDialog.Destroy (); if (res == ResponseType.Ok) return true; return false; } private void Init () { ui = new Glade.XML (null, "lat.glade", "loginDialog", null); ui.Autoconnect (this); Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("locked-48x48.png"); image455.Pixbuf = pb; loginDialog.Icon = Global.latIcon; } private void Relogin () { try { if (useSSLCheckButton.Active) conn.Settings.Encryption = EncryptionType.SSL; if (conn.Settings.Encryption == EncryptionType.TLS) conn.StartTLS (); conn.Bind (userEntry.Text, passEntry.Text); } catch (Exception e) { string errorMsg = Mono.Unix.Catalog.GetString ("Unable to re-login"); errorMsg += "\nError: " + e.Message; HIGMessageDialog dialog = new HIGMessageDialog ( loginDialog, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Login error", errorMsg); dialog.Run (); dialog.Destroy (); } } public void OnOkClicked (object o, EventArgs args) { if (isRelogin) { Relogin (); } else { userName = userEntry.Text; userPass = passEntry.Text; } loginDialog.HideAll (); } public void OnCancelClicked (object o, EventArgs args) { loginDialog.HideAll (); } public string UserName { get { return userName; } } public string UserPass { get { return userPass; } } } } lat-1.2.4/lat/AttributeEditorWidget.cs0000644000175000001440000003775311702646352014625 00000000000000// // lat - AttributeEditorWidget.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using System.Collections.Specialized; using System.IO; using Gtk; using GLib; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Utilclass; namespace lat { public class AttributeEditorWidget : Gtk.VBox { ScrolledWindow sw; Button applyButton; TreeView tv; ListStore store; Connection conn; string currentDN; bool displayAll; List allAttrs; NameValueCollection currentAttributes; public AttributeEditorWidget() : base () { sw = new ScrolledWindow (); sw.HscrollbarPolicy = PolicyType.Automatic; sw.VscrollbarPolicy = PolicyType.Automatic; store = new ListStore (typeof (string), typeof(string)); store.SetSortColumnId (0, SortType.Ascending); tv = new TreeView (); tv.Model = store; TreeViewColumn col; col = tv.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; CellRendererText cell = new CellRendererText (); cell.Editable = true; cell.Edited += new EditedHandler (OnAttributeEdit); tv.AppendColumn ("Value", cell, "text", 1); tv.KeyPressEvent += new KeyPressEventHandler (OnKeyPress); tv.ButtonPressEvent += new ButtonPressEventHandler (OnRightClick); tv.RowActivated += new RowActivatedHandler (OnRowActivated); sw.AddWithViewport (tv); HButtonBox hb = new HButtonBox (); hb.Layout = ButtonBoxStyle.End; applyButton = new Button (); applyButton.Label = "Apply"; applyButton.Image = new Gtk.Image (Stock.Apply, IconSize.Button); applyButton.Clicked += new EventHandler (OnApplyClicked); applyButton.Sensitive = false; hb.Add (applyButton); this.PackStart (sw, true, true, 0); this.PackStart (hb, false, false, 5); this.ShowAll (); } void OnApplyClicked (object o, EventArgs args) { List modList = new List (); NameValueCollection newAttributes = new NameValueCollection (); foreach (object[] row in this.store) { string newValue = row[1].ToString(); if (newValue == "" || newValue == null) continue; newAttributes.Add (row[0].ToString(), newValue); } foreach (string key in newAttributes.AllKeys) { string[] newValues = newAttributes.GetValues(key); string[] oldValues = currentAttributes.GetValues (key); LdapAttribute la = new LdapAttribute (key, newValues); if (oldValues == null) { LdapModification lm = new LdapModification (LdapModification.ADD, la); modList.Add (lm); } else { foreach (string nv in newValues) { bool foundMatch = false; foreach (string ov in oldValues) if (ov == nv) foundMatch = true; if (!foundMatch) { LdapModification lm = new LdapModification (LdapModification.REPLACE, la); modList.Add (lm); } } } } foreach (string key in currentAttributes.AllKeys) { string[] newValues = newAttributes.GetValues (key); if (newValues == null) { string[] oldValues = currentAttributes.GetValues (key); LdapAttribute la = new LdapAttribute (key, oldValues); LdapModification lm = new LdapModification (LdapModification.DELETE, la); modList.Add (lm); } else { LdapAttribute la = new LdapAttribute (key, newValues); LdapModification lm = new LdapModification (LdapModification.REPLACE, la); modList.Add (lm); } } Util.ModifyEntry (conn, currentDN, modList.ToArray()); } void OnAttributeEdit (object o, EditedArgs args) { TreeIter iter; if (!store.GetIterFromString (out iter, args.Path)) return; string oldText = (string) store.GetValue (iter, 1); if (oldText == args.NewText) return; store.SetValue (iter, 1, args.NewText); applyButton.Sensitive = true; } public void Show (Connection connection, LdapEntry entry, bool showAll) { displayAll = showAll; conn = connection; currentDN = entry.DN; currentAttributes = new NameValueCollection (); // FIXME: crashes after an apply if I don't re-create the store; store = new ListStore (typeof (string), typeof(string)); store.SetSortColumnId (0, SortType.Ascending); tv.Model = store; // store.Clear (); allAttrs = new List (); LdapAttribute a = entry.getAttribute ("objectClass"); for (int i = 0; i < a.StringValueArray.Length; i++) { string o = (string) a.StringValueArray[i]; store.AppendValues ("objectClass", o); currentAttributes.Add ("objectClass", o); string[] attrs = conn.Data.GetAllAttributes (o); if (attrs != null) { foreach (string at in attrs) if (!allAttrs.Contains (at)) allAttrs.Add (at); } else { Log.Debug("Could not retrieve any attribute for objectClass " + o); } } LdapAttributeSet attributeSet = entry.getAttributeSet (); // Fedora Directory Server supports an Access Control Item (ACI) // but it is not listed as "allowed attribute" for any objectClass // found in Fedora's LDAP schema. if (showAll && conn.Settings.ServerType == LdapServerType.FedoraDirectory) { LdapEntry[] acientries = conn.Data.Search( currentDN, LdapConnection.SCOPE_BASE, "objectclass=*", new string[] {"aci"} ); if (acientries.Length > 0) { LdapEntry acientry = acientries[0]; LdapAttribute aciattr = acientry.getAttribute("aci"); if (aciattr != null) if (attributeSet.Add(aciattr) == false) Log.Debug ("Could not add ACI attribute."); } } foreach (LdapAttribute attr in attributeSet) { if (allAttrs.Contains (attr.Name)) allAttrs.Remove (attr.Name); if (attr.Name.ToLower() == "objectclass") continue; try { foreach (string s in attr.StringValueArray) { store.AppendValues (attr.Name, s); currentAttributes.Add (attr.Name, s); } } catch (ArgumentOutOfRangeException e) { // FIXME: this only happens with gmcs store.AppendValues (attr.Name, ""); Log.Debug ("Show attribute arugment out of range: {0}", attr.Name); Log.Debug (e.Message); } } if (!showAll) return; foreach (string n in allAttrs) store.AppendValues (n, ""); } void InsertAttribute () { string attrName; TreeModel model; TreeIter iter; if (!tv.Selection.GetSelected (out model, out iter)) return; attrName = (string) store.GetValue (iter, 0); if (attrName == null) return; SchemaParser sp = conn.Data.GetAttributeTypeSchema (attrName); if (!sp.Single) { TreeIter newRow = store.InsertAfter (iter); store.SetValue (newRow, 0, attrName); applyButton.Sensitive = true; } else { HIGMessageDialog dialog = new HIGMessageDialog ( null, 0, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, "Unable to insert value", "Multiple values not supported by this attribute"); dialog.Run (); dialog.Destroy (); } } void DeleteAttribute () { TreeModel model; TreeIter iter; if (!tv.Selection.GetSelected (out model, out iter)) return; store.Remove (ref iter); applyButton.Sensitive = true; } void OnKeyPress (object o, KeyPressEventArgs args) { switch (args.Event.Key) { case Gdk.Key.Insert: case Gdk.Key.KP_Insert: InsertAttribute (); break; case Gdk.Key.Delete: case Gdk.Key.KP_Delete: DeleteAttribute (); break; default: break; } } [ConnectBefore] void OnRightClick (object o, ButtonPressEventArgs args) { if (args.Event.Button == 3) DoPopUp (); } void RunViewerPlugin (AttributeViewPlugin avp, string attributeName) { LdapEntry le = conn.Data.GetEntry (currentDN); LdapAttribute la = le.getAttribute (attributeName); bool existing = false; if (la != null) existing = true; LdapAttribute newla = new LdapAttribute (attributeName); switch (avp.DataType) { case ViewerDataType.Binary: if (existing) avp.OnActivate (attributeName, SupportClass.ToByteArray (la.ByteValue)); else avp.OnActivate (attributeName, new byte[0]); break; case ViewerDataType.String: if (existing) avp.OnActivate (attributeName, la.StringValue); else avp.OnActivate (attributeName, ""); break; } if (avp.ByteValue != null) newla.addBase64Value (System.Convert.ToBase64String (avp.ByteValue, 0, avp.ByteValue.Length)); else if (avp.StringValue != null) newla.addValue (avp.StringValue); else return; LdapModification lm; if (existing) lm = new LdapModification (LdapModification.REPLACE, newla); else lm = new LdapModification (LdapModification.ADD, newla); List modList = new List (); modList.Add (lm); Util.ModifyEntry (conn, currentDN, modList.ToArray()); this.Show (conn, conn.Data.GetEntry (currentDN), displayAll); } void OnRowActivated (object o, RowActivatedArgs args) { TreePath path = args.Path; TreeIter iter; if (store.GetIter (out iter, path)) { string name = null; name = (string) store.GetValue (iter, 0); foreach (AttributeViewPlugin avp in Global.Plugins.AttributeViewPlugins) { foreach (string an in avp.AttributeNames) if (an.ToLower() == name.ToLower()) if (conn.AttributeViewers.Contains (avp.GetType().ToString())) RunViewerPlugin (avp, name); } } } void OnInsertActivate (object o, EventArgs args) { InsertAttribute (); } void OnDeleteActivate (object o, EventArgs args) { DeleteAttribute (); } public string GetAttributeName () { TreeModel model; TreeIter iter; string name; if (tv.Selection.GetSelected (out model, out iter)) { name = (string) store.GetValue (iter, 0); return name; } return null; } byte[] ReadFileBytes (string fileName) { List fileBytes = new List (); try { FileStream fs = File.OpenRead (fileName); byte[] buf = new byte[4096]; int ret = 0; do { ret = fs.Read (buf, 0, buf.Length); for (int i = 0; i < ret; i++) fileBytes.Add (buf[i]); } while (ret != 0); fs.Close (); } catch (Exception e) { Log.Debug (e); HIGMessageDialog dialog = new HIGMessageDialog ( null, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Add binary value error", e.Message); dialog.Run (); dialog.Destroy (); } return fileBytes.ToArray(); } void OnAddBinaryValueActivate (object o, EventArgs args) { FileChooserDialog fcd = new FileChooserDialog ( Mono.Unix.Catalog.GetString ("Select file to add as binary attribute"), Gtk.Stock.Open, null, FileChooserAction.Open); fcd.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel); fcd.AddButton (Gtk.Stock.Open, ResponseType.Ok); fcd.SelectMultiple = false; ResponseType response = (ResponseType) fcd.Run(); if (response == ResponseType.Ok) { byte[] fileBytes = ReadFileBytes (fcd.Filename); if (fileBytes.Length == 0) return; string attributeName = GetAttributeName (); string attributeValue = Base64.encode (SupportClass.ToSByteArray (fileBytes)); LdapEntry le = conn.Data.GetEntry (currentDN); LdapAttribute la = le.getAttribute (attributeName); bool existing = false; if (la != null) existing = true; LdapAttribute newla = new LdapAttribute (attributeName); newla.addBase64Value (attributeValue); LdapModification lm; if (existing) lm = new LdapModification (LdapModification.REPLACE, newla); else lm = new LdapModification (LdapModification.ADD, newla); List modList = new List (); modList.Add (lm); Util.ModifyEntry (conn, currentDN, modList.ToArray()); this.Show (conn, conn.Data.GetEntry (currentDN), displayAll); } fcd.Destroy(); } void WriteBytesToFile (string fileName, byte[] fileBytes) { try { FileStream fs = File.OpenWrite (fileName); fs.Write (fileBytes, 0, fileBytes.Length); fs.Close (); } catch (Exception e) { Log.Debug (e); HIGMessageDialog dialog = new HIGMessageDialog ( null, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Save binary attribute error", e.Message); dialog.Run (); dialog.Destroy (); } } void OnSaveBinaryValueActivate (object o, EventArgs args) { FileChooserDialog fcd = new FileChooserDialog ( Mono.Unix.Catalog.GetString ("Save binary as"), Gtk.Stock.Save, null, FileChooserAction.Save); fcd.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel); fcd.AddButton (Gtk.Stock.Save, ResponseType.Ok); fcd.SelectMultiple = false; ResponseType response = (ResponseType) fcd.Run(); if (response == ResponseType.Ok) { string attributeName = GetAttributeName (); LdapEntry le = conn.Data.GetEntry (currentDN); LdapAttribute la = le.getAttribute (attributeName); WriteBytesToFile (fcd.Filename, SupportClass.ToByteArray (la.ByteValue)); } fcd.Destroy (); } void OnAddObjectClassActivate (object o, EventArgs args) { AddObjectClassDialog dlg = new AddObjectClassDialog (conn); foreach (string s in dlg.ObjectClasses) { string[] req = conn.Data.GetRequiredAttrs (s); store.AppendValues ("objectClass", s); if (req == null) continue; foreach (string r in req) { if (allAttrs.Contains (r)) allAttrs.Remove (r); string m = currentAttributes[r]; if (m == null) { store.AppendValues (r, ""); currentAttributes.Add (r, ""); } } } } void DoPopUp() { Menu popup = new Menu(); ImageMenuItem addBinaryValueItem = new ImageMenuItem ("Add binary value..."); addBinaryValueItem.Image = new Gtk.Image (Stock.Open, IconSize.Menu); addBinaryValueItem.Activated += new EventHandler (OnAddBinaryValueActivate); addBinaryValueItem.Show (); popup.Append (addBinaryValueItem); ImageMenuItem newObjectClassItem = new ImageMenuItem ("Add object class(es)..."); newObjectClassItem.Image = new Gtk.Image (Stock.Add, IconSize.Menu); newObjectClassItem.Activated += new EventHandler (OnAddObjectClassActivate); newObjectClassItem.Show (); popup.Append (newObjectClassItem); ImageMenuItem deleteItem = new ImageMenuItem ("Delete attribute"); deleteItem.Image = new Gtk.Image (Stock.Delete, IconSize.Menu); deleteItem.Activated += new EventHandler (OnDeleteActivate); deleteItem.Show (); popup.Append (deleteItem); ImageMenuItem newItem = new ImageMenuItem ("Insert attribute"); newItem.Image = new Gtk.Image (Stock.New, IconSize.Menu); newItem.Activated += new EventHandler (OnInsertActivate); newItem.Show (); popup.Append (newItem); ImageMenuItem saveBinaryValueItem = new ImageMenuItem ("Save binary value..."); saveBinaryValueItem.Image = new Gtk.Image (Stock.Save, IconSize.Menu); saveBinaryValueItem.Activated += new EventHandler (OnSaveBinaryValueActivate); saveBinaryValueItem.Show (); popup.Append (saveBinaryValueItem); popup.Popup(null, null, null, 3, Gtk.Global.CurrentEventTime); } } } lat-1.2.4/lat/AboutDialog.cs0000644000175000001440000000300511704514413012512 00000000000000// // lat - AboutDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Gtk; namespace lat { public class AboutDialog { static string[] _author = { "Loren Bandiera, Jeroen Asselman" }; static string[] _docs = { "Loren Bandiera" }; static string _translators = "Pablo Borges (pt_BR)\nThomas Constans (fr_FR)"; static string _desc = "LDAP Administration Tool"; static string _copy = "Copyright \xa9 2005-2006 MMG Security Inc.\nCopyright \xa9 2008-2012 Jeroen Asselman"; public AboutDialog () { Gtk.AboutDialog ab = new Gtk.AboutDialog (); ab.Authors = _author; ab.Comments = _desc; ab.Copyright = _copy; ab.Documenters = _docs; ab.ProgramName = Defines.PACKAGE; ab.TranslatorCredits = _translators; ab.Version = Defines.VERSION; ab.Icon = Global.latIcon; ab.Run (); ab.Destroy (); } } } lat-1.2.4/lat/TimeDateDialog.cs0000644000175000001440000000353711702646352013154 00000000000000// // lat - TimeDateDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; namespace lat { public class TimeDateDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog timeDateDialog; [Glade.Widget] Gtk.SpinButton hourSpin; [Glade.Widget] Gtk.SpinButton minuteSpin; [Glade.Widget] Gtk.SpinButton secondSpin; [Glade.Widget] Gtk.Calendar calendar; private double _time = 0; public TimeDateDialog () { ui = new Glade.XML (null, "lat.glade", "timeDateDialog", null); ui.Autoconnect (this); timeDateDialog.Icon = Global.latIcon; timeDateDialog.Run (); timeDateDialog.Destroy (); } public void OnOkClicked (object o, EventArgs args) { int hour = Convert.ToInt32 (hourSpin.Value); int minute = Convert.ToInt32 (minuteSpin.Value); int second = Convert.ToInt32 (secondSpin.Value); DateTime dt = calendar.GetDate (); DateTime userDT = new DateTime (dt.Year, dt.Month, dt.Day, hour, minute, second); _time = Util.GetUnixTime (userDT); timeDateDialog.HideAll (); } public void OnCancelClicked (object o, EventArgs args) { timeDateDialog.HideAll (); } public double UnixTime { get { return _time; } } } } lat-1.2.4/lat/Defines.cs0000644000175000001440000000212312052151626011675 00000000000000// // lat - Defines.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Xml; namespace lat { public struct Defines { public static string PACKAGE = "lat"; public static string VERSION = "1.2.4"; public static string LOCALE_DIR = "/usr/local/share/locale"; public static string SYS_PLUGIN_DIR = "/usr/local/lib/lat/plugins"; } } lat-1.2.4/lat/ConnectDialog.cs0000644000175000001440000001650411702646352013047 00000000000000// // lat - ConnectDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Net.Sockets; using Novell.Directory.Ldap; using Gtk; namespace lat { public class ConnectDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog connectionDialog; [Glade.Widget] Gtk.Entry hostEntry; [Glade.Widget] Gtk.Entry portEntry; [Glade.Widget] Gtk.Entry ldapBaseEntry; [Glade.Widget] Gtk.Entry userEntry; [Glade.Widget] Gtk.Entry passEntry; [Glade.Widget] Gtk.RadioButton tlsRadioButton; [Glade.Widget] Gtk.RadioButton sslRadioButton; [Glade.Widget] Gtk.RadioButton noEncryptionRadioButton; [Glade.Widget] Gtk.CheckButton saveProfileButton; [Glade.Widget] Gtk.Entry profileNameEntry; [Glade.Widget] Gtk.HBox stHBox; // [Glade.Widget] Gtk.Notebook notebook1; // [Glade.Widget] TreeView profileListview; [Glade.Widget] Gtk.Image image5; // bool haveProfiles = false; EncryptionType encryption; // ListStore profileListStore; ComboBox serverTypeComboBox; public ConnectDialog () { ui = new Glade.XML (null, "lat.glade", "connectionDialog", null); ui.Autoconnect (this); Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server-48x48.png"); image5.Pixbuf = pb; connectionDialog.Icon = Global.latIcon; connectionDialog.Resizable = false; portEntry.Text = "389"; createCombo (); // profileListStore = new ListStore (typeof (string)); // profileListview.Model = profileListStore; // profileListStore.SetSortColumnId (0, SortType.Ascending); // // TreeViewColumn col; // col = profileListview.AppendColumn ("Name", new CellRendererText (), "text", 0); // col.SortColumnId = 0; // // UpdateProfileList (); // // if (haveProfiles) { // // notebook1.CurrentPage = 1; // connectionDialog.Resizable = true; // } noEncryptionRadioButton.Active = true; connectionDialog.Run (); connectionDialog.Destroy (); } void createCombo () { serverTypeComboBox = ComboBox.NewText (); serverTypeComboBox.AppendText ("OpenLDAP"); serverTypeComboBox.AppendText ("Microsoft Active Directory"); serverTypeComboBox.AppendText ("Fedora Directory Server"); serverTypeComboBox.AppendText ("Generic LDAP server"); serverTypeComboBox.Active = 0; serverTypeComboBox.Show (); stHBox.PackStart (serverTypeComboBox, true, true, 5); } // private string GetSelectedProfileName () // { // TreeIter iter; // TreeModel model; // // if (profileListview.Selection.GetSelected (out model, out iter)) { // // string name = (string) model.GetValue (iter, 0); // return name; // } // // return null; // } // // private ConnectionProfile GetSelectedProfile () // { // ConnectionProfile cp = new ConnectionProfile(); // string profileName = GetSelectedProfileName (); // // if (profileName != null) // cp = Global.Profiles [profileName]; // // return cp; // } public void OnPageSwitch (object o, SwitchPageArgs args) { // if (args.PageNum == 0) // connectionDialog.Resizable = false; // else if (args.PageNum == 1) // connectionDialog.Resizable = true; } public void OnRowDoubleClicked (object o, RowActivatedArgs args) { // ProfileConnect (); } // void UpdateProfileList () // { // string[] names = Global.Profiles.GetProfileNames (); // // if (names.Length > 1) // haveProfiles = true; // // profileListStore.Clear (); // // foreach (string s in names) // profileListStore.AppendValues (s); // } // public void OnProfileAdd (object o, EventArgs args) { // new ProfileDialog (); // UpdateProfileList (); } public void OnProfileEdit (object o, EventArgs args) { // string profileName = GetSelectedProfileName (); // // if (profileName != null) { // // ConnectionProfile cp = Global.Profiles [profileName]; // // new ProfileDialog (cp); // // UpdateProfileList (); // } } public void OnProfileRemove (object o, EventArgs args) { // string profileName = GetSelectedProfileName (); // string msg = null; // // if (profileName != null) { // // msg = String.Format ("{0} {1}", // Mono.Unix.Catalog.GetString ( // "Are you sure you want to delete the profile:"), // profileName); // // if (Util.AskYesNo (connectionDialog, msg)) { // // Global.Profiles.Remove (profileName); // Global.Profiles.SaveProfiles (); // UpdateProfileList (); // } // } } public void OnEncryptionToggled (object obj, EventArgs args) { if (tlsRadioButton.Active) { portEntry.Text = "389"; encryption = EncryptionType.TLS; } else if (sslRadioButton.Active) { portEntry.Text = "636"; encryption = EncryptionType.SSL; } else { portEntry.Text = "389"; encryption = EncryptionType.None; } } // private void ProfileConnect () // { // LdapServer server = null; // ConnectionProfile cp = GetSelectedProfile (); // // if (cp.Host == null) { // // string msg = Mono.Unix.Catalog.GetString ( // "No profile selected"); // // HIGMessageDialog dialog = new HIGMessageDialog ( // connectionDialog, // 0, // Gtk.MessageType.Error, // Gtk.ButtonsType.Ok, // "Profile error", // msg); // // dialog.Run (); // dialog.Destroy (); // // return; // } // // if (cp.LdapRoot == "") { // // server = new LdapServer (cp.Host, cp.Port, cp.ServerType); // // } else { // // server = new LdapServer (cp.Host, cp.Port, // cp.LdapRoot, // cp.ServerType); // } // // server.ProfileName = cp.Name; // encryption = cp.Encryption; // // if (cp.DontSavePassword) { // // LoginDialog ld = new LoginDialog ( // Mono.Unix.Catalog.GetString ("Enter your password"), // cp.User); // // ld.Run (); // // if (ld.UserPass != null) // DoConnect (server, ld.UserName, ld.UserPass); // // } else { // // DoConnect (server, cp.User, cp.Pass); // } // } public void OnConnectClicked (object o, EventArgs args) { TreeIter iter; if (!serverTypeComboBox.GetActiveIter (out iter)) return; string serverType = (string) serverTypeComboBox.Model.GetValue (iter, 0); ConnectionData cd = new ConnectionData (); cd.Host = hostEntry.Text; cd.Port = int.Parse (portEntry.Text); cd.UserName = userEntry.Text; cd.Pass = passEntry.Text; cd.DirectoryRoot = ldapBaseEntry.Text; cd.ServerType = Util.GetServerType (serverType); cd.DontSavePassword = false; cd.Encryption = encryption; if (saveProfileButton.Active) { cd.Name = profileNameEntry.Text; cd.Dynamic = false; } else { cd.Name = String.Format ("{0}:{1}", cd.Host, cd.Port); cd.Dynamic = true; } Connection conn = new Connection (cd); Global.Connections [cd.Name] = conn; } } } lat-1.2.4/lat/SelectGroupsDialog.cs0000644000175000001440000000443511702646352014075 00000000000000// // lat - SelectGroupsDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; namespace lat { public class SelectGroupsDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog selectGroupsDialog; [Glade.Widget] Gtk.TreeView allGroupsTreeview; private ListStore store; private List groups; public SelectGroupsDialog (string[] allGroups) { ui = new Glade.XML (null, "lat.glade", "selectGroupsDialog", null); ui.Autoconnect (this); groups = new List (); TreeViewColumn col; store = new ListStore (typeof (string)); allGroupsTreeview.Model = store; allGroupsTreeview.Selection.Mode = SelectionMode.Multiple; col = allGroupsTreeview.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; store.SetSortColumnId (0, SortType.Ascending); foreach (string s in allGroups) store.AppendValues (s); selectGroupsDialog.Icon = Global.latIcon; selectGroupsDialog.Resize (320, 200); selectGroupsDialog.Run (); selectGroupsDialog.Destroy (); } public void OnOkClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = allGroupsTreeview.Selection.GetSelectedRows (out model); foreach (TreePath t in tp) { store.GetIter (out iter, t); string name = (string) store.GetValue (iter, 0); groups.Add (name); } selectGroupsDialog.HideAll (); } public void OnCancelClicked (object o, EventArgs args) { selectGroupsDialog.HideAll (); } public string[] SelectedGroupNames { get { return groups.ToArray (); } } } } lat-1.2.4/lat/LdapTreeView.cs0000644000175000001440000004171611702646352012674 00000000000000// // lat - LdapTreeView.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Text.RegularExpressions; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Utilclass; using Gtk; using GLib; using Gdk; namespace lat { public class dnSelectedEventArgs : EventArgs { string _dn; string _server; bool _isHost; public dnSelectedEventArgs (string dn, bool isHost, string server) { _dn = dn; _server = server; _isHost = isHost; } public string DN { get { return _dn; } } public bool IsHost { get { return _isHost; } } public string Server { get { return _server; } } } public delegate void dnSelectedHandler (object o, dnSelectedEventArgs args); public class LdapTreeView : Gtk.TreeView { TreeStore browserStore; TreeIter rootIter; Gtk.Window parent; Connection conn; bool IsSingle = false; bool _handlersSet = false; Gtk.ToolButton _newButton = null; Gtk.ToolButton _deleteButton = null; int browserSelectionMethod = 0; enum TreeCols { Icon, DN, RDN }; public event dnSelectedHandler dnSelected; static TargetEntry[] _sourceTable = new TargetEntry[] { new TargetEntry ("text/plain", 0, 1), }; static TargetEntry[] _targetsTable = new TargetEntry[] { new TargetEntry ("text/uri-list", 0, 0), new TargetEntry ("text/plain", 0, 1), }; public LdapTreeView (Gtk.Window parentWindow) : base () { Init (parentWindow); Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); rootIter = browserStore.AppendValues (dirIcon, "Servers", "Servers"); foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = browserStore.AppendValues (rootIter, dirIcon, n, n); browserStore.AppendValues (iter, null, "", ""); } TreePath path = browserStore.GetPath (rootIter); this.ExpandRow (path, false); this.ButtonPressEvent += new ButtonPressEventHandler (OnBrowserRightClick); this.ShowAll (); } public LdapTreeView (Gtk.Window parentWindow, Connection connection) : base () { Init (parentWindow); conn = connection; IsSingle = true; if (!conn.IsConnected) conn.Connect (); Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); rootIter = browserStore.AppendValues (dirIcon, "Servers", "Servers"); TreeIter iter = browserStore.AppendValues (rootIter, dirIcon, conn.Settings.Name, conn.Settings.Name); browserStore.AppendValues (iter, null, "", ""); TreePath path = browserStore.GetPath (rootIter); this.ExpandRow (path, false); this.ButtonPressEvent += new ButtonPressEventHandler (OnBrowserRightClick); this.ShowAll (); } void Init (Gtk.Window parentWindow) { parent = parentWindow; browserStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string)); this.Model = browserStore; this.HeadersVisible = false; this.RowActivated += new RowActivatedHandler (OnRowActivated); this.RowCollapsed += new RowCollapsedHandler (ldapRowCollapsed); this.RowExpanded += new RowExpandedHandler (ldapRowExpanded); this.Selection.Changed += OnSelectionChanged; Gtk.Drag.DestSet (this, DestDefaults.All, _targetsTable, Gdk.DragAction.Copy); Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask, _sourceTable, Gdk.DragAction.Copy | DragAction.Move); this.DragBegin += new DragBeginHandler (OnDragBegin); this.DragDataGet += new DragDataGetHandler (OnDragDataGet); this.DragDataReceived += new DragDataReceivedHandler (OnDragDataReceived); TreeViewColumn col; this.AppendColumn ("icon", new CellRendererPixbuf (), "pixbuf", (int)TreeCols.Icon); col = this.AppendColumn ("DN", new CellRendererText (), "text", (int)TreeCols.DN); col.Visible = false; this.AppendColumn ("RDN", new CellRendererText (), "text", (int)TreeCols.RDN); } void DispatchDNSelectedEvent (string dn, bool host, string serverName) { if (dnSelected != null) dnSelected (this, new dnSelectedEventArgs (dn, host, serverName)); } public string GetSelectedDN () { TreeModel ldapModel; TreeIter ldapIter; string dn; if (this.Selection.GetSelected (out ldapModel, out ldapIter)) { dn = (string) browserStore.GetValue (ldapIter, (int)TreeCols.DN); return dn; } return null; } public void GetSelectedDN (out string dn, out string connection) { TreeModel model; TreeIter iter; if (this.Selection.GetSelected (out model, out iter)) { string name = (string) browserStore.GetValue (iter, (int)TreeCols.DN); string connectionName = FindServerName (iter, model); dn = name; connection = connectionName; return; } dn = null; connection = null; } public TreeIter GetSelectedIter () { TreeModel ldapModel; TreeIter ldapIter; if (this.Selection.GetSelected (out ldapModel, out ldapIter)) return ldapIter; return ldapIter; } public void RemoveRow (TreeIter iter) { browserStore.Remove (ref iter); } public void Refresh () { browserStore.Clear (); Gdk.Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); rootIter = browserStore.AppendValues (dirIcon, "Servers", "Servers"); TreePath path = browserStore.GetPath (rootIter); if (IsSingle) { TreeIter iter = browserStore.AppendValues (rootIter, dirIcon, conn.Settings.Name, conn.Settings.Name); browserStore.AppendValues (iter, null, "", ""); } else { foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = browserStore.AppendValues (rootIter, dirIcon, n, n); browserStore.AppendValues (iter, null, "", ""); } } this.ExpandRow (path, false); } public void AddConnection (string connectionName) { Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); TreeIter iter = browserStore.AppendValues (rootIter, dirIcon, connectionName, connectionName); browserStore.AppendValues (iter, null, ""); } public string GetActiveServerName () { TreeModel model; TreeIter iter; if (this.Selection.GetSelected (out model, out iter)) return FindServerName (iter, model); return null; } void OnSelectionChanged (object o, EventArgs args) { if (this.BrowserSelectionMethod == 2) return; Gtk.TreeIter iter; Gtk.TreeModel model; if (this.Selection.GetSelected (out model, out iter)) { string dn = (string) model.GetValue (iter, (int)TreeCols.DN); string serverName = FindServerName (iter, model); if (dn.Equals (serverName)) { DispatchDNSelectedEvent (dn, true, serverName); return; } DispatchDNSelectedEvent (dn, false, serverName); } } void OnRowActivated (object o, RowActivatedArgs args) { if (this.BrowserSelectionMethod == 1) return; TreePath path = args.Path; TreeIter iter; if (browserStore.GetIter (out iter, path)) { string name = (string) browserStore.GetValue (iter, (int)TreeCols.DN); if (name == "Servers") return; string serverName = FindServerName (iter, browserStore); if (name.Equals (serverName)) { DispatchDNSelectedEvent (name, true, serverName); return; } DispatchDNSelectedEvent (name, false, serverName); } } void ldapRowCollapsed (object o, RowCollapsedArgs args) { string name = (string) browserStore.GetValue (args.Iter, (int)TreeCols.DN); string serverName = FindServerName (args.Iter, browserStore); if (name == serverName) return; Log.Debug ("collapsed row: {0}", name); TreeIter child; browserStore.IterChildren (out child, args.Iter); // string fcName = (string) browserStore.GetValue (child, (int)TreeCols.DN); TreeIter lastChild = child; while (browserStore.IterNext (ref child)) { browserStore.Remove (ref lastChild); // string cn = (string) browserStore.GetValue (child, (int)TreeCols.DN); lastChild = child; } browserStore.Remove (ref lastChild); Gdk.Pixbuf pb = parent.RenderIcon (Stock.Open, IconSize.Menu, ""); browserStore.AppendValues (args.Iter, pb, ""); } string FindServerName (TreeIter iter, TreeModel model) { TreeIter parent; browserStore.IterParent (out parent, iter); if (!browserStore.IterIsValid (parent)) return null; string parentName = (string)model.GetValue (parent, (int)TreeCols.DN); if (parentName == "Servers") return (string)model.GetValue (iter, (int)TreeCols.DN); return FindServerName (parent, model); } void ldapRowExpanded (object o, RowExpandedArgs args) { string name = null; name = (string) browserStore.GetValue (args.Iter, (int)TreeCols.DN); if (name == "Servers") return; TreeIter child; browserStore.IterChildren (out child, args.Iter); string childName = (string)browserStore.GetValue (child, (int)TreeCols.DN); if (childName != "") return; browserStore.Remove (ref child); Log.Debug ("Row expanded {0}", name); string serverName = FindServerName (args.Iter, browserStore); if (!IsSingle) { conn = Global.Connections [serverName]; } try { if (!conn.IsConnected) conn.Connect (); } catch (Exception e) { browserStore.AppendValues (args.Iter, null, "", ""); HIGMessageDialog dialog = new HIGMessageDialog ( parent, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Connection error", e.Message); dialog.Run (); dialog.Destroy (); return; } if (name == serverName) { Pixbuf pb = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); TreeIter i = browserStore.AppendValues (args.Iter, pb, conn.DirectoryRoot, conn.DirectoryRoot); browserStore.AppendValues (i, null, "", ""); } else { AddEntry (name, conn, args.Iter); } TreePath path = browserStore.GetPath (args.Iter); this.ExpandRow (path, false); } void AddEntry (string name, Connection conn, TreeIter iter) { try { Pixbuf pb = Pixbuf.LoadFromResource ("x-directory-normal.png"); LdapEntry[] ldapEntries = conn.Data.GetEntryChildren (name); foreach (LdapEntry le in ldapEntries) { Log.Debug ("\tchild: {0}", le.DN); DN dn = new DN (le.DN); RDN rdn = (RDN) dn.RDNs[0]; TreeIter newChild; newChild = browserStore.AppendValues (iter, pb, le.DN, rdn.Value); browserStore.AppendValues (newChild, pb, "", ""); } } catch { string msg = Mono.Unix.Catalog.GetString ( "Unable to read data from server"); HIGMessageDialog dialog = new HIGMessageDialog ( parent, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Network error", msg); dialog.Run (); dialog.Destroy (); } } public void removeToolbarHandlers () { if (_handlersSet) { _newButton.Clicked -= new EventHandler (OnNewEntryActivate); _deleteButton.Clicked -= new EventHandler (OnDeleteActivate); _handlersSet = false; } } public void setToolbarHandlers (Gtk.ToolButton newButton, Gtk.ToolButton deleteButton) { _newButton = newButton; _deleteButton = deleteButton; _newButton.Clicked += new EventHandler (OnNewEntryActivate); _deleteButton.Clicked += new EventHandler (OnDeleteActivate); _handlersSet = true; } public void OnNewEntryActivate (object o, EventArgs args) { string dn = GetSelectedDN (); TreeModel model; TreeIter iter; if (this.Selection.GetSelected (out model, out iter)) { string serverName = FindServerName (iter, model); if (serverName == null) return; if (!IsSingle) conn = Global.Connections [serverName]; new NewEntryDialog (conn, dn); } } void OnRenameActivate (object o, EventArgs args) { string dn = GetSelectedDN (); TreeIter iter = GetSelectedIter (); string serverName = FindServerName (iter, browserStore); if (serverName == null) return; if (!IsSingle) conn = Global.Connections [serverName]; if (dn == conn.Settings.Host) return; RenameEntryDialog red = new RenameEntryDialog (conn, dn); TreeModel model; TreeIter iter2, parentIter; if (red.RenameHappened) { if (this.Selection.GetSelected (out model, out iter2)) { browserStore.IterParent (out parentIter, iter2); TreePath tp = browserStore.GetPath (parentIter); this.CollapseRow (tp); this.ExpandRow (tp, false); } } } void OnExportActivate (object o, EventArgs args) { string dn = GetSelectedDN (); if (dn.Equals (null)) return; TreeIter iter = GetSelectedIter (); string serverName = FindServerName (iter, browserStore); if (serverName == null) return; if (!IsSingle) conn = Global.Connections [serverName]; Util.ExportData (conn, this.parent, dn); } public void OnDeleteActivate (object o, EventArgs args) { TreeModel model; TreeIter iter; if (!this.Selection.GetSelected (out model, out iter)) return; string dn = (string) browserStore.GetValue (iter, (int)TreeCols.DN); string serverName = FindServerName (iter, model); if (serverName == null) return; if (!IsSingle) conn = Global.Connections [serverName]; if (dn == conn.Settings.Host) return; try { if (Util.DeleteEntry (conn, dn)) browserStore.Remove (ref iter); } catch {} } private void DoPopUp() { Menu popup = new Menu(); ImageMenuItem newItem = new ImageMenuItem (Stock.New, new Gtk.AccelGroup(IntPtr.Zero)); newItem.Activated += new EventHandler (OnNewEntryActivate); newItem.Show (); popup.Append (newItem); MenuItem renameItem = new MenuItem ("Rename..."); renameItem.Activated += new EventHandler (OnRenameActivate); renameItem.Show (); popup.Append (renameItem); MenuItem exportItem = new MenuItem ("Export..."); exportItem.Activated += new EventHandler (OnExportActivate); exportItem.Show (); popup.Append (exportItem); ImageMenuItem deleteItem = new ImageMenuItem (Stock.Delete, new Gtk.AccelGroup(IntPtr.Zero)); deleteItem.Activated += new EventHandler (OnDeleteActivate); deleteItem.Show (); popup.Append (deleteItem); popup.Popup(null, null, null, 3, Gtk.Global.CurrentEventTime); } [ConnectBefore] private void OnBrowserRightClick (object o, ButtonPressEventArgs args) { if (args.Event.Button == 3) DoPopUp (); } public void OnDragBegin (object o, DragBeginArgs args) { Gdk.Pixbuf pb = Pixbuf.LoadFromResource ("text-x-generic.png"); Gtk.Drag.SetIconPixbuf (args.Context, pb, 0, 0); } public void OnDragDataGet (object o, DragDataGetArgs args) { Log.Debug ("BEGIN OnDragDataGet"); Gtk.TreeModel model; Gtk.TreeIter iter; if (!this.Selection.GetSelected (out model, out iter)) return; string dn = (string) model.GetValue (iter, (int)TreeCols.DN); string data = null; Log.Debug ("Exporting entry: {0}", dn); if (!IsSingle) { string serverName = FindServerName (iter, model); if (serverName == null) return; conn = Global.Connections [serverName]; } Util.ExportData (conn, dn, out data); Atom[] targets = args.Context.Targets; args.SelectionData.Set (targets[0], 8, System.Text.Encoding.UTF8.GetBytes (data)); Log.Debug ("END OnDragDataGet"); } public void OnDragDataReceived (object o, DragDataReceivedArgs args) { Log.Debug ("BEGIN OnDragDataReceived"); bool success = false; string data = System.Text.Encoding.UTF8.GetString ( args.SelectionData.Data); Gtk.TreeModel model; Gtk.TreeIter iter; if (!this.Selection.GetSelected (out model, out iter)) return; if (!IsSingle) { string serverName = FindServerName (iter, model); if (serverName == null) return; conn = Global.Connections [serverName]; } switch (args.Info) { case 0: { string[] uri_list = Regex.Split (data, "\r\n"); Util.ImportData (conn, parent, uri_list); success = true; break; } case 1: Util.ImportData (conn, parent, data); success = true; break; } Log.Debug ("import success: {0}", success.ToString()); Gtk.Drag.Finish (args.Context, success, false, args.Time); Log.Debug ("END OnDragDataReceived"); } public int BrowserSelectionMethod { get { return browserSelectionMethod; } set { browserSelectionMethod = value; } } } } lat-1.2.4/lat/LdapServer.cs0000644000175000001440000003200611702646352012400 00000000000000// // lat - LdapServer.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Syscert = System.Security.Cryptography.X509Certificates; using System.Text; using Mono.Security.X509; using Mono.Security.Cryptography; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Rfc2251; using Novell.Directory.Ldap.Utilclass; namespace lat { public enum LdapServerType { ActiveDirectory, OpenLDAP, FedoraDirectory, Generic, Unknown }; public enum EncryptionType : byte { None, SSL, TLS }; public struct ActiveDirectoryInfo { public string DnsHostName; public string DomainControllerFunctionality; public string ForestFunctionality; public string DomainFunctionality; public bool IsGlobalCatalogReady; public bool IsSynchronized; } /// The main class that encapsulates the connection /// to a directory server through the Ldap protocol. /// public class LdapServer { string host; int port; string rootDN; string schemaDN; string defaultSearchFilter; string sType; string profileName; EncryptionType encryption; ActiveDirectoryInfo adInfo; LdapServerType ldapServerType; LdapConnection conn; public LdapServer (ConnectionData connectionData) { conn = new LdapConnection (); host = connectionData.Host; port = connectionData.Port; sType = Util.GetServerType (connectionData.ServerType); encryption = connectionData.Encryption; if (connectionData.DirectoryRoot != "") rootDN = connectionData.DirectoryRoot; profileName = connectionData.Name; adInfo = new ActiveDirectoryInfo (); SetServerType (); } public LdapServer (string hostName, int hostPort, string serverType) { conn = new LdapConnection (); host = hostName; port = hostPort; sType = serverType; rootDN = null; encryption = EncryptionType.None; adInfo = new ActiveDirectoryInfo (); SetServerType (); } public LdapServer (string hostName, int hostPort, string dirRoot, string serverType) { conn = new LdapConnection (); host = hostName; port = hostPort; rootDN = dirRoot; sType = serverType; adInfo = new ActiveDirectoryInfo (); SetServerType (); } #region methods public void Add (LdapEntry entry) { Log.Debug ("Adding entry {0}", entry.DN); conn.Add (entry); } /// Binds to the directory server with the given user /// name and password. /// /// Username /// Password public void Bind (string userName, string userPass) { conn.Bind (userName, userPass); Log.Debug ("Bound to directory as: {0}", userName); } /// Connects to the directory server. /// /// Type of encryption to use for session public void Connect (EncryptionType encryptionType) { encryption = encryptionType; if (encryption == EncryptionType.SSL) conn.SecureSocketLayer = true; conn.UserDefinedServerCertValidationDelegate += new CertificateValidationCallback(SSLHandler); conn.Connect (host, port); if (encryption == EncryptionType.TLS) { conn.startTLS (); } if (schemaDN == null) schemaDN = "cn=subschema"; if (rootDN == null) QueryRootDSE (); Log.Debug ("Connected to '{0}' on port {1}", host, port); Log.Debug ("Base: {0}", rootDN); Log.Debug ("Using encryption type: {0}", encryptionType.ToString()); } /// Copy a directory entry /// /// Distinguished name of the entry to copy /// New name for entry /// Parent name public void Copy (string oldDN, string newRDN, string parentDN) { string newDN = string.Format ("{0},{1}", newRDN, parentDN); LdapEntry[] entry = Search (oldDN, LdapConnection.SCOPE_BASE, "objectclass=*", null); if (!(entry.Length > 0)) return; LdapEntry oldEntry = entry[0]; LdapAttributeSet attributeSet = new LdapAttributeSet(); foreach (LdapAttribute attr in oldEntry.getAttributeSet()) { LdapAttribute newAttr = new LdapAttribute (attr); attributeSet.Add (newAttr); } LdapEntry le = new LdapEntry (newDN, attributeSet); conn.Add (le); } /// Deletes a directory entry /// /// Distinguished name of the entry to delete public void Delete (string dn) { conn.Delete (dn); } /// Disconnects from a directory server /// public void Disconnect () { conn.Disconnect (); conn = null; Log.Debug ("Disconnected from '{0}'", host); } public LdapSchema GetSchema () { if (!conn.Connected) return null; return conn.FetchSchema (conn.GetSchemaDN()); } public string GetSchemaDN () { if (!conn.Connected) return null; return conn.GetSchemaDN(); } /// Modifies the specified entry /// /// Distinguished name of entry to modify /// Array of LdapModification objects public void Modify (string dn, LdapModification[] mods) { conn.Modify (dn, mods); } /// Moves the specified entry /// /// Distinguished name of entry to move /// New name of entry /// Name of parent entry public void Move (string oldDN, string newRDN, string parentDN) { conn.Rename (oldDN, newRDN, parentDN, true); } /// Renames the specified entry /// /// Distinguished name of entry to rename /// New to rename entry to /// Save old entry public void Rename (string oldDN, string newDN, bool saveOld) { conn.Rename (oldDN, newDN, saveOld); } /// Searches the directory /// /// Where to start the search /// Scope of search /// Filter to search for /// Attributes to search for /// List of entries matching filter public LdapEntry[] Search (string searchBase, int searchScope, string searchFilter, string[] searchAttrs) { if (!conn.Connected) return null; try { List retVal = new List (); RfcFilter rfcFilter = new RfcFilter (searchFilter); LdapSearchConstraints cons = new LdapSearchConstraints (); cons.MaxResults = 0; LdapSearchQueue queue = conn.Search (searchBase, searchScope, rfcFilter.filterToString(), searchAttrs, false, (LdapSearchQueue) null, cons); LdapMessage msg; while ((msg = queue.getResponse ()) != null) { if (msg is LdapSearchResult) { LdapEntry entry = ((LdapSearchResult) msg).Entry; retVal.Add (entry); } } return retVal.ToArray (); } catch (Exception e) { Log.Debug (e); return null; } } /// Tries to upgrade to an encrypted connection public void StartTLS () { conn.startTLS (); } #endregion #region private_methods private void SetActiveDirectoryInfo (LdapEntry dse) { LdapAttribute a = dse.getAttribute ("dnsHostName"); adInfo.DnsHostName = a.StringValue; LdapAttribute b = dse.getAttribute ("domainControllerFunctionality"); if (b.StringValue == "0") adInfo.DomainControllerFunctionality = "Windows 2000 Mode"; else if (b.StringValue == "2") adInfo.DomainControllerFunctionality = "Windows Server 2003 Mode"; else adInfo.DomainControllerFunctionality = ""; LdapAttribute c = dse.getAttribute ("forestFunctionality"); if (c.StringValue == "0") adInfo.ForestFunctionality = "Windows 2000 Forest Mode"; else if (c.StringValue == "1") adInfo.ForestFunctionality = "Windows Server 2003 Interim Forest Mode"; else if (c.StringValue == "2") adInfo.ForestFunctionality = "Windows Server 2003 Forest Mode"; else adInfo.ForestFunctionality = ""; LdapAttribute d = dse.getAttribute ("domainFunctionality"); if (d.StringValue == "0") adInfo.DomainFunctionality = "Windows 2000 Domain Mode"; else if (d.StringValue == "1") adInfo.DomainFunctionality = "Windows Server 2003 Interim Domain Mode"; else if (d.StringValue == "2") adInfo.DomainFunctionality = "Windows Server 2003 Domain Mode"; else adInfo.DomainFunctionality = ""; LdapAttribute e = dse.getAttribute ("isGlobalCatalogReady"); adInfo.IsGlobalCatalogReady = bool.Parse (e.StringValue); LdapAttribute f = dse.getAttribute ("isSynchronized"); adInfo.IsSynchronized = bool.Parse (f.StringValue); } private void QueryRootDSE () { LdapEntry[] dse; if (ldapServerType == LdapServerType.ActiveDirectory) { dse = Search ("", LdapConnection.SCOPE_BASE, "", null); } else { string[] attrs = new string[] { "namingContexts", "subschemaSubentry" }; dse = Search ("", LdapConnection.SCOPE_BASE, "objectclass=*", attrs); } if (dse.Length > 0) { LdapAttribute a = dse[0].getAttribute ("namingContexts"); rootDN = a.StringValue; LdapAttribute b = dse[0].getAttribute ("subschemaSubentry"); schemaDN = b.StringValue; if (ldapServerType == LdapServerType.ActiveDirectory) SetActiveDirectoryInfo (dse[0]); } else { Log.Debug ("Unable to find directory namingContexts"); } } void SetServerType () { switch (sType.ToLower()) { case "microsoft active directory": ldapServerType = LdapServerType.ActiveDirectory; defaultSearchFilter = ""; break; case "openldap": ldapServerType = LdapServerType.OpenLDAP; defaultSearchFilter = "(objectClass=*)"; break; case "fedora directory server": ldapServerType = LdapServerType.FedoraDirectory; defaultSearchFilter = "(objectClass=*)"; break; case "generic": ldapServerType = LdapServerType.Generic; defaultSearchFilter = "(objectClass=*)"; break; default: ldapServerType = LdapServerType.Unknown; defaultSearchFilter = ""; break; } } static bool SSLHandler (Syscert.X509Certificate certificate, int[] certificateErrors) { bool retVal = true; X509Certificate x509 = null; byte[] data = certificate.GetRawCertData(); if (data != null) x509 = new X509Certificate (data); StringBuilder msg = new StringBuilder (); msg.AppendFormat (" {0}X.509 v{1} Certificate", (x509.IsSelfSigned ? "Self-signed " : String.Empty), x509.Version); msg.AppendFormat ("\nSerial Number: {0}", CryptoConvert.ToHex (x509.SerialNumber)); msg.AppendFormat ("\nIssuer Name: {0}", x509.IssuerName); msg.AppendFormat ("\nSubject Name: {0}", x509.SubjectName); msg.AppendFormat ("\nValid From: {0}", x509.ValidFrom); msg.AppendFormat ("\nValid Until: {0}", x509.ValidUntil); msg.AppendFormat ("\nUnique Hash: {0}", CryptoConvert.ToHex (x509.Hash)); Log.Debug ("Certificate info:\n{0}", msg.ToString()); Log.Debug ("Certificate errors:\n{0}", certificateErrors.Length); return retVal; } #endregion #region properties public string AuthDN { get { return conn.AuthenticationDN; } } public bool Bound { get { return conn.Bound; } } public bool Connected { get { return conn.Connected; } } public string DirectoryRoot { get { return rootDN; } } public string DefaultSearchFilter { get { return defaultSearchFilter; } } public string Host { get { return host; } } public int Port { get { return port; } set { port = value; } } public string ProfileName { get { return profileName; } set { profileName = value; } } public int Protocol { get { return conn.ProtocolVersion; } } public LdapServerType ServerType { get { return ldapServerType; } } public string ServerTypeString { get { return Util.GetServerType (ldapServerType); } } public bool UseSSL { get { return conn.SecureSocketLayer; } set { conn.SecureSocketLayer = value; } } public EncryptionType Encryption { get { return encryption; } set { encryption = value; } } public ActiveDirectoryInfo ADInfo { get { return adInfo; } } #endregion } } lat-1.2.4/lat/AddObjectClassDialog.cs0000644000175000001440000000511211702646352014254 00000000000000// // lat - AddObjectClassDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; namespace lat { public class AddObjectClassDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog addObjectClassDialog; [Glade.Widget] Gtk.TreeView objClassTreeView; List objectClasses; ListStore store; public AddObjectClassDialog (Connection conn) { objectClasses = new List (); ui = new Glade.XML (null, "lat.glade", "addObjectClassDialog", null); ui.Autoconnect (this); store = new ListStore (typeof (bool), typeof (string)); CellRendererToggle crt = new CellRendererToggle(); crt.Activatable = true; crt.Toggled += OnClassToggled; objClassTreeView.AppendColumn ("Enabled", crt, "active", 0); objClassTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1); objClassTreeView.Model = store; try { foreach (string n in conn.Data.ObjectClasses) store.AppendValues (false, n); } catch (Exception e) { store.AppendValues (false, "Error getting object classes"); Log.Debug (e); } addObjectClassDialog.Icon = Global.latIcon; addObjectClassDialog.Resize (300, 400); addObjectClassDialog.Run (); addObjectClassDialog.Destroy (); } void OnClassToggled (object o, ToggledArgs args) { TreeIter iter; if (store.GetIter (out iter, new TreePath(args.Path))) { bool old = (bool) store.GetValue (iter,0); string name = (string) store.GetValue (iter, 1); if (!old) objectClasses.Add (name); else objectClasses.Remove (name); store.SetValue(iter,0,!old); } } public void OnOkClicked (object o, EventArgs args) { addObjectClassDialog.HideAll (); } public void OnDlgDelete (object o, DeleteEventArgs args) { addObjectClassDialog.HideAll (); } public string[] ObjectClasses { get { return objectClasses.ToArray (); } } } }lat-1.2.4/lat/ServiceFinder.cs0000644000175000001440000000617111702646352013065 00000000000000// // lat - ServiceFinder.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using Avahi; namespace lat { public class FoundServiceEventArgs : EventArgs { public Connection FoundConnection; } public class RemovedServiceEventArgs : EventArgs { public string ConnectionName; } public delegate void FoundServiceEventHandler (object o, FoundServiceEventArgs args); public delegate void RemovedServiceEventHandler (object o, RemovedServiceEventArgs args); public class ServiceFinder { Client client; ServiceBrowser sb; public event FoundServiceEventHandler Found; public event RemovedServiceEventHandler Removed; public ServiceFinder () { try { client = new Client(); } catch (Exception e) { Log.Info ("Unable to enable avahi support"); Log.Debug (e); } } public void Start () { try { sb = new ServiceBrowser (client, "_ldap._tcp"); sb.ServiceAdded += OnServiceAdded; sb.ServiceRemoved += OnServiceRemoved; } catch (Exception e) { Log.Debug (e); } } public void Stop () { try { sb.Dispose (); } catch (Exception e){ Log.Debug (e); } } void OnServiceResolved (object o, ServiceInfoArgs args) { ConnectionData cd = new ConnectionData (); cd.Name = String.Format ("{0} ({1})", args.Service.Name, args.Service.Address); cd.Host = args.Service.Address.ToString (); cd.Port = args.Service.Port; cd.UserName = ""; cd.Pass = ""; cd.DontSavePassword = false; cd.ServerType = Util.GetServerType ("Generic LDAP server"); cd.Dynamic = true; Log.Debug ("Found LDAP service {0} on {1} port {2}", args.Service.Name, args.Service.Address, args.Service.Port); if (args.Service.Port == 636) cd.Encryption = EncryptionType.SSL; Connection conn = new Connection (cd); if (Found != null) { FoundServiceEventArgs fargs = new FoundServiceEventArgs (); fargs.FoundConnection = conn; Found (this, fargs); } } void OnServiceAdded (object o, ServiceInfoArgs args) { ServiceResolver resolver = new ServiceResolver (client, args.Service); resolver.Found += OnServiceResolved; } void OnServiceRemoved (object o, ServiceInfoArgs args) { if (Removed == null) return; RemovedServiceEventArgs rargs = new RemovedServiceEventArgs (); rargs.ConnectionName = String.Format ("{0} ({1})", args.Service.Name, args.Service.Address); Removed (this, rargs); } } } lat-1.2.4/lat/LdapEntryAnalyzer.cs0000644000175000001440000001016411702646352013742 00000000000000// // lat - LdapEntryAnalyzer.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class LdapEntryAnalyzer { List mods; public LdapEntryAnalyzer () { mods = new List (); } static bool IsAttributeEmpty (LdapAttribute attribute) { if (attribute == null) return true; if (attribute.size() == 0) return true; if (attribute.StringValue == null || attribute.StringValue == "") return true; return false; } public static string[] CheckRequiredAttributes (Connection conn, LdapEntry entry) { List missingAttributes = new List (); LdapAttribute objAttr = entry.getAttribute ("objectClass"); if (objAttr == null) return null; foreach (string o in objAttr.StringValueArray) { if (o.Equals ("top")) continue; string[] reqs = conn.Data.GetRequiredAttrs (o); if (reqs == null) continue; foreach (string r in reqs) { if (r.Equals ("cn")) continue; if (IsAttributeEmpty (entry.getAttribute (r))) { missingAttributes.Add (r); continue; } } } return missingAttributes.ToArray(); } public void Run (LdapEntry lhs, LdapEntry rhs) { Log.Debug ("Starting LdapEntryAnalyzer"); if (lhs.CompareTo (rhs) != 0) { Log.Debug ("Entry DNs don't match\nlhs: {0}\nrhs: {1}", lhs.DN, rhs.DN); return; } LdapAttributeSet las = lhs.getAttributeSet (); foreach (LdapAttribute la in las) { LdapAttribute rla = rhs.getAttribute (la.Name); if (rla == null){ Log.Debug ("Delete attribute {0} from {1}", la.Name, lhs.DN); LdapAttribute a = new LdapAttribute (la.Name); LdapModification m = new LdapModification (LdapModification.DELETE, a); mods.Add (m); } else { if (rla.StringValueArray.Length > 1) { Log.Debug ("Replacing attribute {0} with multiple values", la.Name); LdapAttribute a = new LdapAttribute (la.Name, rla.StringValueArray); LdapModification m = new LdapModification (LdapModification.REPLACE, a); mods.Add (m); } else if (la.StringValue != rla.StringValue) { LdapAttribute newattr; LdapModification lm; if (rla.StringValue == "" || rla.StringValue == null) { Log.Debug ("Delete attribute {0} from {1}", la.Name, lhs.DN); newattr = new LdapAttribute (la.Name); lm = new LdapModification (LdapModification.DELETE, newattr); } else { Log.Debug ("Replace attribute {0} value from {1} to {2} ", la.Name, la.StringValue, rla.StringValue); newattr = new LdapAttribute (la.Name, rla.StringValue); lm = new LdapModification (LdapModification.REPLACE, newattr); } mods.Add (lm); } } } LdapAttributeSet rlas = rhs.getAttributeSet (); foreach (LdapAttribute la in rlas) { LdapAttribute lla = lhs.getAttribute (la.Name); if (lla == null && la.StringValue != string.Empty) { Log.Debug ("Add attribute {0} value [{1}] to {2}", la.Name, la.StringValue, lhs.DN); LdapAttribute a = new LdapAttribute (la.Name, la.StringValue); LdapModification m = new LdapModification (LdapModification.ADD, a); mods.Add (m); } } Log.Debug ("End LdapEntryAnalyzer"); } public LdapModification[] Differences { get { return mods.ToArray(); } } } }lat-1.2.4/lat/SearchBuilderDialog.cs0000644000175000001440000001571411702646352014174 00000000000000// // lat - SearchBuilderDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; namespace lat { public struct SearchCriteria { public HBox hbox; public Gtk.Entry attrEntry; public ComboBox critCombo; public Gtk.Entry valEntry; public ComboBox boolCombo; public SearchCriteria (HBox aHbox, Gtk.Entry attr, ComboBox op, Gtk.Entry val, ComboBox bc) { hbox = aHbox; attrEntry = attr; critCombo = op; valEntry = val; boolCombo = bc; } } public class SearchBuilderDialog { [Glade.Widget] Gtk.Dialog searchBuilderDialog; [Glade.Widget] HBox opHbox; [Glade.Widget] Gtk.Entry attributeEntry; [Glade.Widget] Gtk.Entry valueEntry; [Glade.Widget] VBox critVbox; [Glade.Widget] Button addButton; [Glade.Widget] Button removeButton; [Glade.Widget] Button okButton; [Glade.Widget] Button cancelButton; [Glade.Widget] Gtk.Image image117; Glade.XML ui; ComboBox opComboBox; ComboBox firstCritCombo; List _allCombos; int _numCriteria = 0; Dictionary _critTable; LdapSearch _ls; static string[] ops = { "begins with", "ends with", "equals", "contains", "is present" }; static string[] boolOps = { "", "AND", "OR" }; public SearchBuilderDialog () { _allCombos = new List (); _critTable = new Dictionary (); _ls = new LdapSearch (); ui = new Glade.XML (null, "lat.glade", "searchBuilderDialog", null); ui.Autoconnect (this); Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("edit-find-48x48.png"); image117.Pixbuf = pb; opComboBox = createCombo (ops); opHbox.Add (opComboBox); addButton.Clicked += new EventHandler (OnAddClicked); removeButton.Clicked += new EventHandler (OnRemoveClicked); okButton.Clicked += new EventHandler (OnOkClicked); cancelButton.Clicked += new EventHandler (OnCancelClicked); searchBuilderDialog.Icon = Global.latIcon; searchBuilderDialog.Run (); searchBuilderDialog.Destroy (); } static void comboSetActive (ComboBox cb, string[] list, string name) { int count = 0; foreach (string s in list) { if (s.Equals (name)) cb.Active = count; count++; } } static ComboBox createCombo (string[] list) { ComboBox retVal = ComboBox.NewText (); foreach (string s in list) retVal.AppendText (s); retVal.Active = 0; retVal.Show (); return retVal; } void toggleBoolCombo (int row) { string prevKey = "row" + (row - 1).ToString(); SearchCriteria prevSC = (SearchCriteria) _critTable [prevKey]; prevSC.boolCombo.Sensitive = !prevSC.boolCombo.Sensitive; } void createCritRow (string attr, string op, string val) { _numCriteria++; HBox hbox = new HBox (false, 0); critVbox.PackStart (hbox, true, true, 0); Gtk.Entry attrEntry = new Gtk.Entry (); attrEntry.Text = attr; attrEntry.Show (); hbox.PackStart (attrEntry, true, true, 5); VBox vbox75 = new VBox (false, 0); vbox75.Show (); hbox.PackStart (vbox75, true, true, 5); ComboBox critCombo = createCombo (ops); comboSetActive (critCombo, ops, op); vbox75.PackStart (critCombo, false, true, 16); Gtk.Entry valEntry = new Gtk.Entry (); valEntry.Text = val; valEntry.Show (); hbox.PackStart (valEntry, true, true, 5); VBox vbox76 = new VBox (false, 0); vbox76.Show (); hbox.PackStart (vbox76, true, true, 5); ComboBox boolCombo = createCombo (boolOps); boolCombo.Sensitive = false; vbox76.PackStart (boolCombo, false, true, 16); if (_numCriteria == 1) { firstCritCombo = boolCombo; firstCritCombo.Changed += new EventHandler (OnBoolChanged); } else if (_numCriteria > 1) { _allCombos.Add (boolCombo); } SearchCriteria sc = new SearchCriteria ( hbox, attrEntry, critCombo, valEntry, boolCombo); string key = "row" + _numCriteria.ToString (); _critTable.Add (key, sc); if (_numCriteria > 1) toggleBoolCombo (_numCriteria); critVbox.ShowAll (); } void OnBoolChanged (object o, EventArgs args) { foreach (ComboBox c in _allCombos) { if (c == null) continue; if (c.Sensitive) { TreeIter iter; if (!firstCritCombo.GetActiveIter (out iter)) return; string s = (string) firstCritCombo.Model.GetValue (iter, 0); comboSetActive (c, boolOps, s); } } } void OnAddClicked (object o, EventArgs args) { TreeIter iter; if (!opComboBox.GetActiveIter (out iter)) return; string s = (string) opComboBox.Model.GetValue (iter, 0); createCritRow (attributeEntry.Text, s, valueEntry.Text); attributeEntry.Text = ""; valueEntry.Text = ""; } void OnRemoveClicked (object o, EventArgs args) { string key = "row" + _numCriteria.ToString (); SearchCriteria sc = (SearchCriteria) _critTable [key]; sc.hbox.Destroy (); sc.attrEntry.Destroy (); sc.critCombo.Destroy (); sc.valEntry.Destroy (); sc.boolCombo.Destroy (); _critTable.Remove (key); if (_numCriteria > 1) toggleBoolCombo (_numCriteria); _numCriteria--; } void buildFilter () { string boolOp = ""; foreach (string key in _critTable.Keys) { SearchCriteria sc = (SearchCriteria) _critTable [key]; TreeIter iter; if (!sc.critCombo.GetActiveIter (out iter)) return; string s = (string) sc.critCombo.Model.GetValue (iter, 0); _ls.addCondition ( sc.attrEntry.Text, s, sc.valEntry.Text); if (!sc.boolCombo.GetActiveIter (out iter)) return; string bc = (string) sc.boolCombo.Model.GetValue (iter, 0); if (!bc.Equals ("")) boolOp = bc; } _ls.addBool (boolOp); _ls.endBool (); } void OnOkClicked (object o, EventArgs args) { if (!attributeEntry.Text.Equals ("")) { TreeIter iter; if (!opComboBox.GetActiveIter (out iter)) return; string s = (string) opComboBox.Model.GetValue (iter, 0); // simple search; only one criteria _ls.addCondition ( attributeEntry.Text, s, valueEntry.Text); } else { // complex search buildFilter (); } searchBuilderDialog.HideAll (); } void OnCancelClicked (object o, EventArgs args) { searchBuilderDialog.HideAll (); } public string UserFilter { get { return _ls.Filter; } } } } lat-1.2.4/lat/Makefile.am0000644000175000001440000000502211702646352012034 00000000000000SUBDIRS = . plugins if BUILD_AVAHI AVAHI_CSFLAGS = -define:ENABLE_AVAHI AVAHI_CSFILES = \ $(srcdir)/ServiceFinder.cs AVAHI_REFERENCES = $(AVAHI_LIBS) endif if BUILD_NETWORKMANAGER NETWORKMANAGER_CSFLAGS = -define:ENABLE_NETWORKMANAGER NETWORKMANAGER_REFERENCES = \ $(top_builddir)/network-manager/network-manager.dll endif CSC = $(MCS) -codepage:utf8 $(MCS_FLAGS) $(AVAHI_CSFLAGS) $(NETWORKMANAGER_CSFLAGS) ASSEMBLY = lat CSFILES = \ AboutDialog.cs \ AddObjectClassDialog.cs \ AssemblyInfo.cs \ AttributeEditorWidget.cs \ ConnectDialog.cs \ ConnectionManager.cs \ CreateEntryDialog.cs \ Defines.cs \ LDIF.cs \ LdapEntryAnalyzer.cs \ LdapSearch.cs \ LdapServer.cs \ LdapTreeView.cs \ Log.cs \ LoginDialog.cs \ Main.cs \ MassEditDialog.cs \ NewEntryDialog.cs \ PasswordDialog.cs \ Preferences.cs \ ProfileDialog.cs \ RenameEntryDialog.cs \ SMBPassword.cs \ SambaPopulateDialog.cs \ SchemaTreeView.cs \ SearchBuilderDialog.cs \ SearchResultsTreeView.cs \ SelectContainerDialog.cs \ SelectGroupsDialog.cs \ ServerData.cs \ Templates.cs \ TemplatesDialog.cs \ TemplateEditorDialog.cs \ TimeDateDialog.cs \ Util.cs \ ViewDataTreeView.cs \ ViewDialog.cs \ ViewPluginManager.cs \ ViewsTreeView.cs \ Window.cs SOURCES_BUILD = $(addprefix $(srcdir)/, $(CSFILES)) REFERENCES = \ ../gnome-keyring-glue/gnome-keyring-glue.dll \ $(NETWORKMANAGER_REFERENCES) \ Mono.Posix \ Mono.Security \ Novell.Directory.Ldap REFERENCES_BUILD = $(addprefix -r:, $(REFERENCES)) RESOURCES = \ lat.glade \ lat.png \ contact-new.png \ contact-new-48x48.png \ edit-find.png \ edit-find-48x48.png \ locked16x16.png \ locked-48x48.png \ stock_person.png \ text-x-generic.png \ unlocked16x16.png \ users.png \ x-directory-normal.png \ x-directory-remote-server.png \ x-directory-remote-workgroup.png \ mail-message-new.png \ document-save.png \ go-home.png \ x-directory-remote-server-48x48.png RESOURCES_BUILD = $(addprefix /resource:$(top_srcdir)/resources/, $(RESOURCES)) $(ASSEMBLY).exe: $(SOURCES_BUILD) $(AVAHI_CSFILES) $(CSC) -out:$@ $(SOURCES_BUILD) $(AVAHI_CSFILES) $(REFERENCES_BUILD) $(AVAHI_REFERENCES) $(RESOURCES_BUILD) $(GTKSHARP_LIBS) all: $(ASSEMBLY).exe ASSEMBLYlibdir = $(pkglibdir) ASSEMBLYlib_DATA = $(ASSEMBLY).exe man_MANS = \ $(ASSEMBLY).1 bin_SCRIPTS = $(ASSEMBLY) EXTRA_DIST = \ $(CSFILES) \ ServiceFinder.cs \ $(man_MANS) \ AssemblyInfo.cs.in \ Defines.cs.in \ $(ASSEMBLY).in CLEANFILES = \ $(ASSEMBLY).exe \ $(ASSEMBLY).exe.mdb DISTCLEANFILES = \ AssemblyInfo.cs \ Defines.cs \ $(ASSEMBLY) lat-1.2.4/lat/ProfileDialog.cs0000644000175000001440000002276511702646352013064 00000000000000// // lat - ProfileDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; namespace lat { public class ProfileDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog profileDialog; [Glade.Widget] Gtk.Entry profileNameEntry; [Glade.Widget] Gtk.Entry hostEntry; [Glade.Widget] Gtk.Entry portEntry; [Glade.Widget] Gtk.Entry ldapBaseEntry; [Glade.Widget] Gtk.Entry userEntry; [Glade.Widget] Gtk.Entry passEntry; [Glade.Widget] Gtk.CheckButton savePasswordButton; [Glade.Widget] Gtk.RadioButton tlsRadioButton; [Glade.Widget] Gtk.RadioButton sslRadioButton; [Glade.Widget] Gtk.RadioButton noEncryptionRadioButton; [Glade.Widget] Gtk.HBox stHBox; [Glade.Widget] Gtk.Image image7; Connection conn; ComboBox serverTypeComboBox; EncryptionType encryption = EncryptionType.None; bool isEdit = false; string oldName = null; [Glade.Widget] TreeView pluginTreeView; [Glade.Widget] TreeView attrViewPluginTreeView; ListStore pluginStore; ListStore attrPluginStore; public ProfileDialog () { conn = new Connection (new ConnectionData()); Init (); portEntry.Text = "389"; profileDialog.Run (); profileDialog.Destroy (); } public ProfileDialog (Connection conn) { this.conn = conn; Init (); oldName = conn.Settings.Name; profileNameEntry.Text = conn.Settings.Name; hostEntry.Text = conn.Settings.Host; portEntry.Text = conn.Settings.Port.ToString(); ldapBaseEntry.Text = conn.Settings.DirectoryRoot; userEntry.Text = conn.Settings.UserName; if (conn.Settings.DontSavePassword) savePasswordButton.Active = true; else passEntry.Text = conn.Settings.Pass; switch (conn.Settings.Encryption) { case EncryptionType.TLS: tlsRadioButton.Active = true; break; case EncryptionType.SSL: sslRadioButton.Active = true; break; case EncryptionType.None: noEncryptionRadioButton.Active = true; break; } comboSetActive (serverTypeComboBox, Util.GetServerType (conn.Settings.ServerType)); isEdit = true; profileDialog.Run (); profileDialog.Destroy (); } void Init () { ui = new Glade.XML (null, "lat.glade", "profileDialog", null); ui.Autoconnect (this); Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("x-directory-remote-server-48x48.png"); image7.Pixbuf = pb; createCombo (); noEncryptionRadioButton.Active = true; // views pluginStore = new ListStore (typeof (bool), typeof (string)); CellRendererToggle crt = new CellRendererToggle(); crt.Activatable = true; crt.Toggled += OnClassToggled; pluginTreeView.AppendColumn ("Enabled", crt, "active", 0); pluginTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1); pluginTreeView.Model = pluginStore; foreach (ViewPlugin vp in Global.Plugins.ServerViewPlugins) { if (conn.ServerViews.Contains (vp.GetType().ToString())) pluginStore.AppendValues (true, vp.Name); else pluginStore.AppendValues (false, vp.Name); } attrPluginStore = new ListStore (typeof (bool), typeof (string)); crt = new CellRendererToggle(); crt.Activatable = true; crt.Toggled += OnAttributeViewerToggled; attrViewPluginTreeView.AppendColumn ("Enabled", crt, "active", 0); attrViewPluginTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1); attrViewPluginTreeView.Model = attrPluginStore; if (conn.AttributeViewers.Count == 0) conn.SetDefaultAttributeViewers (); foreach (AttributeViewPlugin avp in Global.Plugins.AttributeViewPlugins) { if (conn.AttributeViewers.Contains (avp.GetType().ToString())) attrPluginStore.AppendValues (true, avp.Name); else attrPluginStore.AppendValues (false, avp.Name); } profileDialog.Icon = Global.latIcon; } static void comboSetActive (ComboBox cb, string name) { if (name.Equals ("generic ldap server")) cb.Active = 2; else if (name.Equals ("openldap")) cb.Active = 0; else if (name.Equals ("microsoft active directory")) cb.Active = 1; } void createCombo () { serverTypeComboBox = ComboBox.NewText (); serverTypeComboBox.AppendText ("OpenLDAP"); serverTypeComboBox.AppendText ("Microsoft Active Directory"); serverTypeComboBox.AppendText ("Fedora Directory Server"); serverTypeComboBox.AppendText ("Generic LDAP server"); serverTypeComboBox.Active = 0; serverTypeComboBox.Show (); stHBox.PackStart (serverTypeComboBox, true, true, 5); } public void OnAboutClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; if (pluginTreeView.Selection.GetSelected (out model, out iter)) { string name = (string) pluginStore.GetValue (iter, 1); ViewPlugin vp = Global.Plugins.GetViewPlugin (name, conn.Settings.Name); if (vp != null) { Gtk.AboutDialog ab = new Gtk.AboutDialog (); ab.Authors = vp.Authors; ab.Comments = vp.Description; ab.Copyright = vp.Copyright; ab.ProgramName = vp.Name; ab.Version = vp.Version; ab.Icon = vp.Icon; ab.Run (); ab.Destroy (); } } } public void OnAttrAboutClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; if (attrViewPluginTreeView.Selection.GetSelected (out model, out iter)) { string name = (string) attrPluginStore.GetValue (iter, 1); AttributeViewPlugin vp = Global.Plugins.FindAttributeView (name); if (vp != null) { Gtk.AboutDialog ab = new Gtk.AboutDialog (); ab.Authors = vp.Authors; ab.Comments = vp.Description; ab.Copyright = vp.Copyright; ab.ProgramName = vp.Name; ab.Version = vp.Version; ab.Run (); ab.Destroy (); } } } void OnAttributeViewerToggled (object o, ToggledArgs args) { TreeIter iter; if (attrPluginStore.GetIter (out iter, new TreePath(args.Path))) { bool old = (bool) attrPluginStore.GetValue (iter,0); string name = (string) attrPluginStore.GetValue (iter, 1); AttributeViewPlugin vp = Global.Plugins.FindAttributeView (name); if (!conn.AttributeViewers.Contains (vp.GetType().ToString())) conn.AttributeViewers.Add (vp.GetType().ToString()); else conn.AttributeViewers.Remove (vp.GetType().ToString()); Global.Connections [conn.Settings.Name] = conn; attrPluginStore.SetValue(iter,0,!old); } } void OnClassToggled (object o, ToggledArgs args) { TreeIter iter; if (pluginStore.GetIter (out iter, new TreePath(args.Path))) { bool old = (bool) pluginStore.GetValue (iter,0); string name = (string) pluginStore.GetValue (iter, 1); ViewPlugin vp = Global.Plugins.GetViewPlugin (name, conn.Settings.Name); if (!conn.ServerViews.Contains (vp.GetType().ToString())) conn.ServerViews.Add (vp.GetType().ToString()); else conn.ServerViews.Remove (vp.GetType().ToString()); Global.Connections [conn.Settings.Name] = conn; pluginStore.SetValue(iter,0,!old); } } public void OnConfigureClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; if (pluginTreeView.Selection.GetSelected (out model, out iter)) { string name = (string) pluginStore.GetValue (iter, 1); new PluginConfigureDialog (conn, name); } } public void OnSavePasswordToggled (object obj, EventArgs args) { if (savePasswordButton.Active) passEntry.Sensitive = false; else passEntry.Sensitive = true; } public void OnEncryptionToggled (object obj, EventArgs args) { if (tlsRadioButton.Active) { portEntry.Text = "389"; encryption = EncryptionType.TLS; } else if (sslRadioButton.Active) { portEntry.Text = "636"; encryption = EncryptionType.SSL; } else { portEntry.Text = "389"; encryption = EncryptionType.None; } } public void OnOkClicked (object o, EventArgs args) { TreeIter iter; if (!serverTypeComboBox.GetActiveIter (out iter)) return; string st = (string) serverTypeComboBox.Model.GetValue (iter, 0); ConnectionData data = new ConnectionData (); data.Name = profileNameEntry.Text; data.Host = hostEntry.Text; data.Port = int.Parse (portEntry.Text); data.DirectoryRoot = ldapBaseEntry.Text; data.UserName = userEntry.Text; data.Encryption = encryption; data.DontSavePassword = savePasswordButton.Active; data.ServerType = Util.GetServerType (st); if (data.DontSavePassword) data.Pass = ""; else data.Pass = passEntry.Text; if (isEdit) { Connection c = Global.Connections [data.Name]; c.Settings = data; if (!oldName.Equals (data.Name)) { Global.Connections.Delete (oldName); Global.Connections[data.Name] = c; } else { // Global.Connections[data.Name] = c; } } else { Connection c = new Connection (data); Global.Connections[data.Name] = c; } Global.Connections.Save (); } } } lat-1.2.4/lat/ViewDataTreeView.cs0000644000175000001440000003104611703112045013477 00000000000000// // lat - ViewDataTreeView.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using Gdk; using GLib; using System; using System.Collections.Generic; using Novell.Directory.Ldap; namespace lat { public class ViewDataTreeView : Gtk.TreeView { Connection conn; Gtk.Window parentWindow; Menu popup; ListStore dataStore; ViewPlugin viewPlugin; int dnColumn; public ViewDataTreeView (Connection connection, Gtk.Window parent) : base () { conn = connection; parentWindow = parent; this.Selection.Mode = Gtk.SelectionMode.Multiple; this.ButtonPressEvent += new ButtonPressEventHandler (OnRightClick); this.RowActivated += new RowActivatedHandler (OnRowActivated); this.Selection.Changed += (object o, EventArgs args) => {}; this.ShowAll (); } public void ConfigureView (ViewPlugin vp) { viewPlugin = vp; SetViewColumns (); } public void Populate () { if (viewPlugin.SearchBase == null) viewPlugin.SearchBase = conn.DirectoryRoot; try { LdapEntry[] data = conn.Data.Search (conn.DirectoryRoot, viewPlugin.Filter); Log.Debug ("InsertData()\n\tbase: [{0}]\n\tfilter: [{1}]\n\tnumResults: [{2}]", viewPlugin.SearchBase, viewPlugin.Filter, data.Length); string msg = string.Format (Mono.Unix.Catalog.GetString ("Found {0} entries"), data.Length); Global.Window.WriteStatusMessage (msg); DoInsert (data, viewPlugin.ColumnAttributes); } catch (Exception e) { HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Connection error", e.Message); dialog.Run (); dialog.Destroy (); } } void DoInsert (LdapEntry[] objs, string[] attributes) { try { if (this.dataStore != null) this.dataStore.Clear (); foreach (LdapEntry le in objs) { string[] values = conn.Data.GetAttributeValuesFromEntry (le, attributes); string[] newvalues = new string [values.Length + 1]; values.CopyTo (newvalues, 0); newvalues [values.Length] = le.DN; this.dataStore.AppendValues (newvalues); } } catch { string msg = Mono.Unix.Catalog.GetString ( "Unable to read data from server"); HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Network error", msg); dialog.Run (); dialog.Destroy (); } } void DoPopUp() { popup = new Menu(); ImageMenuItem newItem = new ImageMenuItem ("New"); Gtk.Image newImage = new Gtk.Image (Stock.New, IconSize.Menu); newItem.Image = newImage; newItem.Activated += new EventHandler (OnNewEntryActivate); newItem.Show (); popup.Append (newItem); Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource ("document-save.png"); ImageMenuItem exportItem = new ImageMenuItem ("Export"); exportItem.Image = new Gtk.Image (pb); exportItem.Activated += new EventHandler (OnExportActivate); exportItem.Show (); popup.Append (exportItem); ImageMenuItem deleteItem = new ImageMenuItem ("Delete"); Gtk.Image deleteImage = new Gtk.Image (Stock.Delete, IconSize.Menu); deleteItem.Image = deleteImage; deleteItem.Activated += new EventHandler (OnDeleteActivate); deleteItem.Show (); popup.Append (deleteItem); ImageMenuItem propItem = new ImageMenuItem ("Properties"); Gtk.Image propImage = new Gtk.Image (Stock.Properties, IconSize.Menu); propItem.Image = propImage; propItem.Activated += new EventHandler (OnEditActivate); propItem.Show (); popup.Append (propItem); bool users = false; if (viewPlugin.Name.ToLower() == "users") { SeparatorMenuItem sm = new SeparatorMenuItem (); sm.Show (); popup.Append (sm); Gdk.Pixbuf pwdImage = Gdk.Pixbuf.LoadFromResource ("locked16x16.png"); ImageMenuItem pwdItem = new ImageMenuItem ("Change password"); pwdItem.Image = new Gtk.Image (pwdImage); pwdItem.Activated += new EventHandler (OnPwdActivate); pwdItem.Show (); popup.Append (pwdItem); users = true; } if (users || viewPlugin.Name.ToLower() == "contacts") { if (!users) { SeparatorMenuItem sm = new SeparatorMenuItem (); sm.Show (); popup.Append (sm); } pb = Gdk.Pixbuf.LoadFromResource ("mail-message-new.png"); ImageMenuItem mailItem = new ImageMenuItem ("Send email"); mailItem.Image = new Gtk.Image (pb); mailItem.Activated += new EventHandler (OnEmailActivate); mailItem.Show (); popup.Append (mailItem); Gdk.Pixbuf wwwImage = Gdk.Pixbuf.LoadFromResource ("go-home.png"); ImageMenuItem wwwItem = new ImageMenuItem ("Open home page"); wwwItem.Image = new Gtk.Image (wwwImage); wwwItem.Activated += new EventHandler (OnWWWActivate); wwwItem.Show (); popup.Append (wwwItem); } popup.Popup(null, null, null, 3, Gtk.Global.CurrentEventTime); } public string GetDN (TreePath path) { TreeIter iter; if (this.dataStore.GetIter (out iter, path)) { string dn = (string) this.dataStore.GetValue (iter, dnColumn); return dn; } return null; } public void OnNewEntryActivate (object o, EventArgs args) { viewPlugin.OnAddEntry (conn); Populate (); } public void ShowNewItemDialog (string viewName) { viewPlugin = null; viewPlugin = Global.Plugins.GetViewPlugin (viewName, conn.Settings.Name); if (viewPlugin == null) { return; } ConfigureView (viewPlugin); viewPlugin.OnAddEntry (conn); Populate (); } public void OnEditActivate (object o, EventArgs args) { TreeModel model; if (this.Selection == null) return; TreePath[] tp = this.Selection.GetSelectedRows (out model); foreach (TreePath path in tp) { try { LdapEntry le = conn.Data.GetEntry (GetDN(path)); viewPlugin.OnEditEntry (conn, le); Populate (); } catch (Exception e) { Log.Debug (e); string msg = Mono.Unix.Catalog.GetString ("Unable to edit entry"); HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Error", msg); dialog.Run (); dialog.Destroy (); } } } string GetSelectedAttribute (string attrName) { Gtk.TreeModel model; TreePath[] tp = this.Selection.GetSelectedRows (out model); try { LdapEntry le = conn.Data.GetEntry (GetDN(tp[0])); LdapAttribute la = le.getAttribute (attrName); return la.StringValue; } catch {} return ""; } void OnEmailActivate (object o, EventArgs args) { string url = GetSelectedAttribute ("mail"); if (url == null || url == "") { string msg = Mono.Unix.Catalog.GetString ( "Invalid or empty email address"); HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Email error", msg); dialog.Run (); dialog.Destroy (); return; } try { Gnome.Url.Show ("mailto:" + url); } catch (Exception e) { string errorMsg = Mono.Unix.Catalog.GetString ("Unable to send mail to: ") + url; errorMsg += "\nError: " + e.Message; HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Email error", errorMsg); dialog.Run (); dialog.Destroy (); } } void DeleteEntry (TreePath[] path) { try { if (!(path.Length > 1)) { LdapEntry le = conn.Data.GetEntry (GetDN(path[0])); Util.DeleteEntry (conn, le.DN); return; } List dnList = new List (); foreach (TreePath tp in path) { LdapEntry le = conn.Data.GetEntry (GetDN(tp)); dnList.Add (le.DN); } Util.DeleteEntry (conn, dnList.ToArray ()); } catch {} } public void OnDeleteActivate (object o, EventArgs args) { TreeModel model; TreePath[] tp = this.Selection.GetSelectedRows (out model); DeleteEntry (tp); Populate (); } void OnExportActivate (object o, EventArgs args) { TreeModel model; TreePath[] tp = this.Selection.GetSelectedRows (out model); try { LdapEntry le = conn.Data.GetEntry (GetDN(tp[0])); Util.ExportData (conn, parentWindow, le.DN); } catch {} } void OnPwdActivate (object o, EventArgs args) { PasswordDialog pd = new PasswordDialog (); if (pd.UserResponse == ResponseType.Cancel) return; if (pd.UnixPassword == null || pd.UnixPassword == "") return; TreeModel model; TreePath[] tp = this.Selection.GetSelectedRows (out model); foreach (TreePath path in tp) { LdapEntry le = conn.Data.GetEntry (GetDN(path)); ChangePassword (le, pd); } } void ChangePassword (LdapEntry entry, PasswordDialog pd) { List mods = new List (); LdapAttribute la; LdapModification lm; la = new LdapAttribute ("userPassword", pd.UnixPassword); lm = new LdapModification (LdapModification.REPLACE, la); mods.Add (lm); if (Util.CheckSamba (entry)) { la = new LdapAttribute ("sambaLMPassword", pd.LMPassword); lm = new LdapModification (LdapModification.REPLACE, la); mods.Add (lm); la = new LdapAttribute ("sambaNTPassword", pd.NTPassword); lm = new LdapModification (LdapModification.REPLACE, la); mods.Add (lm); } Util.ModifyEntry (conn, entry.DN, mods.ToArray()); } public void OnRefreshActivate (object o, EventArgs args) { Populate (); } [ConnectBefore] void OnRightClick (object o, ButtonPressEventArgs args) { // FIXME: Find a way to not deselect on multiple selection if (args.Event.Button == 3) DoPopUp (); } void OnRowActivated (object o, RowActivatedArgs args) { TreePath path = args.Path; TreeIter iter; if (this.dataStore.GetIter (out iter, path)) { string dn = (string) this.dataStore.GetValue (iter, dnColumn); try { viewPlugin.OnEditEntry (conn, conn.Data.GetEntry (dn)); } catch (Exception e) { Log.Debug (e); string msg = Mono.Unix.Catalog.GetString ("Unable to edit entry"); HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Error", msg); dialog.Run (); dialog.Destroy (); } } } void OnWWWActivate (object o, EventArgs args) { string url = GetSelectedAttribute ("wWWHomePage"); try { Gnome.Url.Show (url); } catch (Exception e) { string errorMsg = Mono.Unix.Catalog.GetString ("Unable to open page: ") + url; errorMsg += "\nError: " + e.Message; HIGMessageDialog dialog = new HIGMessageDialog ( parentWindow, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Network error", errorMsg); dialog.Run (); dialog.Destroy (); } } void SetViewColumns () { if (dataStore != null) dataStore.Clear (); foreach (TreeViewColumn col in this.Columns) this.RemoveColumn (col); int colLength = viewPlugin.ColumnNames.Length + 1; System.Type[] types = new System.Type [colLength]; for (int i = 0; i < colLength; i++) types[i] = typeof (string); dataStore = new ListStore (types); this.Model = dataStore; CellRenderer crt = new CellRendererText (); for (int i = 0; i < viewPlugin.ColumnNames.Length; i++) { TreeViewColumn col = new TreeViewColumn (); col.Title = viewPlugin.ColumnNames[i]; col.PackStart (crt, true); col.AddAttribute (crt, "text", i); col.SortColumnId = i; this.AppendColumn (col); } dnColumn = viewPlugin.ColumnNames.Length; TreeViewColumn c = new TreeViewColumn (); c.Title = "DN"; c.PackStart (crt, true); c.AddAttribute (crt, "text", dnColumn); c.Visible = false; this.AppendColumn (c); this.ShowAll (); } } }lat-1.2.4/lat/SelectContainerDialog.cs0000644000175000001440000000457311702646352014543 00000000000000// // lat - SelectContainerDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; namespace lat { public class SelectContainerDialog { [Glade.Widget] Gtk.Dialog selectContainerDialog; [Glade.Widget] ScrolledWindow browserScrolledWindow; [Glade.Widget] Gtk.Label msgLabel; Glade.XML ui; LdapTreeView _ldapTreeview; string _dn = ""; public SelectContainerDialog (Connection connection, Gtk.Window parent) { ui = new Glade.XML (null, "lat.glade", "selectContainerDialog", null); ui.Autoconnect (this); _ldapTreeview = new LdapTreeView (parent, connection); _ldapTreeview.dnSelected += new dnSelectedHandler (ldapDNSelected); _ldapTreeview.BrowserSelectionMethod = (int)Preferences.Get (Preferences.BROWSER_SELECTION); browserScrolledWindow.AddWithViewport (_ldapTreeview); browserScrolledWindow.Show (); selectContainerDialog.Resize (350, 400); selectContainerDialog.Icon = Global.latIcon; } public void Run () { selectContainerDialog.Run (); selectContainerDialog.Destroy (); } public string DN { get { return _dn; } } public string Title { set { selectContainerDialog.Title = value; } } public string Message { set { msgLabel.Markup = String.Format ("{0}", value); } } private void ldapDNSelected (object o, dnSelectedEventArgs args) { if (args.IsHost) return; _dn = args.DN; selectContainerDialog.HideAll (); } public void OnOkClicked (object o, EventArgs args) { _dn = _ldapTreeview.GetSelectedDN (); selectContainerDialog.HideAll (); } public void OnCancelClicked (object o, EventArgs args) { selectContainerDialog.HideAll (); } } } lat-1.2.4/lat/PasswordDialog.cs0000644000175000001440000001213111702646352013250 00000000000000// // lat - PasswordDialog.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Security.Cryptography; using System.Text; using Gtk; using Mono.Unix; namespace lat { public class PasswordDialog { [Glade.Widget] Gtk.Dialog passwordDialog; [Glade.Widget] Gtk.Entry passwordEntry; [Glade.Widget] Gtk.Entry reenterEntry; [Glade.Widget] Gtk.RadioButton md5RadioButton; [Glade.Widget] Gtk.RadioButton shaRadioButton; [Glade.Widget] Gtk.CheckButton useSaltCheckButton; Glade.XML ui; private string _unix; private string _lm; private string _nt; private bool passwordsDontMatch = false; private ResponseType response; public PasswordDialog () { ui = new Glade.XML (null, "lat.glade", "passwordDialog", null); ui.Autoconnect (this); passwordDialog.Icon = Global.latIcon; // Use SSHA by default shaRadioButton.Active = true; useSaltCheckButton.Active = true; response = (ResponseType) passwordDialog.Run (); while (passwordsDontMatch) { passwordsDontMatch = false; response = (ResponseType) passwordDialog.Run (); } passwordDialog.Destroy (); } private byte[] getSalt () { byte[] retVal = new byte [8]; RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetNonZeroBytes (retVal); return retVal; } private byte[] addSalt (HashAlgorithm hashAlgorithm, byte[] buffer) { // get salt byte[] saltBytes = getSalt (); // Create buffer for password + salt byte[] bufferWithSaltBytes = new byte[buffer.Length + saltBytes.Length]; // Insert password for (int i = 0; i < buffer.Length; i++) bufferWithSaltBytes[i] = buffer[i]; // Insert salt for (int i = 0; i < saltBytes.Length; i++) bufferWithSaltBytes[buffer.Length + i] = saltBytes[i]; // Encrypt byte[] hashBytes = hashAlgorithm.ComputeHash (bufferWithSaltBytes); // Create byte array for encrypted hash + salt byte[] hashWithSaltBytes = new byte[hashBytes.Length + saltBytes.Length]; // Insert hashed password for (int i = 0; i < hashBytes.Length; i++) hashWithSaltBytes[i] = hashBytes[i]; // Insert salt for (int i = 0; i < saltBytes.Length; i++) hashWithSaltBytes[hashBytes.Length + i] = saltBytes[i]; return hashWithSaltBytes; } private string doEncryption (string input, string algorithm, bool salted) { string retVal = ""; if (input.Equals ("")) { return retVal; } HashAlgorithm hashAlgorithm = null; byte[] hash = null; string encText = null; switch (algorithm) { case "MD5": hashAlgorithm = new MD5CryptoServiceProvider(); encText = "{MD5}"; break; case "SHA": hashAlgorithm = new SHA1Managed(); encText = "{SHA}"; break; } ASCIIEncoding enc = new ASCIIEncoding(); byte[] buffer = enc.GetBytes (input); if (salted) { byte[] saltedBuffer = addSalt (hashAlgorithm, buffer); encText = "{S" + algorithm + "}"; retVal = encText + Convert.ToBase64String (saltedBuffer); } else { hash = hashAlgorithm.ComputeHash(buffer); retVal = encText + Convert.ToBase64String (hash); } return retVal; } private void GeneratePassword () { if (md5RadioButton.Active) { _unix = doEncryption (passwordEntry.Text, "MD5", useSaltCheckButton.Active); } else if (shaRadioButton.Active) { _unix = doEncryption (passwordEntry.Text, "SHA", useSaltCheckButton.Active); } SMBPassword smbpass = new SMBPassword (passwordEntry.Text); _lm = smbpass.LM; _nt = smbpass.NT; } public void OnEncryptionChanged (object o, EventArgs args) { GeneratePassword (); } public void OnOkClicked (object o, EventArgs args) { if (passwordEntry.Text != reenterEntry.Text) { string msg = Mono.Unix.Catalog.GetString ("Password don't match"); HIGMessageDialog dialog = new HIGMessageDialog ( passwordDialog, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Password error", msg); dialog.Run (); dialog.Destroy (); passwordsDontMatch = true; return; } GeneratePassword (); } public void OnCancelClicked (object o, EventArgs args) { _unix = null; } public ResponseType UserResponse { get { return response; } } public string UnixPassword { get { return _unix; } } public string LMPassword { get { return _lm; } } public string NTPassword { get { return _nt; } } } } lat-1.2.4/lat/ViewsTreeView.cs0000644000175000001440000001323411702646352013103 00000000000000// // lat - ViewsTreeView.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using Gdk; using System; namespace lat { public class ViewSelectedEventArgs : EventArgs { string viewName; string connectionName; public ViewSelectedEventArgs (string name, string connection) { viewName = name; connectionName = connection; } public string Name { get { return viewName; } } public string ConnectionName { get { return connectionName; } } } public delegate void ViewSelectedHandler (object o, ViewSelectedEventArgs args); public class ViewsTreeView : Gtk.TreeView { TreeStore viewsStore; TreeIter viewRootIter; enum TreeCols { Icon, Name }; public event ViewSelectedHandler ViewSelected; public ViewsTreeView () : base () { viewsStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string)); this.Model = viewsStore; this.HeadersVisible = false; this.AppendColumn ("viewsIcon", new CellRendererPixbuf (), "pixbuf", (int)TreeCols.Icon); this.AppendColumn ("viewsRoot", new CellRendererText (), "text", (int)TreeCols.Name); Gdk.Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); viewRootIter = viewsStore.AppendValues (dirIcon, "Servers"); TreePath path = viewsStore.GetPath (viewRootIter); foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = viewsStore.AppendValues (viewRootIter, dirIcon, n); viewsStore.AppendValues (iter, null, ""); } this.RowExpanded += new RowExpandedHandler (OnRowExpanded); this.RowActivated += new RowActivatedHandler (OnRowActivated); this.ExpandRow (path, false); this.ShowAll (); } public void AddConnection (Connection conn) { Gdk.Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); TreeIter iter = viewsStore.AppendValues (viewRootIter, dirIcon, conn.Settings.Name); AddViews (conn, iter); } public void Refresh () { viewsStore.Clear (); Gdk.Pixbuf dirIcon = Pixbuf.LoadFromResource ("x-directory-remote-server.png"); viewRootIter = viewsStore.AppendValues (dirIcon, "Servers"); TreePath path = viewsStore.GetPath (viewRootIter); foreach (string n in Global.Connections.ConnectionNames) { TreeIter iter = viewsStore.AppendValues (viewRootIter, dirIcon, n); viewsStore.AppendValues (iter, null, ""); } this.ExpandRow (path, false); } void OnRowExpanded (object o, RowExpandedArgs args) { string name = (string) viewsStore.GetValue (args.Iter, 1); if (name == "Servers") return; TreeIter child; viewsStore.IterChildren (out child, args.Iter); string childName = (string)viewsStore.GetValue (child, 1); if (childName != "") return; viewsStore.Remove (ref child); Log.Debug ("View expanded {0}", name); Connection conn = Global.Connections [name]; AddViews (conn, args.Iter); TreePath path = viewsStore.GetPath (args.Iter); this.ExpandRow (path, false); } void AddViews (Connection conn, TreeIter profileIter) { if (conn == null) { Log.Error ("Unable to add views to ViewsTreeView connection is null"); return; } if (conn.ServerViews.Count == 0) conn.SetDefaultServerViews (); foreach (ViewPlugin vp in Global.Plugins.ServerViewPlugins) { if (conn.ServerViews.Contains (vp.GetType().ToString())) viewsStore.AppendValues (profileIter, vp.Icon, vp.Name); } } public string GetSelectedViewName () { TreeModel model; TreeIter iter; string name; if (this.Selection.GetSelected (out model, out iter)) { name = (string) viewsStore.GetValue (iter, (int)TreeCols.Name); return name; } return null; } public string GetActiveServerName () { TreeModel model; TreeIter iter; if (this.Selection.GetSelected (out model, out iter)) return FindServerName (iter, model); return null; } string FindServerName (TreeIter iter, TreeModel model) { TreeIter parent; viewsStore.IterParent (out parent, iter); if (!viewsStore.IterIsValid (parent)) return null; string parentName = (string)model.GetValue (parent, (int)TreeCols.Name); if (parentName == "Servers") return (string)model.GetValue (iter, (int)TreeCols.Name); return FindServerName (parent, model); } void DispatchViewSelectedEvent (string name, string connection) { if (ViewSelected != null) ViewSelected (this, new ViewSelectedEventArgs (name, connection)); } void OnRowActivated (object o, RowActivatedArgs args) { TreePath path = args.Path; TreeIter iter; if (viewsStore.GetIter (out iter, path)) { string name = (string) viewsStore.GetValue (iter, (int)TreeCols.Name); if (name == "Servers") return; TreeIter parent; viewsStore.IterParent (out parent, iter); string connection = (string) viewsStore.GetValue (parent, (int)TreeCols.Name); if (connection == "Servers") connection = name; DispatchViewSelectedEvent (name, connection); } } } } lat-1.2.4/lat/TemplateEditorDialog.cs0000644000175000001440000001316711704524010014366 00000000000000// // lat - TemplateEditorDialog.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using Gtk; using System; using System.Collections.Generic; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Utilclass; namespace lat { public class TemplateEditorDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog templateEditorDialog; [Glade.Widget] Gtk.Entry nameEntry; [Glade.Widget] TreeView objTreeView; [Glade.Widget] TreeView attrTreeView; ListStore objListStore; ListStore attrListStore; List _objectClass; Template t = null; Connection conn; bool _isEdit = false; public TemplateEditorDialog (Connection connection) { conn = connection; Init (); templateEditorDialog.Run (); templateEditorDialog.Destroy (); } public TemplateEditorDialog (Connection connection, Template theTemplate) { conn = connection; _isEdit = true; t = theTemplate; Init (); nameEntry.Text = t.Name; nameEntry.Sensitive = false; foreach (string s in t.Classes) { objListStore.AppendValues (s); _objectClass.Add (s); } ShowAttributes (); templateEditorDialog.Run (); templateEditorDialog.Destroy (); } void Init () { _objectClass = new List (); ui = new Glade.XML (null, "lat.glade", "templateEditorDialog", null); ui.Autoconnect (this); setupTreeViews (); templateEditorDialog.Icon = Global.latIcon; templateEditorDialog.Resize (640, 480); } void setupTreeViews () { // Object class objListStore = new ListStore (typeof (string)); objTreeView.Model = objListStore; TreeViewColumn col; col = objTreeView.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; objListStore.SetSortColumnId (0, SortType.Ascending); // Attributes attrListStore = new ListStore (typeof (string), typeof (string), typeof (string)); attrTreeView.Model = attrListStore; col = attrTreeView.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; col = attrTreeView.AppendColumn ("Type", new CellRendererText (), "text", 1); col.SortColumnId = 1; CellRendererText cell = new CellRendererText (); cell.Editable = true; cell.Edited += new EditedHandler (OnAttributeEdit); col = attrTreeView.AppendColumn ("Default Value", cell, "text", 2); col.SortColumnId = 2; attrListStore.SetSortColumnId (0, SortType.Ascending); } void OnAttributeEdit (object o, EditedArgs args) { TreeIter iter; if (!attrListStore.GetIterFromString (out iter, args.Path)) return; string oldText = (string) attrListStore.GetValue (iter, 2); if (oldText.Equals (args.NewText)) return; attrListStore.SetValue (iter, 2, args.NewText); } void ShowAttributes () { attrListStore.Clear (); string[] required, optional; conn.Data.GetAllAttributes (_objectClass, out required, out optional); foreach (string s in required) { if (_isEdit) { attrListStore.AppendValues (s, "Required", t.GetAttributeDefaultValue (s)); } else { attrListStore.AppendValues (s, "Required", ""); } } foreach (string s in optional) { if (_isEdit) { attrListStore.AppendValues (s, "Optional", t.GetAttributeDefaultValue (s)); } else { attrListStore.AppendValues (s, "Optional", ""); } } } public void OnObjAddClicked (object o, EventArgs args) { AddObjectClassDialog dlg = new AddObjectClassDialog (conn); foreach (string s in dlg.ObjectClasses) { if (_objectClass.Contains (s)) continue; _objectClass.Add (s); objListStore.AppendValues (s); } ShowAttributes (); } public void OnObjRemoveClicked (object o, EventArgs args) { Gtk.TreeIter iter; Gtk.TreeModel model; if (objTreeView.Selection.GetSelected (out model, out iter)) { string objClass = (string) model.GetValue (iter, 0); _objectClass.Remove (objClass); objListStore.Remove (ref iter); ShowAttributes (); } } public void OnObjClearClicked (object o, EventArgs args) { objListStore.Clear (); _objectClass.Clear (); attrListStore.Clear (); } public void OnAttrClearClicked (object o, EventArgs args) { attrListStore.Clear (); } public void OnAttrRemoveClicked (object o, EventArgs args) { Gtk.TreeIter iter; Gtk.TreeModel model; if (attrTreeView.Selection.GetSelected (out model, out iter)) attrListStore.Remove (ref iter); } public void OnOkClicked (object o, EventArgs args) { if (_isEdit) { t.Name = nameEntry.Text; t.ClearAttributes (); } else { t = new Template (nameEntry.Text); } t.AddClass (_objectClass); foreach (object[] row in attrListStore) { string nam = (string) row[0]; string val = (string) row[2]; if (string.IsNullOrEmpty(nam) || string.IsNullOrEmpty(val)) continue; t.AddAttribute (nam, val); } } public Template UserTemplate { get { return t; } } } } lat-1.2.4/lat/SMBPassword.cs0000644000175000001440000001307511702646352012502 00000000000000// Class to generate NTLM passwords for Samba // // Modified by Loren Bandiera from: // Mono.Security.Protocol.Ntlm.ChallengeResponse // // Author: // Sebastien Pouliot // // (C) 2003 Motus Technologies Inc. (http://www.motus.com) // (C) 2004 Novell (http://www.novell.com) // // References // a. NTLM Authentication Scheme for HTTP, Ronald Tschalär // http://www.innovation.ch/java/ntlm.html // b. The NTLM Authentication Protocol, Copyright © 2003 Eric Glass // http://davenport.sourceforge.net/ntlm.html // // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Globalization; using System.Security.Cryptography; using System.Text; using Mono.Security; using Mono.Security.Cryptography; public class SMBPassword : IDisposable { static private byte[] magic = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 }; // This is the pre-encrypted magic value with a null DES key (0xAAD3B435B51404EE) // Ref: http://packetstormsecurity.nl/Crackers/NT/l0phtcrack/l0phtcrack2.5-readme.html static private byte[] nullEncMagic = { 0xAA, 0xD3, 0xB4, 0x35, 0xB5, 0x14, 0x04, 0xEE }; private bool _disposed; private byte[] _lmpwd; private byte[] _ntpwd; // constructors public SMBPassword () { _disposed = false; _lmpwd = new byte [21]; _ntpwd = new byte [21]; } public SMBPassword (string password) : this () { Password = password; } ~SMBPassword () { if (!_disposed) Dispose (); } // properties public string Password { get { return null; } set { if (_disposed) throw new ObjectDisposedException ("too late"); // create Lan Manager password DES des = DES.Create (); des.Mode = CipherMode.ECB; ICryptoTransform ct = null; // Note: In .NET DES cannot accept a weak key // this can happen for a null password if ((value == null) || (value.Length < 1)) { Buffer.BlockCopy (nullEncMagic, 0, _lmpwd, 0, 8); } else { des.Key = PasswordToKey (value, 0); ct = des.CreateEncryptor (); ct.TransformBlock (magic, 0, 8, _lmpwd, 0); } // and if a password has less than 8 characters if ((value == null) || (value.Length < 8)) { Buffer.BlockCopy (nullEncMagic, 0, _lmpwd, 8, 8); } else { des.Key = PasswordToKey (value, 7); ct = des.CreateEncryptor (); ct.TransformBlock (magic, 0, 8, _lmpwd, 8); } // create NT password MD4 md4 = MD4.Create (); byte[] data = ((value == null) ? (new byte [0]) : (Encoding.Unicode.GetBytes (value))); byte[] hash = md4.ComputeHash (data); Buffer.BlockCopy (hash, 0, _ntpwd, 0, 16); // clean up Array.Clear (data, 0, data.Length); Array.Clear (hash, 0, hash.Length); des.Clear (); } } public string LM { get { if (_disposed) throw new ObjectDisposedException ("too late"); string tmp = ""; for (int i = 0; i < 16; i++) { tmp += _lmpwd[i].ToString("X2"); } return tmp; } } public string NT { get { if (_disposed) throw new ObjectDisposedException ("too late"); string tmp = ""; for (int i = 0; i < 16; i++) { tmp += _ntpwd[i].ToString("X2"); } return tmp; } } // IDisposable method public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } private void Dispose (bool disposing) { if (!_disposed) { // cleanup our stuff Array.Clear (_lmpwd, 0, _lmpwd.Length); Array.Clear (_ntpwd, 0, _ntpwd.Length); _disposed = true; } } // private methods private byte[] PrepareDESKey (byte[] key56bits, int position) { // convert to 8 bytes byte[] key = new byte [8]; key [0] = key56bits [position]; key [1] = (byte) ((key56bits [position] << 7) | (key56bits [position + 1] >> 1)); key [2] = (byte) ((key56bits [position + 1] << 6) | (key56bits [position + 2] >> 2)); key [3] = (byte) ((key56bits [position + 2] << 5) | (key56bits [position + 3] >> 3)); key [4] = (byte) ((key56bits [position + 3] << 4) | (key56bits [position + 4] >> 4)); key [5] = (byte) ((key56bits [position + 4] << 3) | (key56bits [position + 5] >> 5)); key [6] = (byte) ((key56bits [position + 5] << 2) | (key56bits [position + 6] >> 6)); key [7] = (byte) (key56bits [position + 6] << 1); return key; } private byte[] PasswordToKey (string password, int position) { byte[] key7 = new byte [7]; int len = System.Math.Min (password.Length - position, 7); Encoding.ASCII.GetBytes (password.ToUpper (CultureInfo.CurrentCulture), position, len, key7, 0); byte[] key8 = PrepareDESKey (key7, 0); // cleanup intermediate key material Array.Clear (key7, 0, key7.Length); return key8; } } lat-1.2.4/lat/Log.cs0000644000175000001440000000557111702646352011061 00000000000000// // lat - Main.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Diagnostics; using System.IO; using System.Text; namespace lat { public enum LogLevel { Error, Warn, Info, Debug, None } public static class Log { static TextWriter textWriter; static LogLevel currentLevel = LogLevel.Info; public static void Initialize (LogLevel logLevel) { Log.currentLevel = logLevel; textWriter = Console.Out; } static void WriteLine (LogLevel level, string format, object[] args, Exception ex) { if (textWriter == null) return; if (currentLevel < level) return; string exceptionText = null; if (ex != null) exceptionText = ex.ToString(); StringBuilder prefix = new StringBuilder (); prefix.AppendFormat ("{0} [{1:00000}] ", Defines.PACKAGE, Process.GetCurrentProcess ().Id); switch (level) { case LogLevel.Error: prefix.Append ("ERROR "); break; case LogLevel.Warn: prefix.Append ("WARN "); break; case LogLevel.Info: prefix.Append ("INFO "); break; case LogLevel.Debug: prefix.Append ("DEBUG "); break; default: break; } StringBuilder msg = new StringBuilder (); msg.Append (prefix.ToString()); if (format != null) msg.AppendFormat (format, args); if (exceptionText != null) { msg.Append ("\n"); msg.Append (exceptionText); } textWriter.WriteLine (msg.ToString()); } public static void Error (string message, params object[] args) { WriteLine (LogLevel.Error, message, args, null); } public static void Error (Exception e) { WriteLine (LogLevel.Error, null, null, e); } public static void Warn (string message, params object[] args) { WriteLine (LogLevel.Warn, message, args, null); } public static void Warn (Exception e) { WriteLine (LogLevel.Warn, null, null, e); } public static void Info (string message, params object[] args) { WriteLine (LogLevel.Info, message, args, null); } public static void Debug (string message, params object[] args) { WriteLine (LogLevel.Debug, message, args, null); } public static void Debug (Exception e) { WriteLine (LogLevel.Debug, null, null, e); } } } lat-1.2.4/lat/ViewPluginManager.cs0000644000175000001440000002735311702646352013726 00000000000000// // lat - ViewManager.cs // Author: Loren Bandiera // Copyright 2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; using Gtk; using Novell.Directory.Ldap; namespace lat { [Serializable] public struct ViewPluginConfig { public string PluginName; public string[] ColumnNames; public string[] ColumnAttributes; public string DefaultNewContainer; public string Filter; public string SearchBase; public Dictionary Defaults; } [Serializable] public class PluginConfigCollection : ICollection { Dictionary pluginConfigs; public PluginConfigCollection () { pluginConfigs = new Dictionary (); } public void Add (ViewPluginConfig vpc) { pluginConfigs.Add (vpc.PluginName, vpc); } public void Clear () { pluginConfigs.Clear (); } public bool Contains (ViewPluginConfig vpc) { if (pluginConfigs.ContainsValue (vpc)) return true; return false; } public bool Contains (string name) { if (pluginConfigs.ContainsKey (name)) return true; return false; } public void CopyTo (ViewPluginConfig[] array, int arrayIndex) { int count = 0; foreach (KeyValuePair kvp in pluginConfigs) { array [arrayIndex + count] = kvp.Value; count++; } } IEnumerator IEnumerable.GetEnumerator () { return pluginConfigs.GetEnumerator (); } public IEnumerator GetEnumerator () { return pluginConfigs.Values.GetEnumerator (); } public void Remove (string name) { if (pluginConfigs.ContainsKey (name)) pluginConfigs.Remove (name); } public bool Remove (ViewPluginConfig vpc) { return pluginConfigs.Remove (vpc.PluginName); } public void Update (ViewPluginConfig vpc) { pluginConfigs[vpc.PluginName] = vpc; } public int Count { get { return pluginConfigs.Count; } } public bool IsReadOnly { get { return false; } } public ViewPluginConfig this [string name] { get { return pluginConfigs [name]; } set { pluginConfigs[name] = value; } } } public abstract class ViewPlugin { protected ViewPluginConfig config; public ViewPlugin () { } // Methods public abstract void Init (); public abstract void OnAddEntry (Connection conn); public abstract void OnEditEntry (Connection conn, LdapEntry le); public abstract void OnPopupShow (Menu popup); public abstract void OnSetDefaultValues (Connection conn); // Properties public ViewPluginConfig PluginConfiguration { get { if (config.Defaults == null) config.Defaults = new Dictionary (); return config; } set { config = value; } } public string[] ColumnAttributes { get { return config.ColumnAttributes; } set { config.ColumnAttributes = value; } } public string[] ColumnNames { get { return config.ColumnNames; } set { config.ColumnNames = value; } } public string DefaultNewContainer { get { return config.DefaultNewContainer; } set { config.DefaultNewContainer = value; } } public string Filter { get { return config.Filter; } set { config.Filter = value; } } public string SearchBase { get { return config.SearchBase; } set { config.SearchBase = value; } } public abstract string[] Authors { get; } public abstract string Copyright { get; } public abstract string Description { get; } public abstract string Name { get; } public abstract string Version { get; } public abstract string MenuLabel { get; } public abstract AccelKey MenuKey { get; } public abstract Gdk.Pixbuf Icon { get; } } public enum ViewerDataType : int { Binary, String }; public abstract class AttributeViewPlugin { public AttributeViewPlugin () { } public abstract void OnActivate (string attributeName, string attributeData); public abstract void OnActivate (string attributeName, byte[] attributeData); public abstract string[] AttributeNames { get; } public abstract string StringValue { get; } public abstract byte[] ByteValue { get; } public abstract ViewerDataType DataType { get; } public abstract string[] Authors { get; } public abstract string Copyright { get; } public abstract string Description { get; } public abstract string Name { get; } public abstract string Version { get; } } public class PluginManager { string pluginDirectory; string pluginStateDirectory; string pluginStateFile; List viewPluginList; List attrPluginList; Dictionary viewPluginHash; Dictionary serverViewConfig; FileSystemWatcher sysPluginWatch; FileSystemWatcher usrPluginWatch; public PluginManager () { viewPluginList = new List (); attrPluginList = new List (); viewPluginHash = new Dictionary (); serverViewConfig = new Dictionary (); string latDir = Util.GetConfigDirectory (); DirectoryInfo di = new DirectoryInfo (latDir); if (!di.Exists) di.Create (); DirectoryInfo dir = null; #if DEBUG // Load any plugins in the plugins directory // relative to the executing path. // This is for debug purposes only. // -- JA 19/10/2008 Assembly exeAsm = Assembly.GetExecutingAssembly(); string runLocation = Path.GetDirectoryName(exeAsm.Location); dir = new DirectoryInfo(runLocation); foreach(FileInfo fi in dir.GetFiles("*.dll")) LoadPluginsFromFile(fi.FullName); #endif // Load any plugins in sys dir dir = new System.IO.DirectoryInfo (Defines.SYS_PLUGIN_DIR); if (dir.Exists) foreach (FileInfo f in dir.GetFiles("*.dll")) LoadPluginsFromFile (f.FullName); // Load any plugins in home dir pluginStateDirectory = latDir; pluginStateFile = Path.Combine (pluginStateDirectory, "plugins.state"); pluginDirectory = Path.Combine (latDir, "plugins"); dir = new System.IO.DirectoryInfo (pluginDirectory); if (dir.Exists) foreach (FileInfo f in dir.GetFiles("*.dll")) LoadPluginsFromFile (f.FullName); // Login plugin states (if any) Load (); // Watch for any plugins to be added/removed if (Directory.Exists(Defines.SYS_PLUGIN_DIR)) { try { sysPluginWatch = new FileSystemWatcher (Defines.SYS_PLUGIN_DIR, "*.dll"); sysPluginWatch.Created += OnPluginCreated; sysPluginWatch.Deleted += OnPluginDeleted; sysPluginWatch.EnableRaisingEvents = true; } catch (Exception e) { Log.Debug ("Plugin system watch error: {0}", e); } } else Log.Debug("Plugin system directory does not exist."); if (Directory.Exists(pluginDirectory)) { try { usrPluginWatch = new FileSystemWatcher (pluginDirectory, "*.dll"); usrPluginWatch.Created += OnPluginCreated; usrPluginWatch.Deleted += OnPluginDeleted; usrPluginWatch.EnableRaisingEvents = true; } catch (Exception e) { Log.Debug ("Plugin user dir watch error: {0}", e); } } else Log.Debug("Plugin user dir does not exist."); } void OnPluginCreated (object sender, FileSystemEventArgs args) { Log.Debug ("New plugin found: {0}", Path.GetFileName (args.FullPath)); LoadPluginsFromFile (args.FullPath); } void OnPluginDeleted (object sender, FileSystemEventArgs args) { // FIXME: remove plugin Log.Debug ("Plugin deleted: {0}", Path.GetFileName (args.FullPath)); } void LoadPluginsFromFile (string fileName) { Assembly asm = Assembly.LoadFrom (fileName); Type [] types = asm.GetTypes (); foreach (Type type in types) { if (type.IsSubclassOf (typeof (ViewPlugin))) { ViewPlugin plugin = (ViewPlugin) Activator.CreateInstance (type); if (plugin == null) continue; viewPluginList.Add (plugin); viewPluginHash.Add (plugin.MenuLabel, plugin.Name); Log.Debug ("Loaded plugin: {0}", type.FullName); } else if (type.IsSubclassOf (typeof (AttributeViewPlugin))) { AttributeViewPlugin plugin = (AttributeViewPlugin) Activator.CreateInstance (type); if (plugin == null) continue; attrPluginList.Add (plugin); Log.Debug ("Loaded plugin: {0}", type.FullName); } } } public ViewPlugin GetViewPlugin (string pluginName, string configName) { ViewPlugin retVal = null; string labelKey = null; if (viewPluginHash.ContainsKey (pluginName)) labelKey = viewPluginHash [pluginName]; foreach (ViewPlugin vp in viewPluginList) { if (vp.Name == pluginName || vp.Name == labelKey) retVal = vp; } if (retVal != null && serverViewConfig.ContainsKey (configName)) { PluginConfigCollection pcc = serverViewConfig [configName]; if (pcc.Contains (pluginName)) { ViewPluginConfig vpc = pcc [pluginName]; if (vpc.Defaults == null) vpc.Defaults = new Dictionary (); retVal.PluginConfiguration = vpc; } } return retVal; } public AttributeViewPlugin FindAttributeView (string name) { foreach (AttributeViewPlugin avp in attrPluginList) if (avp.Name == name) return avp; return null; } public void Load () { if (!File.Exists (pluginStateFile)) return; try { Stream stream = File.OpenRead (pluginStateFile); IFormatter formatter = new BinaryFormatter(); this.serverViewConfig = (Dictionary) formatter.Deserialize (stream); stream.Close (); Log.Debug ("Loaded {0} configs from plugins.state", this.serverViewConfig.Count); } catch (Exception e) { Log.Error ("Error loading plugin state: {0}", e.Message); Log.Debug (e); } } public void Save () { try { Stream stream = File.OpenWrite (pluginStateFile); IFormatter formatter = new BinaryFormatter (); formatter.Serialize (stream, this.serverViewConfig); stream.Close (); Log.Debug ("Saved {0} configs to plugins.state", this.serverViewConfig.Count); } catch (Exception e) { Log.Error ("Error saving plugin state: {0}", e.Message); Log.Debug (e); } } public void SetPluginConfiguration (string connName, ViewPluginConfig config) { if (serverViewConfig.ContainsKey (connName)) { PluginConfigCollection pcc = serverViewConfig [connName]; pcc.Update (config); } else { PluginConfigCollection pcc = new PluginConfigCollection (); pcc.Add (config); serverViewConfig.Add (connName, pcc); } } public Dictionary ServerViewConfig { get { return serverViewConfig; } set { serverViewConfig = value; } } public ViewPlugin[] ServerViewPlugins { get { return viewPluginList.ToArray (); } } public AttributeViewPlugin[] AttributeViewPlugins { get { return attrPluginList.ToArray (); } } } } lat-1.2.4/lat/Preferences.cs0000644000175000001440000002607211702646352012600 00000000000000// // lat - Preferences.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 . // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Gtk; namespace lat { public class Preferences { public const string MAIN_WINDOW_MAXIMIZED = "/apps/lat/ui/maximized"; public const string MAIN_WINDOW_X = "/apps/lat/ui/main_window_x"; public const string MAIN_WINDOW_Y = "/apps/lat/ui/main_window_y"; public const string MAIN_WINDOW_WIDTH = "/apps/lat/ui/main_window_width"; public const string MAIN_WINDOW_HEIGHT = "/apps/lat/ui/main_window_height"; public const string MAIN_WINDOW_HPANED = "/apps/lat/ui/main_window_hpaned"; public const string BROWSER_SELECTION = "/apps/lat/ui/browser_selection"; static GConf.Client client; static GConf.NotifyEventHandler changed_handler; public static GConf.Client Client { get { if (client == null) { client = new GConf.Client (); changed_handler = new GConf.NotifyEventHandler (OnSettingChanged); client.AddNotify ("/apps/lat", changed_handler); } return client; } } public static object GetDefault (string key) { switch (key) { case MAIN_WINDOW_X: case MAIN_WINDOW_Y: case MAIN_WINDOW_HEIGHT: case MAIN_WINDOW_WIDTH: case MAIN_WINDOW_HPANED: return null; case BROWSER_SELECTION: return 2; } return null; } public static object Get (string key) { try { return Client.Get (key); } catch (GConf.NoSuchKeyException) { object default_val = GetDefault (key); if (default_val != null) Client.Set (key, default_val); return default_val; } } public static void Set (string key, object value) { Client.Set (key, value); } public static event GConf.NotifyEventHandler SettingChanged; static void OnSettingChanged (object sender, GConf.NotifyEventArgs args) { if (SettingChanged != null) { SettingChanged (sender, args); } } } public class PreferencesDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog preferencesDialog; [Glade.Widget] RadioButton browserSingleClickButton; [Glade.Widget] RadioButton browserDoubleClickButton; [Glade.Widget] TreeView profilesTreeView; ListStore profileStore; Gnome.Program program; bool gettingHelp = false; public PreferencesDialog (Gnome.Program program) { ui = new Glade.XML (null, "lat.glade", "preferencesDialog", null); ui.Autoconnect (this); this.program = program; profileStore = new ListStore (typeof (string)); profilesTreeView.Model = profileStore; profileStore.SetSortColumnId (0, SortType.Ascending); TreeViewColumn col; col = profilesTreeView.AppendColumn ("Name", new CellRendererText (), "text", 0); col.SortColumnId = 0; UpdateProfileList (); LoadPreference (Preferences.BROWSER_SELECTION); preferencesDialog.Icon = Global.latIcon; preferencesDialog.Resize (300, 400); preferencesDialog.Run (); if (gettingHelp) { preferencesDialog.Run (); gettingHelp = false; } preferencesDialog.Destroy (); } void UpdateProfileList () { profileStore.Clear (); foreach (string s in Global.Connections.ConnectionNames) profileStore.AppendValues (s); } void LoadPreference (String key) { object val = Preferences.Get (key); if (val == null) return; switch (key) { case Preferences.BROWSER_SELECTION: int b = (int) val; if (b == 1) browserSingleClickButton.Active = true; else if (b == 2) browserDoubleClickButton.Active = true; break; } } string GetSelectedProfileName () { TreeIter iter; TreeModel model; if (profilesTreeView.Selection.GetSelected (out model, out iter)) { string name = (string) model.GetValue (iter, 0); return name; } return null; } public void OnAddProfileClicked (object o, EventArgs args) { new ProfileDialog (); UpdateProfileList (); } public void OnEditProfileClicked (object o, EventArgs args) { string profileName = GetSelectedProfileName (); if (profileName == null) return; Connection conn = Global.Connections [profileName]; new ProfileDialog (conn); UpdateProfileList (); } public void OnDeleteProfileClicked (object o, EventArgs args) { string profileName = GetSelectedProfileName (); string msg = null; if (profileName == null) { // show dialog; must select entry to edit return; } msg = String.Format ("{0} {1}", Mono.Unix.Catalog.GetString ( "Are you sure you want to delete the profile:"), profileName); if (Util.AskYesNo (preferencesDialog, msg)) { Global.Connections.Delete (profileName); Global.Connections.Save (); UpdateProfileList (); } } public void OnDoubleClickToggled (object o, EventArgs args) { if (browserSingleClickButton.Active) Preferences.Set (Preferences.BROWSER_SELECTION, 1); else Preferences.Set (Preferences.BROWSER_SELECTION, 2); } public void OnHelpClicked (object o, EventArgs args) { try { gettingHelp = true; Gnome.Help.DisplayDesktopOnScreen (program, Defines.PACKAGE, "lat.xml", "lat-preferences", Gdk.Screen.Default); } catch (Exception e) { HIGMessageDialog dialog = new HIGMessageDialog ( null, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, "Help error", e.Message); dialog.Run (); dialog.Destroy (); } } } public class PluginConfigureDialog { Glade.XML ui; [Glade.Widget] Gtk.Dialog pluginConfigureDialog; [Glade.Widget] Gtk.Entry filterEntry; [Glade.Widget] Gtk.Button newContainerButton; [Glade.Widget] Gtk.Button searchBaseButton; [Glade.Widget] TreeView columnsTreeView; ListStore columnStore; Connection conn; ViewPlugin vp; List colNames; List colAttrs; public PluginConfigureDialog (Connection connection, string pluginName) { conn = connection; colNames = new List (); colAttrs = new List (); ui = new Glade.XML (null, "lat.glade", "pluginConfigureDialog", null); ui.Autoconnect (this); columnStore = new ListStore (typeof (string), typeof (string)); CellRendererText cell = new CellRendererText (); cell.Editable = true; cell.Edited += new EditedHandler (OnNameEdit); columnsTreeView.AppendColumn ("Name", cell, "text", 0); cell = new CellRendererText (); cell.Editable = true; cell.Edited += new EditedHandler (OnAttributeEdit); columnsTreeView.AppendColumn ("Attribute", cell, "text", 1); columnsTreeView.Model = columnStore; vp = Global.Plugins.GetViewPlugin (pluginName, connection.Settings.Name); if (vp != null) { for (int i = 0; i < vp.ColumnNames.Length; i++) { columnStore.AppendValues (vp.ColumnNames[i], vp.ColumnAttributes[i]); colNames.Add (vp.ColumnNames[i]); colAttrs.Add (vp.ColumnAttributes[i]); } filterEntry.Text = vp.Filter; if (vp.DefaultNewContainer != "") newContainerButton.Label = vp.DefaultNewContainer; if (vp.SearchBase != "") searchBaseButton.Label = vp.SearchBase; } else { Log.Error ("Unable to find view plugin {0}", pluginName); } pluginConfigureDialog.Icon = Global.latIcon; pluginConfigureDialog.Resize (300, 400); pluginConfigureDialog.Run (); pluginConfigureDialog.Destroy (); } void OnAttributeEdit (object o, EditedArgs args) { TreeIter iter; if (!columnStore.GetIterFromString (out iter, args.Path)) return; string oldAttr = (string) columnStore.GetValue (iter, 1); colAttrs.Remove (oldAttr); colAttrs.Add (args.NewText); columnStore.SetValue (iter, 1, args.NewText); } void OnNameEdit (object o, EditedArgs args) { TreeIter iter; if (!columnStore.GetIterFromString (out iter, args.Path)) return; string oldName = (string) columnStore.GetValue (iter, 0); colNames.Remove (oldName); colNames.Add (args.NewText); columnStore.SetValue (iter, 0, args.NewText); } public void OnOkClicked (object o, EventArgs args) { ViewPluginConfig vpc = new ViewPluginConfig (); vpc.ColumnAttributes = colAttrs.ToArray (); vpc.ColumnNames = colNames.ToArray (); vpc.PluginName = vp.Name; vpc.Filter = filterEntry.Text; if (newContainerButton.Label != "") vpc.DefaultNewContainer = newContainerButton.Label; if (searchBaseButton.Label != "") vpc.SearchBase = searchBaseButton.Label; if (vp.PluginConfiguration.Defaults == null) vpc.Defaults = new Dictionary (); else vpc.Defaults = vp.PluginConfiguration.Defaults; vp.PluginConfiguration = vpc; Global.Plugins.SetPluginConfiguration (conn.Settings.Name, vpc); } public void OnAddClicked (object o, EventArgs args) { columnStore.AppendValues ("Untitiled", "Unknown"); } public void OnRemoveClicked (object o, EventArgs args) { TreeModel model; TreeIter iter; if (columnsTreeView.Selection.GetSelected (out model, out iter)) { string name = (string) columnStore.GetValue (iter, 0); string attr = (string) columnStore.GetValue (iter, 1); colNames.Remove (name); colAttrs.Remove (attr); columnStore.Remove (ref iter); } } public void OnFilterBuildClicked (object o, EventArgs args) { SearchBuilderDialog sbd = new SearchBuilderDialog (); filterEntry.Text = sbd.UserFilter; } public void OnNewContainerClicked (object o, EventArgs args) { SelectContainerDialog scd = new SelectContainerDialog (conn, null); scd.Message = String.Format (Mono.Unix.Catalog.GetString ("Select a container for new objects")); scd.Title = Mono.Unix.Catalog.GetString ("Select container"); scd.Run (); if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host)) newContainerButton.Label = scd.DN; } public void OnSearchBaseClicked (object o, EventArgs args) { SelectContainerDialog scd = new SelectContainerDialog (conn, null); scd.Message = String.Format (Mono.Unix.Catalog.GetString ("Select a search base")); scd.Title = Mono.Unix.Catalog.GetString ("Select container"); scd.Run (); if (!scd.DN.Equals ("") && !scd.DN.Equals (conn.Settings.Host)) searchBaseButton.Label = scd.DN; } public void OnSetDefaultValuesClicked (object o, EventArgs args) { vp.OnSetDefaultValues (conn); Log.Debug ("OnSetDefaultValuesClicked vp.PluginConfiguration.Defaults.Count: {0}", vp.PluginConfiguration.Defaults.Count); } } } lat-1.2.4/lat/ServerData.cs0000644000175000001440000004145211702646352012376 00000000000000// // lat - ServerData.cs // Author: Loren Bandiera // Copyright 2005-2006 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using Novell.Directory.Ldap; using Novell.Directory.Ldap.Utilclass; namespace lat { public class ServerData { LdapServer server; public ServerData (LdapServer server) { this.server = server; } public void Add (LdapEntry entry) { server.Add (entry); } /// Adds an entry to the directory /// /// /// The distinguished name of the new entry. /// An arraylist of string attributes for the /// new ldap entry. public void Add (string dn, List attributes) { Log.Debug ("START Connection.Add ()"); Log.Debug ("dn: {0}", dn); LdapAttributeSet attributeSet = new LdapAttributeSet(); foreach (LdapAttribute attr in attributes) { foreach (string v in attr.StringValueArray) Log.Debug ("{0}:{1}", attr.Name, v); attributeSet.Add (attr); } LdapEntry newEntry = new LdapEntry( dn, attributeSet ); Add (newEntry); Log.Debug ("END Connection.Add ()"); } /// Copy a directory entry /// /// Distinguished name of the entry to copy /// New name for entry /// Parent name public void Copy (string oldDN, string newRDN, string parentDN) { server.Copy (oldDN, newRDN, parentDN); } /// Deletes a directory entry /// /// Distinguished name of the entry to delete public void Delete (string dn) { server.Delete (dn); } /// Gets a list of all attributes for the given object class /// /// Name of object class public string[] GetAllAttributes (string objClass) { try { LdapSchema schema = server.GetSchema (); LdapObjectClassSchema ocs = schema.getObjectClassSchema ( objClass ); List attrs = new List (); if (ocs.RequiredAttributes != null) { foreach (string r in ocs.RequiredAttributes) if (!attrs.Contains (r)) attrs.Add (r); } if (ocs.OptionalAttributes != null) { foreach (string o in ocs.OptionalAttributes) if (!attrs.Contains (o)) attrs.Add (o); } attrs.Sort (); return attrs.ToArray (); } catch (Exception e) { Log.Debug (e); return null; } } /// Gets a list of required and optional attributes for /// the given object classes. /// /// List of object classes /// Required attributes /// Optional attributes public void GetAllAttributes (List objClass, out string[] required, out string[] optional) { try { LdapSchema schema = server.GetSchema (); LdapObjectClassSchema ocs; List r_attrs = new List (); List o_attrs = new List (); foreach (string c in objClass) { ocs = schema.getObjectClassSchema ( c ); if (ocs.RequiredAttributes != null) { foreach (string r in ocs.RequiredAttributes) if (!r_attrs.Contains (r)) r_attrs.Add (r); } if (ocs.OptionalAttributes != null) { foreach (string o in ocs.OptionalAttributes) if (!o_attrs.Contains (o)) o_attrs.Add (o); } } required = r_attrs.ToArray (); optional = o_attrs.ToArray (); } catch (Exception e) { required = null; optional = null; Log.Debug (e); } } /// Gets a list of attribute types supported on the /// directory. /// /// An array of LdapEntry objects public string[] GetAttributeTypes () { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, server.DefaultSearchFilter, new string[] { "attributetypes" }); if (entries == null) return null; List tmp = new List (); LdapAttribute la = entries[0].getAttribute ("attributetypes"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); tmp.Add (sp.Names[0]); } tmp.Sort (); return tmp.ToArray (); } /// Gets the schema for a given attribute type /// /// Attribute type /// A SchemaParser object public SchemaParser GetAttributeTypeSchema (string attrType) { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, server.DefaultSearchFilter, new string[] { "attributetypes" }); if (entries == null) return null; foreach (LdapEntry entry in entries) { LdapAttribute la = entry.getAttribute ("attributetypes"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); foreach (string a in sp.Names) if (attrType.Equals (a)) return sp; } } return null; } /// Gets the value of an attribute for the given /// entry. /// /// LdapEntry /// Attribute to lookup type /// The value of the attribute (or an empty string if there is /// no value). public string GetAttributeValueFromEntry (LdapEntry le, string attr) { LdapAttribute la = le.getAttribute (attr); if (la != null) return la.StringValue; return ""; } /// Gets the value of the given attribute for the given /// entry. /// /// LdapEntry /// List of attributes to lookup /// A list of attribute values public string[] GetAttributeValuesFromEntry (LdapEntry le, string[] attrs) { if (le == null || attrs == null) throw new ArgumentNullException (); List retVal = new List (); foreach (string n in attrs) { LdapAttribute la = le.getAttribute (n); if (la != null) retVal.Add (la.StringValue); else retVal.Add (""); } return retVal.ToArray (); } /// Gets an entry in the directory. /// /// The distinguished name of the entry public LdapEntry GetEntry (string dn) { LdapEntry[] entry = server.Search (dn, LdapConnection.SCOPE_BASE, "objectclass=*", null); if (entry.Length > 0) return entry[0]; return null; } /// Gets the children of a given entry. /// /// Distiguished name of entry /// A list of children (if any) public LdapEntry[] GetEntryChildren (string entryDN) { return server.Search (entryDN, LdapConnection.SCOPE_ONE, "objectclass=*", null); } /// Gets the schema information for a given ldap syntax /// /// LDAP syntax /// schema information public SchemaParser GetLdapSyntax (string synName) { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, "", new string[] { "ldapSyntaxes" }); if (entries == null) return null; LdapAttribute la = entries[0].getAttribute ("ldapSyntaxes"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); if (synName.Equals (sp.Description)) return sp; } return null; } /// Gets the servers LDAP syntaxes (if available). /// /// matching rules public string[] GetLdapSyntaxes () { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, "", new string[] { "ldapSyntaxes" }); if (entries == null) return null; List tmp = new List (); LdapAttribute la = entries[0].getAttribute ("ldapSyntaxes"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); tmp.Add (sp.Description); } tmp.Sort (); return tmp.ToArray (); } /// Gets the local Samba SID (if available). /// /// sambaSID public string GetLocalSID () { LdapEntry[] sid = server.Search (server.DirectoryRoot, LdapConnection.SCOPE_SUB, "objectclass=sambaDomain", null); if (sid.Length > 0) { LdapAttribute a = sid[0].getAttribute ("sambaSID"); return a.StringValue; } return null; } /// Gets the schema information for a given matching rule /// /// Matching rule /// schema information public SchemaParser GetMatchingRule (string matName) { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, "", new string[] { "matchingRules" }); if (entries == null) return null; LdapAttribute la = entries[0].getAttribute ("matchingRules"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); foreach (string a in sp.Names) if (matName.Equals (a)) return sp; } return null; } /// Gets the servers matching rules (if available). /// /// matching rules public string[] GetMatchingRules () { LdapEntry[] entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, "", new string[] { "matchingRules" }); if (entries == null) return null; List tmp = new List (); LdapAttribute la = entries[0].getAttribute ("matchingRules"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); tmp.Add (sp.Names[0]); } tmp.Sort (); return tmp.ToArray (); } /// Gets the next available gidNumber /// /// The next group number public int GetNextGID () { List gids = new List (); LdapEntry[] groups = server.Search (server.DirectoryRoot, LdapConnection.SCOPE_SUB, "gidNumber=*", null); foreach (LdapEntry entry in groups) { LdapAttribute a = entry.getAttribute ("gidNumber"); gids.Add (int.Parse(a.StringValue)); } gids.Sort (); if (gids.Count == 0) return 1000; else return (gids [gids.Count - 1]) + 1; } /// Gets the next available uidNumber /// /// The next user number public int GetNextUID () { List uids = new List (); LdapEntry[] users = server.Search (server.DirectoryRoot, LdapConnection.SCOPE_SUB, "uidNumber=*", null); foreach (LdapEntry entry in users) { LdapAttribute a = entry.getAttribute ("uidNumber"); uids.Add (int.Parse(a.StringValue)); } uids.Sort (); if (uids.Count == 0) return 1000; else return (uids [uids.Count - 1]) + 1; } /// Gets the schema of a given object class. /// /// Name of object class /// A SchemaParser object public SchemaParser GetObjectClassSchema (string objClass) { LdapEntry[] entries; entries = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, server.DefaultSearchFilter, new string[] { "objectclasses" }); foreach (LdapEntry entry in entries) { LdapAttribute la = entry.getAttribute ("objectclasses"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); foreach (string a in sp.Names) if (objClass.Equals (a)) return sp; } } return null; } /// Gets a list of requried attributes for a given object class. /// /// Name of object class /// An array of required attribute names public string[] GetRequiredAttrs (string objClass) { if (objClass == null) return null; LdapSchema schema = server.GetSchema (); LdapObjectClassSchema ocs = schema.getObjectClassSchema ( objClass ); if (ocs != null) return ocs.RequiredAttributes; return null; } /// Gets a list of requried attributes for a list of given /// object classes. /// /// Array of objectclass names /// An array of required attribute names public string[] GetRequiredAttrs (string[] objClasses) { if (objClasses == null) return null; List retVal = new List (); LdapSchema schema = server.GetSchema (); foreach (string oc in objClasses) { LdapObjectClassSchema ocs = schema.getObjectClassSchema ( oc ); foreach (string c in ocs.RequiredAttributes) if (!retVal.Contains (c)) retVal.Add (c); } return retVal.ToArray (); } /// Modifies the specified entry /// /// Distinguished name of entry to modify /// Array of LdapModification objects public void Modify (string dn, LdapModification[] mods) { server.Modify (dn, mods); } /// Moves the specified entry /// /// Distinguished name of entry to move /// New name of entry /// Name of parent entry public void Move (string oldDN, string newRDN, string parentDN) { server.Move (oldDN, newRDN, parentDN); } /// Renames the specified entry /// /// Distinguished name of entry to rename /// New to rename entry to /// Save old entry public void Rename (string oldDN, string newDN, bool saveOld) { server.Rename (oldDN, newDN, saveOld); } /// Searches the directory /// /// filter to search for /// List of entries matching filter public LdapEntry[] Search (string searchFilter) { return server.Search (server.DirectoryRoot, LdapConnection.SCOPE_SUB, searchFilter, null); } /// Searches the directory /// /// Where to start the search /// Filter to search for /// List of entries matching filter public LdapEntry[] Search (string searchBase, string searchFilter) { return server.Search (searchBase, LdapConnection.SCOPE_SUB, searchFilter, null); } /// Searches the directory /// /// Where to start the search /// Scope of search /// Filter to search for /// Attributes to search for /// List of entries matching filter public LdapEntry[] Search (string searchBase, int searchScope, string searchFilter, string[] searchAttrs) { return server.Search (searchBase, searchScope, searchFilter, searchAttrs); } /// Searches the directory for all entries of a given object /// class. /// /// Name of objectclass /// List of entries matching objectclass public LdapEntry[] SearchByClass (string objectClass) { return Search (server.DirectoryRoot, String.Format ("objectclass={0}", objectClass)); } public string[] ObjectClasses { get { LdapEntry[] le = server.Search ( server.GetSchemaDN (), LdapConnection.SCOPE_BASE, server.DefaultSearchFilter, new string[] { "objectclasses" }); if (le == null) return null; List tmp = new List (); LdapAttribute la = le[0].getAttribute ("objectclasses"); foreach (string s in la.StringValueArray) { SchemaParser sp = new SchemaParser (s); tmp.Add (sp.Names[0]); } tmp.Sort (); return tmp.ToArray (); } } } }lat-1.2.4/lat/Templates.cs0000644000175000001440000000765311704523422012273 00000000000000// // lat - Templates.cs // Author: Loren Bandiera // Copyright 2005 MMG Security, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; Version 2 // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // using System; using System.Collections.Generic; using System.IO; using System.Xml; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; namespace lat { [Serializable] public class Template { string _name; List _objClasses; Dictionary _attributes; public Template (string name) { _name = name; _objClasses = new List (); _attributes = new Dictionary (); } public void AddClass (List classes) { _objClasses.Clear (); _objClasses = classes; } public void AddClass (string name) { _objClasses.Add (name); } public void ClearAttributes () { _attributes.Clear (); } public void AddAttribute (string attrName, string attrValue) { _attributes.Add (attrName, attrValue); } public string GetAttributeDefaultValue (string attrName) { string result; _attributes.TryGetValue(attrName, out result); return result; } public string Name { get { return _name; } set { _name = value; } } public string[] Classes { get { return _objClasses.ToArray (); } } } public class TemplateManager { string _configFile; List