+++ /dev/null
-#!/bin/bash
-
-apt-get update
-
-source include.sh
-apt-get update
-WD=`pwd`
-# get everything built.
-for i in `cat $TARGETS`; do
- cd $WD
- DISTRO=`dirname $i`
- VSERVER_BASE=`basename $i`
- DISTVER=`basename $i |sed "s;CitadelBuild.;;"`
- DISTVER=`cd $APACHE_ROOT/public_html/$DISTRO/; ls -d ?$DISTVER `
- echo "****** building $DISTRO $DISTVER ******"
- CleanBuild $VSERVER_BASE $CHECKOUT_DIR
-
- echo "****** building $DISTRO $DISTVER libcitadel ******"
- cd $WD
- GetSource $VSERVER_BASE $CHECKOUT_DIR libcitadel
- BuildSource $VSERVER_BASE $CHECKOUT_DIR libcitadel
- InstallContrib $VSERVER_BASE $CHECKOUT_DIR libcitadel
-
- echo "****** building $DISTRO $DISTVER Webcit ******"
- cd $WD
- GetSource $VSERVER_BASE $CHECKOUT_DIR webcit
- BuildSource $VSERVER_BASE $CHECKOUT_DIR webcit
-
- echo "****** building $DISTRO $DISTVER Citadel ******"
- cd $WD
- GetSource $VSERVER_BASE $CHECKOUT_DIR citadel
- BuildSource $VSERVER_BASE $CHECKOUT_DIR citadel
-
-done
-
-# put it public.
-for i in `cat $TARGETS`; do
- echo "****** installing $DISTRO $DISTVER ******"
-
- cd $WD
- DISTRO=`dirname $i`
- VSERVER_BASE=`basename $i`
- DISTVER=`basename $i |sed "s;CitadelBuild.;;"`
- DISTVER=`cd $APACHE_ROOT/public_html/$DISTRO/; ls -d ?$DISTVER `
-
- CleanApache "$DISTRO/$DISTVER"
-
- cd $WD
- UpperResults $VSERVER_BASE "$DISTRO/$DISTVER"
-done
-
-
-
-chroot ${VSERVER_ROOT}/apache/ /bin/bash -c "cd ${CIT_APACHE_DIR}/; ./refresh.sh"
+++ /dev/null
-#!/bin/bash
-source include.sh
-
-# First get the chroot up and running with:
-#apt-get install bzip2 perl-doc lib32stdc++6 manpages-dev autoconf automake1.9 libtool flex libc6-dev-i386 lib32gcc1 groff debhelper po-debconf bison autotools-dev libdb4.3-dev libldap2-dev libncurses5-dev libpam0g-dev libssl-dev cdbs g++ locales dpatch fakeroot patchutils
-WD=`pwd`
-
-for i in `cat $TARGETS`; do
- cd $WD
- DISTRO=`dirname $i`
- VSERVER_BASE=`basename $i`
- DISTVER=`basename $i |sed "s;CitadelBuild.;;"`
- DISTVER=`cd $APACHE_ROOT/public_html/$DISTRO/; ls -d ?$DISTVER `
- echo "*** building $DISTRO $DISTVER ical *****"
-
- CleanBuild $VSERVER_BASE $CONTRIB_DIR
-
- cd $WD
- if grep -q $VSERVER_BASE libical_targets; then
- GetSource $VSERVER_BASE $CONTRIB_DIR libical
- BuildSource $VSERVER_BASE $CONTRIB_DIR libical
- InstallContrib $VSERVER_BASE $CONTRIB_DIR libical
- fi
-
- echo "*** building $DISTRO $DISTVER sieve *****"
- cd $WD
- if grep -q $VSERVER_BASE libsieve_targets; then
- GetSource $VSERVER_BASE $CONTRIB_DIR libsieve
- BuildSource $VSERVER_BASE $CONTRIB_DIR libsieve
- InstallContrib $VSERVER_BASE $CONTRIB_DIR libsieve
- fi
- echo "**** done. ****"
- echo "*** building $DISTRO $DISTVER tinymce *****"
- cd $WD
- if grep -q $VSERVER_BASE tinymce_targets; then
- GetSource $VSERVER_BASE $CONTRIB_DIR tinymce
- BuildSource $VSERVER_BASE $CONTRIB_DIR tinymce
- InstallContrib $VSERVER_BASE $CONTRIB_DIR tinymce
- fi
- echo "**** done. ****"
-done
-
-#for i in `cat $TARGETS`; do
-# echo "*** installing $DISTRO *****"
-#
-#done
-
-
-chroot ${VSERVER_ROOT}/apache/ /bin/bash -c "cd ${CIT_APACHE_DIR}/; ./refresh.sh"
+++ /dev/null
-#!/bin/bash
-cp ~vs/citadelPrepare/home/checkout/tmp/webcit_* ~vs/apache/home/debiancitadel/public_html/source/
-cp ~vs/citadelPrepare/home/checkout/tmp/citadel_* ~vs/apache/home/debiancitadel/public_html/source/
-
-chroot ~vs/apache /bin/bash -c "cd /home/debiancitadel/; ./refreshsource.sh"
+++ /dev/null
-#!/bin/sh
-#
-# Automatic script to install Citadel on a target system.
-# Copyright (C) 2004 Michael Hampton <error@citadel.org>
-# Copyright (C) 2004-2015 Art Cancro <ajc@citadel.org>
-#
-# This program is open source software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# Our favorite operating system is called Linux.
-#
-# 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.
-#
-# Reading this script? Here's some helpful hints:
-#
-# If you're seeing this in your browser, it's probably not what you want.
-# You can either save it to disk and run it, or do it the easy way:
-#
-# curl http://easyinstall.citadel.org/install | sh
-#
-# Note that this script installs software on your system and so it requires
-# root privileges. Feel free to inspect the script to make sure we didn't
-# do anything stupid...
-#
-# We have provided you the source code according to the terms of the respective
-# software licenses included in the source code packages, even if you choose
-# not to keep the source code around. You can always download it again later.
-#
-# We install the "latest" or "stable" versions of these packages:
-#
-# Citadel server, WebCit, libcitadel, libical, Berkeley DB, libSieve, Expat
-#
-# Do *not* attempt to do anything with the UNATTENDED_BUILD mode. This is
-# for our use only and is not only unsupported, but we will deliberately break
-# it from time to time in order to prevent you from trying to use it.
-
-###############################################################################
-#
-# This is the general stuff we're going to do, in order:
-#
-# 1. Gather information about the target system
-# 2. Present the installation steps (from 1 above) to the user
-# 3. Present any pre-install customizations to the user
-# 4. Do the installation
-# A. Download any source code files packages required
-# B. If we build our own, compile and install prerequisites then Citadel
-# 5. Do post-installation setup
-#
-# Then call it a day.
-#
-###############################################################################
-
-
-# Begin user customization area
-#
-# These two directories specify where Citadel and its private support
-# libraries will be installed. This keeps them safely tucked away from
-# the rest of your system. The defaults should be fine for most people.
-
-SUPPORT=/usr/local/ctdlsupport
-CITADEL=/usr/local/citadel
-WEBCIT=/usr/local/webcit
-WORKDIR=/tmp
-BUILD=$WORKDIR/citadel-build.$$
-LOG=$WORKDIR/citadel-install-log.txt
-export SUPPORT CITADEL WEBCIT
-unset LANG
-
-MAKEOPTS=""
-
-# End user customization area
-
-# We're now exporting a bunch of environment variables, and here's a list:
-# CITADEL_INSTALLER Set to "web" to indicate this script
-# CITADEL Directory where Citadel is installed
-# WEBCIT Directory where WebCit is installed
-# SUPPORT Directory where support programs are installed
-# DISTRO_MAJOR Linux distribution name, if applicable
-# DISTRO_MINOR Linux distribution name, if applicable
-# DISTRO_VERSION Linux distribution version (major digit) if applicable
-# CC C compiler being used
-# MAKE Make program being used
-# CFLAGS C compiler flags
-# LDFLAGS Linker flags
-# IS_UPGRADE Set to "yes" if upgrading an existing Citadel
-# CTDL_DIALOG Where (if at all) the "whiptail" or "dialog" program may be found
-
-# Let Citadel setup recognize the Citadel installer
-CITADEL_INSTALLER=web
-export CITADEL_INSTALLER
-
-SETUP="Citadel Easy Install"
-DOWNLOAD_SITE=http://easyinstall.citadel.org
-
-# Original source code packages.
-DB_SOURCE=db-5.1.29.NC.tar.gz
-ICAL_SOURCE=libical-easyinstall.tar.gz
-LIBSIEVE_SOURCE=libsieve-2.2.7-ctdl2.tar.gz
-EXPAT_SOURCE=expat-2.0.1.tar.gz
-LIBCURL_SOURCE=curl-7.26.0.tar.gz
-LIBEV_SOURCE=libev-4.11.tar.gz
-CARES_SOURCE=c-ares-1.7.5.tar.gz
-LIBDISCOUNT_SOURCE=discount-2.1.8.tar.gz
-LIBCITADEL_SOURCE=libcitadel-easyinstall.tar.gz
-CITADEL_SOURCE=citadel-easyinstall.tar.gz
-WEBCIT_SOURCE=webcit-easyinstall.tar.gz
-TEXTCLIENT_SOURCE=textclient-easyinstall.tar.gz
-INCADD=
-LDADD=
-
-case `uname -s` in
- *BSD)
- LDADD="-L/usr/local/lib"
- INCADD="-I/usr/local/include"
- ;;
-esac
-
-##### BEGIN Functions #####
-
-GetVersionFromFile()
-{
- VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
-}
-
-
-die () {
- echo
- echo $SETUP is aborting.
- echo
- echo A log file has been written to $LOG
- echo Reading this file may tell you what went wrong. If you
- echo need to ask for help on the support forum, please post the
- echo last screenful of text from this log.
- echo
- echo Operating system: ${OSSTR}
- echo Operating system: ${OSSTR} >>$LOG
- cd $WORKDIR
- rm -fr $BUILD
- exit 1
-}
-
-
-
-test_build_dir() {
- tempfilename=test$$.sh
-
- echo '#!/bin/sh' >$tempfilename
- echo '' >>$tempfilename
- echo 'exit 0' >>$tempfilename
- chmod 700 $tempfilename
-
- [ -x $tempfilename ] || {
- echo Cannot write to `pwd`
- echo 'Are you not running this program as root?'
- die
- }
-
- ./$tempfilename || {
- echo Cannot execute a script.
- echo 'If /tmp is mounted noexec, please change this before continuing.'
- die
- }
-
-}
-
-
-
-download_this () {
- WGET=`which wget 2>/dev/null`
- CURL=`which curl 2>/dev/null`
- if [ -n "${WGET}" -a -x "${WGET}" ]; then
- $WGET $DOWNLOAD_SITE/$FILENAME >/dev/null 2>>$LOG || die
- else
- if [ -n "${CURL}" -a -x "${CURL}" ]; then
- $CURL $DOWNLOAD_SITE/$FILENAME >$FILENAME 2>>$LOG || die
- else
- echo Unable to find a wget or curl command.
- echo $SETUP cannot continue.
- die;
- fi
- fi
-}
-
-
-
-install_ical () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=libical-easyinstall.sum ; download_this
- SUM=`cat libical-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/libical-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* libical does not need updating."
- return
- fi
- fi
- echo "* Downloading libical..."
- FILENAME=$ICAL_SOURCE ; download_this
- echo "* Installing libical..."
- ( gzip -dc $ICAL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/libical >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
- rm -f $WEBCIT/webcit-easyinstall.sum 2>/dev/null
-}
-
-install_libsieve () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=libsieve-easyinstall.sum ; download_this
- SUM=`cat libsieve-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/libsieve-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* libsieve does not need updating."
- return
- fi
- fi
- echo "* Downloading libsieve..."
- FILENAME=$LIBSIEVE_SOURCE ; download_this
- echo "* Installing libsieve..."
- ( gzip -dc $LIBSIEVE_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/libsieve-2.2.7/src >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-install_expat () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=expat-easyinstall.sum ; download_this
- SUM=`cat expat-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/expat-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* expat does not need updating."
- return
- fi
- fi
- echo "* Downloading expat..."
- FILENAME=$EXPAT_SOURCE ; download_this
- echo "* Installing Expat..."
- ( gzip -dc $EXPAT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/expat-2.0.1 >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-
-install_libcurl () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=libcurl-easyinstall.sum ; download_this
- SUM=`cat libcurl-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/libcurl-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* libcurl does not need updating."
- return
- fi
- fi
- echo "* Downloading libcurl..."
- FILENAME=$LIBCURL_SOURCE ; download_this
- echo "* Installing libcurl..."
- ( gzip -dc $LIBCURL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- CFLAGS="${CFLAGS} -I${SUPPORT}/include ${INCADD} -g"
- CPPFLAGS="${CFLAGS}"
- LDFLAGS="-L${SUPPORT}/lib -Wl,--rpath -Wl,${SUPPORT}/lib ${LDADD}"
- export CFLAGS CPPFLAGS LDFLAGS
-
- cd $BUILD/curl-7.26.0 >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT --disable-file --disable-ldap --disable-ldaps \
- --disable-dict --disable-telnet --disable-tftp --disable-manual \
- --enable-thread --disable-sspi --disable-crypto-auth --disable-cookies \
- --without-libssh2 --without-ca-path --without-libidn \
- --enable-ares=$SUPPORT \
- >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-
-install_libev () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=libev-easyinstall.sum ; download_this
- SUM=`cat libev-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/libev-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* libev does not need updating."
- return
- fi
- fi
- echo "* Downloading libev..."
- FILENAME=$LIBEV_SOURCE ; download_this
- echo "* Installing libev..."
- ( gzip -dc $LIBEV_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/libev-4.11 >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-
-install_cares () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=c-ares-easyinstall.sum ; download_this
- SUM=`cat c-ares-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/c-ares-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* c-ares does not need updating."
- return
- fi
- fi
- echo "* Downloading c-ares..."
- FILENAME=$CARES_SOURCE ; download_this
- echo "* Installing c-ares..."
- ( gzip -dc $CARES_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/c-ares-1.7.5 >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $SUPPORT/etc/libcurl-easyinstall.sum 2>/dev/null
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-install_discount () {
- cd $BUILD >>$LOG 2>&1 || die
- cp /home/willi/Downloads/discount*z .
- FILENAME=discount-easyinstall.sum ; download_this
- SUM=`cat discount-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/discount-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* discount does not need updating."
- return
- fi
- fi
- echo "* Downloading discount..."
- FILENAME=$LIBDISCOUNT_SOURCE ; download_this
- echo "* Installing discount..."
- ( gzip -dc $LIBDISCOUNT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/discount-2.1.8 >>$LOG 2>&1 || die
- ./configure.sh --shared \
- --prefix=$SUPPORT \
- --with-id-anchor \
- --with-github-tags \
- --with-fenced-code \
- --with-dl=both \
- ||die
-
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $SUPPORT/etc/discount-easyinstall.sum 2>/dev/null
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-install_libcitadel () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=libcitadel-easyinstall.sum ; download_this
- SUM=`cat libcitadel-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/libcitadel-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* libcitadel does not need updating."
- return
- fi
- fi
- echo "* Downloading libcitadel..."
- FILENAME=$LIBCITADEL_SOURCE ; download_this
- echo "* Installing libcitadel..."
- ( gzip -dc $LIBCITADEL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/libcitadel >>$LOG 2>&1 || die
- ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- # Upgrading libcitadel forces the upgrade of programs which link to it
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
- rm -f $CITADEL/webcit-easyinstall.sum 2>/dev/null
- rm -f $CITADEL/textclient-easyinstall.sum 2>/dev/null
-}
-
-install_db () {
- cd $BUILD >>$LOG 2>&1 || die
- FILENAME=db-easyinstall.sum ; download_this
- SUM=`cat db-easyinstall.sum`
- SUMFILE=$SUPPORT/etc/db-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* Berkeley DB does not need updating."
- return
- fi
- fi
- echo "* Downloading Berkeley DB..."
- FILENAME=$DB_SOURCE ; download_this
- echo "* Installing Berkeley DB..."
- ( gzip -dc $DB_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/db-5.1.29.NC/build_unix >>$LOG 2>&1 || die
- ../dist/configure --prefix=$SUPPORT --disable-compat185 --disable-cxx --disable-debug --disable-dump185 --disable-java --disable-tcl --disable-test --without-rpm >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
-}
-
-install_prerequisites () {
-
- # Create the support directories if they don't already exist
-
- mkdir $SUPPORT 2>/dev/null
- mkdir $SUPPORT/bin 2>/dev/null
- mkdir $SUPPORT/sbin 2>/dev/null
- mkdir $SUPPORT/lib 2>/dev/null
- mkdir $SUPPORT/libexec 2>/dev/null
- mkdir $SUPPORT/include 2>/dev/null
- mkdir $SUPPORT/etc 2>/dev/null
-
- # Now have phun!
-
- if [ -z "$OK_ICAL" ]
- then
- install_ical
- fi
- if [ -z "$OK_LIBSIEVE" ]
- then
- install_libsieve
- fi
- if [ -z "$OK_DB" ]
- then
- install_db
- fi
- if [ -z "$OK_EXPAT" ]
- then
- install_expat
- fi
- if [ -z "$OK_LIBEV" ]
- then
- install_libev
- fi
- if [ -z "$OK_CARES" ]
- then
- install_cares
- fi
- if [ -z "$OK_DISCOUNT" ]
- then
- install_discount
- fi
- if [ -z "$OK_LIBCURL" ]
- then
- install_libcurl
- fi
-}
-
-install_sources () {
-
- install_libcitadel
-
- cd $BUILD >>$LOG 2>&1 || die
- if [ x$IS_UPGRADE = xyes ]
- then
- echo "* Upgrading your existing Citadel installation."
- fi
-
- CFLAGS="${CFLAGS} -I${SUPPORT}/include ${INCADD} -g"
- CPPFLAGS="${CFLAGS}"
- LDFLAGS="-L${SUPPORT}/lib -Wl,--rpath -Wl,${SUPPORT}/lib ${LDADD}"
- export CFLAGS CPPFLAGS LDFLAGS
-
- DO_INSTALL_CITADEL=yes
- FILENAME=citadel-easyinstall.sum ; download_this
- SUM=`cat citadel-easyinstall.sum`
- SUMFILE=$CITADEL/citadel-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* Citadel does not need updating."
- DO_INSTALL_CITADEL=no
- fi
- fi
-
- if [ $DO_INSTALL_CITADEL = yes ] ; then
- echo "* Downloading Citadel..."
- FILENAME=$CITADEL_SOURCE ; download_this
- echo "* Installing Citadel..."
- cd $BUILD >>$LOG 2>&1 || die
- ( gzip -dc $CITADEL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/citadel >>$LOG 2>&1 || die
- if [ -z "$OK_DB" ]
- then
- ./configure --prefix=$CITADEL --with-db=$SUPPORT --with-pam --with-libical --disable-threaded-client >>$LOG 2>&1 || die
- else
- ./configure --prefix=$CITADEL --with-db=$OK_DB --with-pam --with-libical --disable-threaded-client >>$LOG 2>&1 || die
- fi
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- if [ x$IS_UPGRADE = xyes ]
- then
- echo "* Performing Citadel upgrade..."
- $MAKE upgrade >>$LOG 2>&1 || die
- else
- echo "* Performing Citadel install..."
- $MAKE install >>$LOG 2>&1 || die
- useradd -c "Citadel service account" -d $CITADEL -s $CITADEL/citadel citadel >>$LOG 2>&1
- fi
- echo $SUM >$SUMFILE
- fi
-
- ## begin webcit install
-
- cd $BUILD >>$LOG 2>&1 || die
- DO_INSTALL_WEBCIT=yes
- FILENAME=webcit-easyinstall.sum ; download_this
- SUM=`cat webcit-easyinstall.sum`
- SUMFILE=$WEBCIT/webcit-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* WebCit does not need updating."
- DO_INSTALL_WEBCIT=no
- fi
- fi
-
- if [ $DO_INSTALL_WEBCIT = yes ] ; then
- echo "* Downloading WebCit..."
- FILENAME=$WEBCIT_SOURCE ; download_this
- echo "* Installing WebCit..."
- cd $BUILD >>$LOG 2>&1 || die
- ( gzip -dc $WEBCIT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/webcit >>$LOG 2>&1 || die
- ./configure --prefix=$WEBCIT --with-libical >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- rm -fr $WEBCIT/static 2>&1
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- fi
-
- ## begin text client install
-
- cd $BUILD >>$LOG 2>&1 || die
- DO_INSTALL_TEXTCLIENT=yes
- FILENAME=textclient-easyinstall.sum ; download_this
- SUM=`cat textclient-easyinstall.sum`
- SUMFILE=$CITADEL/webcit-easyinstall.sum
- if [ -r $SUMFILE ] ; then
- OLDSUM=`cat $SUMFILE`
- if [ "$SUM" = "$OLDSUM" ] ; then
- echo "* Citadel text mode client does not need updating."
- DO_INSTALL_TEXTCLIENT=no
- fi
- fi
-
- if [ $DO_INSTALL_TEXTCLIENT = yes ] ; then
- echo "* Downloading the Citadel text mode client..."
- FILENAME=$TEXTCLIENT_SOURCE ; download_this
- echo "* Installing the Citadel text mode client..."
- cd $BUILD >>$LOG 2>&1 || die
- ( gzip -dc $TEXTCLIENT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
- cd $BUILD/textclient >>$LOG 2>&1 || die
- ./configure --prefix=$CITADEL >>$LOG 2>&1 || die
- $MAKE $MAKEOPTS >>$LOG 2>&1 || die
- $MAKE install >>$LOG 2>&1 || die
- echo " Complete."
- echo $SUM >$SUMFILE
- fi
-}
-
-
-do_config () {
- echo "* Configuring your system ..."
-
- if [ x$IS_UPGRADE = xyes ]
- then
- echo Upgrading your existing Citadel installation.
- else
- echo This is a new Citadel installation.
- fi
-
- if [ -x /etc/init.d/citadel ] ; then
- echo Stopping any previously running Citadel server...
- /etc/init.d/citadel stop
- fi
-
- # If we are running a Linux operating system we try even harder to stop citserver
- if uname -a | grep -i linux ; then
- if ps ax | grep citserver | grep -v grep ; then
- echo citserver still running ... trying again to terminate it
- killall citserver
- sleep 3
- fi
- fi
-
- # If we are running a Linux operating system we try even harder to stop citserver
- if uname -a | grep -i linux ; then
- if ps ax | grep citserver | grep -v grep ; then
- echo citserver still running ... trying again to terminate it
- killall -9 citserver
- sleep 3
- fi
- fi
-
- FILENAME=citadel-init-scripts.tar ; download_this
- cat citadel-init-scripts.tar | (cd / ; tar xvf - )
- echo Starting Citadel server...
- /etc/init.d/citadel start
-
- $CITADEL/setup </dev/tty || die
- $WEBCIT/setup </dev/tty || die
-}
-
-
-
-##### END Functions #####
-
-##### BEGIN main #####
-
-
-# 0. Test to make sure we're running as root
-
-PERMSTESTDIR=/usr/local/ctdltest.$$
-mkdir $PERMSTESTDIR || {
- echo
- echo 'Easy Install is unable to create subdirectories in /usr/local.'
- echo 'Did you forget to run the install command as the root user?'
- echo 'Please become root (with a command like "su" or "sudo su") and'
- echo 'try again.'
- echo
- exit 1
-}
-rmdir $PERMSTESTDIR 2>/dev/null
-
-# 1. Gather information about the target system
-
-# Non-GNU make does not work.
-# This probably ought to be fixed, but for now we will simply require GNU make.
-
-MAKE=xx
-if gmake -v 2>&1 | grep -i GNU ; then
- MAKE=`which gmake`
-else
- if make -v 2>&1 | grep -i GNU ; then
- MAKE=`which make`
- fi
-fi
-
-if [ $MAKE == xx ] ; then
- echo
- echo 'Easy Install requires GNU Make (gmake), which was not found.'
- echo 'Please install gmake and try again.'
- echo
- exit 1
-fi
-
-export MAKE
-
-clear
-
-os=`uname`
-
-echo MAKE is $MAKE
-export MAKE
-rm -f $LOG 2>/dev/null
-
-
-# Determine which operating system we are running on
-
-OS=`uname -s`
-REV=`uname -r`
-MACH=`uname -m`
-
-if [ "${OS}" = "SunOS" ] ; then
- OS=Solaris
- ARCH=`uname -p`
- OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
-elif [ "${OS}" = "AIX" ] ; then
- OSSTR="${OS} `oslevel` (`oslevel -r`)"
-elif [ "${OS}" = "Linux" ] ; then
- KERNEL=`uname -r`
- if [ -f /etc/redhat-release ] ; then
- DIST='RedHat'
- PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
- REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
- elif [ -f /etc/SUSE-release ] ; then
- DIST=`cat /etc/SUSE-release | tr "\n" ' '| sed s/VERSION.*//`
- REV=`cat /etc/SUSE-release | tr "\n" ' ' | sed s/.*=\ //`
- elif [ -f /etc/mandrake-release ] ; then
- DIST='Mandrake'
- PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
- REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
- elif [ -f /etc/debian_version ] ; then
- DIST="Debian `cat /etc/debian_version`"
- REV=""
-
- fi
- if [ -f /etc/UnitedLinux-release ] ; then
- DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
- fi
-
- OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
-
-fi
-
-
-rm -rf $BUILD
-mkdir -p $BUILD
-cd $BUILD
-
-
-# 2. Present the installation steps (from 1 above) to the user
-clear
-if whiptail --infobox "Welcome to Citadel Easy Install" 10 70 2>/dev/null
-then
- CTDL_DIALOG=`which whiptail`
- export CTDL_DIALOG
-fi
-clear
-
-test_build_dir
-
-echo "Welcome to $SETUP"
-echo Running on: ${OSSTR}
-echo "We will perform the following actions:"
-echo ""
-echo "Installation:"
-echo "* Download/install supporting libraries (if needed)"
-echo "* Download/install Citadel (if needed)"
-echo "* Download/install WebCit (if needed)"
-echo ""
-echo "Configuration:"
-echo "* Configure Citadel"
-echo "* Configure WebCit"
-echo ""
-echo -n "Perform the above installation steps now? "
-if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
-
- yesno=yes
-else
- read yesno </dev/tty
-fi
-
-if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
- exit 2
-fi
-
-
-FILENAME=gpl.txt ; download_this
-cat $FILENAME
-echo ""
-echo "Do you accept the terms of this license?"
-echo "If you do not accept the General Public License, Easy Install will exit."
-echo -n "Enter Y or Yes to accept: "
-if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
- yesno=yes
-else
- read yesno </dev/tty
-fi
-
-if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
- exit 2
-fi
-
-echo
-if [ -f $CITADEL/citadel.config ]
-then
- IS_UPGRADE=yes
- echo "* Upgrading your existing Citadel installation."
-else
- IS_UPGRADE=no
- echo "* This is a NEW Citadel installation."
-fi
-
-if [ x$IS_UPGRADE = xyes ]
-then
- echo
- echo "This appears to be an upgrade of an existing Citadel installation."
- echo -n "Have you performed a FULL BACKUP of your programs and data? "
- if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
- yesno=yes
- else
- read yesno </dev/tty
- fi
-
- if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
- echo
- echo "citadel.org does not provide emergency support for sites"
- echo "which broke irrecoverably during a failed upgrade."
- echo "Easy Install will now exit."
- exit 2
- fi
-fi
-
-clear
-
-echo ""
-echo "Installation will now begin."
-echo "Command output will not be sent to the terminal."
-echo "To view progress, see the $LOG file."
-echo ""
-
-# 3. Do the installation
-
-install_prerequisites
-install_sources
-
-# 4. Do post-installation setup
-
-if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
- echo skipping config
-else
- do_config
-fi
-rm -fr $BUILD
-
-##### END main #####
-
-
+++ /dev/null
-export VSERVER_ROOT=/var/lib/vservers/
-export CIT_APACHE_DIR=/home/debiancitadel/
-export APACHE_ROOT=${VSERVER_ROOT}/apache/${CIT_APACHE_DIR}
-export TARGETS=/home/citbuild/targets
-export CHECKOUT_DIR=/home/checkout/
-export CONTRIB_DIR=/home/contrib/
-
-# retrieve the debian sources.
-# $1: the VSERVER_BASE
-# $2: the inner Directory, aka CHECKOUT_DIR
-# $3: the Program Component.
-GetSource()
-{
- cd ${VSERVER_ROOT}/$1/${2}; apt-get source $3
-}
-
-# compile the sources of one component.
-# $1: the VSERVER_BASE
-# $2: the inner Directory, aka CHECKOUT_DIR
-# $3: the Program Component.
-BuildSource ()
-{
- chroot ${VSERVER_ROOT}/$1/ /bin/bash -c "cd ${2}/${3}*; fakeroot dpkg-buildpackage"
-}
-
-# Install a contrib library into the build system.
-# $1: the VSERVER_BASE
-# $2: the inner Directory, aka CHECKOUT_DIR
-# $3: the Program Component.
-InstallContrib ()
-{
- chroot ${VSERVER_ROOT}/$1/ /bin/bash -c "cd ${2}; dpkg -i ${3}*.deb"
-}
-
-
-# $1: the VSERVER_BASE
-# $2: the distro dir on the webserver
-UpperResults()
-{
- mv ${VSERVER_ROOT}/${1}/${CHECKOUT_DIR}/*.deb $APACHE_ROOT/public_html/$2/
- cp ${VSERVER_ROOT}/${1}/${CONTRIB_DIR}/*.deb $APACHE_ROOT/public_html/$2/
-}
-
-# $1: the VSERVER_BASE
-# $2: the inner Directory, aka CHECKOUT_DIR
-CleanBuild()
-{
- rm -rf ${VSERVER_ROOT}/$1/${2}/*
-}
-
-
-# $1: the distro dir on the webserver
-CleanApache()
-{
- rm -f $APACHE_ROOT/public_html/$1/*.deb
-}
-
-
-# Install a contrib library into the build system.
-# $1: the VSERVER_BASE
-UpgradeBuildTarget ()
-{
- chroot ${VSERVER_ROOT}/$1/ /bin/bash -c "apt-get update; apt-get upgrade"
-}
+++ /dev/null
-#!/bin/bash
-
-# This script updates your Easy Install repository from git.
-
-#export BRANCH=master
-#export BRANCH=811592051c9c28dfd815d8e36b4006a7b78d6d66
-export BRANCH=v8.24
-
-export BASE=`pwd`
-rm -vfr citadel 2>/dev/null
-/usr/bin/git clone git://git.citadel.org/appl/gitroot/citadel.git
-cd $BASE/citadel
-
-/usr/bin/git checkout $BRANCH
-
-for module in libcitadel citadel webcit textclient
-do
- echo bootstrap of $module starting
- cd $BASE/citadel/${module}
- ./bootstrap
- /usr/bin/git log -1 --pretty=%H . >../${module}-easyinstall.sum
- cd ..
- tar cvhzf ${module}-easyinstall.tar.gz \
- --exclude .git \
- --exclude "tests/testdata" \
- --exclude debian \
- ${module}
- mv -vf ${module}-easyinstall.tar.gz .. && mv -vf ${module}-easyinstall.sum ..
-done
-
-cd $BASE
-rm -vfr citadel
-
-echo Done.
+++ /dev/null
-#!/bin/bash
-source include.sh
-apt-get update
-WD=`pwd`
-# get everything built.
-for i in `cat $TARGETS`; do
- cd $WD
- DISTRO=`dirname $i`
- VSERVER_BASE=`basename $i`
- DISTVER=`basename $i |sed "s;CitadelBuild.;;"`
- DISTVER=`cd $APACHE_ROOT/public_html/$DISTRO/; ls -d ?$DISTVER `
- echo "****** upgrading $DISTRO ******"
-
- UpgradeBuildTarget $i
-
-
-done
+++ /dev/null
-<?PHP
-
-define('CITADEL_DEBUG_HTML', FALSE);
-
-if ($_SERVER["argc"] < 3)
- die("need at least two params Call me CreateUserFromData.php testuser opensesame.\n");
-
-
-$user = $_SERVER["argv"][1];
-$password = $_SERVER["argv"][1];
-echo "----------------------- Creating User $user -------------------\n";
-$vcardname = $user."/vcard.txt";
-if (! is_array(stat($vcardname)))
- die("\nCouldn't find vcard in $vcardname\n");
-
-$configname= $user."/config.txt";
-if (!is_array(stat($configname)))
- die("\nCouldn't find users config in $configname\n");
-
-
-$vcardfh = fopen($vcardname, "r");
-$vcard = fread($vcardfh, filesize($vcardname));
-fclose($vcardfh);
-
-$configfh = fopen($configname, "r");
-$config = fread($configfh, filesize($configname));
-fclose($configfh);
-
-
-include "ctdlsession.php";
-include "ctdlprotocol.php";
-include "ctdlelements.php";
-
-//define(CITADEL_DEBUG_HTML, FALSE);
-establish_citadel_session();
-create_new_user($user, $password);
-
-ctdl_goto("My Citadel Config");
-list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
-
-$Webcit_Preferences = array();
-$Webcit_PrefMsgid = 0;
-if ($num_msgs > 0) foreach ($msgs as $msgnum) {
- print_r($msgnum);
-
- // Fetch the message from the server
- list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
-
- // Bail out gracefully if the message isn't there.
- if (!$ok) {
- echo "Error: " . $response . "\n";
- return false;
- }
- if (isset($fields['part']))
- {
- $parts = explode('|', $fields['part']);
- print_r($parts);
- if ($parts[4]=="text/x-vcard")
- list($size, $OldVcard) = download_attachment($msgnum, $result[2]);
- else
- ctdl_dele($msgnum);
- }
- else if ($fields['subj'] == "__ WebCit Preferences __")
- {
- $Webcit_PrefMsgid = $msgnum;
- $Webcit_Preferences = $fields;
- }
-}
-
-"begin:vcard
-n:Surename;CName;mitte;Mrs;IV
-title:master
-fn:CName Surename
-org:citadel.org
-adr:blarg;Road To nowhere ;10;Metropolis;NRW;12345;Country
-tel;home:888888888
-tel;work:99999999999
-email;internet:user@samplecitadel.org
-email;internet:me@samplecitadel.org
-email;internet:myself@samplecitadel.org
-email;internet:i@samplecitadel.org
-FBURL;PREF:http://samplecitadel.org/Cname_Lastname.vfb
-UID:Citadel vCard: personal card for Cname Lastname at samplecitadel.org
-end:vcard
-";
-$entarray=array();
-$entarray['post']=1;
-$entarray['format_type']=FMT_RFC822;
-enter_message_0($entarray, "text/x-vcard; charset=UTF-8", $vcard);
-
-
-$Webcit_Preferences=$config;
-"
-iconbar|ib_displayas=0,ib_logo=0,ib_summary=1,ib_inbox=1,ib_calendar=1,ib_contacts=1,ib_notes=1,ib
-_tasks=1,ib_rooms=1,ib_users=2,ib_chat=1,ib_advanced=1,ib_logoff=0,ib_citadel=1
-roomlistview|rooms
-emptyfloors|yes
-weekstart|0
-use_sig|no
-startpage|dotskip&room=_BASEROOM_
-signature|
-daystart|8
-floordiv_expanded|
-current_iconbar|0
-calhourformat|24
-dayend|17
-";
-
-if ($Webcit_PrefMsgid != '0')
-{
- ctdl_dele($Webcit_PrefMsgid);
-
-}
-$entarray=array();
-$entarray['post']=1;
-$entarray['format_type']=FMT_FIXED;
-$entarray['subject'] = "__ WebCit Preferences __";
-$entarray['anon_flag'] = '0';
-enter_message_0($entarray,
- "",
- "somevar|somevalue\r\n".$Webcit_Preferences);
-
-ctdl_end_session();
-
-?>
\ No newline at end of file
+++ /dev/null
-
-This is a simple framework for accessing the services of a Citadel server
-using PHP. It is not feature complete, and it is COMPLETELY UNSUPPORTED.
-
-Basically this is just a big pile of code to do with as you please. If
-you make improvements to it, we would be happy to accept patches.
-
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-15">
- <TITLE></TITLE>
- <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.0.3 (Linux)">
- <META NAME="CREATED" CONTENT="20031103;22165400">
- <META NAME="CHANGED" CONTENT="20031103;22264800">
- <STYLE>
- <!--
- @page { size: 21.59cm 27.94cm; margin-left: 3.18cm; margin-right: 3.18cm; margin-top: 2.54cm; margin-bottom: 2.54cm }
- P { margin-bottom: 0.21cm }
- -->
- </STYLE>
-</HEAD>
-<BODY LANG="en-US">
-<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT FACE="Sans-serif">Citadel/UX
-Web Framework for PHP</FONT></P>
-<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT FACE="Sans-serif"><I>something
-resembling documentation</I></FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal"><BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal"><FONT FACE="Sans-serif"><U>Global
-variables</U></FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">You can count on these being available:</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_nodename"] –
-Short nodename of the Citadel server.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_humannode"] –
-Human-readable name of the site.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_fqdn"] –
-Fully-qualified domain name of the Citadel server.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_software"] –
-The server software (e.g. Citadel/UX 9.99)</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_city"] –
-Geographic location of the Citadel server.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["serv_sysadmin"] –
-Name of the system administrator.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["ctdlsession"] –
-Name of the session ID. Not very useful.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["username"] – Name
-of the user currently logged in.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">$_SESSION["password"] –
-Current user's password. Don't use this.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal"><FONT FACE="Sans-serif"><U>Session
-stuff</U></FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm"><BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">Upon establishment of a new PHP session, a
-copy of “sessionproxy.php” will be spawned. This is a
-session proxy which maintains a connection to the Citadel server. It
-will time out after 15 minutes if no additional connections are made.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">Only the login.php, do_login.php, and
-logout.php pages may be displayed when there is no user logged in.
-Any attempt to load another page without logging in will
-automatically be redirected to login.php.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">When a successful login is completed,
-welcome.php will be loaded.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">To end the session, simply link to
-logout.php. There is code on that page to end the session and shut
-everything down.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal"><FONT FACE="Sans-serif"><U>Protocol
-library</U></FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">ctdl_iden() </FONT>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">Called without any arguments. This just
-identifies our client to the Citadel server. This is called by
-ctdlsession.php so you probably don't need to use it.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">ctdl_get_server_info()</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">Also called by ctdlsession.php, this loads up
-most of the global variables listed above.</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">login_existing_user($user, $pass)</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm"><SPAN STYLE="text-decoration: none"><SPAN STYLE="font-style: normal"><FONT FACE="Sans-serif">create_new_user($user,
-$pass)</FONT></SPAN></SPAN></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">ctdl_mesg($banner_name)</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<FONT FACE="Sans-serif">ctdl_rwho()</FONT></P>
-<P ALIGN=LEFT STYLE="margin-bottom: 0cm; font-style: normal; text-decoration: none">
-<BR>
-</P>
-</BODY>
-</HTML>
\ No newline at end of file
+++ /dev/null
-<?PHP
-
-// Please override these defaults in config_ctdlclient_local.php, not here.
-
-#do you want to see the server conversation for exploring the protocol?
-define('CITADEL_DEBUG_PROXY', FALSE);
-#switch this if you're using php5
-define('SOCKET_PREFIX', "unix://");
-#define('SOCKET_PREFIX', "");
-include "config_ctdlclient_local.php";
-
-// Examples:
-//
-// On the same host:
-// unix:///var/run/citadel/citadel.sock
-//
-// On a different host (or via loopback):
-// tcp://citserver.example.com
-// tcp://127.0.0.1
-
-if (!defined('CITADEL_HOSTNAME')) {
- define('CITADEL_HOSTNAME',"tcp://127.0.0.1");
-}
-
-// make it 0 to use unix domain sockets
-if (!defined('CITADEL_TCP_PORTNO')) {
- define('CITADEL_TCP_PORTNO','504');
-}
-
-// do you want to see the server conversation for exploring the protocol?
-if (!defined('CITADEL_DEBUG_CITPROTO')) {
- define('CITADEL_DEBUG_CITPROTO',0);
-}
-if (!defined('CITADEL_DEBUG_PROXY')) {
- define('CITADEL_DEBUG_PROXY', FALSE);
-}
-
-if (!defined('CITADEL_DEBUG_HTML')) {
- define('CITADEL_DEBUG_HTML', FALSE);
-}
-?>
+++ /dev/null
-<?PHP
-
-// $Id$
-//
-// Translates Citadel protocol data to insertable HTML snippets. You can
-// use these directly, or you can bypass them completely.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
-
-//
-// Fetch and display a message.
-//
-function display_message($msgnum) {
-
- echo '<TABLE border=0 width=100% bgcolor="#DDDDDD"><TR><TD>' ;
- // Fetch the message from the server
- list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
-
- // Bail out gracefully if the message isn't there.
- if (!$ok) {
- echo "Error: " . htmlspecialchars($response) . "<BR>" ;
- echo '</TD></TR></TABLE>' ;
- return;
- }
-
- // Begin header
- echo "<B><I>" ;
- echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
- echo " from " . htmlspecialchars($fields["from"]) ;
-
- if (isset($fields["rfca"]) && strlen($fields["rfca"]) > 0) {
- echo " <" . htmlspecialchars($fields["rfca"]) . ">" ;
- }
- else if ( (strlen($fields["node"]) > 0)
- && (strcasecmp($fields["node"], $_SESSION["serv_nodename"])) ) {
- echo " @" . htmlspecialchars($fields["node"]) ;
- if (strlen($fields["hnod"]) > 0) {
- echo " (" . htmlspecialchars($fields["hnod"]) . ")" ;
- }
- }
-
- if (isset($fields["rcpt"]) && strlen($fields["rcpt"]) > 0) {
- echo " to " . htmlspecialchars($fields["rcpt"]) ;
- }
- echo "</I></B><BR>\n" ;
-
- // Subject
- if (strlen($fields["subj"]) > 0) {
- echo"<i>Subject: " .
- htmlspecialchars($fields["subj"]) .
- "</i><BR>\n" ;
- }
-
- // Do message text
- if ($fields['formatet_text'] != "")
- echo $fields['formatet_text'] . "<BR>";
- else
- echo $fields["text"] . "<BR>";
-
- echo '</TD></TR></TABLE><BR>' ;
-}
-
-function get_message_partlist($msgnum) {
-
- // Fetch the message from the server
- list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
-
- // Bail out gracefully if the message isn't there.
- if (!$ok) {
- echo "Error: " . htmlspecialchars($response) . "<BR>" ;
- return false;
- }
- if (isset($fields['part']))
- {
- $parts = explode('|', $fields['part']);
- print_r($parts);
- return $parts;
-
- }
- return false;
-}
-
-
-
-?>
+++ /dev/null
-<?PHP
-
-// $Id$
-//
-// Header and footer code to be included on every page. Not only does it
-// contain some common markup, but it also calls some code glue that holds
-// the session together.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
-
-// All of the back-end magic gets included from here. The rest of the
-// pages in the system then only have to include ctdlheader.php (since it
-// is required) and they get the others automatically.
-//
-include "ctdlsession.php";
-include "ctdlprotocol.php";
-include "ctdlelements.php";
-
-function bbs_page_header() {
-
- // Make sure we're connected to Citadel. Do not remove this!!
- establish_citadel_session();
-
- echo <<<LITERAL
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link rel="stylesheet" href="sitestyle.css" type="text/css" />
- <meta name="Description" content="Citadel BBS">
- <meta name="Keywords" content="citadel,bbs">
- <meta name="MSSmartTagsPreventParsing" content="TRUE">
- <title>
-LITERAL;
-
- if ($_SESSION["serv_humannode"]) {
- echo $_SESSION["serv_humannode"] ;
- }
- else {
- echo "BBS powered by Citadel" ;
- }
-
- echo <<<LITERAL
-</title>
-</head>
-
-<body
- text="#000000"
- bgcolor="#FFFFFF"
- link="#0000FF"
- vlink="#990066"
- alink="#DD0000"
->
-
-
-LITERAL;
-
- echo '<div id="Header">';
- echo '<TABLE BORDER=0 WIDTH=100%>';
- echo '<TR>';
- echo '<TD>' . $_SESSION["serv_humannode"] . '</TD>' ;
- echo '<TD>' . (isset($_SESSION["username"]))?'':$_SESSION["username"] . '</TD>' ;
- echo '<TD>' . (isset($_SESSION["room"]))?'':$_SESSION["room"] . '</TD>' ;
- echo '<TD ALIGN=RIGHT><A HREF="logout.php">Log out</A></TD>' ;
- echo '</TR></TABLE>';
- echo '</div>';
-
- // Temporary menu
- if (isset($_SESSION["logged_in"])) {
- echo '<div id="Menu">' .
- '<a href="listrooms.php">' .
- 'room list</A><BR>' .
- '<a href="readmsgs.php?mode=all&count=0">' .
- 'Read all</a><BR>' .
- '<a href="readmsgs.php?mode=new&count=0">' .
- 'Read new</a><BR>' .
- '<a href="display_enter.php">' .
- 'Enter msg</a><BR>' .
- '<a href="who.php">' .
- 'Who is online?</a><BR>' .
- '<a href="myinfo.php">' .
- 'My information</a><BR>' .
- '<A HREF="logout.php">' .
- 'Log out</A>' .
- '</div>' ;
- echo '<div id="demolinks">' .
- '<a href="testcommand.php">' .
- 'demolist</A><BR>' .
- '<a href="readmsgs.php?mode=all&count=0">' .
- 'Read all</a><BR>' .
- '<a href="readmsgs.php?mode=new&count=0">' .
- 'Read new</a><BR>' .
- '<a href="display_enter.php">' .
- 'Enter msg</a><BR>' .
- '<a href="who.php">' .
- 'Who is online?</a><BR>' .
- '<A HREF="logout.php">' .
- 'Log out</A>' .
- '</div>' ;
- }
-
- echo '<div id="Content">' ;
-
-}
-
-
-function bbs_page_footer() {
- //echo "<HR>";
- //echo "Powered by Citadel. And a few cups of coffee.<BR>\n";
-
- echo '</div>' ;
- echo '</BODY></HTML>';
-}
-
-
-?>
+++ /dev/null
-<?PHP
-// $Id$
-//
-// Implements various Citadel server commands.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// One program is released under the terms of the GNU General Public License.
-include "config_ctdlclient.php";
-
-define('VIEW_BBS' ,'0'); /* Bulletin board view */
-define('VIEW_MAILBOX' ,'1'); /* Mailbox summary */
-define('VIEW_ADDRESSBOOK' ,'2'); /* Address book view */
-define('VIEW_CALENDAR' ,'3'); /* Calendar view */
-define('VIEW_TASKS' ,'4'); /* Tasks view */
-define('VIEW_NOTES' ,'5'); /* Notes view */
-define("FMT_CITADEL", 0);
-define("FMT_FIXED", 1);
-define("FMT_RFC822", 4);
-
-function debugLog($string)
-{
- print ($string);
-}
-
-function dbgprintf_wrapin($string, $html)
-{
- if (!CITADEL_DEBUG_HTML){
- if ($html)
- debugLog("<< ".$string."\n");
- }
- else
- printf($string);
-}
-function dbgprintf_wrapout($string, $html)
-{
- if (!CITADEL_DEBUG_HTML){
- if ($html)
- debugLog("<< ".$string."\n");
- }
- else
- printf($string);
-
-}
-//--------------------------------------------------------------------------------
-// internal functions for server communication
-//--------------------------------------------------------------------------------
-//
-// serv_gets() -- generic function to read one line of text from the server
-//
-function serv_gets($readblock=FALSE) {
- global $clientsocket;
-
- $buf = fgets($clientsocket, 4096); // Read line
- $buf = substr($buf, 0, (strlen($buf)-1) ); // strip trailing LF
- if (CITADEL_DEBUG_CITPROTO == 1) {
- if (!$readblock) dbgprintf_wrapin("<div class='ctdldbgRead'>\n", false);
- dbgprintf_wrapin($buf, true);
- if (!$readblock) dbgprintf_wrapin ("\n</div>\n", false);
- else dbgprintf_wrapin ("<br>\n", false);
- }
- return $buf;
-}
-
-//
-// serv_get_n() -- generic function to read a binary blob from the server
-//
-function serv_get_n($nBytes) {
- global $clientsocket;
-
- if (CITADEL_DEBUG_CITPROTO == 1) {
- dbgprintf_wrapin ("<div class='ctdldbgRead'>\n", false);
- dbgprintf_wrapin("reading ".$nBytes." bytes from server\n", true);
- dbgprintf_wrapin ("</div>\n", false);
- }
- $buf = fread($clientsocket, $nBytes);
- if (CITADEL_DEBUG_CITPROTO == 1) {
- if (!$buf) dbgprintf_wrapin ("<div class='ctdldbgRead'>\n", false);
- dbgprintf_wrapin($buf, true);
- if (!$buf) dbgprintf_wrapin ("</div>\n", false);
- else dbgprintf_wrapin ("<br>\n", false);
- }
- return $buf;
-}
-
-//
-// serv_puts() -- generic function to write one line of text to the server
-//
-function serv_puts($buf) {
- global $clientsocket;
-
- fwrite($clientsocket, $buf . "\n", (strlen($buf)+1) );
- fflush($clientsocket);
- if (CITADEL_DEBUG_CITPROTO == 1) {
- dbgprintf_wrapin("<div class='ctdldbgWrite'>", false);
- dbgprintf_wrapin($buf, true);
- dbgprintf_wrapin("</div>\n", false);
- }
-}
-
-
-function read_array() {
- $nLines = 0;
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout("<div class='ctdldbgRead'>\n", false);
- $buf = serv_gets(TRUE);
- $ret = array();
- while (strcasecmp($buf, "000")){
- array_push($ret, $buf);
- $buf = serv_gets(TRUE);
- $nLines++;
- }
- if (CITADEL_DEBUG_CITPROTO == 1){
- dbgprintf_wrapout("read ".$nLines." lines from the server.\n", true);
- dbgprintf_wrapout ("</div>\n", false);
- }
- return $ret;
-}
-
-function read_binary() {
- $nLines = 0;
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout ("<div class='ctdldbgRead'>\n", false);
- $buf = serv_gets(TRUE);
-
- if (CITADEL_DEBUG_CITPROTO == 1){
- dbgprintf_wrapout("status line from the server\n", true);
- }
-
- $statusline = explode(" ", $buf);
-
- if ($statusline[0] == 600)
- {
- $buf = serv_get_n($statusline[1]);
-
- }
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout ("</div>\n", false);
- return array($statusline, $buf);
-}
-
-
-
-//
-// text_to_server() -- sends a block of text to the server. Assumes that
-// the server just sent back a SEND_LISTING response code
-// and is now expecting a 000-terminated series of lines.
-// Set 'convert_to_html' to TRUE to convert the block of
-// text to HTML along the way.
-//
-function text_to_server($thetext, $convert_to_html) {
-
- // HTML mode
- if ($convert_to_html) {
-
- // Strip CR's; we only want the LF's
- $thetext = trim($thetext, "\r");
-
- // Replace hard line breaks with <BR>'s
- $thetext = str_replace("\n", "<BR>\n", $thetext);
-
- }
-
- // Either mode ... send it to the server now
- $one_line = strtok($thetext, "\n");
- while ($one_line !== FALSE) {
- $one_line = trim($one_line, "\n\r");
- if ($one_line == "000") $one_line = "-000" ;
- serv_puts($one_line);
- $one_line = strtok("\n");
- }
-
- serv_puts("000"); // Tell the server we're done...
-
- serv_puts("ECHO echo test."); // FIXME
- echo "Echo test: " . serv_gets() . "<BR>\n" ;
-
-}
-
-//--------------------------------------------------------------------------------
-// protocol commands
-//--------------------------------------------------------------------------------
-
-
-//
-// Identify ourselves to the Citadel server (do one once after connection)
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#iden.identify.the.client.software */
-//
-function ctdl_iden($client_info) {
- global $clientsocket;
-
- if (count($client_info) != 5)
- die("ctdl_iden takes 5 arguments!");
- // Identify client and hostname
- serv_puts("IDEN ".implode('|', $client_info));
- $buf = serv_gets();
-}
-
-function ctdl_MessageFormatsPrefered($formatlist){
- // Also express our message format preferences
- serv_puts("MSGP ".implode("|", $formatlist));
- $buf = serv_gets();
-}
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#noop.no.operation */
-function ctdl_noop(){
- // Also express our message format preferences
- serv_puts("NOOP ");
- $buf = serv_gets();
-}
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#quit.quit */
-function ctdl_quit(){
- // Also express our message format preferences
- serv_puts("QUIT ");
- $buf = serv_gets();
-}
-
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#mesg.read.system.message */
-function ctdl_gtls(){
- // Also express our message format preferences
- serv_puts("GTLS ");
- $buf = serv_gets();
- return $buf;
-}
-
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#qnop.quiet.no.operation */
-/* this seems to be dangerous. ask IG
-function ctdl_qnoop(){
- // Also express our message format preferences
- serv_puts("QNOP ");
-}
-*/
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#echo.echo.something */
-function ctdl_doecho($echotext){
- // Also express our message format preferences
- serv_puts("ECHO ".$echotext);
- $buf = serv_gets();
-
-}
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#time.get.server.local.time */
-/* TODO: what are the other two params? doku is incomplete here. */
-function ctdl_time(){
- // Also express our message format preferences
- serv_puts("TIME");
- $buf = serv_gets();
-
-}
-
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#qdir.query.global.directory */
-function ctdl_qdir($who){
- // Also express our message format preferences
- serv_puts("QDIR ".$who);
- $buf = serv_gets();
- return array((substr($buf, 0, 1) == "2"), $buf);
-}
-
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#auto.autocompletion.of.email.addresses */
-function ctdl_auto($who){
- // Also express our message format preferences
- serv_puts("AUTO ".$who);
- $buf = serv_gets();
- if (substr($buf, 0, 1) == "1") {
- $reply = read_array();
- if (count($reply) == 0)
- return false;
- return $reply;
- }
- else
- return false;
-}
-
-
-
-//
-// login_existing_user() -- attempt to login using a supplied username/password
-// Returns an array with two variables:
-// 0. TRUE or FALSE to determine success or failure
-// 1. String error message (if relevant)
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#user.send.user.name */
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#pass.send.password */
-
-//
-function login_existing_user($user, $pass) {
- global $clientsocket;
-
- serv_puts("USER " . $user);
- $resp = serv_gets();
-
- if (substr($resp, 0, 3) == 541) // we're already logged in.
- return array(TRUE, substr($resp, 4));
- if (substr($resp, 0, 1) != "3") {
-
- return array(FALSE, substr($resp, 4));
- }
-
- serv_puts("PASS " . $pass);
- $resp = serv_gets();
- if (substr($resp, 0, 1) != "2") {
- return array(FALSE, substr($resp, 4));
- }
-
- $_SESSION["username"] = $user;
- $_SESSION["password"] = $pass;
- become_logged_in(substr($resp, 4));
-
- return array(TRUE, "Login successful. Have fun.");
-}
-
-
-//
-// create_new_user() -- attempt to create a new user
-// using a supplied username/password
-// Returns an array with two variables:
-// 0. TRUE or FALSE to determine success or failure
-// 1. String error message (if relevant)
-//
-function create_new_user($user, $pass) {
- global $clientsocket;
-
- serv_puts("NEWU " . $user);
- $resp = serv_gets();
- if (substr($resp, 0, 1) != "2") {
- return array(FALSE, substr($resp, 4));
- }
-
- serv_puts("SETP " . $pass);
- $resp = serv_gets();
- if (substr($resp, 0, 1) != "2") {
- return array(FALSE, substr($resp, 4));
- }
-
- $_SESSION["username"] = $user;
- $_SESSION["password"] = $pass;
- become_logged_in(substr($resp, 4));
-
- return array(TRUE, "Login successful. Have fun.");
-}
-
-
-//
-// Code common to both existing-user and new-user logins
-//
-function become_logged_in($server_parms) {
- $_SESSION["logged_in"] = 1;
-
- $tokens = explode("|", $server_parms);
-
- $oneline["username"] = $tokens[0];
- $oneline["axlevel"] = $tokens[1];
- $oneline["calls"] = $tokens[2];
- $oneline["posts"] = $tokens[3];
- $oneline["userflags"] = $tokens[4];
- $oneline["usernum"] = $tokens[5];
- $oneline["lastcall"] = $tokens[6];
-
- ctdl_goto("_BASEROOM_");
-}
-
-
-
-//
-// Learn all sorts of interesting things about the Citadel server to
-// which we are connected.
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#info.get.server.info */
-//
-function ctdl_get_serv_info() {
- serv_puts("INFO");
- $reply = read_array();
- if ((count($reply) == 23) &&
- substr($reply[0], 0, 1) == "1") {
- $server_info=array();
- $server_info["serv_nodename"] = $reply[1];
- $server_info["serv_humannode"] = $reply[2];
- $server_info["serv_fqdn"] = $reply[3];
- $server_info["serv_software"] = $reply[4];
- $server_info["serv_city"] = $reply[6];
- $server_info["serv_sysadmin"] = $reply[7];
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("<pre>", false);
- dbgprintf_wrapout(print_r($server_info, true), true);
- dbgprintf_wrapout("</pre>", false);
- }
- return $server_info;
- }
- else
- {
- dbgprintf_wrapin ("didn't understand the reply to the INFO command".
- print_r($reply, TRUE), false);
-
- die ("CTDLPHP: didn't understand the reply to the INFO command");
- }
-}
-
-//
-// Learn all sorts of interesting things about the Citadel server to
-// which we are connected.
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#info.get.server.info */
-//
-function ctdl_get_registration_info() {
- serv_puts("GREG");
- $reply = read_array();
- dbgprintf_wrapout(print_r($reply, true), true);
-// die ("didn't understand the reply to the INFO command");
-
-}
-
-
-//
-// Display a system banner. (Returns completed HTML.)
-// (One is probably temporary because it outputs more or less finalized
-// markup. For now it's just usable.)
-//
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#mesg.read.system.message */
-function ctdl_mesg($msgname) {
- global $clientsocket;
-
- $msgtext = "<DIV ALIGN=CENTER>\n";
-
- serv_puts("MESG " . $msgname);
- $response = read_array();
-
- if (substr($response[0], 0, 1) == "1") {
- array_shift($response); // throw away the status code.
- $msgtext .= "<TT>" . implode( "</TT><BR>\n" ,$response);
- }
- else {
- $msgtext .= "<B><I>" . substr($response[0], 4) . "</I></B><BR>\n";
- }
-
- $msgtext .= "</DIV>\n";
- return($msgtext);
-}
-
-//
-// Delete a Message.
-// http://www.citadel.org/doku.php/documentation:appproto:room_indexes_and_messages#dele.delete.a.message
-
-function ctdl_dele($msgname) {
- global $clientsocket;
-
- $msgtext = "<DIV ALIGN=CENTER>\n";
-
- serv_puts("DELE " . $msgname);
- $response = serv_gets();
-
- if (substr($response[0], 0, 1) == "1") {
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#mesg.read.system.message */
-//// TODO: is this still supported?
-function ctdl_mrtg($what) {
- global $clientsocket;
-
- serv_puts("MRTG ".$what);
- $response = serv_gets();
-
- if (substr($response, 0, 1) != "1") {
- return array(0, NULL);
- }
-
- $responses = read_array();
- return $responses;
-}
-//
-// Fetch the list of users currently logged in.
-/* http://www.citadel.org/doku.php/documentation:appproto:connection#rwho.read.who.s.online */
-//
-function ctdl_rwho() {
- global $clientsocket;
-
- serv_puts("RWHO");
- $response = serv_gets();
-
- if (substr($response, 0, 1) != "1") {
- return array(0, NULL);
- }
-
- $all_lines = array();
- $num_lines = 0;
-
- $responses = read_array();
- foreach ($responses as $response) {
- $tokens = explode("|", $response);
- $oneline = array();
-
- $oneline["session"] = $tokens[0];
- $oneline["user"] = $tokens[1];
- $oneline["room"] = $tokens[2];
- $oneline["host"] = $tokens[3];
- $oneline["client"] = $tokens[4];
- $oneline["idlesince"] = $tokens[5];
- $oneline["lastcmd"] = $tokens[6];
- $oneline["flags"] = $tokens[7];
- $oneline["realname"] = $tokens[8];
- $oneline["realroom"] = $tokens[9];
- $oneline["realhostname"] = $tokens[10];
- $oneline["registered"] = $tokens[11];
-
- // IGnore the rest of the fields for now.
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("<pre>", false);
- dbgprintf_wrapout(print_r($oneline, true), true);
- dbgprintf_wrapout("</pre>", false);;
-
- }
-
-
- $num_lines = array_push($all_lines, $oneline);
- }
-
- return array($num_lines, $all_lines);
-
-}
-
-
-//
-// Goto a room.
-//
-function ctdl_goto($to_where) {
-
- serv_puts("GOTO " . $to_where);
- $response = serv_gets();
-
- $results = explode ("|", $response);
- $status_room = array_shift($results);
- $status = substr($status_room, 0, 3);
- if (substr($status, 0, 1) == "2") {
- $room = substr($status_room, 4);
- array_unshift($results, $room);
- $room_state=array(
- "state" => TRUE,
- "statereply" => $status,
- "roomname" => $results[ 0],
- "nunreadmsg" => $results[ 1],
- "nmessages" => $results[ 2],
- "rinfopresent" => $results[ 3],
- "flags" => $results[ 4],
- "msgidmax" => $results[ 5],
- "msgidreadmax" => $results[ 6],
- "ismailroom" => $results[ 7],
- "isroomaide" => $results[ 8],
- "nnewmessages" => $results[ 9],
- "floorid" => $results[10],
- "viewselected" => $results[11],
- "defaultview" => $results[12],
- "istrashcan" => $results[13]);
-
- $_SESSION["room"] = $room;
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("<pre>", false);
- dbgprintf_wrapout(print_r($room_state, true), true);
- dbgprintf_wrapout("</pre>", false);
-
- }
-
- return $room_state;
- }
-
- else {
- return array("state" => FALSE, "statereply" => $status);
- }
-
-}
-
-
-
-//
-// Fetch the list of known rooms.
-//
-function ctdl_knrooms() {
- global $clientsocket;
-
- serv_puts("LKRA");
- $response = serv_gets();
- if (substr($response, 0, 1) != "1") {
- return array(0, NULL);
- }
- $results = read_array();
- $all_lines = array();
- $num_lines = 0;
-
- foreach ($results as $result){
- $oneline = array();
- $tokens = explode("|",$result);
-
- $oneline["name"] = $tokens[0];
- $oneline["flags"] = $tokens[1];
- $oneline["floor"] = $tokens[2];
- $oneline["order"] = $tokens[3];
- $oneline["flags2"] = $tokens[4];
- $oneline["access"] = $tokens[5];
-
- if ($oneline["access"] & 8) {
- $oneline["hasnewmsgs"] = TRUE;
- }
- else {
- $oneline["hasnewmsgs"] = FALSE;
- }
-
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("<pre>", false);
- dbgprintf_wrapout(print_r($oneline, true), true);
- dbgprintf_wrapout("</pre>", false);
-
- }
- $num_lines = array_push($all_lines, $oneline);
- }
-
- return array($num_lines, $all_lines);
-
-}
-
-//
-// Fetch the list of known floors.
-//
-/* http://www.citadel.org/doku.php/documentation:appproto:rooms#lflr.list.all.known.floors */
-function ctdl_knfloors() {
- global $clientsocket;
-
- serv_puts("LFLR");
- $response = serv_gets();
- if (substr($response, 0, 1) != "1") {
- return array(0, NULL);
- }
-
- $results = read_array();
- $all_lines = array();
- $num_lines = 0;
-
- foreach ($results as $result){
- $oneline = array();
- $tokens = explode("|",$result);
-
- $oneline["id"] = $tokens[0];
- $oneline["name"] = $tokens[1];
- $oneline["nref"] = $tokens[2];
-
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("<pre>", false);
- dbgprintf_wrapout(print_r($oneline, true), true);
- dbgprintf_wrapout("</pre>", false);
- }
- $num_lines = array_push($all_lines, $oneline);
- }
-
- return array($num_lines, $all_lines);
-
-}
-
-/* http://www.citadel.org/doku.php/documentation:appproto:rooms#cflr.create.a.new.floor */
-
-//
-// Fetch the list of messages in one room.
-// Returns: count, response, message array
-//
-function ctdl_msgs($mode, $count) {
- global $clientsocket;
-
- serv_puts("MSGS " . $mode . "|" . $count);
- $responses = read_array();
- dbgprintf_wrapout(print_r($responses, true), false);
-
- $response = array_shift($responses);
-
- $num_msgs = count($responses);
- if (substr($response, 0, 1) != "1") {
- return array(0, substr($response, 4), NULL);
- }
-
- if (CITADEL_DEBUG_CITPROTO == 1)
- {
- dbgprintf_wrapout("found ".$num_msgs." messages.", true);
- }
- return array($num_msgs, $response, $responses);
-}
-
-
-// Load a message from the server.
-function ctdl_fetch_message($msgnum) {
- global $clientsocket;
-
- serv_puts("MSG4 " . $msgnum);
-
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout("<div class='ctdldbgRead'>", false);
- $response = serv_gets(TRUE);
-
- if (substr($response, 0, 1) != "1") {
- return array(FALSE, substr($response, 4), NULL);
- }
-
- $fields = array();
- while (strcmp($buf = serv_gets(TRUE), "000")) {
- if (substr($buf, 0, 4) == "text") {
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout("</div>\n<h3>Message Body Follows</h3><div class='ctdldbgRead'>", false);
- // We're in the text body. New loop here.
- $texts = ctdl_msg4_from_server();
- $fields["text"] = $texts[0];
- $fields["formated_text"]=$texts[1];
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout ("</div>", false);
- return array(TRUE, substr($response, 4), $fields);
- }
- else {
- $fields[substr($buf, 0, 4)] = substr($buf, 5);
- }
- }
-
- // Message terminated prematurely (no text body)
- return array(FALSE, substr($response, 4), $fields);
-}
-
-// Load a message from the server.
-function ctdl_fetch_message_rfc822($msgnum) {
- global $clientsocket;
-
- serv_puts("MSG2 " . $msgnum);
-
- if (CITADEL_DEBUG_CITPROTO == 1)
- dbgprintf_wrapout("<div class='ctdldbgRead'>", false);
- $response = serv_gets(TRUE);
-
- if (substr($response, 0, 1) != "1") {
- return array(FALSE, NULL);
- }
- $message = "";
- $buf="";
- while ($buf = serv_gets(TRUE)) {
-// dbgprintf_wrapout($buf, true);
- if ($buf=="000")
- {
- $message .= "\n.\n";
- break;
- }
- $message = $message . "\n" . $buf;
- $buf = "";
- }
-
-// dbgprintf_wrapout($message, true);
- // Message terminated prematurely (no text body)
- return array(TRUE, $message);
-}
-
-// Support function for ctdl_fetch_message(). This handles the text body
-// portion of the message, converting various formats to HTML as
-// appropriate.
-function ctdl_msg4_from_server() {
-
- $txt = "";
- $modified_txt = "";
- $msgformat = "text/plain";
- $in_body = FALSE;
-
- $previous_line = "";
- while (strcmp($buf = serv_gets(TRUE), "000")) {
- if ($in_body == FALSE) {
- if (strlen($buf) == 0) {
- $in_body = TRUE;
- }
- else {
- if (!strncasecmp($buf, "content-type: ", 14)) {
- $msgformat = substr($buf, 14);
- }
- }
- }
- else {
- if (!strcasecmp($msgformat, "text/html")) {
- $txt .= $buf;
- }
- else if (!strcasecmp($msgformat, "text/plain")) {
- $txt .= "\r\n".$buf;
- $modified_txt .= "<TT>" . htmlspecialchars($buf) . "</TT><BR>\n" ;
-
- }
- else if (!strcasecmp($msgformat, "text/x-citadel-variformat")) {
- if (substr($previous_line, 0, 1) == " ") {
- $txt .= "<BR>\n" ;
- }
- $txt .= htmlspecialchars($buf);
- }
- else {
- $txt .= htmlspecialchars($buf);
- }
- $previous_line = $buf;
- }
- }
-
- return(array($txt, $modified_txt));
-}
-
-
-
-function download_attachment($msgnum, $attindex)
-{
- $command = "DLAT ".$msgnum."|".$attindex;
- serv_puts($command);
- $reply = read_binary();
- return $reply;
-
-}
-
-
-function enter_message_0($msgHdr, $contentType, $data)
-{
- $send = array();
-
- if (isset($msgHdr['newusermail']))
- array_unshift($send, $msgHdr['newusermail']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['supplied_euid']))
- array_unshift($send, $msgHdr['supplied_euid']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['bcc']))
- array_unshift($send, $msgHdr['bcc']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['cc']))
- array_unshift($send, $msgHdr['cc']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['do_confirm']))
- array_unshift($send, $msgHdr['do_confirm']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['newusername']))
- array_unshift($send, $msgHdr['newusername']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['subject']))
- array_unshift($send, $msgHdr['subject']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['format_type']))
- array_unshift($send, $msgHdr['format_type']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['anon_flag']))
- array_unshift($send, $msgHdr['anon_flag']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['recp']))
- array_unshift($send, $msgHdr['recp']);
- else
- array_unshift($send, "");
-
- if (isset($msgHdr['post']))
- array_unshift($send, $msgHdr['post']);
- else
- array_unshift($send, "");
-
- $params = implode('|', $send);
- serv_puts("ENT0 ".$params);
-
- $reply=serv_gets();
- if (substr($reply, 0, 1) != 4)
- return array(false, array(), array());
- serv_puts("Content-type: ".$contentType);
- serv_puts("");
- serv_puts($data."\r\n");
- serv_puts("000");
-}
-
-
-?>
+++ /dev/null
-<?PHP
-// $Id$
-//
-// This gets called from within the header functions. It establishes or
-// connects to a PHP session, and then connects to Citadel if necessary.
-//
-// Web designers: please make changes in ctdlheader.php, not here.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
-
-function establish_citadel_session() {
-
- global $session, $clientsocket;
-
- if (strcmp('4.3.0', phpversion()) > 0) {
- die("This program requires PHP 4.3.0 or newer.");
- }
-
-
- session_start();
-
- if (isset($_SESSION["ctdlsession"])) {
- $session = $_SESSION["ctdlsession"];
- }
- else {
- $session = "CtdlSession." . time() . rand(1000,9999) ;
- $_SESSION["ctdlsession"] = $session;
- }
-
- // See if there's a Citadel connection proxy open for this session.
- // The name of the socket is identical to the name of the
- // session, and it's found in the /tmp directory.
-
- $sockname = "/tmp/" . $session . ".socket" ;
- $errno = 0;
- $errstr = "";
- if (is_array(stat($sockname)))
- $clientsocket = fsockopen(SOCKET_PREFIX.$sockname, 0, $errno, $errstr, 5);
- else
- $clientsocket = false;
-//// TODO: if we get connection refused...
- echo "$socketname - $errno - $errstr";
-
- if (!$clientsocket) {
- // It ain't there, dude. Open up the proxy. (C version)
- //$cmd = "./sessionproxy " . $sockname ;
- //exec($cmd);
-
- // It ain't there, dude. Open up the proxy. (PHP version)
- if (CITADEL_DEBUG_PROXY){
- $stdout = '>>/tmp/sessionproxyout.txt ';
- }
- else{
- $stdout = '>/dev/null ';
- }
-
- $cmd = "./sessionproxy.php " . $sockname .
- " </dev/null ".$stdout."2>&1 " .
- " 3>&1 4>&1 5>&1 6>&1 7>&1 8>&1 & " ;
- exec($cmd);
- sleep(1);
-
- // Keep attempting connections 10 times per second up to 100 times
- $attempts = 0;
- while (!$clientsocket) {
- usleep(100);
- if (is_array(stat($sockname)))
- $clientsocket = fsockopen(SOCKET_PREFIX.$sockname, 0, $errno, $errstr, 5);
- else
- $clientsocket = false;
- $attempts += 1;
- if ($attempts > 100) {
- echo "ERROR: unable to start connection proxy. ";
- echo "Please contact your system administrator.<BR>\n";
- flush();
- exit(1);
- }
- }
-
- // At this point we have a good connection to Citadel.
- $identity=array(
- "DevelNr" => '0',
- "ClientID" => '8',
- "VersionNumber" => '001',
- "ClientInfoString" => 'PHP web client|',
- "Remote Address" => $_SERVER['REMOTE_ADDR'] );
-
- ctdl_iden($identity); // Identify client
- ctdl_MessageFormatsPrefered(array("text/html","text/plain"));
- if (isset($_SESSION["username"])) {
- login_existing_user(
- $_SESSION["username"],
- $_SESSION["password"]
- );
- }
-
- if (isset($_SESSION["room"])) {
- ctdl_goto($_SESSION["room"]);
- }
- else {
- ctdl_goto("_BASEROOM_");
- }
- }
-
- if (!isset($_SESSION["serv_humannode"])) {
- $server_info = ctdl_get_serv_info();
- // print_r($server_info);
- $keys = array_keys($server_info);
- foreach ($keys as $key)
- $_SESSION[$key] = $server_info[$key];
- }
-
- // If the user is trying to call up any page other than
- // login.php logout.php do_login.php,
- // and the session is not logged in, redirect to login.php
- //
- if (isset($_SESSION["logged_in"]) && ($_SESSION["logged_in"] != 1)) {
- $filename = basename(getenv('SCRIPT_NAME'));
- if ( (strcmp($filename, "login.php"))
- && (strcmp($filename, "logout.php"))
- && (strcmp($filename, "do_login.php"))
- ) {
- header("Location: login.php");
- exit(0);
- }
- }
-
-
-}
-
-
-//
-// Clear out both our Citadel session and our PHP session. We're done.
-//
-function ctdl_end_session() {
- global $clientsocket, $session;
-
- // Tell the Citadel server to terminate our connection.
- // (The extra newlines force it to see that the Citadel session
- // ended, and the proxy will quit.)
- //
- fwrite($clientsocket, "QUIT\n\n\n\n\n\n\n\n\n\n\n");
- $response = fgets($clientsocket, 4096); // IGnore response
- fclose($clientsocket);
- unset($clientsocket);
-
- // Now clear our PHP session.
- $_SESSION = array();
- session_write_close();
-}
-
-?>
+++ /dev/null
-<?PHP
-
- include "ctdlheader.php";
- bbs_page_header();
-
- serv_puts("ENT0 ");
- $response = serv_gets();
-
- if (substr($response, 0, 1) != '2') {
- echo htmlspecialchars(substr($response, 3)) . '<br>' ;
- }
- else {
- echo '<center>' .
- '<form ENCTYPE="multipart/form-data" ' .
- 'METHOD="POST" ACTION="postmsg.php" NAME="postmsg">' .
- '<input TYPE="submit" NAME="sc" VALUE="Save message">'.
- '<input TYPE="submit" NAME="sc" VALUE="Cancel">' .
- '<br>' .
- '<textarea NAME="msgtext" wrap=soft' .
- ' ROWS=25 COLS=80 WIDTH=80></textarea><br> '.
- '</form>' .
- '</center> '
- ;
- }
-
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
-
-// $Id$
-//
-// The login form displayed in login.php submits to this page.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
-include "ctdlheader.php";
-
-bbs_page_header();
-
-if ($_REQUEST["action"] == "Login") {
- list($retval, $msg) =
- login_existing_user($_REQUEST["user"], $_REQUEST["pass"]);
-}
-else if ($_REQUEST["action"] == "New User") {
- list($retval, $msg) =
- create_new_user($_REQUEST["user"], $_REQUEST["pass"]);
-}
-else {
- echo "uuuuhhhhhhhhh....<BR>\n" ;
-}
-
-
-if ($retval == FALSE) {
- echo "<DIV ALIGN=CENTER>", $msg, "<BR><BR>\n" ;
- echo "<a href=\"login.php\">Try again</A><BR>\n" ;
- echo "<a href=\"logout.php\">Log out</A><BR>\n" ;
-}
-else {
- echo "<A HREF=\"welcome.php\">Logged in. ";
- echo "Click to continue if your browser does not refresh.</a><BR>";
- echo "<meta http-equiv=\"refresh\" content=\"15;url=welcome.php\">\n";
-}
-
-bbs_page_footer();
-
-?>
-
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-
- ctdl_goto($_REQUEST["towhere"]);
-
- echo "You are now in: ", htmlspecialchars($_SESSION["room"]) , "<BR>\n";
-?>
-
-<a href="readmsgs.php?mode=new&count=0">Read new messages</a><BR>
-<a href="readmsgs.php?mode=all&count=0">Read all messages</a><BR>
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
-
-header("Location: login.php");
-
-?>
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-?>
-
-<H1>Known rooms</H1>
-
-This is a sample page to demonstrate how to generate a room list.
-
-<UL>
-
-<?PHP
- list($num_rooms, $roomlist) = ctdl_knrooms();
-
- if ($num_rooms > 0) foreach ($roomlist as $x) {
- echo '<LI>';
- if ($x["hasnewmsgs"]) echo '<B>';
- echo '<A HREF="goto.php?towhere=' .
- urlencode($x["name"]) . '">' .
- htmlspecialchars($x["name"]) . "</A>" ;
- if ($x["hasnewmsgs"]) echo '</B>';
- echo "</LI>\n" ;
- }
-?>
-
-</UL>
-
-Sample links<BR>
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
-
-// $Id$
-//
-// Initial start page for PHP-based Citadel web sessions.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
- include "ctdlheader.php";
- bbs_page_header();
-
- echo ctdl_mesg("hello");
-?>
-
- <div align=center>
- <form action="do_login.php" method="POST">
-
- <table border="0" cellspacing="5" cellpadding="5" BGCOLOR="#EEEEEE">
- <tr><td>User name:</td>
- <td><input type="text" name="user" maxlength="25"></td></tr>
- <tr><td>Password:</td>
- <td><input type="password" name="pass" maxlength="20"></td></tr>
-
- <tr><td align=center COLSPAN=2>
- <input type="submit" name="action" value="Login">
- <input type="submit" name="action" value="New User">
- <a href="logout.php">Exit</A>
- </td></tr>
-
- </table>
- </form>
- </div>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
-
-// $Id$
-//
-// Log out the user and destroy the session.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
- include "ctdlheader.php";
-
- bbs_page_header();
-
- echo ctdl_mesg("goodbye");
-
- echo "<a href=\"login.php\">Log in again</a><BR>\n" ;
-
- bbs_page_footer();
- ctdl_end_session();
-?>
+++ /dev/null
-<?PHP
-$vcard="";
-include "ctdlheader.php";
-bbs_page_header();
-
-echo "This is an example of the use of " .
-"ctdl_get_registration_info() to display " .
-"your personal data.<BR><BR>\n" ;
-
-echo "<TABLE border=1>" .
-"<TR>" .
-"<TD><B>User</B></TD>" .
-"<TD><B>Room</B></TD>" .
-"<TD><B>Host</B></TD>" .
-"</TR>" ;
-
-ctdl_goto("My Citadel Config");
-list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
-
-echo "num_msgs: " . $num_msgs . "<BR>\n" ;
-echo "response: " . htmlspecialchars($response) . "<BR>\n" ;
-$Webcit_Preferences = array();
-$Webcit_PrefMsgid = 0;
-if ($num_msgs > 0) foreach ($msgs as $msgnum) {
- print_r($msgnum);
-
- // Fetch the message from the server
- list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
-
- // Bail out gracefully if the message isn't there.
- if (!$ok) {
- echo "Error: " . htmlspecialchars($response) . "<BR>" ;
- return false;
- }
- if (isset($fields['part']))
- {
- $parts = explode('|', $fields['part']);
- print_r($parts);
- if ($parts[4]=="text/x-vcard")
- list($size, $vcard) = download_attachment($msgnum, $result[2]);
- else
- ctdl_dele($msgnum);
- }
- else if ($fields['subj'] == "__ WebCit Preferences __")
- {
- $Webcit_PrefMsgid = $msgnum;
- $Webcit_Preferences = $fields;
- }
-}
-
-echo "</TABLE>\n--------------------------------------- <pre>\n". $vcard."</pre>";
-
-echo "putting it back in!";
-
-$vcard =
-"begin:vcard
-n:Surename;CName;mitte;Mrs;IV
-title:master
-fn:CName Surename
-org:citadel.org
-adr:blarg;Road To nowhere ;10;Metropolis;NRW;12345;Country
-tel;home:888888888
-tel;work:99999999999
-email;internet:user@samplecitadel.org
-email;internet:me@samplecitadel.org
-email;internet:myself@samplecitadel.org
-email;internet:i@samplecitadel.org
-FBURL;PREF:http://samplecitadel.org/Cname_Lastname.vfb
-UID:Citadel vCard: personal card for Cname Lastname at samplecitadel.org
-end:vcard
-";
-preg_replace('/Sir/', 'Mrs',$vcard);
-echo "Now its: <pre>\n".$vcard."</pre>";
-$entarray=array();
-$entarray['post']=1;
-$entarray['format_type']=FMT_RFC822;
-enter_message_0($entarray, "text/x-vcard; charset=UTF-8", $vcard);
-
-
-if ($Webcit_PrefMsgid != '0')
-{
- ctdl_dele($Webcit_PrefMsgid);
-
- $entarray=array();
- $entarray['post']=1;
- $entarray['format_type']=FMT_FIXED;
- $entarray['subject'] = $Webcit_Preferences['subj'];
- $entarray['anon_flag'] = '0';
- enter_message_0($entarray,
- "",
- "somevar|somevalue\r\n".$Webcit_Preferences['text']);
-}
-?>
-
-<BR>Sample links<BR>
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-?>
-
-<h1>Page Two</h1>
-
-<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus nisl
-tortor, ultrices nec, laoreet ac, porta eu, felis. Aenean elit sapien,
-ornare vitae, condimentum ut, feugiat vitae, metus. Curabitur id leo.
-Vivamus semper suscipit justo. Pellentesque interdum rutrum lacus. Fusce
-egestas, tellus ut suscipit semper, dolor metus vestibulum orci, id hendrerit
-diam dolor vel diam. Quisque at mauris. Fusce sollicitudin. Integer ante
-quam, malesuada at, ullamcorper nec, dictum id, nulla. Donec nec arcu sit
-amet justo molestie fermentum. Cras tortor. Fusce est tortor, euismod non,
-rutrum ut, lobortis suscipit, orci. Maecenas venenatis, purus ac volutpat
-euismod, ligula nulla ullamcorper mi, eu fringilla justo wisi quis dolor.
-Morbi vitae enim. Pellentesque tempor, nisl quis euismod tincidunt, tellus
-odio tempor lacus, sit amet viverra enim ante nec nunc. Aliquam vestibulum
-feugiat urna. Cras lectus libero, vestibulum non, pellentesque id, cursus
-sit amet, turpis. Aliquam ipsum magna, vulputate sit amet, iaculis eget,
-molestie rutrum, felis. Curabitur ante metus, rutrum in, vestibulum nec,
-faucibus sit amet, magna. In pretium lacus eget mi.</p>
-
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-<a href="who.php">Who is online?</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-?>
-
-<h1>Page Three</h1>
-
-<P>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vel arcu
-sit amet orci suscipit pellentesque. Cras consequat erat vel libero. Integer
-dignissim, ipsum at sagittis feugiat, massa nibh placerat erat, in pretium
-pede purus at est. Nullam suscipit iaculis magna. Sed eleifend wisi ut
-ipsum. Morbi sed libero quis nunc sagittis venenatis. Sed volutpat neque eu
-augue. Duis tortor felis, dignissim eget, mattis eget, tempus vel, ipsum.
-Nam est. Etiam leo. Fusce urna diam, commodo eget, eleifend sit amet,
-fermentum at, turpis. Nunc luctus. Pellentesque auctor, felis vel venenatis
-fermentum, tellus nunc faucibus odio, vel mattis dolor nulla vitae purus.
-Vivamus sagittis mi sit amet nibh.</p>
-
-<a href="welcome.php">Page One</a><BR>
-<a href="page2.php">Page Two</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
-
+++ /dev/null
-<?PHP
-
- include "ctdlheader.php";
- bbs_page_header();
-
- serv_puts("ENT0 1||0|4|");
- $response = serv_gets();
-
- if (substr($response, 0, 1) != '4') {
- echo htmlspecialchars(substr($response, 3)) . '<br>' ;
- }
- else {
- serv_puts("Content-type: text/html");
- serv_puts("");
- text_to_server(stripslashes($_REQUEST["msgtext"]), TRUE);
- }
-
- echo "Message has been posted.<BR>\n" ;
-
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-
- list($num_msgs, $response, $msgs) = ctdl_msgs($_REQUEST["mode"],
- $_REQUEST["count"] );
-
- echo "num_msgs: " . $num_msgs . "<BR>\n" ;
- echo "response: " . htmlspecialchars($response) . "<BR>\n" ;
-
- if ($num_msgs > 0) foreach ($msgs as $msgnum) {
- display_message($msgnum);
- }
-
-?>
-
-<BR>
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-#!/usr/bin/php -q
-
-<?php
-include "config_ctdlclient.php";
-// $Id$
-//
-// This is the session proxy that binds a unix domain socket to a Citadel
-// server connection. We need one of these for each session because PHP does
-// not have a way to bind a session to a persistent socket.
-//
-// Web designers: don't touch this module. It's not included in your web pages
-// and therefore you don't need to be here.
-//
-// Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
-// This program is released under the terms of the GNU General Public License.
-
-global $msgsock;
-
-// sock_gets() -- reads one line of text from a socket
-//
-if (CITADEL_DEBUG_PROXY)
-{
- define_syslog_variables();
- openlog("sessionproxylog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
-}
-function sock_gets($sock) {
- global $msgsock;
- socket_clear_error($msgsock);
- $buf = socket_read($sock, 4096, PHP_NORMAL_READ);
- if (CITADEL_DEBUG_PROXY)
- {
- syslog(LOG_DEBUG, "gets Read: ".$buf);
- }
- if (socket_last_error($sock)) return false;
-
- if (preg_match("'\n$'s", $buf)) {
- $buf = substr($buf, 0, strpos($buf, "\n"));
- }
-
- return $buf;
-}
-
-
-
-
-// *** Start of main program ***
-
-error_reporting(E_ALL);
-
-/* Allow the script to hang around waiting for connections. */
-set_time_limit(0);
-
-/* Turn on implicit output flushing so we see what we're getting
- * as it comes in.
- */
-ob_implicit_flush();
-
-if ($argc != 2) {
- echo "usage: ", $argv[0], " sockname\n";
- exit(1);
-}
-
-$sockname = $argv[1];
-
-if ($sockname == "/tmp/") {
- echo "Invalid socket name.\n";
- exit(1);
-}
-
-// If there's a dead socket already there, remove it.
-system("/bin/rm -f " . $sockname);
-
-$sock = socket_create(AF_UNIX, SOCK_STREAM, 0);
-if (!$sock) {
- echo "socket_create() failed: ", socket_strerror($sock), "\n";
- system("/bin/rm -f " . $sockname);
- exit(2);
-}
-
-$ret = socket_bind($sock, $sockname);
-if (!$ret) {
- echo "socket_bind() failed: ", socket_strerror($ret), "\n";
- system("/bin/rm -f " . $sockname);
- exit(3);
-}
-
-$ret = socket_listen($sock, 5);
-if (!$ret) {
- echo "socket_listen() failed: ", socket_strerror($ret), "\n";
- system("/bin/rm -f " . $sockname);
- exit(4);
-}
-
-// Set the permissions so someone else doesn't jump into our connection.
-chmod($sockname, 0600);
-
-// We need to get a connection to the Citadel server going now.
-
-$ctdlsock = fsockopen(CITADEL_HOSTNAME, CITADEL_TCP_PORTNO, $errno, $errstr, 30);
-if (!$ctdlsock) {
- socket_close ($sock);
- system("/bin/rm -f " . $sockname);
- exit(5);
-}
-
-// Read the greeting from the Citadel server.
-if (!$buf = fgets($ctdlsock, 4096)) {
- socket_close ($sock);
- system("/bin/rm -f " . $sockname);
- exit(6);
-}
-
-// Make sure the server is allowing logins.
-if (substr($buf, 0, 1) != "2") {
- socket_close ($sock);
- system("/bin/rm -f " . $sockname);
- exit(7);
-}
-
-do {
- // Wait for connections, but time out after 15 minutes.
- // socket_select() is completely b0rken in PHP 4.1, which is why
- // this program requires PHP 4.3 or newer.
- //
- if (socket_select($readsock = array($sock),
- $writesock = NULL,
- $exceptsock = NULL,
- 900, 0
- ) == 0) {
- // Timing out.
- socket_close ($sock);
- system("/bin/rm -f " . $sockname);
- exit(8);
- }
-
- // Ok, there's a valid connection coming in. Accept it.
- $msgsock = socket_accept($sock);
- if ($msgsock >= 0) do {
- $buf = sock_gets($msgsock);
- if ($buf !== false) {
-// fwrite($logfd, ">>");
-// fwride($logfd, $buf);
- if (!fwrite($ctdlsock, $buf . "\n")) {
- fclose($ctdlsock);
- socket_close($sock);
- system("/bin/rm -f " . $sockname);
- exit(9);
- }
- $talkback = fgets($ctdlsock, 4096);
- if (CITADEL_DEBUG_PROXY)
- {
- syslog(LOG_DEBUG, "talkback: ".$talkback);
- }
- if (!$talkback) {
- if (CITADEL_DEBUG_PROXY)
- {
- syslog(LOG_ERROR, "closing socket.");
- }
- fclose($ctdlsock);
- socket_close($sock);
- system("/bin/rm -f " . $sockname);
- exit(10);
- }
- socket_write($msgsock, $talkback, strlen($talkback));
-
- // BINARY_FOLLOWS mode
- if (substr($talkback, 0, 1) == "6") {
- $bytes = intval(substr($talkback, 4));
- if (CITADEL_DEBUG_PROXY)
- {
- syslog(LOG_DEBUG, "reading ".$bytes." bytes from server");
- }
- $buf = fread($ctdlsock, $bytes);
- if (CITADEL_DEBUG_PROXY)
- {
- syslog(LOG_DEBUG, "Read: ".$buf);
- }
- socket_write($msgsock, $buf, $bytes);
- }
-
- // LISTING_FOLLOWS mode
- if (substr($talkback, 0, 1) == "1") do {
- $buf = fgets($ctdlsock, 4096);
- if (!$buf) {
- $buf = "000\n" ;
- }
- else {
- socket_write($msgsock, $buf,
- strlen($buf));
- }
- } while ($buf != "000\n");
-
- // SEND_LISTING mode
- if (substr($talkback, 0, 1) == "4") do {
- socket_clear_error($msgsock);
- $buf = sock_gets($msgsock);
- if (socket_last_error($msgsock)) {
- $buf = "000" ;
- }
- if (!fwrite($ctdlsock, $buf . "\n")) {
- fclose($ctdlsock);
- socket_close($sock);
- system("/bin/rm -f " . $sockname);
- exit(11);
- }
- } while ($buf != "000");
-
- }
- } while($buf !== false);
-
- socket_close ($msgsock);
-
-} while (true);
-
-socket_close($sock);
-fclose($ctdlsock);
-system("/bin/rm -f " . $sockname);
-exit(0);
-
-?>
+++ /dev/null
-/*
- * $Id$
- *
- * Shamelessly swiped from ESR's home page. http://www.catb.org/~esr/
- *
- * Originally cribbed from http://bluerobot.com/web/layouts/layout1.html
- * However, people who merge the hotlink colors are evil and should be killed,
- * so I removed that. Fixing font sizes in pixels is evil, too; is much as
- * possible I has move all dimensions to be relative to the associated font
- * size. Finally, light grey is a great background color, but lousy for
- * foreground text on white.
- */
-
-body {
- margin:0;
- padding:0;
- font-family: bitstream vera sans, helvetica, sans-serif;
- color:#333;
- background-color:white;
- }
-p {
- font-family: bitstream vera sans, helvetica, sans-serif;
- margin:0 0 1em 0;
- padding:0;
- }
-#Content>p {text-indent:2em; margin:0;}
-#Content>p+p {text-indent:2em;}
-
-h1 {
- font-size: x-large;
- margin-bottom: 0.25ex;
- }
-h2 {
- font-size: large;
- margin-bottom: 0.25ex;
- }
-
-a {
- text-decoration:none;
- font-family:verdana, arial, bitstream vera sans, helvetica, sans-serif;
- }
-a:hover {background-color:#ccc;}
-
-#Header {
- font-weight:600;
- font-size: x-large; /* should be same as an h1 header */
- margin:20px 0 10px 0;
- padding:0.3ex 0 1.3ex 20px;
- border-style:solid;
- border-color:black;
- border-width:1px 0;
- background-color:#eee;
-
-/* Here is the ugly brilliant hack that protects IE5/Win from its own
-stupidity. Thanks to Tantek Celik for the hack and to Eric Costello
-for publicizing it. IE5/Win incorrectly parses the "\"}"" value,
-prematurely closing the style declaration. The incorrect IE5/Win value
-is above, while the correct value is below. See
-http://glish.com/css/hacks.asp for details. */
-
- voice-family: "\"}\"";
- voice-family:inherit;
- height:1ex+3px; /* UNTESTED! Was 14px */
- }
-/* I've heard this called the "be nice to Opera 5" rule. Basically, it
-feeds correct length values to user agents that exhibit the parsing
-error exploited above yet get the CSS box model right and understand
-the CSS2 parent-child selector. ALWAYS include a "be nice to Opera 5"
-rule every time you use the Tantek Celik hack (above). */
-body>#Header {height:14px;}
-
-#Content {
- /* Left margin is menu width + 3em
- */
- margin:0 50px 50px 11em;
- padding:10px;
- }
-
-#Menu {
- position:absolute;
- top:80px;
- left:20px;
- width:8em;
- padding:0.5em;
- background-color:#eee;
- border:1px dashed #999;
-/* Again, the ugly brilliant hack. */
- voice-family: "\"}\"";
- voice-family:inherit;
- width:8em;
- }
-/* Again, "be nice to Opera 5". */
-body>#Menu {width:8em;}
-
-/* For convenience */
-.centered {
- text-align: center;
- margin-left: auto;
- margin-right: auto;
- }
-
-.notebox {
- background-color:#eee;
- border:1px dashed #999;
- margin: 15px;
- font-size:small;
- text-indent: 0;
-}
-
-#demolinks {
- position:absolute;
- top:200px;
- left:20px;
- width:8em;
- padding:0.5em;
- background-color:#eee;
- border:1px dashed #999;
-/* Again, the ugly brilliant hack. */
- voice-family: "\"}\"";
- voice-family:inherit;
- width:8em;
- }
-/* Again, "be nice to Opera 5". */
-body>#demolinks {width:8em;}
-
-/* For convenience */
-.centered {
- text-align: center;
- margin-left: auto;
- margin-right: auto;
- }
-
-.notebox {
- background-color:#eee;
- border:1px dashed #999;
- margin: 15px;
- font-size:small;
- text-indent: 0;
-}
-
-.ctdldbgRead {
- color:#ff0000;
- background-color:#eee;
- border:1px dashed #999;
- margin: 15px;
- font-size:small;
- text-indent: 0;
-}
-
-.ctdldbgWrite {
- color:#0000ff;
- background-color:#eee;
- border:1px dashed #999;
- margin: 15px;
- font-size:small;
- text-indent: 0;
-}
+++ /dev/null
-iconbar|ib_displayas=0,ib_logo=0,ib_summary=1,ib_inbox=1,ib_calendar=1,ib_contacts=1,ib_notes=1,ib
-_tasks=1,ib_rooms=1,ib_users=2,ib_chat=1,ib_advanced=1,ib_logoff=0,ib_citadel=1
-roomlistview|rooms
-emptyfloors|yes
-weekstart|0
-use_sig|no
-startpage|dotskip&room=_BASEROOM_
-signature|
-daystart|8
-floordiv_expanded|
-current_iconbar|0
-calhourformat|24
-dayend|17
-
+++ /dev/null
-begin:vcard
-n:Surename;CName;mitte;Mrs;IV
-title:master
-fn:CName Surename
-org:citadel.org
-adr:blarg;Road To nowhere ;10;Metropolis;NRW;12345;Country
-tel;home:888888888
-tel;work:99999999999
-email;internet:user@samplecitadel.org
-email;internet:me@samplecitadel.org
-email;internet:myself@samplecitadel.org
-email;internet:i@samplecitadel.org
-FBURL;PREF:http://samplecitadel.org/Cname_Lastname.vfb
-UID:Citadel vCard: personal card for Cname Lastname at samplecitadel.org
-end:vcard
-
+++ /dev/null
-<?PHP
- include "ctdlheader.php";
- bbs_page_header();
-?>
-
-<h1>You're online!</h1>
-<h2><?PHP echo "Welcome to ", $_SESSION["serv_humannode"]; ?></h2>
-<h3><?PHP echo "You're in: ", $_SESSION["room"]; ?></h3>
-
-<p>This is a sample welcome.php page. Someone with mad HTML kung-fu should
-edit this and make it useful and attractive.</p>
-
-<P>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum
-ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
-Praesent nec massa. Nam enim est, semper sed, ultrices ac, malesuada et,
-odio. Sed sit amet turpis at enim venenatis hendrerit. Vivamus malesuada,
-ipsum et condimentum consectetuer, sapien elit suscipit lorem, vitae
-pellentesque dolor arcu in dui. Aliquam erat volutpat. Cras libero.
-Vestibulum convallis, neque quis accumsan viverra, nisl dolor molestie diam,
-ut consequat tellus augue sed augue. Praesent faucibus blandit est. Morbi
-feugiat laoreet orci. Nunc eu elit id urna vehicula sollicitudin. Nam elit
-lorem, mattis et, interdum eu, bibendum sed, tortor. Mauris eu metus. Fusce
-tellus tortor, vehicula at, iaculis vitae, adipiscing quis, sapien. Lorem
-ipsum dolor sit amet, consectetuer adipiscing elit.</p>
-
-<b>Sample links</b><BR>
-<a href="who.php">Who is online?</a><BR>
-<a href="listrooms.php">room list</A><BR>
-<a href="page2.php">Page Two</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?PHP
-
- include "ctdlheader.php";
- bbs_page_header();
-
- echo "This is an example of the use of ctdl_rwho() to display " .
- "the list of users currently logged in.<BR><BR>\n" ;
-
- echo "<TABLE border=1>" .
- "<TR>" .
- "<TD><B>User</B></TD>" .
- "<TD><B>Room</B></TD>" .
- "<TD><B>Host</B></TD>" .
- "</TR>" ;
-
- list($num_users, $wholist) = ctdl_rwho();
-
- if ($num_users > 0) foreach ($wholist as $x) {
- echo "<TR>";
- echo "<TD>", htmlspecialchars($x["user"]), "</TD>";
- echo "<TD>", htmlspecialchars($x["room"]), "</TD>";
- echo "<TD>", htmlspecialchars($x["host"]), "</TD>";
- echo "</TR>\n";
- }
-
- echo "</TABLE>\n";
-
-?>
-
-<BR>Sample links<BR>
-<a href="welcome.php">Page One</a><BR>
-<a href="page3.php">Page Three</a><BR>
-
-<?PHP
- bbs_page_footer();
-?>
+++ /dev/null
-<?
-/***********************************************
-* File : maildir.php
-* Project : Z-Push
-* Descr : This backend is based on
-* 'BackendDiff' which handles the
-* intricacies of generating
-* differentials from static
-* snapshots. This means that the
-* implementation here needs no
-* state information, and can simply
-* return the current state of the
-* messages. The diffbackend will
-* then compare the current state
-* to the known last state of the PDA
-* and generate change increments
-* from that.
-*
-* Created : 01.10.2007
-*
-* © Zarafa Deutschland GmbH, www.zarafaserver.de
-* This file is distributed under GPL v2.
-* Consult LICENSE file for details
-************************************************/
-
-include_once('diffbackend.php');
-
-// The is an improved version of mimeDecode from PEAR that correctly
-// handles charsets and charset conversion
-include_once('mimeDecode.php');
-
-include_once('ctdlprotocol.php');
-
-include_once('ctdlsession.php');
-
-
-class BackendCitadel extends BackendDiff
-{
- /* Called to logon a user. These are the three authentication strings that you must
- * specify in ActiveSync on the PDA. Normally you would do some kind of password
- * check here. Alternatively, you could ignore the password here and have Apache
- * do authentication via mod_auth_*
- */
- function Logon($username, $domain, $password) {
- debugLog ("Logging in.\n");
- establish_citadel_session();
- $usr = explode ('\\', $username);
-/// debugLog(print_r($usr, true));
- debugLog($password);
- if (count ($usr) == 2)
- $username = $usr[1];
- $ret = login_existing_user($username, $password);
- if ($ret[0] != TRUE)
- echo $ret[1];
- return $ret[0];
- }
-
- /* Called directly after the logon. This specifies the client's protocol version
- * and device id. The device ID can be used for various things, including saving
- * per-device state information.
- * The $user parameter here is normally equal to the $username parameter from the
- * Logon() call. In theory though, you could log on a 'foo', and then sync the emails
- * of user 'bar'. The $user here is the username specified in the request URL, while the
- * $username in the Logon() call is the username which was sent as a part of the HTTP
- * authentication.
- */
- function Setup($user, $devid, $protocolversion) {
- debugLog ("Setup\n");
- $this->_user = $user;
- $this->_devid = $devid;
- $this->_protocolversion = $protocolversion;
- return true;
- }
-
- /* Sends a message which is passed as rfc822. You basically can do two things
- * 1) Send the message to an SMTP server as-is
- * 2) Parse the message yourself, and send it some other way
- * It is up to you whether you want to put the message in the sent items folder. If you
- * want it in 'sent items', then the next sync on the 'sent items' folder should return
- * the new message as any other new message in a folder.
- */
- function SendMessage($rfc822) {
- debugLog("SendMessage\n");
- // Unimplemented
- return true;
- }
-
- /* Should return a wastebasket folder if there is one. This is used when deleting
- * items; if this function returns a valid folder ID, then all deletes are handled
- * as moves and are sent to your backend as a move. If it returns FALSE, then deletes
- * are always handled as real deletes and will be sent to your importer as a DELETE
- */
- function GetWasteBasket() {
- debugLog("GetWasteBasket");
- return "Trash";
- }
-
- /* Should return a list (array) of messages, each entry being an associative array
- * with the same entries as StatMessage(). This function should return stable information; ie
- * if nothing has changed, the items in the array must be exactly the same. The order of
- * the items within the array is not important though.
- *
- * The cutoffdate is a date in the past, representing the date since which items should be shown.
- * This cutoffdate is determined by the user's setting of getting 'Last 3 days' of e-mail, etc. If
- * you ignore the cutoffdate, the user will not be able to select their own cutoffdate, but all
- * will work OK apart from that.
- */
- function GetMessageList($folderid, $cutoffdate) {
- debugLog("GetMessageList $folderid $cutoffdate");
-/// $this->moveNewToCur();
-
- ctdl_goto ($folderid);
-
-# if($folderid != "root")
-# return false;
-
- // return stats of all messages in a dir. We can do this faster than
- // just calling statMessage() on each message; We still need fstat()
- // information though, so listing 10000 messages is going to be
- // rather slow (depending on filesystem, etc)
-
- // we also have to filter by the specified cutoffdate so only the
- // last X days are retrieved. Normally, this would mean that we'd
- // have to open each message, get the Received: header, and check
- // whether that is in the filter range. Because this is much too slow, we
- // are depending on the creation date of the message instead, which should
- // normally be just about the same, unless you just did some kind of import.
-
- $message = ctdl_msgs("","");
- debugLog(print_r($message, true), true);
- $messages = array();
-
- if ($message[0] > 0) for ($i=0; $i < $message[0]; $i ++)
- {
- $thismessage["id"] = $message[2][$i];
- $thismessage["flags"] = 0;
- $thismessage["flags"] |= 1; // 'seen' aka 'read' is the only flag we want to know about
- array_push($messages, $thismessage);
-
- }
- return $messages;
-// $messages = array();
-// $dirname = $this->getPath();
-//
-// $dir = opendir($dirname);
-//
-// if(!$dir)
-// return false;
-//
-// while($entry = readdir($dir)) {
-// if($entry{0} == ".")
-// continue;
-//
-// $message = array();
-//
-// $stat = stat("$dirname/$entry");
-//
-// if($stat["mtime"] < $cutoffdate) {
-// // message is out of range for curoffdate, ignore it
-// continue;
-// }
-//
-// $message["mod"] = $stat["mtime"];
-//
-// $matches = array();
-//
-// // Flags according to http://cr.yp.to/proto/maildir.html (pretty authoritative - qmail author's website)
-// if(!preg_match("/([^:]+):2,([PRSTDF]*)/",$entry,$matches))
-// continue;
-// $message["id"] = $matches[1];
-// $message["flags"] = 0;
-//
-// if(strpos($matches[2],"S") !== false) {
-// $message["flags"] |= 1; // 'seen' aka 'read' is the only flag we want to know about
-// }
-//
-// array_push($messages, $message);
-// }
-//
-// return $messages;
- }
-
- /* This function is analogous to GetMessageList. In simple implementations like this one,
- * you probably just return one folder.
- */
- function GetFolderList() {
- $folders = array();
- debugLog("GetFolderList");
- $ret = ctdl_knrooms(); /// TODO: should we just get the rooms with new messages in them? No.
- if ($ret[0])
- {
- $fldr = $ret[1];
- foreach ($fldr as $folder)
- { // hide contacts and calendar here... TODO: do we realy need to?
- if (($folder['name'] != 'Calendar') && ($folder['name'] != 'Contacts'))
- {
- $folders[] = array("id" => $folder['name'],
- "parent" => $folder['floor'],
- "mod" => "Inbox");
-
- }
- }
- return $folders;
- }
- else return false;
-
-
-/// $inbox = array();
-/// $inbox["id"] = "root";
-/// $inbox["parent"] = "0";
-/// $inbox["mod"] = "Inbox";
-///
-/// $folders[]=$inbox;
-///
-/// $sub = array();
-/// $sub["id"] = "sub";
-/// $sub["parent"] = "root";
-/// $sub["mod"] = "Sub";
-///
-///// $folders[]=$sub;
-///
-/// return $folders;
- }
-
- /* GetFolder should return an actual SyncFolder object with all the properties set. Folders
- * are pretty simple really, having only a type, a name, a parent and a server ID.
- */
- function GetFolder($id) {
- debugLog("GetFolder $id");
- $ret = ctdl_goto ($id);
-// debugLog(print_r($ret, true));
- $box = new SyncFolder();
- $box->serverid = $id;
- $box->parentid = $ret['floorid'];
- $box->displayname = $ret['roomname'];
- switch ($ret['defaultview'])
- {
- case VIEW_BBS:
- $box->type = SYNC_FOLDER_TYPE_OTHER;
- break;
- case VIEW_MAILBOX:
- $box->type = SYNC_FOLDER_TYPE_INBOX;
- break;
- case VIEW_ADDRESSBOOK:
- $box->type = SYNC_FOLDER_TYPE_OTHER;
- break;
- case VIEW_CALENDAR:
- $box->type = SYNC_FOLDER_TYPE_OTHER;
- break;
- case VIEW_TASKS:
- $box->type = SYNC_FOLDER_TYPE_OTHER;
- break;
- case VIEW_NOTES:
- $box->type = SYNC_FOLDER_TYPE_OTHER;
- break;
- }
- return $box;
-// if($id == "root") {
-// $inbox = new SyncFolder();
-//
-// $inbox->serverid = $id;
-// $inbox->parentid = "0"; // Root
-// $inbox->displayname = "Inbox";
-// $inbox->type = SYNC_FOLDER_TYPE_INBOX;
-//
-// return $inbox;
-// } else if($id = "sub") {
-// $inbox = new SyncFolder();
-// $inbox->serverid = $id;
-// $inbox->parentid = "root";
-// $inbox->displayname = "Sub";
-// $inbox->type = SYNC_FOLDER_TYPE_OTHER;
-//
-// return $inbox;
-// } else {
-// return false;
-// }
- }
-
- /* Return folder stats. This means you must return an associative array with the
- * following properties:
- * "id" => The server ID that will be used to identify the folder. It must be unique, and not too long
- * How long exactly is not known, but try keeping it under 20 chars or so. It must be a string.
- * "parent" => The server ID of the parent of the folder. Same restrictions as 'id' apply.
- * "mod" => This is the modification signature. It is any arbitrary string which is constant as long as
- * the folder has not changed. In practice this means that 'mod' can be equal to the folder name
- * as this is the only thing that ever changes in folders. (the type is normally constant)
- */
- function StatFolder($id) {
-debugLog("Statfolder $id");
- $folder = $this->GetFolder($id);
-
- $stat = array();
- $stat["id"] = $id;
- $stat["parent"] = $folder->parentid;
- $stat["mod"] = $folder->displayname;
-
- return $stat;
- }
-
- /* Should return attachment data for the specified attachment. The passed attachment identifier is
- * the exact string that is returned in the 'AttName' property of an SyncAttachment. So, you should
- * encode any information you need to find the attachment in that 'attname' property.
- */
- function GetAttachmentData($attname) {
-debugLog("GetAttachmentData");
- list($id, $part) = explode(":", $attname);
-
- $fn = $this->findMessage($id);
-
- // Parse e-mail
- $rfc822 = file_get_contents($this->getPath() . "/$fn");
-
- $message = Mail_mimeDecode::decode(array('decode_headers' => true, 'decode_bodies' => true, 'include_bodies' => true, 'input' => $rfc822, 'crlf' => "\n", 'charset' => 'utf-8'));
- return $message->parts[$part]->body;
- }
-
- /* StatMessage should return message stats, analogous to the folder stats (StatFolder). Entries are:
- * 'id' => Server unique identifier for the message. Again, try to keep this short (under 20 chars)
- * 'flags' => simply '0' for unread, '1' for read
- * 'mod' => modification signature. As soon as this signature changes, the item is assumed to be completely
- * changed, and will be sent to the PDA as a whole. Normally you can use something like the modification
- * time for this field, which will change as soon as the contents have changed.
- */
-
- function StatMessage($folderid, $id) {
- debugLog("StatMessage $folderid $id");
- return array ("id" => "$id", "flags" => 0, "mod", "12345");
-//
-// $dirname = $this->getPath();
-// $fn = $this->findMessage($id);
-// if(!$fn)
-// return false;
-//
-// $stat = stat("$dirname/$fn");
-//
-// $entry = array();
-// $entry["id"] = $id;
-// $entry["flags"] = 0;
-//
-// if(strpos($fn,"S"))
-// $entry["flags"] |= 1;
-// $entry["mod"] = $stat["mtime"];
-//
-// return $entry;
- }
-
- /* GetMessage should return the actual SyncXXX object type. You may or may not use the '$folderid' parent folder
- * identifier here.
- * Note that mixing item types is illegal and will be blocked by the engine; ie returning an Email object in a
- * Tasks folder will not do anything. The SyncXXX objects should be filled with as much information as possible,
- * but at least the subject, body, to, from, etc.
- */
- function GetMessage($folderid, $id) {
- debugLog("GetMessge $folderid $id");
-# if($folderid != 'root')
-# return false;
-
-// $fn = $this->findMessage($id);
-
- // Get flags, etc
- $stat = $this->StatMessage($folderid, $id);
-
- // Parse e-mail
- $rfc822 = $this->findMessage($id);
-#file_get_contents($this->getPath() . "/" . $fn);
- debugLog("-------------------".print_r($rfc822, true));
- $params = array('decode_headers' => true, 'decode_bodies' => true, 'include_bodies' => true, 'crlf' => "\r\n", 'charset' => 'utf-8');
- $decoder = new Mail_mimeDecode($rfc822);
- $message = $decoder->decode();
-
- debugLog(print_r($message, true));
- $output = new SyncMail();
-
- $output->body = str_replace("\n", "\r\n", $this->getBody($message));
- $output->bodysize = strlen($output->body);
- $output->bodytruncated = 0;
- $output->datereceived = $this->parseReceivedDate($message->headers["received"][0]);
- $output->displayto = $message->headers["to"];
- $output->importance = $message->headers["x-priority"];
- $output->messageclass = "IPM.Note";
- $output->subject = $message->headers["subject"];
- $output->read = $stat["flags"];
- $output->to = $message->headers["to"];
- $output->cc = $message->headers["cc"];
- $output->from = $message->headers["from"];
- $output->reply_to = isset($message->headers["reply-to"]) ? $message->headers["reply-to"] : null;
-
- // Attachments are only searched in the top-level part
- $n = 0;
- if(isset($message->parts)) {
- foreach($message->parts as $part) {
- if($part->ctype_primary == "application") {
- $attachment = new SyncAttachment();
- $attachment->attsize = strlen($part->body);
-
- if(isset($part->d_parameters['filename']))
- $attname = $part->d_parameters['filename'];
- else if(isset($part->ctype_parameters['name']))
- $attname = $part->ctype_parameters['name'];
- else if(isset($part->headers['content-description']))
- $attname = $part->headers['content-description'];
- else $attname = "unknown attachment";
-
- $attachment->displayname = $attname;
- $attachment->attname = $id . ":" . $n;
- $attachment->attmethod = 1;
- $attachment->attoid = isset($part->headers['content-id']) ? $part->headers['content-id'] : "";
-
- array_push($output->attachments, $attachment);
- }
- $n++;
- }
- }
-
- return $output;
- }
-
- /* This function is called when the user has requested to delete (really delete) a message. Usually
- * this means just unlinking the file its in or somesuch. After this call has succeeded, a call to
- * GetMessageList() should no longer list the message. If it does, the message will be re-sent to the PDA
- * as it will be seen as a 'new' item. This means that if you don't implement this function, you will
- * be able to delete messages on the PDA, but as soon as you sync, you'll get the item back
- */
- function DeleteMessage($folderid, $id) {
- debugLog("DeleteMessage");
- if($folderid != 'root')
- return false;
-
- $fn = $this->findMessage($id);
-
- if(!$fn)
- return true; // success because message has been deleted already
-
-
- if(!unlink($this->getPath() . "/$fn")) {
- return true; // success - message may have been deleted in the mean time (since findMessage)
- }
-
- return true;
- }
-
- /* This should change the 'read' flag of a message on disk. The $flags
- * parameter can only be '1' (read) or '0' (unread). After a call to
- * SetReadFlag(), GetMessageList() should return the message with the
- * new 'flags' but should not modify the 'mod' parameter. If you do
- * change 'mod', simply setting the message to 'read' on the PDA will trigger
- * a full resync of the item from the server
- */
- function SetReadFlag($folderid, $id, $flags) {
- debugLog("SetReadFlag");
- if($folderid != 'root')
- return false;
-
- $fn = $this->findMessage($id);
-
- if(!$fn)
- return true; // message may have been deleted
-
- if(!preg_match("/([^:]+):2,([PRSTDF]*)/",$fn,$matches))
- return false;
-
- // remove 'seen' (S) flag
- if(!$flags) {
- $newflags = str_replace("S","",$matches[2]);
- } else {
- // make sure we don't double add the 'S' flag
- $newflags = str_replace("S","",$matches[2]) . "S";
- }
-
- $newfn = $matches[1] . ":2," . $newflags;
- // rename if required
- if($fn != $newfn)
- rename($this->getPath() ."/$fn", $this->getPath() . "/$newfn");
-
- return true;
- }
-
- /* This function is called when a message has been changed on the PDA. You should parse the new
- * message here and save the changes to disk. The return value must be whatever would be returned
- * from StatMessage() after the message has been saved. This means that both the 'flags' and the 'mod'
- * properties of the StatMessage() item may change via ChangeMessage().
- * Note that this function will never be called on E-mail items as you can't change e-mail items, you
- * can only set them as 'read'.
- */
- function ChangeMessage($folderid, $id, $message) {
- debugLog("ChangeMessage");
- return false;
- }
-
- /* This function is called when the user moves an item on the PDA. You should do whatever is needed
- * to move the message on disk. After this call, StatMessage() and GetMessageList() should show the items
- * to have a new parent. This means that it will disappear from GetMessageList() will not return the item
- * at all on the source folder, and the destination folder will show the new message
- */
- function MoveMessage($folderid, $id, $newfolderid) {
- debugLog("MoveMessage");
- return false;
- }
-
- // ----------------------------------------
- // maildir-specific internals
-
- function findMessage($id) {
- debugLog("findMessage $id");
- // We could use 'this->_folderid' for path info but we currently
- // only support a single INBOX. We also have to use a glob '*'
- // because we don't know the flags of the message we're looking for.
-
- $msg = ctdl_fetch_message_rfc822($id);
- if ($msg[0])
- return $msg[1];
- else
- return false;
-// $dirname = $this->getPath();
-// $dir = opendir($dirname);
-//
-// while($entry = readdir($dir)) {
-// if(strpos($entry,$id) === 0)
-// return $entry;
-// }
-// return false; // not found
- }
-
- /* Parse the message and return only the plaintext body
- */
- function getBody($message) {
- debugLog("getBody -> $message <-");
- $body = "";
- $htmlbody = "";
-
- $this->getBodyRecursive($message, "plain", $body);
-
- if(!isset($body) || $body === "") {
- $this->getBodyRecursive($message, "html", $body);
- // HTML conversion goes here
- }
-
- return $body;
- }
-
- // Get all parts in the message with specified type and concatenate them together, unless the
- // Content-Disposition is 'attachment', in which case the text is apparently an attachment
- function getBodyRecursive($message, $subtype, &$body) {
- debugLog("GetBodyRecursive $subtype".print_r($message, true));
- if(strcasecmp($message->ctype_primary,"text")==0 && strcasecmp($message->ctype_secondary,$subtype)==0 && isset($message->body))
- $body .= $message->body;
-
- if(strcasecmp($message->ctype_primary,"multipart")==0) {
- foreach($message->parts as $part) {
- if(!isset($part->disposition) || strcasecmp($part->disposition,"attachment")) {
- $this->getBodyRecursive($part, $subtype, $body);
- }
- }
- }
- }
-
- function parseReceivedDate($received) {
- debugLog("parseRecivedDate");
- $pos = strpos($received, ";");
- if(!$pos)
- return false;
-
- $datestr = substr($received, $pos+1);
- $datestr = ltrim($datestr);
-
- return strtotime($datestr);
- }
-
- /* moves everything in Maildir/new/* to Maildir/cur/
- */
- function moveNewToCur() {
- debugLog("moveNewToCur");
- $newdirname = MAILDIR_BASE . "/" . $this->_user . "/" . MAILDIR_SUBDIR . "/new";
-
- $newdir = opendir($newdirname);
-
- while($newentry = readdir($newdir)) {
- if($newentry{0} == ".")
- continue;
-
- // link/unlink == move. This is the way to move the message according to cr.yp.to
- link($newdirname . "/" . $newentry, $this->getPath() . "/" . $newentry . ":2,");
- unlink($newdirname . "/" . $newentry);
- }
- }
-
- /* The path we're working on
- */
- function getPath() {
- debugLog("GetPath");
- return MAILDIR_BASE . "/" . $this->_user . "/" . MAILDIR_SUBDIR . "/cur";
- }
-};
-
-
-?>
\ No newline at end of file
+++ /dev/null
-textclient (925-1) stable; urgency=low
-
- * new release
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 19 Dec 2018 16:57:49 -0500
-
-textclient (924-1) stable; urgency=low
-
- * new release
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 19 Dec 2018 16:57:49 -0500
-
-textclient (917-1) stable; urgency=low
-
- * new release
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 03 Jan 2018 16:57:49 -0500
-
-textclient (9.16-1) stable; urgency=low
-
- * new release
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 01 Jan 2018 12:56:30 -0400
-
-textclient (9.01-1) stable; urgency=low
-
- * new release
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 01 Apr 2015 12:56:30 -0400
-
-textclient (8.29-1) stable; urgency=low
-
- * development prerelease
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Sat, 07 Dec 2013 11:41:23 +0100
-
-textclient (8.21-1) stable; urgency=low
-
- * new upstream version
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 16 Oct 2013 22:00:00 +0001
-
-textclient (8.20-1) stable; urgency=low
-
- * new upstream version
-
- -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 16 May 2012 22:00:00 +0001
-
+++ /dev/null
-Source: textclient
-Section: mail
-Priority: extra
-Maintainer: Wilfried Goesgens <w.goesgens@outgesourced.org>
-Build-Depends: debhelper (>= 4), po-debconf, autotools-dev,
- gettext, locales, libcitadel-dev (>= 8.11),
-Standards-Version: 3.8.0
-
-Package: citadel-client
-Architecture: any
-Recommends: shared-mime-info
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, citadel-common
-Description: complete and feature-rich groupware server (command line client)
- This is package contains the command line client for Citadel, a complete and
- feature-rich open source groupware platform.
- .
- See the 'citadel-server' package for more information.
+++ /dev/null
-This package was debianized by Fathi Boudra <fboudra@free.fr> on
-Wed, 27 Dec 2006 17:30:35 +0100.
-
-It was downloaded from http://www.citadel.org
-
-Upstream Authors (the citadel development team):
- Clint Adams
- Steven M. Bellovin
- Nathan Bryant
- Art Cancro
- Brian Costello
- Nick Georbit
- David Given
- Wilfried Goesgens
- Michael Hampton
- Andru Luvisi
- Daniel Malament
- Stu Mark
- Edward S. Marshall
- Ben Mehlman
- Matt Pfleger
- Ari Samson
- Trey Van Riper
- John Walker
- Steve Williams
- Ethan Young
-
-Copyright: (C) 1987-2012 Citadel development team
-
-Copyright for CRC16: (C) 1996-2003 Indigo Systems Corporation
-
-Copyright for MD5 implementation: (C) 1993 Colin Plumb
-
-Copyright for RFC 2739 openldap schema:
- (C) 2000 The Internet Society
- (C) 2004 Martin Konold <martin.konold@erfrakon.de>
- (C) 2006 Art Cancro <ajc@uncensored.citadel.org>
-
-CRC16 license:
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- Neither the name of the Indigo Systems Corporation nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
-
-MD5 license:
-
- This code was written by Colin Plumb in 1993, no copyright is claimed.
- This code is in the public domain; do with it what you wish.
-
-RFC 2739 openldap schema license:
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-citadel license:
-
- This package 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 3 of the License.
-
- This package 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 package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-* In addition, as a special exception, the copyright holders give
-* permission to link the code of portions of this program with the
-* OpenSSL library under certain conditions as described in each
-* individual source file, and distribute linked combinations
-* including the two.
-* You must obey the GNU General Public License in all respects
-* for all of the code used other than OpenSSL. If you modify
-* file(s) with this exception, you may extend this exception to your
-* version of the file(s), but you are not obligated to do so. If you
-* do not wish to do so, delete this exception statement from your
-* version. If you delete this exception statement from all source
-* files in the program, then also delete it here.
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL-3'.
-
-The Debian packaging is Copyright (C) 2006-2012, Debian Citadel Team
-<pkg-citadel-devel@lists.alioth.debian.org> and is licensed under the GPL, see
-above.
+++ /dev/null
-#!/usr/bin/make -f
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This has to be exported to make some magic below work.
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-export DH_OPTIONS
-
-DEB_DESTDIR = $(CURDIR)/debian/tmp
-
-CFLAGS = -Wall -g -Werror=format-security
-
-COMPILER=
-EXTRA_ARGS=
-PROFILE_ARGS=
-#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling threadoff rss gcov clang cares"
-ifneq (,$(findstring clang,$(DEB_BUILD_OPTIONS)))
- COMPILER="clang"
-endif
-ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
- PROFILE_ARGS= --with-gprof
-endif
-
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW
- LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
- EXTRA_ARGS = --with-backtrace
- ifneq (,$(findstring event,$(DEB_BUILD_OPTIONS)))
- EXTRA_ARGS = --with-backtrace
- endif
-else
- LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
- CFLAGS += -O2
-endif
-
-ifneq (,$(findstring backtrace,$(DEB_BUILD_OPTIONS)))
- CFLAGS+= -rdynamic -D_GNU_SOURCE -MD -MP
- LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
- EXTRA_ARGS += --with-backtrace
-endif
-
-ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
- THREAD_ARGS=--without-threaded-client
- CFLAGS += -D WITH_THREADLOG
-else
- THREAD_ARGS=
-endif
-
-ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -D BIGBAD_IODBG
-endif
-
-ifneq (,$(findstring gcov,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -fprofile-arcs -ftest-coverage
- LDFLAGS += -fprofile-arcs -ftest-coverage
-endif
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
-
- export CC=$(COMPILER); export LDFLAGS="$(LDFLAGS)"; export CFLAGS="$(CFLAGS)"; ./configure \
- --prefix=/var/lib/citadel/ \
- --with-datadir=/var/lib/citadel/ \
- --with-helpdir=/usr/share/citadel-server/ \
- --with-staticdatadir=/etc/citadel/ \
- --with-spooldir=/var/spool/citadel/ \
- --with-sysconfdir=/etc/citadel/ \
- --with-rundir=/var/run/citadel/ \
- --with-docdir=/usr/share/doc/citadel-doc/ \
- --with-ssldir=/etc/ssl/citadel/ \
- --with-utility-bindir=/usr/lib/citadel-server/ \
- --with-autosysconfdir=/var/lib/citadel/data/ \
- --with-localedir=/usr/share/ \
- --with-pam \
- --with-db \
- --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)
-
- touch configure-stamp
-
-#Architecture
-build: build-arch build-indep
-
-build-arch: build-arch-stamp
-build-arch-stamp: configure-stamp
-
- $(MAKE)
- touch $@
-
-build-indep: build-indep-stamp
-build-indep-stamp: configure-stamp
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-arch-stamp build-indep-stamp configure-stamp
-
-
- dh_clean
- rm -f config.status config.log
-#[ ! -f Makefile ] || $(MAKE) distclean
-
-install: install-indep install-arch
-install-indep: build-indep
- dh_testdir
- dh_testroot
- dh_clean -k -i
- dh_installdirs -i
-
- $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new
-
- dh_install -i --sourcedir=debian/tmp
-
-install-arch: build-arch
- dh_testdir
- dh_testroot
- dh_clean -k -s
- dh_installdirs -s
-
- $(MAKE) install-locale DESTDIR=$(DEB_DESTDIR)
- $(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new
-
- dh_install -s --sourcedir=debian/tmp
-
-binary-common:
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installdebconf
- dh_installinit --name=textclient
- dh_installman
- dh_strip --dbg-package=citadel-textclient-dbg
- dh_link
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-# Build architecture independant packages using the common target.
-binary-indep: build-indep install-indep
- $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
-
-# Build architecture dependant packages using the common target.
-binary-arch: build-arch install-arch
- $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
-
-binary: binary-arch binary-indep
-.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure