Skip to content

Cannot access "View my details"

I have a clean new system, installed from source (latest master branch) running in an Alpine Linux container with PHP 8.3. I log in as admin:12345 and click User functions/View my details, I see this error:

Exception [0] Call to undefined function session_status()
At line 19 of /usr/share/davical/inc/csrf_tokens.php
================= Stack Trace ===================
/usr/share/davical/htdocs/admin.php[28] include_once()
/usr/share/davical/inc/ui/principal-edit.php[1145] principal_editor()
/usr/share/davical/inc/ui/principal-edit.php[213] getCsrfField()
/usr/share/davical/inc/csrf_tokens.php[91] getCsrf()
/usr/share/davical/inc/csrf_tokens.php[75] sessionExists()

The same issue occurs if I click on User functions/Create new principal.

How can this be resolved?

The Dockerfile is a slightly modified version of what I found on the Internet, I changed the order of the steps, such that the custom configs are copied in the end, this way the Docker image is rebuilt much faster.

FROM 	alpine

ENV	TIME_ZONE="Europe/Berlin"
ENV	HOST_NAME="davical.example"

# apk
RUN	apk --update add \
	sudo \
	bash \
	less \
	sed \
	supervisor \
	rsyslog \
	postgresql \
	apache2 \
	apache2-utils \
	apache2-ssl \
	php83 \
	php83-apache2 \
	php83-pgsql \
	php83-imap \
	php83-curl \
	php83-cgi \
	php83-xml \
	php83-gettext \ 
	php83-iconv \ 
	php83-ldap \
	php83-pdo \
	php83-pdo_pgsql \
	php83-calendar \
	perl \
	perl-yaml \
	perl-dbd-pg \
	perl-dbi \
	git \
# git
	&& git clone https://gitlab.com/davical-project/awl.git /usr/share/awl/ \
	&& git clone https://gitlab.com/davical-project/davical.git /usr/share/davical/ \
	&& rm -rf /usr/share/davical/.git /usr/share/awl/.git/ \
	&& apk del git \
# Apache
	&& chown -R root:apache /usr/share/davical \
	&& cd /usr/share/davical/ \
	&& find ./ -type d -exec chmod u=rwx,g=rx,o=rx '{}' \; \
	&& find ./ -type f -exec chmod u=rw,g=r,o=r '{}' \; \
	&& find ./ -type f -name *.sh -exec chmod u=rwx,g=r,o=rx '{}' \; \
	&& find ./ -type f -name *.php -exec chmod u=rwx,g=rx,o=r '{}' \; \
	&& chmod o=rx /usr/share/davical/dba/update-davical-database \
	&& chmod o=rx /usr/share/davical \
	&& chown -R root:apache /usr/share/awl \
	&& cd /usr/share/awl/ \
	&& find ./ -type d -exec chmod u=rwx,g=rx,o=rx '{}' \; \
	&& find ./ -type f -exec chmod u=rw,g=r,o=r '{}' \; \
	&& find ./ -type f -name *.sh -exec chmod u=rwx,g=rx,o=r '{}' \; \
	&& find ./ -type f -name *.sh -exec chmod u=rwx,g=r,o=rx '{}' \; \
	&& chmod o=rx /usr/share/awl \
	&& sed -i /CustomLog/s/^/#/ /etc/apache2/httpd.conf \
	&& sed -i /ErrorLog/s/^/#/ /etc/apache2/httpd.conf \
	&& sed -i /TransferLog/s/^/#/ /etc/apache2/httpd.conf \
	&& sed -i /CustomLog/s/^/#/ /etc/apache2/conf.d/ssl.conf \
	&& sed -i /ErrorLog/s/^/#/ /etc/apache2/conf.d/ssl.conf \
	&& sed -i /TransferLog/s/^/#/ /etc/apache2/conf.d/ssl.conf

# config files, shell scripts
COPY 	initialize_db.sh /sbin/initialize_db.sh
COPY	backup_db.sh /sbin/backup_db.sh
COPY	docker-entrypoint.sh /sbin/docker-entrypoint.sh
COPY	restore_db.sh /sbin/restore_db.sh
COPY	apache.conf /config/apache.conf
COPY	davical.php /config/davical.php
COPY	supervisord.conf /config/supervisord.conf
COPY	rsyslog.conf /config/rsyslog.conf

# permissions for shell scripts and config files
RUN chmod 0755 /sbin/initialize_db.sh \
	&& chmod 0755 /sbin/backup_db.sh  \
	&& chmod 0755 /sbin/docker-entrypoint.sh \
	&& chmod 0755 /sbin/restore_db.sh \
	&& mkdir /etc/davical /etc/supervisor.d/ /etc/rsyslog.d \
	&& echo -e "\$IncludeConfig /etc/rsyslog.d/*.conf" > /etc/rsyslog.conf \
	&& chown -R root:apache /etc/davical \
	&& chmod -R u=rwx,g=rx,o= /etc/davical \
	&& chown root:apache /config/davical.php \
	&& chmod u+rwx,g+rx /config/davical.php \
	&& ln -s /config/apache.conf /etc/apache2/conf.d/davical.conf \	
	&& ln -s /config/davical.php /etc/davical/config.php \
	&& ln -s /sbin/backup_db.sh /etc/periodic/daily/backup \
	&& ln -s /config/supervisord.conf /etc/supervisor.d/supervisord.ini \
	&& ln -s /config/rsyslog.conf /etc/rsyslog.d/rsyslog-davical.conf \
# clean-up etc
	&& rm -rf /var/cache/apk/* \
 	&& mkdir -p /run/apache2 \
	&& mkdir /run/postgresql \
	&& chmod a+w /run/postgresql

EXPOSE 80
VOLUME 	["/var/lib/postgresql/data/","/config"]
ENTRYPOINT ["/sbin/docker-entrypoint.sh"]