Compare commits
No commits in common. "d812c031994b387e71619e3ddf9679ffca47b7b7" and "b2c7df32ebb2d491b952776bec051d37cc1943f8" have entirely different histories.
d812c03199
...
b2c7df32eb
10 changed files with 857 additions and 636 deletions
25
.drone.yml
Normal file
25
.drone.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
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:8.4-apache AS base
|
||||
FROM php:7.4-apache AS base
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ RUN apt-get update && \
|
|||
RUN a2enmod rewrite && \
|
||||
sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf
|
||||
|
||||
COPY --from=composer:2.10 /usr/bin/composer /usr/bin/composer
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
|
||||
|
||||
FROM base AS development
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -2,7 +2,7 @@
|
|||
DOCKER_UID = "$(shell id -u):$(shell id -g)"
|
||||
|
||||
# Basic docker-compose command
|
||||
DOCKER_COMPOSE = DOCKER_UID=$(DOCKER_UID) docker compose
|
||||
DOCKER_COMPOSE = DOCKER_UID=$(DOCKER_UID) docker-compose
|
||||
|
||||
# Commands inside containers
|
||||
DOCKER_RUN = $(DOCKER_COMPOSE) run --rm app
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@
|
|||
"optimize-autoloader": true
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.4",
|
||||
"php": "^7.4",
|
||||
"ext-pdo": "*",
|
||||
"ext-yaml": "*",
|
||||
"slim/slim": "^4.15",
|
||||
"slim/psr7": "^1.8",
|
||||
"php-di/php-di": "^7.1",
|
||||
"slim/twig-view": "^3.4"
|
||||
"slim/slim": "^4.8",
|
||||
"slim/psr7": "^1.3",
|
||||
"php-di/php-di": "^6.3",
|
||||
"slim/twig-view": "^3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"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 @@
|
|||
name: mail-account-admin
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
app:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ abstract class FormData
|
|||
|
||||
private static function validateMailAddress(string $address, bool $required = true, string $fieldName = 'Mail address'): ?string
|
||||
{
|
||||
// Note: This validator allows '%' as wildcard character inside the username of mail addresses.
|
||||
// Note: This validator allows '%' as wildcard character inside mail addresses.
|
||||
if (!$required && $address === '') {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ abstract class FormData
|
|||
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).");
|
||||
}
|
||||
return $address;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class Account
|
|||
(int)$data['user_id'],
|
||||
$data['username'],
|
||||
$data['password'],
|
||||
$data['is_active'] === 1,
|
||||
$data['is_active'] === '1',
|
||||
$data['home_dir'],
|
||||
$data['memo'] !== null ? $data['memo'] : '',
|
||||
new DateTimeImmutable($data['created_at']),
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class AdminUser
|
|||
(int)$data['admin_id'],
|
||||
$data['username'],
|
||||
$data['password'],
|
||||
$data['is_active'] === 1,
|
||||
$data['is_active'] === '1',
|
||||
new DateTimeImmutable($data['created_at']),
|
||||
new DateTimeImmutable($data['modified_at']),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use PDO;
|
|||
|
||||
class AccountRepository extends BaseRepository
|
||||
{
|
||||
public function fetchAccountList(?string $filterByDomain = null): array
|
||||
public function fetchAccountList(string $filterByDomain = null): array
|
||||
{
|
||||
$queryWhere = '';
|
||||
$queryParams = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue