Compare commits
2 commits
b2c7df32eb
...
d812c03199
| Author | SHA1 | Date | |
|---|---|---|---|
| d812c03199 | |||
| 7d78df604d |
10 changed files with 636 additions and 857 deletions
25
.drone.yml
25
.drone.yml
|
|
@ -1,25 +0,0 @@
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: install dependencies
|
|
||||||
image: composer
|
|
||||||
volumes:
|
|
||||||
- name: composer-cache
|
|
||||||
path: /tmp/cache
|
|
||||||
environment:
|
|
||||||
COMPOSER_CACHE_DIR: /tmp/cache
|
|
||||||
commands:
|
|
||||||
- composer install --no-progress --no-interaction --ignore-platform-reqs
|
|
||||||
|
|
||||||
- name: run unit tests
|
|
||||||
image: php:7.4
|
|
||||||
commands:
|
|
||||||
- vendor/bin/phpunit -c phpunit.xml
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: composer-cache
|
|
||||||
host:
|
|
||||||
path: /tmp/drone/composer-cache
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM php:7.4-apache AS base
|
FROM php:8.4-apache AS base
|
||||||
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ RUN apt-get update && \
|
||||||
RUN a2enmod rewrite && \
|
RUN a2enmod rewrite && \
|
||||||
sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf
|
sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf
|
||||||
|
|
||||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2.10 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
|
||||||
FROM base AS development
|
FROM base AS development
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -2,7 +2,7 @@
|
||||||
DOCKER_UID = "$(shell id -u):$(shell id -g)"
|
DOCKER_UID = "$(shell id -u):$(shell id -g)"
|
||||||
|
|
||||||
# Basic docker-compose command
|
# Basic docker-compose command
|
||||||
DOCKER_COMPOSE = DOCKER_UID=$(DOCKER_UID) docker-compose
|
DOCKER_COMPOSE = DOCKER_UID=$(DOCKER_UID) docker compose
|
||||||
|
|
||||||
# Commands inside containers
|
# Commands inside containers
|
||||||
DOCKER_RUN = $(DOCKER_COMPOSE) run --rm app
|
DOCKER_RUN = $(DOCKER_COMPOSE) run --rm app
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
"optimize-autoloader": true
|
"optimize-autoloader": true
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"php": "^8.4",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"ext-yaml": "*",
|
"ext-yaml": "*",
|
||||||
"slim/slim": "^4.8",
|
"slim/slim": "^4.15",
|
||||||
"slim/psr7": "^1.3",
|
"slim/psr7": "^1.8",
|
||||||
"php-di/php-di": "^6.3",
|
"php-di/php-di": "^7.1",
|
||||||
"slim/twig-view": "^3.2"
|
"slim/twig-view": "^3.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9"
|
"phpunit/phpunit": "^9"
|
||||||
|
|
|
||||||
1440
composer.lock
generated
1440
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,4 @@
|
||||||
version: '3.4'
|
name: mail-account-admin
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ abstract class FormData
|
||||||
|
|
||||||
private static function validateMailAddress(string $address, bool $required = true, string $fieldName = 'Mail address'): ?string
|
private static function validateMailAddress(string $address, bool $required = true, string $fieldName = 'Mail address'): ?string
|
||||||
{
|
{
|
||||||
// Note: This validator allows '%' as wildcard character inside mail addresses.
|
// Note: This validator allows '%' as wildcard character inside the username of mail addresses.
|
||||||
if (!$required && $address === '') {
|
if (!$required && $address === '') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +55,7 @@ abstract class FormData
|
||||||
self::validateString($address, 3, 100, $fieldName)
|
self::validateString($address, 3, 100, $fieldName)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!preg_match('/^[a-z0-9%._+-]+@[a-z0-9%.-]+$/', $address) || preg_match('/^\\.|\\.\\.|\\.@|@\\.|\\.$/', $address)) {
|
if (!preg_match('/^[a-z0-9%._+-]+@[a-z0-9.-]+$/', $address) || preg_match('/^\\.|\\.\\.|\\.@|@\\.|\\.$/', $address)) {
|
||||||
throw new InputValidationError("$fieldName is not valid (must be a valid mail address).");
|
throw new InputValidationError("$fieldName is not valid (must be a valid mail address).");
|
||||||
}
|
}
|
||||||
return $address;
|
return $address;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class Account
|
||||||
(int)$data['user_id'],
|
(int)$data['user_id'],
|
||||||
$data['username'],
|
$data['username'],
|
||||||
$data['password'],
|
$data['password'],
|
||||||
$data['is_active'] === '1',
|
$data['is_active'] === 1,
|
||||||
$data['home_dir'],
|
$data['home_dir'],
|
||||||
$data['memo'] !== null ? $data['memo'] : '',
|
$data['memo'] !== null ? $data['memo'] : '',
|
||||||
new DateTimeImmutable($data['created_at']),
|
new DateTimeImmutable($data['created_at']),
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class AdminUser
|
||||||
(int)$data['admin_id'],
|
(int)$data['admin_id'],
|
||||||
$data['username'],
|
$data['username'],
|
||||||
$data['password'],
|
$data['password'],
|
||||||
$data['is_active'] === '1',
|
$data['is_active'] === 1,
|
||||||
new DateTimeImmutable($data['created_at']),
|
new DateTimeImmutable($data['created_at']),
|
||||||
new DateTimeImmutable($data['modified_at']),
|
new DateTimeImmutable($data['modified_at']),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use PDO;
|
||||||
|
|
||||||
class AccountRepository extends BaseRepository
|
class AccountRepository extends BaseRepository
|
||||||
{
|
{
|
||||||
public function fetchAccountList(string $filterByDomain = null): array
|
public function fetchAccountList(?string $filterByDomain = null): array
|
||||||
{
|
{
|
||||||
$queryWhere = '';
|
$queryWhere = '';
|
||||||
$queryParams = [];
|
$queryParams = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue