Import ncpfs 2.2.1

This commit is contained in:
ncpfs archive import
2026-04-28 20:39:59 +02:00
parent 0979ae6a41
commit 82706139bf
547 changed files with 176953 additions and 12604 deletions

View File

@@ -0,0 +1,6 @@
LTLIBRARY_SHARED_NAME = php_auth_nds.la
LTLIBRARY_SOURCES = php_auth_nds.c
LTLIBRARY_LDFLAGS = -L../../lib -lncp
EXTRA_INCLUDES = -I../../include -DNCPFS_VERSION=\"@VERSION@\"
include $(top_srcdir)/build/dynlib.mk

1279
contrib/php/acinclude.m4 Normal file

File diff suppressed because it is too large Load Diff

4927
contrib/php/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: dynlib.mk,v 1.4 2002/02/28 08:25:30 sebastian Exp $
#
all: all-recursive
include $(builddir)/libs.mk
include $(top_srcdir)/build/rules.mk

80
contrib/php/build/fastgen.sh Executable file
View File

@@ -0,0 +1,80 @@
#! /bin/sh
#
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: fastgen.sh,v 1.14 2002/02/28 08:25:33 sebastian Exp $
#
if test "$#" = "0"; then
echo "Usage: fastgen.sh <srcdir> <mkdir_p> <bsdmakefile_p> <file>"
fi
srcdir=$1
shift
mkdir_p=$1
shift
bsd_makefile=$1
shift
top_srcdir=`(cd $srcdir; pwd)`
top_builddir=`pwd`
if test "$mkdir_p" = "yes"; then
mkdir_p="mkdir -p"
else
mkdir_p="$top_srcdir/build/shtool mkdir -p"
fi
if test "$bsd_makefile" = "yes"; then
(cd $top_srcdir; ./build/bsd_makefile)
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile
top_srcdir = $top_srcdir
top_builddir = $top_builddir
srcdir = $top_srcdir/$dir
builddir = $top_builddir/$dir
VPATH = $top_srcdir/$dir
EOF
test -z "$dir" && dir=.
touch $dir/.deps
done
else
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
cat - $top_srcdir/$makefile.in <<EOF >$makefile
top_srcdir = $top_srcdir
top_builddir = $top_builddir
srcdir = $top_srcdir/$dir
builddir = $top_builddir/$dir
VPATH = $top_srcdir/$dir
EOF
test -z "$dir" && dir=.
touch $dir/.deps
done
fi

View File

@@ -0,0 +1,23 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: library.mk,v 1.12 2002/02/28 08:25:33 sebastian Exp $
#
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)

View File

@@ -0,0 +1,24 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: ltlib.mk,v 1.7 2002/02/28 08:25:34 sebastian Exp $
#
targets = $(LTLIBRARY_NAME)
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk

View File

@@ -0,0 +1,75 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: mkdep.awk,v 1.5 2002/02/28 08:25:35 sebastian Exp $
#
# Usage:
#
# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \
# awk -f mkdep.awk > dependencies
{
top_srcdir=$1
top_builddir=$2
srcdir=$3
cmd=$4
for (i = 5; i <= NF; i++) {
if (match($i, "^-[A-Z]") == 0)
break;
cmd=cmd " " $i
}
dif=i-1
for (; i <= NF; i++)
filenames[i-dif]=$i
no_files=NF-dif
for(i = 1; i <= no_files; i++) {
if (system("test -r " filenames[i]) != 0)
continue
target=filenames[i]
sub(srcdir "/", "", target)
target2=target
sub("\.(c|cpp)$", ".lo", target);
sub("\.(c|cpp)$", ".slo", target2);
for (e in used)
delete used[e]
cmdx=cmd " " filenames[i]
done=0
while ((cmdx | getline) > 0) {
if (match($0, "^# [0-9]* \".*\.h\"") != 0) {
if (sub(top_srcdir, "$(top_srcdir)", $3) == 0)
sub(top_builddir, "$(top_builddir)", $3)
if (substr($3,2,1) != "/" && used[$3] != 1) {
if (done == 0)
printf(target " " target2 ":")
done=1
printf(" \\\n\t" substr($3,2,length($3)-2))
used[$3] = 1;
}
}
}
if (done == 1)
print "\n"
}
}

View File

@@ -0,0 +1,23 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: program.mk,v 1.6 2002/02/28 08:25:35 sebastian Exp $
#
PROGRAM_OBJECTS = $(PROGRAM_SOURCES:.c=.lo)
$(PROGRAM_NAME): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
$(LINK_CLEAN) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD)

View File

@@ -0,0 +1,77 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: rules_pear.mk,v 1.16 2002/02/28 08:25:37 sebastian Exp $
#
include $(top_srcdir)/build/rules_common.mk
install_targets = install-modules
all: all-recursive
install: install-recursive
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
@otarget=`echo $@|sed s/-recursive//`; \
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
cvsclean:
@for i in `find . -name .cvsignore`; do \
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \
done
@rm -f $(SUBDIRS) 2>/dev/null || true
install-modules:
if [ -d modules ]; then \
$(mkinstalldirs) $(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(moduledir); \
fi
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
distclean-recursive distclean clean-x all-p install-p distclean-p \
depend-p clean-p

View File

@@ -0,0 +1,77 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: rules_common.mk,v 1.11 2002/02/28 08:25:36 sebastian Exp $
#
include $(top_builddir)/config_vars.mk
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) -prefer-pic $(EXTRA_CFLAGS) -c $< && touch $@
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) -prefer-pic $(EXTRA_CXXFLAGS) -c $< && touch $@
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
LINK_CLEAN = $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
DEFS = -I. -I$(srcdir) -I$(top_builddir)/main -I$(top_srcdir)
moduledir = $(EXTENSION_DIR)
CXX_SUFFIX = .cpp
.SUFFIXES:
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
.c.o:
$(COMPILE) -c $<
$(CXX_SUFFIX).o:
$(CXX_COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.c.lo:
$(PHP_COMPILE)
$(CXX_SUFFIX).lo:
$(CXX_PHP_COMPILE)
.s.lo:
$(PHP_COMPILE)
.c.slo:
$(SHARED_COMPILE)
$(CXX_SUFFIX).slo:
$(CXX_SHARED_COMPILE)
.y.c:
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
if test -f y.tab.h; then \
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
else :; fi
.l.c:
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@

716
contrib/php/build/shtool Executable file
View File

@@ -0,0 +1,716 @@
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
## Version 1.4.9 (16-Apr-2000)
## Ingredients: 3/17 available modules
##
##
## 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, or contact Ralf S. Engelschall <rse@engelschall.com>.
##
## Notice: Given that you include this file verbatim into your own
## source tree, you are justified in saying that it remains separate
## from your package, and that this way you are simply just using GNU
## shtool. So, in this situation, there is no requirement that your
## package itself is licensed under the GNU General Public License in
## order to take advantage of GNU shtool.
##
##
## Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]
##
## Available commands:
## echo Print string with optional construct expansion
## install Install a program, script or datafile
## mkdir Make one or more directories
##
## Not available commands (because module was not built-in):
## mdate Pretty-print modification time of a file or dir
## table Pretty-print a field-separated list as a table
## prop Display progress with a running propeller
## move Move files with simultaneous substitution
## mkln Make link with calculation of relative paths
## mkshadow Make a shadow tree through symbolic links
## fixperm Fix file permissions inside a source tree
## tarball Roll distribution tarballs
## guessos Simple operating system guesser
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
## version Generate and maintain a version information file
## path Deal with program paths
##
if [ $# -eq 0 ]; then
echo "$0:Error: invalid command line" 1>&2
echo "$0:Hint: run \`$0 -h' for usage" 1>&2
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
echo ''
echo 'Available global <options>:'
echo ' -v, --version display shtool version information'
echo ' -h, --help display shtool usage help page (this one)'
echo ' -d, --debug display shell trace information'
echo ''
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
echo ' echo [-n] [-e] [<str> ...]'
echo ' install [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]'
echo ' [-e<ext>] <file> <path>'
echo ' mkdir [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]'
echo ''
echo 'Not available <cmd-name> (because module was not built-in):'
echo ' mdate [-n] [-z] [-s] [-d] [-f<str>] [-o<spec>] <path>'
echo ' table [-F<sep>] [-w<width>] [-c<cols>] [-s<strip>] <str><sep><str>...'
echo ' prop [-p<str>]'
echo ' move [-v] [-t] [-e] [-p] <src-file> <dst-file>'
echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
echo ' fixperm [-v] [-t] <path> [<path> ...]'
echo ' tarball [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u'
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
echo ' guessos '
echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]'
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
echo ' [-d<type>] <file>'
echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
echo ''
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
echo "GNU shtool 1.4.9 (16-Apr-2000)"
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
shift
set -x
fi
name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
case "$name" in
echo|install|mkdir )
# implicit tool command selection
tool="$name"
;;
* )
# explicit tool command selection
tool="$1"
shift
;;
esac
arg_spec=""
opt_spec=""
gen_tmpfile=no
##
## DISPATCH INTO SCRIPT PROLOG
##
case $tool in
echo )
str_tool="echo"
str_usage="[-n] [-e] [<str> ...]"
arg_spec="0+"
opt_spec="n.e."
opt_n=no
opt_e=no
;;
install )
str_tool="install"
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
arg_spec="2="
opt_spec="v.t.c.C.s.m:o:g:e:"
opt_v=no
opt_t=no
opt_c=no
opt_C=no
opt_s=no
opt_m=""
opt_o=""
opt_g=""
opt_e=""
;;
mkdir )
str_tool="mkdir"
str_usage="[-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]"
arg_spec="1+"
opt_spec="t.f.p.m:"
opt_t=no
opt_f=no
opt_p=no
opt_m=""
;;
-* )
echo "$0:Error: unknown option \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
exit 1
;;
* )
echo "$0:Error: unknown command \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
exit 1
;;
esac
##
## COMMON UTILITY CODE
##
# determine name of tool
if [ ".$tool" != . ]; then
# used inside shtool script
toolcmd="$0 $tool"
toolcmdhelp="shtool $tool"
msgprefix="shtool:$tool"
else
# used as standalone script
toolcmd="$0"
toolcmdhelp="sh $0"
msgprefix="$str_tool"
fi
# parse argument specification string
eval `echo $arg_spec |\
sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
# parse option specification string
eval `echo h.$opt_spec |\
sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
# interate over argument line
opt_PREV=''
while [ $# -gt 0 ]; do
# special option stops processing
if [ ".$1" = ".--" ]; then
shift
break
fi
# determine option and argument
opt_ARG_OK=no
if [ ".$opt_PREV" != . ]; then
# merge previous seen option with argument
opt_OPT="$opt_PREV"
opt_ARG="$1"
opt_ARG_OK=yes
opt_PREV=''
else
# split argument into option and argument
case "$1" in
-[a-zA-Z0-9]*)
eval `echo "x$1" |\
sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
;;
-[a-zA-Z0-9])
opt_OPT=`echo "x$1" | cut -c3-`
opt_ARG=''
;;
*)
break
;;
esac
fi
# eat up option
shift
# determine whether option needs an argument
eval "opt_MODE=\$opt_MODE_${opt_OPT}"
if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then
if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then
opt_PREV="$opt_OPT"
continue
fi
fi
# process option
case $opt_MODE in
'.' )
# boolean option
eval "opt_${opt_OPT}=yes"
;;
':' )
# option with argument (multiple occurances override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
'+' )
# option with argument (multiple occurances append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\""
;;
* )
echo "$msgprefix:Error: unknown option: \`-$opt_OPT'" 1>&2
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
exit 1
;;
esac
done
if [ ".$opt_PREV" != . ]; then
echo "$msgprefix:Error: missing argument to option \`-$opt_PREV'" 1>&2
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
exit 1
fi
# process help option
if [ ".$opt_h" = .yes ]; then
echo "Usage: $toolcmdhelp $str_usage"
exit 0
fi
# complain about incorrect number of arguments
case $arg_MODE in
'=' )
if [ $# -ne $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
'+' )
if [ $# -lt $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
esac
# establish a temporary file on request
if [ ".$gen_tmpfile" = .yes ]; then
if [ ".$TMPDIR" != . ]; then
tmpdir="$TMPDIR"
elif [ ".$TEMPDIR" != . ]; then
tmpdir="$TEMPDIR"
else
tmpdir="/tmp"
fi
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
fi
##
## DISPATCH INTO SCRIPT BODY
##
case $tool in
echo )
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
##
text="$*"
# check for broken escape sequence expansion
seo=''
bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" != .3 ]; then
bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" = .3 ]; then
seo='-E'
fi
fi
# check for existing -n option (to suppress newline)
minusn=''
bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" = .3 ]; then
minusn='-n'
fi
# determine terminal bold sequence
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
case $TERM in
# for the most important terminal types we directly know the sequences
xterm|xterm*|vt220|vt220*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
;;
vt100|vt100*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
;;
# for all others, we try to use a possibly existing `tput' or `tcout' utility
* )
paths=`echo $PATH | sed -e 's/:/ /g'`
for tool in tput tcout; do
for dir in $paths; do
if [ -r "$dir/$tool" ]; then
for seq in bold md smso; do # 'smso' is last
bold="`$dir/$tool $seq 2>/dev/null`"
if [ ".$bold" != . ]; then
term_bold="$bold"
break
fi
done
if [ ".$term_bold" != . ]; then
for seq in sgr0 me rmso reset; do # 'reset' is last
norm="`$dir/$tool $seq 2>/dev/null`"
if [ ".$norm" != . ]; then
term_norm="$norm"
break
fi
done
fi
break
fi
done
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
break;
fi
done
;;
esac
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
fi
fi
# determine user name
username=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then
username="$LOGNAME"
if [ ".$username" = . ]; then
username="$USER"
if [ ".$username" = . ]; then
username="`(whoami) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username="`(who am i) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username='unknown'
fi
fi
fi
fi
fi
# determine user id
userid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
userid="`(id -u) 2>/dev/null`"
if [ ".$userid" = . ]; then
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'`
fi
if [ ".$userid" = . ]; then
userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid=`(ypcat passwd) 2>/dev/null |
egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid='?'
fi
fi
fi
fi
fi
# determine host name
hostname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
hostname="`(uname -n) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$hostname" = . ]; then
hostname="`(hostname) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$hostname" = . ]; then
hostname='unknown'
fi
fi
case $hostname in
*.* )
domainname=".`echo $hostname | cut -d. -f2-`"
hostname="`echo $hostname | cut -d. -f1`"
;;
esac
fi
# determine domain name
domainname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
if [ ".$domainname" = . ]; then
if [ -f /etc/resolv.conf ]; then
domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\
sed -e 's/.*domain//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/^\.//' -e 's/^/./' |\
awk '{ printf("%s", $1); }'`"
if [ ".$domainname" = . ]; then
domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\
sed -e 's/.*search//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/ .*//' -e 's/ .*//' \
-e 's/^\.//' -e 's/^/./' |\
awk '{ printf("%s", $1); }'`"
fi
fi
fi
fi
# determine current time
time_day=''
time_month=''
time_year=''
time_monthname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
time_day=`date '+%d'`
time_month=`date '+%m'`
time_year=`date '+%Y' 2>/dev/null`
if [ ".$time_year" = . ]; then
time_year=`date '+%y'`
case $time_year in
[5-9][0-9]) time_year="19$time_year" ;;
[0-4][0-9]) time_year="20$time_year" ;;
esac
fi
case $time_month in
1|01) time_monthname='Jan' ;;
2|02) time_monthname='Feb' ;;
3|03) time_monthname='Mar' ;;
4|04) time_monthname='Apr' ;;
5|05) time_monthname='May' ;;
6|06) time_monthname='Jun' ;;
7|07) time_monthname='Jul' ;;
8|08) time_monthname='Aug' ;;
9|09) time_monthname='Sep' ;;
10) time_monthname='Oct' ;;
11) time_monthname='Nov' ;;
12) time_monthname='Dec' ;;
esac
fi
# expand special ``%x'' constructs
if [ ".$opt_e" = .yes ]; then
text=`echo $seo "$text" |\
sed -e "s/%B/${term_bold}/g" \
-e "s/%b/${term_norm}/g" \
-e "s/%u/${username}/g" \
-e "s/%U/${userid}/g" \
-e "s/%h/${hostname}/g" \
-e "s/%d/${domainname}/g" \
-e "s/%D/${time_day}/g" \
-e "s/%M/${time_month}/g" \
-e "s/%Y/${time_year}/g" \
-e "s/%m/${time_monthname}/g" 2>/dev/null`
fi
# create output
if [ .$opt_n = .no ]; then
echo $seo "$text"
else
# the harder part: echo -n is best, because
# awk may complain about some \xx sequences.
if [ ".$minusn" != . ]; then
echo $seo $minusn "$text"
else
echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
fi
fi
;;
install )
##
## install -- Install a program, script or datafile
## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
src="$1"
dst="$2"
# If destination is a directory, append the input filename
if [ -d $dst ]; then
dst=`echo "$dst" | sed -e 's:/$::'`
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
dst="$dst/$dstfile"
fi
# Add a possible extension to src and dst
if [ ".$opt_e" != . ]; then
src="$src$opt_e"
dst="$dst$opt_e"
fi
# Check for correct arguments
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Error: source and destination are the same" 1>&2
exit 1
fi
# Make a temp file name in the destination directory
dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
dsttmp="$dstdir/#INST@$$#"
# Verbosity
if [ ".$opt_v" = .yes ]; then
echo "$src -> $dst" 1>&2
fi
# Copy or move the file name to the temp name
# (because we might be not allowed to change the source)
if [ ".$opt_C" = .yes ]; then
opt_c=yes
fi
if [ ".$opt_c" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "cp $src $dsttmp" 1>&2
fi
cp $src $dsttmp || exit $?
else
if [ ".$opt_t" = .yes ]; then
echo "mv $src $dsttmp" 1>&2
fi
mv $src $dsttmp || exit $?
fi
# Adjust the target file
# (we do chmod last to preserve setuid bits)
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "strip $dsttmp" 1>&2
fi
strip $dsttmp || exit $?
fi
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $dsttmp" 1>&2
fi
chown $opt_o $dsttmp || exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g $dsttmp" 1>&2
fi
chgrp $opt_g $dsttmp || exit $?
fi
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $dsttmp" 1>&2
fi
chmod $opt_m $dsttmp || exit $?
fi
# Determine whether to do a quick install
# (has to be done _after_ the strip was already done)
quick=no
if [ ".$opt_C" = .yes ]; then
if [ -r $dst ]; then
if cmp -s $src $dst; then
quick=yes
fi
fi
fi
# Finally install the file to the real destination
if [ $quick = yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dsttmp" 1>&2
fi
rm -f $dsttmp
else
if [ ".$opt_t" = .yes ]; then
echo "rm -f $dst && mv $dsttmp $dst" 1>&2
fi
rm -f $dst && mv $dsttmp $dst
fi
;;
mkdir )
##
## mkdir -- Make one or more directories
## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
##
errstatus=0
for p in ${1+"$@"}; do
# if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
else
continue
fi
fi
# if the directory has to be created...
if [ ".$opt_p" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $p" 1>&2
fi
mkdir $p || errstatus=$?
else
# the smart situation
set fnord `echo ":$p" |\
sed -e 's/^:\//%/' \
-e 's/^://' \
-e 's/\// /g' \
-e 's/^%/\//'`
shift
pathcomp=''
for d in ${1+"$@"}; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp="./$pathcomp" ;;
esac
if [ ! -d "$pathcomp" ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $pathcomp" 1>&2
fi
mkdir $pathcomp || errstatus=$?
if [ ".$opt_m" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $pathcomp" 1>&2
fi
chmod $opt_m $pathcomp || errstatus=$?
fi
fi
pathcomp="$pathcomp/"
done
fi
done
exit $errstatus
;;
esac
exit 0
##EOF##

1409
contrib/php/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

11
contrib/php/config.h.in Normal file
View File

@@ -0,0 +1,11 @@
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Whether to build auth-nds as dynamic module */
#undef COMPILE_DL_AUTH_NDS

6
contrib/php/config.m4 Normal file
View File

@@ -0,0 +1,6 @@
PHP_ARG_ENABLE(auth-nds,whether to enable NDS authentication,
[ --enable-auth-nds enable NDS authentication])
if test "$PHP_AUTH_NDS" != "no"; then
PHP_EXTENSION(auth-nds, $ext_shared)
fi

1473
contrib/php/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

6033
contrib/php/configure vendored Executable file

File diff suppressed because it is too large Load Diff

90
contrib/php/configure.in Normal file
View File

@@ -0,0 +1,90 @@
AC_INIT(Makefile.in)
AC_DEFUN(PHP_WITH_PHP_CONFIG,[
AC_ARG_WITH(php-config,
[ --with-php-config=PATH],[
PHP_CONFIG=$withval
],[
PHP_CONFIG=php-config
])
prefix=`$PHP_CONFIG --prefix 2>/dev/null`
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
if test -z "$prefix"; then
AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH)
fi
AC_MSG_CHECKING(for PHP prefix)
AC_MSG_RESULT($prefix)
AC_MSG_CHECKING(for PHP includes)
AC_MSG_RESULT($INCLUDES)
AC_MSG_CHECKING(for PHP extension directory)
AC_MSG_RESULT($EXTENSION_DIR)
])
abs_srcdir=`(cd $srcdir && pwd)`
php_always_shared=yes
PHP_CONFIG_NICE(config.nice)
AC_PROG_CC
AC_PROG_CC_C_O
PHP_SHLIB_SUFFIX_NAME
PHP_WITH_PHP_CONFIG
AC_PREFIX_DEFAULT()
sinclude(config.m4)
enable_static=no
enable_shared=yes
AC_PROG_LIBTOOL
SHARED_LIBTOOL='$(LIBTOOL)'
PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
phplibdir="`pwd`/modules"
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
PHP_SUBST(prefix)
PHP_SUBST(exec_prefix)
PHP_SUBST(libdir)
PHP_SUBST(prefix)
PHP_SUBST(phplibdir)
PHP_SUBST(PHP_COMPILE)
PHP_SUBST(CC)
PHP_SUBST(CFLAGS)
PHP_SUBST(CPP)
PHP_SUBST(CPPFLAGS)
PHP_SUBST(CXX)
PHP_SUBST(DEFS)
PHP_SUBST(EXTENSION_DIR)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST(EXTRA_LIBS)
PHP_SUBST(INCLUDES)
PHP_SUBST(LEX)
PHP_SUBST(LEX_OUTPUT_ROOT)
PHP_SUBST(LFLAGS)
PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(LIBTOOL)
PHP_SUBST(SHELL)
PHP_FAST_OUTPUT(Makefile)
PHP_GEN_CONFIG_VARS
PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES)
test -d modules || mkdir modules
touch .deps
AC_CONFIG_HEADER(config.h)
AC_OUTPUT()

88
contrib/php/dynlib.m4 Normal file
View File

@@ -0,0 +1,88 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
# | available at through the world-wide-web at |
# | http://www.php.net/license/2_02.txt. |
# | If you did not receive a copy of the PHP license and are unable to |
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: dynlib.m4,v 1.9 2002/02/28 08:25:27 sebastian Exp $
#
AC_DEFUN(LIB_SHARED_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
EOF
])
AC_DEFUN(LIB_SHARED_MODULE,[
lib_target="\$(LTLIBRARY_SHARED_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
EOF
])
AC_DEFUN(LIB_STATIC_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
EOF
])
dnl LIB_BUILD(path, shared, convenience)
dnl sets up path to build a shared/static convenience/module
AC_DEFUN(LIB_BUILD,[
lib_makefile="$1/libs.mk"
lib_target=""
$php_shtool mkdir -p $1
if test "$BSD_MAKEFILE" = "yes"; then
lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
else
lib_include_conf="include \$(top_builddir)/config_vars.mk"
fi
cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF
if test "$2" = "shared" || test "$2" = "yes"; then
lib_build_shared=yes
if test -n "$3"; then
dnl ---------------------------------------- Shared Convenience
LIB_SHARED_CONVENIENCE($lib_makefile)
else
dnl ---------------------------------------- Shared Module
LIB_SHARED_MODULE($lib_makefile)
fi
else
dnl ---------------------------------------- Static Convenience = Static Module
LIB_STATIC_CONVENIENCE($lib_makefile)
fi
dnl ---------------------------------------- Generate build targets
if test -n "$lib_target"; then
cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
fi
])

0
contrib/php/install-sh Normal file
View File

5396
contrib/php/libtool Executable file

File diff suppressed because it is too large Load Diff

5107
contrib/php/ltmain.sh Normal file

File diff suppressed because it is too large Load Diff

0
contrib/php/missing Normal file
View File

View File

710
contrib/php/php_auth_nds.c Normal file
View File

@@ -0,0 +1,710 @@
/*
php_auth_nds.c - User verification for ncpfs
Copyright (C) 2000, 2001 Petr Vandrovec
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
Revision history:
1.00 2000, September 30 Petr Vandrovec <vandrove@vc.cvut.cz>
Initial revision, used on dialog.cvut.cz.
1.01 2001, January 10 Petr Vandrovec <vandrove@vc.cvut.cz>
Further polishing, used on cdonline.cvut.cz.
1.01 2001, February 19 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license, polished for release, added sample code.
1.02 2001, March 25 Patrick Pollet
Added some NWDSFreeContext in case of errors
Added group parameter (NDS name or bindery)
1.03 2001, March 28 Patrick Pollet
Added NDS reading attribute functions
string read_nds_string (tree, object, attribute)
string read_nds_num (tree, object, attribute)
1.04 2001, October 27 Patrick Pollet
Added nds_tree_auth allowing a tree name and a list of context to be searched
Simplified code by adding internal CreateCtx and CreateCtxAndConn (called by all NDS related functions)
*/
/*
Original example:
Expects uid as username, srv as server name and pwd as password. If server name
is FDNET or ST, it uses NDS username $uid.FADOP resp. $uid.STUDENT.CVUT-FSV. For
other servers it uses simple bindery login... If password verification passes,
$ss_username and $valid_user are set to $srv/$uid - you can use session_register
on one of them.
if ($HTTP_POST_VARS["uid"] == "")
break;
if ($HTTP_POST_VARS["srv"] == "") {
$auth_err = "Wrong URL";
} else if ($HTTP_POST_VARS["pwd"] == "") {
$auth_err = "Invalid password";
} else {
$uu = strtoupper($HTTP_POST_VARS["uid"]);
if ($HTTP_POST_VARS["srv"] == "FDNET") {
$auth_err = auth_nds($HTTP_POST_VARS["srv"], $uu . ".FADOP", strtoupper($HTTP_POST_VARS["pwd"]));
} else if ($HTTP_POST_VARS["srv"] == "ST") {
$auth_err = auth_nds($HTTP_POST_VARS["srv"], $uu . ".STUDENT.CVUT-FSV", strtoupper($HTTP_POST_VARS["pwd"]));
} else {
$auth_err = auth_bindery($HTTP_POST_VARS["srv"], $uu, $HTTP_POST_VARS["pwd"]);
}
if ($auth_err == "") {
$valid_user = $HTTP_POST_VARS["srv"] . "/" . $uu;
$ss_username = $valid_user;
}
}
for more examples see /contrib/php/site
*/
#include "config.h"
#include <php.h>
#include <ext/standard/info.h>
#include <ncp/nwcalls.h>
#include <ncp/nwnet.h>
#include <ncp/nwclient.h>
#include <Zend/zend_modules.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <wchar.h>
#include <string.h>
static int is_member_of_group_bind( char* errstr,NWCONN_HANDLE conn,const char* user,const char* group) {
int err;
err = NWIsObjectInSet(conn, user, NCP_BINDERY_USER, "GROUPS_I'M_IN", group, NCP_BINDERY_UGROUP);
if (!err) {
err= NWIsObjectInSet(conn, group, NCP_BINDERY_UGROUP, "GROUP_MEMBERS", user, NCP_BINDERY_USER);
if (!err)
return 0;
else {
sprintf(errstr, "inconsistent bindery database for user %s and group %s: %s",
user, group, strnwerror(err));
}
} else {
sprintf (errstr,"user %s is not member of %s: %s", user, group, strnwerror(err));
}
return -1;
}
static int is_member_of_group_nds( char* errstr,NWDSContextHandle ctx,NWCONN_HANDLE conn,NWObjectID oid,const char* group) {
int eval = 0;
Buf_T* buf=NULL;
NWDSCCODE dserr;
nbool8 match;
dserr = NWDSAllocBuf(DEFAULT_MESSAGE_LEN, &buf);
if (dserr) {
sprintf(errstr, "NWDSAllocBuf() failed with %s\n", strnwerror(dserr));
eval = 120;
goto bailout;
}
dserr = NWDSInitBuf(ctx, DSV_COMPARE, buf);
if (dserr) {
sprintf(errstr, "NWDSInitBuf() failed with %s\n", strnwerror(dserr));
eval = 121;
goto bailout;
}
dserr = NWDSPutAttrName(ctx, buf, "Group Membership");
if (dserr) {
sprintf(errstr, "NWDSPutAttrName() failed with %s\n", strnwerror(dserr));
eval = 122;
goto bailout;
}
dserr = NWDSPutAttrVal(ctx, buf, SYN_DIST_NAME, group);
if (dserr) {
sprintf(errstr, "NWDSPutAttrVal() failed with %s\n", strnwerror(dserr));
eval = 123;
goto bailout;
}
dserr = __NWDSCompare(ctx, conn, oid, buf, &match);
if (dserr) {
sprintf(errstr, "__NWDSCompare() failed with %s(oid=%x)\n", strnwerror(dserr), oid);
eval = 124;
goto bailout;
}
if (!match) {
sprintf(errstr, "Not member of NDS group %s\n", group);
eval=125;
}
bailout:
if (buf)
NWDSFreeBuf(buf);
return eval;
}
/* internal; called by all functions requiring a context */
static int _createCtx ( char * errstr, NWDSContextHandle *ctx) {
NWDSCCODE dserr;
u_int32_t ctxflag = 0;
u_int32_t confidence = 0;
int eval = 0;
dserr = NWDSCreateContextHandle(ctx);
if (dserr) {
sprintf(errstr, "NWDSCreateContextHandle failed with %s\n", strnwerror(dserr));
return 100;
}
ctxflag = DCV_XLATE_STRINGS | DCV_DEREF_ALIASES | DCV_TYPELESS_NAMES;
dserr = NWDSSetContext(*ctx, DCK_FLAGS, &ctxflag);
if (dserr) {
sprintf(errstr, "NWDSSetContext(DCK_FLAGS) failed: %s\n", strnwerror(dserr));
eval=101;
goto bailout;
}
dserr = NWDSSetContext(*ctx, DCK_NAME_CONTEXT, "");
if (dserr) {
sprintf(errstr, "NWDSSetContext(DCK_NAME_CONTEXT) failed: %s\n",strnwerror(dserr));
eval=102;
goto bailout;
}
dserr = NWDSSetContext(*ctx, DCK_CONFIDENCE, &confidence);
if (dserr) {
sprintf(errstr, "NWDSSetContext(DCK_CONFIDENCE) failed: %s\n",strnwerror(dserr));
eval=103;
goto bailout;
}
/* success */
return 0;
/*failure */
bailout:
dserr = NWDSFreeContext(*ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=105;
}
return eval;
}
/* internnal; called by all functions requiring a connection to a tree */
static int _createCtxAndConn (char * errstr, const char* treename, NWDSContextHandle *ctx, NWCONN_HANDLE *conn) {
NWDSCCODE dserr;
int eval = 0;
eval=_createCtx (errstr,ctx);
if (eval)
return eval;
dserr= NWCXAttachToTreeByName(conn, treename);
if (dserr) {
sprintf(errstr, "NWCXAttachToTreeByName failed with %s\n", strnwerror(dserr));
eval =99;
goto bailout;
}
dserr = NWDSAddConnection(*ctx, *conn);
if (dserr) {
sprintf(errstr, "Cannot bind connection to context: %s\n",strnwerror(dserr));
eval=104;
goto bailout;
}
/* success */
//sprintf (errstr,"tout va bien\n");
return 0;
/*failure */
bailout:
if (conn) NWCCCloseConn(*conn);
dserr = NWDSFreeContext(*ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=105;
}
return eval;
}
static int bindery_auth (char* errstr, const char* server, const char* user, const char* pwd,
const char * group)
{
struct ncp_conn *conn;
struct ncp_conn_spec spec;
long err;
char upperpw[256];
int i;
if (strlen(pwd) > 255) {
sprintf(errstr, "Specified password is too long");
return 1;
}
for (i = 0; pwd[i]; i++) {
upperpw[i] = toupper(pwd[i]);
}
upperpw[i] = 0;
spec.uid = ~0; /* ensure that ncp_open will not use permanent connection */
spec.server[0] = 0;
spec.user[0] = 0;
strcpy(spec.server, server);
if ((conn = ncp_open(&spec, &err)) == NULL) {
sprintf(errstr, "Cannot connect to server: %s", strnwerror(err));
return 1;
}
/* useless code ???
{
NWCONN_NUM num;
err=NWGetConnectionNumber(conn, &num);
}
*/
/* Bindery authorization */
err = NWVerifyObjectPassword(conn, user, OT_USER, upperpw);
if (err) {
sprintf(errstr, "Wrong credentials: %s", strnwerror(err));
}else {
if (group[0]) {
err=is_member_of_group_bind(errstr,conn,user,group);
}
}
NWCCCloseConn(conn);
return err;
}
/* authenticate to a NDS server */
static int nds_auth_fn(char* errstr, const char* server, const char* objectname, const char* pwd,
const char * group)
{
NWDSCCODE dserr;
NWDSContextHandle ctx=NULL;
NWCONN_HANDLE conn=NULL;
int eval = 0;
NWObjectID oid;
eval=_createCtx (errstr,&ctx);
if (eval)
return eval;
if (server[0] == '/') {
dserr = ncp_open_mount(server, &conn);
if (dserr) {
sprintf(errstr, "ncp_open_mount failed with %s\n", strnwerror(dserr));
eval=104;
goto bailout;
}
} else {
struct ncp_conn_spec connsp;
long err;
memset(&connsp, 0, sizeof(connsp));
strcpy(connsp.server, server);
conn = ncp_open(&connsp, &err);
if (!conn) {
sprintf(errstr, "ncp_open failed with %s\n",strnwerror(err));
eval=105;
goto bailout;
}
}
dserr = NWDSAddConnection(ctx, conn);
if (dserr) {
sprintf(errstr, "Cannot bind connection to context: %s\n",strnwerror(dserr));
eval=106;
goto bailout;
}
dserr = NWDSVerifyObjectPassword(ctx, NDS_PASSWORD, objectname, pwd);
if (dserr) {
sprintf(errstr, "Verify password failed: %s\n",
strnwerror(dserr));
eval = 110;
} else {
if (group[0]) {
dserr=NWDSMapNameToID(ctx, conn,objectname,&oid);
if (dserr) {
sprintf(errstr, "%s when retrieving object ID\n", strnwerror(dserr));
eval =119;
goto bailout;
}
eval=is_member_of_group_nds(errstr,ctx,conn,oid,group);
}
}
bailout:
if (conn) NWCCCloseConn(conn);
if (ctx) {
dserr = NWDSFreeContext(ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=111;
}
}
return eval;
}
/* authenticate to a NDS tree and return FQDN of found user */
static int tree_auth_fn(char* errstr, const char* treename, const char* objectname, const char* contexts,const char* pwd,
const char * group, char * fqdn)
{
NWDSCCODE dserr;
NWDSContextHandle ctx=NULL;
NWCONN_HANDLE conn=NULL;
int eval = 0;
const char * ctxStart;
const char* ctxEnd;
NWObjectID oid;
eval=_createCtxAndConn (errstr,treename, &ctx, &conn);
if (eval)
return eval;
/* scan the search contexts list */
ctxStart=contexts;
do {
strcpy(fqdn,objectname);
if (ctxStart) {
char ctxBuffer[MAX_DN_CHARS];
strcat(fqdn,".");
ctxEnd=strchr(ctxStart,',');
if (ctxEnd) {
memcpy(ctxBuffer,ctxStart,ctxEnd - ctxStart);
ctxBuffer[ctxEnd-ctxStart]=0;
ctxEnd++;
strcat(fqdn,ctxBuffer);
} else
strcat(fqdn,ctxStart);
ctxStart=ctxEnd;
}
eval=109; // don't forget to reset it !!!!
dserr=NWDSMapNameToID(ctx,conn, fqdn,&oid);
if (!dserr) { //found a matching user
dserr = NWDSVerifyObjectPassword(ctx, NDS_PASSWORD, fqdn, pwd);
if (dserr) { //password makes the difference
sprintf(errstr, "Verify password failed: %s\n", strnwerror(dserr));
eval = 110;
} else {
eval=0; // got him
break;
}
}
} while (ctxStart );
if (!dserr) {
if (group[0])
eval=is_member_of_group_nds(errstr,ctx,conn,oid,group);
}
NWCCCloseConn(conn);
dserr = NWDSFreeContext(ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=111;
}
return eval;
}
static int nds_read_string_fn(char* errstr, const char* treename, const char* objectname, const char* attrname,char ** buffer){
/* return single or multi string attributes */
NWDSCCODE dserr;
NWDSContextHandle ctx=NULL;
NWCONN_HANDLE conn=NULL;
int eval = 0;
if (!treename || !objectname || !attrname ) {
sprintf (errstr," invalid parameters.");
return 98;
}
eval=_createCtxAndConn (errstr,treename, &ctx, &conn);
if (eval)
return eval;
dserr= NWCXGetMultiStringAttributeValue (ctx,objectname,attrname,buffer);
if (dserr) {
sprintf(errstr, "NWCXGetAttribute failed : %s\n",strnwerror(dserr));
eval=106;
}
NWCCCloseConn(conn);
dserr = NWDSFreeContext(ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=107;
}
return eval;
}
static int nds_read_int_fn(char* errstr, const char* treename, const char* objectname, const char* attrname,char * buffer, int maxlen){
/* return single numeric NDS (include time and boolean attributes)*/
NWDSCCODE dserr;
NWDSContextHandle ctx=NULL;
NWCONN_HANDLE conn=NULL;
int eval = 0;
if (!treename || !objectname || !attrname ) {
sprintf (errstr," invalid parameters.");
return 98;
}
eval=_createCtxAndConn (errstr,treename, &ctx, &conn);
if (eval)
return eval;
dserr=NWCXGetAttributeValueAsString (ctx,objectname,attrname,buffer,maxlen);
if (dserr) {
sprintf(errstr, "NWCXGetAttribute failed : %s\n",strnwerror(dserr));
eval=106;
}
NWCCCloseConn(conn);
dserr = NWDSFreeContext(ctx);
if (dserr) {
sprintf(errstr, "NWDSFreeContext failed with %s\n", strnwerror(dserr));
eval=107;
}
return eval;
}
PHP_FUNCTION (read_nds_string)
{
int res; /* fcn result code */
const char *treen, *objectn, *attributen;
char errstr[512];
char local_buffer [8192];
char * buffer; // returned by NWCXGetMultiStringAttributeValue
int argc = ZEND_NUM_ARGS();
zval **tree, **object, **attribute;
if (argc != 3 || zend_get_parameters_ex(argc, &tree, &object, &attribute)) {
WRONG_PARAM_COUNT;
}
sprintf(errstr, "Wrong parameters values");
if (!tree || !object || !attribute) {
RETURN_STRING(errstr,1);
}
convert_to_string_ex(tree);
convert_to_string_ex(object);
convert_to_string_ex(attribute);
treen = (*tree)->value.str.val;
objectn = (*object)->value.str.val;
attributen = (*attribute)->value.str.val;
if (!treen || !objectn || !attributen) {
RETURN_STRING(errstr,1);
}
sprintf(errstr, "failure");
res=nds_read_string_fn(errstr,treen,objectn,attributen,&buffer);
if (res) {
RETURN_STRING(errstr,1);
}
if (strlen(buffer) >=sizeof(local_buffer)) {
buffer[sizeof(local_buffer)-1]=0;
}
strcpy(local_buffer,buffer);
free(buffer);
RETURN_STRING(local_buffer,1);
}
PHP_FUNCTION (read_nds_int)
{
int res; /* fcn result code */
const char *treen, *objectn, *attributen;
char errstr[512];
char buffer [512];
int argc = ZEND_NUM_ARGS();
zval **tree, **object, **attribute;
if (argc != 3 || zend_get_parameters_ex(argc, &tree, &object, &attribute)) {
WRONG_PARAM_COUNT;
}
sprintf(errstr, "Wrong parameters values");
if (!tree || !object || !attribute) {
RETURN_STRING(errstr,1);
}
convert_to_string_ex(tree);
convert_to_string_ex(object);
convert_to_string_ex(attribute);
treen = (*tree)->value.str.val;
objectn = (*object)->value.str.val;
attributen = (*attribute)->value.str.val;
if (!treen || !objectn || !attributen) {
RETURN_STRING(errstr,1);
}
buffer[0]=0;
sprintf(errstr, "failure");
res=nds_read_int_fn(errstr,treen,objectn,attributen,buffer,sizeof(buffer));
if (res) {
RETURN_STRING(errstr,1);
}
RETURN_STRING(buffer,1);
}
PHP_FUNCTION(auth_bindery)
{
int res; /* fcn result code */
const char *servern, *usern, *sent_pw, *groupn;
char errstr[512];
int argc = ZEND_NUM_ARGS();
zval **server, **user, **password, ** group;
if (argc != 4 || zend_get_parameters_ex(argc, &server, &user, &password, &group)) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(server);
convert_to_string_ex(user);
convert_to_string_ex(password);
convert_to_string_ex(group);
servern = (*server)->value.str.val;
usern = (*user)->value.str.val;
sent_pw = (*password)->value.str.val;
groupn = (*group)->value.str.val;
/* do they know the magic word? */
sprintf(errstr, "failure");
res = bindery_auth(errstr, servern, usern, sent_pw, groupn );
if (res) {
RETURN_STRING(errstr,1);
}
RETURN_FALSE;
}
PHP_FUNCTION(auth_tree)
{
int res; /* fcn result code */
const char *servern, *ctxs,*usern, *sent_pw, *groupn;
char errstr[512];
char fqdn[MAX_DN_CHARS+1]; // to get the FQDN used
char fqdn_ret[MAX_DN_CHARS+5]; // to return to php DN=xxx.yyy.zzz
int argc = ZEND_NUM_ARGS();
zval **server, **user, **contexts, **password, **group;
if (argc != 5 || zend_get_parameters_ex(argc, &server, &user, &contexts,&password, &group)) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(server);
convert_to_string_ex(user);
convert_to_string_ex(contexts);
convert_to_string_ex(password);
convert_to_string_ex(group);
servern = (*server)->value.str.val;
usern = (*user)->value.str.val;
ctxs = (*contexts)->value.str.val ;
sent_pw = (*password)->value.str.val;
groupn = (*group)->value.str.val;
/* do they know the magic word? */
sprintf(errstr, "failure");
res = tree_auth_fn(errstr, servern, usern, ctxs,sent_pw, groupn,fqdn);
if (res) {
RETURN_STRING(errstr,1);
}
//RETURN_FALSE;
strcpy(fqdn_ret,"DN=");
strcat(fqdn_ret,fqdn);
RETURN_STRING(fqdn_ret,1);
}
PHP_FUNCTION(auth_nds)
{
int res; /* fcn result code */
const char *servern, *usern, *sent_pw, *groupn;
char errstr[512];
int argc = ZEND_NUM_ARGS();
zval **server, **user, **password, **group;
if (argc != 4 || zend_get_parameters_ex(argc, &server, &user, &password, &group)) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(server);
convert_to_string_ex(user);
convert_to_string_ex(password);
convert_to_string_ex(group);
servern = (*server)->value.str.val;
usern = (*user)->value.str.val;
sent_pw = (*password)->value.str.val;
groupn = (*group)->value.str.val;
/* do they know the magic word? */
sprintf(errstr, "failure");
res = nds_auth_fn(errstr, servern, usern, sent_pw, groupn);
if (res) {
RETURN_STRING(errstr,1);
}
RETURN_FALSE;
}
PHP_MINIT_FUNCTION(auth_nds)
{
return SUCCESS;
}
PHP_MINFO_FUNCTION(auth_nds)
{
php_info_print_table_start();
php_info_print_table_row(3, "NDS/Bindery authentication support", "enabled","(c) 2000-2001 by <a HREF=\"mailto:vandrove@vc.cvut.cz\">P.Vandrovec</a> & <A href=\"mailto:patrick.pollet@insa-lyon.fr\">P.Pollet </a>");
php_info_print_table_row(3, "NDS reading properties support", "enabled","(c) 2001 by <A HREF=\"mailto:patrick.pollet@insa-lyon.fr\">P.Pollet</a>");
php_info_print_table_end();
}
function_entry auth_nds_functions[] = {
PHP_FE(auth_bindery, NULL)
PHP_FE(auth_nds, NULL)
PHP_FE(auth_tree, NULL)
PHP_FE(read_nds_string, NULL)
PHP_FE(read_nds_int, NULL)
{NULL, NULL, NULL}
};
zend_module_entry auth_nds_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"auth_nds",
auth_nds_functions,
PHP_MINIT(auth_nds),
NULL,
NULL,
NULL,
PHP_MINFO(auth_nds),
#if ZEND_MODULE_API_NO >= 20010901
NCPFS_VERSION, /* extension version number (string) */
#endif
STANDARD_MODULE_PROPERTIES
};
ZEND_GET_MODULE(auth_nds)

View File

@@ -0,0 +1,12 @@
<?php
/* $Id: config.inc.php3,v 1.26 1999/10/10 19:57:29 tobias Exp $ */
$cfgBorder = "0";
$cfgThBgcolor = "#D3DCE3";
$cfgBgcolorOne = "#CCCCCC";
$cfgBgcolorTwo = "#DDDDDD";
?>

View File

@@ -0,0 +1,8 @@
<hr>
<table border=0 width="90%">
<tr align="right"><TD><P STYLE="color:red;font-size: 8pt;font-family:tahoma" >
V 1.00 P.Pollet le 24/03/2001.
</font></td> </tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,61 @@
<?php
/* $Id: header.inc.php3,v 1.15 1999/07/18 19:54:10 tobias Exp $ */
if (!isset($no_require))
include("lib.inc.php3");
?>
<html>
<head>
<style type="text/css">
//<!--
body { font-family: Arial, Helvetica, sans-serif; font-size: 9pt}
th { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold; background-color: <?php echo $cfgThBgcolor;?>;}
td { font-family: Arial, Helvetica, sans-serif; font-size: 9pt;}
form { font-family: Arial, Helvetica, sans-serif; font-size: 9pt}
h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt; font-weight: bold}
h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold}
A:link { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: none; color: blue}
A:visited { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: none; color: blue}
A:hover { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; text-decoration: underline; color: red}
//-->
</style>
<!--
<META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache,must-revalidate">
-->
</head>
<body bgcolor="#F5F5F5" text="#000000" background="images/bkg.gif">
<TABLE WIDTH=99% BORDER=0>
<TR ALIGN=center>
<TD ALIGN=center>
<A HREF="linuxinfos.phtml"> <IMG SRC="images/linuxlog.gif" BORDER=0 width=50 height=50> </a>
</TD>
<TD COLSPAN=3 ALIGN=CENTER VALIGN=CENTER>
<H1>
<? echo $strEntete ?>
<CENTER>
<?
if (isset($message))
{
show_message(urldecode($message));
}
?>
</center>
</H1></TD>
<TD ALIGN=center>
<A HREF="nwinfos.phtml"> <IMG SRC="images/netware.gif" BORDER=0 ></A>
</TD>
</TR>
</TABLE>
<HR>

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -0,0 +1,108 @@
<?
session_start();
global $ss_authenticated;
#echo "session auth:".$ss_authenticated."<br>";
if (session_is_registered("ss_authenticated"))
{
session_unregister ("ss_authenticated");
unset ($ss_authenticated);
#echo "session auth:".$ss_authenticated."<br>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- *************************************************
EDITEUR WEBEXPERT
DATE DE CREATION: 01/01/00
DERNIERE MODIFICATION: 01/01/00
************************************************** -->
<HTML>
<HEAD>
<TITLE>Identification</TITLE>
<!META NAME="Patrick Pollet" CONTENT="INSA de Lyon">
<!META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!-- Debut du script
function testf(form)
{
var erreur = 0;
//alert ("début de test")
if (form.uid.value.length <3)
{
alert ("Votre login est trop court !");
form.uid.focus();
return(false);
}
if (form.pwd.value.length <5 )
{
alert ("Votre mot de passe comporte au moins cinq caractères");
form.pwd.focus();
return(false);
}
//alert ("fin de test"+erreur)
return (true)
}
// Fin du script -->
</SCRIPT>
</HEAD>
<BODY onload="javascript:document.IDD.uid.focus();">
<?php
$strEntete="Bienvenue au Centre Informatique du Premier Cycle<p> Identification";
include("header.inc.php3");
?>
<CENTER>
<FORM NAME=IDD ACTION="nds.php" METHOD=POST onsubmit="return testf(this)">
<?
#echo "session user:".$ss_username."<br>";
#echo "session auth:".$ss_authenticated."<br>";
#echo "session tree:".$ss_tree."<br>";
?>
<TABLE border=1>
<TR>
<TD align=right bgcolor = <? echo $cfgBgcolorTwo;?> ><br>Veuillez entrer votre login Novell:<br>&nbsp<br></TD>
<TD><INPUT TYPE="text" NAME="uid" SIZE="15" MAXLENGTH="15"
<?
#remet le login
if ($uid!="") { echo " value=".$uid; }
?>
>
</TD>
</TR>
<TR>
<TD align=right bgcolor = <? echo $cfgBgcolorTwo;?>><br>Et votre mot de passe:<br>&nbsp<br></TD>
<TD><INPUT TYPE="password" NAME="pwd" SIZE="12" MAXLENGTH="12">
<TD><INPUT TYPE=HIDDEN NAME="tree" VALUE="INSA_ROOT">
<INPUT TYPE=HIDDEN NAME="ctx" VALUE=".PC">
</TD>
</TR>
<TR>
<TD COLSPAN=2 ALIGN="CENTER">
<br>&nbsp<br>
<INPUT TYPE="reset" VALUE="Annuler" onclick="javascript:document.IDD.uid.focus();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="submit" VALUE=" Valider ">
<br>&nbsp<br>
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
<?php
require ("footer.inc.php3");
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,140 @@
<?php
/* $Id: lib.inc.php3,v 1.41 1999/10/10 11:39:34 tobias Exp $ */
require("config.inc.php3");
function mkjoli($string) {
return ucfirst(strtolower($string));
}
function fillblank($string) {
if (trim($string =="")) return ("&nbsp;");
else return (mkjoli($string));
}
function justify($string,$len) {
while (strlen($string) <$len) {
$string=$string." ";
}
return $string;
}
function justifyhtml($string,$len) {
$l=strlen($string);
while ($l <$len) {
$string=$string."&nbsp;";$l++;
}
return $string;
}
function premier($string) {
$prns=split(" ",trim($string));
return ($prns[0]);
}
function suivant($string) {
$prns=split(" ",trim($string));
$s="";
for ($i=1;$i<count($prns);$i++) {$s=$s.trim($prns[$i])." ";}
return ($s);
}
function marque($string, $pattern) {
$beg="<font color='#FF0000' ><B>";
$end="</b></font>";
if ($pattern=="") return $string;
$string=strtolower($string);
$pattern=strtolower($pattern);
return(str_replace($pattern,$beg.$pattern.$end,$string));
}
function mysql_die($error = "")
{
global $strError,$strMySQLSaid, $strBack;
echo "<b> $strError </b><p>";
if (empty($error))
echo $strMySQLSaid.mysql_error();
else
echo $strMySQLSaid.$error;
echo "<br><a href=\"javascript:history.go(-1)\">$strBack</a>";
require ("footer.inc.php3");
exit;
}
function auth()
{
global $cfgServer;
#$PHP_AUTH_USER = ""; No need to do this since err 401 allready clears that var
Header("status: 401 Unauthorized");
Header("HTTP/1.0 401 Unauthorized");
Header("WWW-authenticate: basic realm=\"phpMySQLAdmin on " . $cfgServer['host'] . "\"");
echo "<HTML><HEAD><TITLE>" . $GLOBALS["strAccessDenied"] . "</TITLE></HEAD>\n";
echo "<BODY BGCOLOR=#FFFFFF><BR><BR><CENTER><H1>" . $GLOBALS["strWrongUser"] . "</H1>\n";
echo "</CENTER></BODY></HTML>";
exit;
}
function count_records ($db,$table)
{ $result = mysql_db_query($db, "select count(*) as num from $table");
$num = mysql_result($result,0,"num");
echo $num;
}
function show_message($message)
{
?>
<div align="center">
<table border="<?php echo $GLOBALS['cfgBorder'];?>" width=70%>
<tr>
<td align=center bgcolor="<?php echo $GLOBALS['cfgThBgcolor'];?>">
<b><?php echo $message;?><b><br>
</td>
</tr>
</table>
</div>
<?php
}
function split_string($sql, $delimiter)
{
$sql = trim($sql);
$buffer = array();
$ret = array();
$in_string = false;
for($i=0; $i<strlen($sql); $i++)
{
if($sql[$i] == $delimiter && !$in_string)
{
$ret[] = substr($sql, 0, $i);
$sql = substr($sql, $i + 1);
$i = 0;
}
if($in_string && ($sql[$i] == $in_string) && $buffer[0] != "\\")
{
$in_string = false;
}
elseif(!$in_string && ($sql[$i] == "\"" || $sql[$i] == "'") && $buffer[0] != "\\")
{
$in_string = $sql[$i];
}
$buffer[0] = $buffer[1];
$buffer[1] = $sql[$i];
}
if (!empty($sql))
{
$ret[] = $sql;
}
return($ret);
}
// -----------------------------------------------------------------
?>

View File

@@ -0,0 +1,42 @@
<?
session_start();
global $ss_authenticated;
if (!session_is_registered("ss_authenticated") || (!$ss_authenticated)) {
header ("Location: index.phtml?message=".urlencode("Vous n êtes pas authentifié"));
exit(); /* capital sinon execute quand même le code plus bas !!!! */
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- *************************************************
EDITEUR WEBEXPERT
DATE DE CREATION: 01/01/00
DERNIERE MODIFICATION: 01/01/00
************************************************** -->
<HTML>
<HEAD>
<TITLE>Menu général</TITLE>
<META NAME="Patrick Pollet" CONTENT="INSA de Lyon">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY >
<?php
$strEntete="Bienvenue au Centre Informatique du Premier Cycle<p> Informations sur ce serveur";
include("header.inc.php3");
?>
<?php
phpinfo();
?>
<?
require ("footer.inc.php3");
?>
</BODY>
</HTML>

View File

@@ -0,0 +1,44 @@
<?
session_start();
global $ss_authenticated;
if (!session_is_registered("ss_authenticated") || (!$ss_authenticated)) {
header ("Location: index.phtml?message=".urlencode("Vous n êtes pas authentifié"));
exit(); /* capital sinon execute quand même le code php plus bas !!!! */
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- *************************************************
EDITEUR WEBEXPERT
DATE DE CREATION: 01/01/00
DERNIERE MODIFICATION: 01/01/00
************************************************** -->
<HTML>
<HEAD>
<TITLE>Menu général</TITLE>
<META NAME="Patrick Pollet" CONTENT="INSA de Lyon">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY >
<?php
$strEntete="Bienvenue au Centre Informatique du Premier Cycle<p> Menu général de l'Intranet enseignants";
include("header.inc.php3");
?>
<?php
#echo "hello ".session_name()."=".session_id()."<BR>";
#echo "vous êtes ".$ss_username."<BR>";
#echo "attaché à ".$ss_tree."<BR>";
?>
<?
require ("footer.inc.php3");
?>
</BODY>
</HTML>

72
contrib/php/site/nds.php Normal file
View File

@@ -0,0 +1,72 @@
<?
session_start();
#doit être après l'ouverture de session
global $ss_username;
global $ss_tree;
global $ss_server;
global $ss_authenticated;
session_unregister("ss_authenticated");
$auth_err= "Pas de login!";
$ss_authenticated=0 ;
$date= date ("d/m/Y H:i:s");
$machine=getenv('http_host')." [".getenv('remote_addr')."]";
$ss_tree =$HTTP_POST_VARS["tree"];
$ss_srv =$HTTP_POST_VARS["srv"];
$ctx =$HTTP_POST_VARS["ctx"];
$uu =$HTTP_POST_VARS["uid"];
$pwd =$HTTP_POST_VARS["pwd"];
if ($ss_tree == "" && $ss_srv == "")
$auth_err = "Pas d'arbre ni de serveur !";
else if ($uu== "")
$auth_err = "Nom d'utilisateur incorrect";
else if ($pwd == "")
$auth_err = "Mot de passe incorrect";
else {
if ($ss_tree !="") {
$ss_username=$uu.$ctx;
if ($ctx == ".PC") {
#echo "authentification à CIPCINSA<BR>";
$auth_err = auth_nds("CIPCINSA", $ss_username, strtoupper($pwd),"profs.pc");
} else if ($ctx == ".GCP.PC") {
#echo "authentification à GCP<BR>";
$auth_err = auth_nds("GCP", $ss_username, strtoupper($pwd),"profs.gcp.pc");
} else
$auth_err = "Access denied!";
} else {
$ss_username=$uu;
#echo "authentification à ".$HTTP_POST_VARS["svr"]."<BR>";
$auth_err = auth_bindery($ss_svr, $uu, $pwd, $HTTP_POST_VARS["grp"]);
}
# write in /var/log/secure
openlog ("php_nds_auth",LOG_ID |LOG_PID ,LOG_AUTHPRIV);
if ($auth_err == "") {
$ss_authenticated=1;
session_register("ss_username");
session_register("ss_authenticated");
session_register("ss_tree");
session_register("ss_server");
syslog (LOG_NOTICE,"granted access to ".$ss_username." the ".$date. " from ".$machine);
closelog();
header ("Location: menu.phtml");
}
else {
syslog (LOG_WARNING,"access denied for ".$uu." from ".$machine." due to ".$auth_err);
closelog();
header ("Location: index.phtml?uid=".$uu."&message=".urlencode($auth_err));
}
}
?>
<BODY>
</body>

View File

@@ -0,0 +1,6 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date du passé
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // toujours modifié
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
?>

View File

@@ -0,0 +1,149 @@
<?
session_start();
#doit être après l'ouverture de session
#global $ss_username;
#global $ss_tree;
#global $ss_server;
#global $ss_authenticated;
if (!session_is_registered("ss_authenticated") || (!$ss_authenticated)) {
header ("Location: index.phtml?message=".urlencode("Vous n êtes pas authentifié"));
exit(); /* capital sinon execute quand même le code plus bas !!!! */
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- *************************************************
EDITEUR WEBEXPERT
DATE DE CREATION: 01/01/00
DERNIERE MODIFICATION: 01/01/00
************************************************** -->
<HTML>
<HEAD>
<TITLE>Menu général</TITLE>
<META NAME="Patrick Pollet" CONTENT="INSA de Lyon">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY >
<?php
$strEntete="Bienvenue au Centre Informatique du Premier Cycle<p> Informations sur votre compte";
include("header.inc.php3");
?>
<TABLE border=1 width=99%>
<?
#attention ce code semble être executé même si redirection en haut
function infoStrSur ($tree,$user,$prop,$propalias) {
syslog (LOG_NOTICE,"infoStrSur called on".$tree." for ".$user. " to get ".$prop);
$fn=read_nds_string ($tree,$user,$prop);
if (strstr($fn,"(-60"))
$fn="&nbsp;";
return "<TR><TD BGCOLOR=#CCCCFF>".$propalias."</TD><TD>".$fn."</TD></TR>";
}
function infoNumSur ($tree,$user,$prop,$propalias) {
syslog (LOG_NOTICE,"infoStrSur called on".$tree." for ".$user. " to get ".$prop);
$fn=read_nds_int($tree,$user,$prop);
if (strstr($fn,"(-60"))
$fn="&nbsp;";
return "<TR><TD BGCOLOR=#CCCCFF>".$propalias."</TD><TD>".$fn."</TD></TR>";
}
if (session_is_registered("ss_authenticated") && ($ss_authenticated)) {
openlog ("php_nds_read",LOG_ID |LOG_PID ,LOG_AUTHPRIV);
echo(infoStrSur($ss_tree,$ss_username,"CN","Login:"));
echo(infoStrSur($ss_tree,$ss_username,"Full Name","Nom complet:"));
echo(infoStrSur($ss_tree,$ss_username,"Given Name","Prénoms:"));
echo(infoStrSur($ss_tree,$ss_username,"Surname","Nom de famille:"));
echo(infoStrSur($ss_tree,$ss_username,"Initials","Civilité:"));
echo(infoStrSur($ss_tree,$ss_username,"Title","Titre:"));
echo(infoStrSur($ss_tree,$ss_username,"Description","Description:"));
echo(infoStrSur($ss_tree,$ss_username,"Generational Qualifier","GQ:"));
echo(infoStrSur($ss_tree,$ss_username,"Group Membership","Adhésion aux groupes:"));
echo(infoStrSur($ss_tree,$ss_username,"Security Equals","Equivalence de sécurité:"));
echo(infoStrSur($ss_tree,$ss_username,"ACL","Droits:"));
echo(infoStrSur($ss_tree,$ss_username,"EMail Address","Adresse Email I:"));
echo(infoStrSur($ss_tree,$ss_username,"Internet EMail Address","Adresse EMail II:"));
echo(infoStrSur($ss_tree,$ss_username,"Home Directory","Repertoire home:"));
echo(infoStrSur($ss_tree,$ss_username,"Message Server","Serveur préféré:"));
echo(infoStrSur($ss_tree,$ss_username,"Profile","Profil:"));
echo(infoStrSur($ss_tree,$ss_username,"Language","Langue:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Time","Date de login:"));
echo(infoNumSur($ss_tree,$ss_username,"Last Login Time","Dernier login:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Disabled","Compte désactivé:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Expiration Time","Votre compte expire le:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Grace Limit","Nombre maximum d'essais:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Grace Remaining","Il vous reste:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Intruder Attempts","Essais d'intrusions:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Intruder Reset Time","Remise à zéro après:"));
echo(infoNumSur($ss_tree,$ss_username,"Login Maximum Simultaneous","Nombre de connexions permises:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Required","Mot de passe obligatoire:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Unique Required","Mots de passe uniques obligatoire:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Allow Change","Chgmt de mot de passe permis:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Minimum Length","Longueur mimimale du mot de passe:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Expiration Time","Date d'expiration du mot de passe:"));
echo(infoNumSur($ss_tree,$ss_username,"Password Expiration Interval","Votre mot de passe expire tous les:"));
echo(infoStrSur($ss_tree,$ss_username,"Telephone Number","N° de téléphone:"));
echo(infoStrSur($ss_tree,$ss_username,"Facsimile Telephone Number","N° de FAX"));
echo(infoStrSur($ss_tree,$ss_username,"SA","Rue:"));
echo(infoStrSur($ss_tree,$ss_username,"Physical Delivery Office Name","Ville:"));
echo(infoStrSur($ss_tree,$ss_username,"Postal Office Box","Boite postale:"));
echo(infoStrSur($ss_tree,$ss_username,"Postal Code","Code postal:"));
echo(infoStrSur($ss_tree,$ss_username,"S","Etat/Province:"));
echo(infoStrSur($ss_tree,$ss_username,"Postal Address","Infos sur étiquettes:"));
echo(infoNumSur($ss_tree,$ss_username,"LINUX:UID","ID Linux:"));
echo(infoNumSur($ss_tree,$ss_username,"LINUX:GID","Groupe Linux:"));
#echo(infoNumSur($ss_tree,$ss_username,"LINUX:Primary GroupID",""));
#echo(infoStrSur($ss_tree,$ss_username,"LINUX:Primary GroupName",""));
echo(infoStrSur($ss_tree,$ss_username,"LINUX:Login Shell","Shell Linux:"));
echo(infoStrSur($ss_tree,$ss_username,"LINUX:Home Directory","Home Linux:"));
echo(infoStrSur($ss_tree,$ss_username,"LINUX:Comments","Gecos Linux:"));
echo(infoNumSur($ss_tree,$ss_username,"UNIX:UID","ID Unix:"));
echo(infoNumSur($ss_tree,$ss_username,"UNIX:GID","Groupe Unix:"));
#echo(infoStrSur($ss_tree,$ss_username,"UNIX:Primary GroupID",""));
#echo(infoStrSur($ss_tree,$ss_username,"UNIX:Primary GroupName",""));
echo(infoStrSur($ss_tree,$ss_username,"UNIX:Login Shell","Shell Unix:"));
echo(infoStrSur($ss_tree,$ss_username,"UNIX:Home Directory","Home Unix:"));
echo(infoStrSur($ss_tree,$ss_username,"UNIX:Comments","Gecos Unix:"));
echo(infoStrSur($ss_tree,$ss_username,"OU","Organisation:"));
echo(infoStrSur($ss_tree,$ss_username,"L","Locations:"));
echo(infoStrSur($ss_tree,$ss_username,"Network Address","Loggué depuis:"));
closelog();
}
?>
</table>
<?
require ("footer.inc.php3");
?>
</BODY>
</HTML>