├── .gitignore
├── BUGS
├── logo.gif
├── templates
├── user.twig
├── master.twig
├── welcome.twig
└── user_list.twig
├── provisioning
├── apache-site.conf
├── Dockerfile_pureftp
└── pureftp-mysql.conf
├── LICENSE.txt
├── include
├── Form
│ ├── Form.php
│ └── User.php
├── Flash.php
├── Template.php
├── Database.php
└── UserAdmin.php
├── schema.sql
├── INSTALL
├── docs
└── pureftp-mysql.conf.example
├── .github
└── workflows
│ └── php.yml
├── CHANGELOG
├── composer.json
├── docker-compose.yml
├── config.php
├── psalm.xml
├── README.md
└── public
└── index.php
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor/
2 | config.local.php
3 |
--------------------------------------------------------------------------------
/BUGS:
--------------------------------------------------------------------------------
1 | See https://github.com/DavidGoodwin/pureftp-user-admin/issues
--------------------------------------------------------------------------------
/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DavidGoodwin/pureftp-user-admin/HEAD/logo.gif
--------------------------------------------------------------------------------
/templates/user.twig:
--------------------------------------------------------------------------------
1 |
{{ edit_type }} User
2 |
3 | {{ form | raw }}
4 |
5 |
--------------------------------------------------------------------------------
/provisioning/apache-site.conf:
--------------------------------------------------------------------------------
1 |
2 | ServerName test
3 | DocumentRoot /srv/pureftp-admin/public
4 |
5 | Require all granted
6 |
7 |
8 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GPL v3.0
2 |
3 | See : http://pureuseradmin.sourceforge.net
4 | See : https://github.com/DavidGoodwin/pureftp-user-admin/blob/aa19ef51dec4ef1e001e228c7e02286fb1e54c0c/pureuserclass.php
5 | See : http://www.gnu.org/licenses/gpl.html
6 |
--------------------------------------------------------------------------------
/include/Form/Form.php:
--------------------------------------------------------------------------------
1 | messages = ['info' => [], 'error' => [] ];
19 | }
20 |
21 |
22 | public function info(string $message) : void {
23 | $this->messages['info'][] = $message;
24 | }
25 |
26 | public function error(string $message) : void {
27 | $this->messages['error'][] = $message;
28 | }
29 |
30 | public function getMessages() : array {
31 | return $this->messages;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.github/workflows/php.yml:
--------------------------------------------------------------------------------
1 | name: PHP Composer
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v2
12 |
13 | - name: setup PHP?
14 | uses: shivammathur/setup-php@v2
15 | with:
16 | php-version: 7.4
17 | extensions: composer:v2
18 | coverage: none
19 | env:
20 | update: true
21 |
22 | - name: Validate composer.json and composer.lock
23 | run: composer validate
24 |
25 | - name: Install dependencies
26 | run: composer install --prefer-dist --no-progress --no-suggest
27 |
28 | - name: Run test suite
29 | run: composer psalm
30 |
31 |
--------------------------------------------------------------------------------
/CHANGELOG:
--------------------------------------------------------------------------------
1 | PureUserAdmin: ChangeLog
2 |
3 | [0.4.0] 2021/05/21
4 |
5 | * Support PHP 7.x
6 | * Move to use PDO / prepared statements etc
7 | * add psalm static analysis
8 | * support argon2i/sha1/crypt/md5 password hashing
9 |
10 | [0.2.1]
11 | * added search and paging in userlist again
12 |
13 | [0.2.0]
14 | * php5 support
15 | * dropped php4 support
16 | * all is in a class now
17 | * phpdoc comments
18 | * made the database fields part of the settings array
19 |
20 | [0.1.0]
21 | * added welcome screen
22 | * added email notification
23 |
24 | [0.0.3]
25 | * changed vars to match my release system
26 |
27 | [0.0.2]
28 | * added check for homedir rights
29 | * changed look
30 |
31 | [0.0.1]
32 | * Initial Release
33 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "davidgoodwin/pureftp-user-admin",
3 | "description": "Web UI for managing PureFTP users within a SQL database",
4 | "type": "project",
5 | "require-dev": {
6 | "php-parallel-lint/php-parallel-lint": "^1.0",
7 | "phpunit/phpunit": "^7.0 | ^8",
8 | "vimeo/psalm": "*"
9 | },
10 | "license": "GPL v2.0",
11 | "authors": [
12 | {
13 | "name": "David Goodwin",
14 | "email": "david@palepurple.co.uk"
15 | }
16 | ],
17 | "require": {
18 | "php" : "^7.2 | ^8.0",
19 | "twig/twig": "^3.0",
20 | "shardj/zf1-future" : "^1.14.0"
21 | },
22 | "autoload": {
23 | "psr-4": {
24 | "PureFTPAdmin\\" : "include\\"
25 | }
26 | },
27 | "autoload-dev": {
28 | "psr-4": {
29 | "PureFTPAdmin\\Test\\": "tests\\"
30 | }
31 | },
32 | "scripts": {
33 | "lint": "@php vendor/bin/parallel-lint --exclude vendor public include",
34 | "psalm": "@php vendor/bin/psalm --show-info=false",
35 | "phpunit": "@php vendor/bin/phpunit",
36 | "test": [
37 | "@lint",
38 | "@phpunit"
39 | ]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 | web:
4 | image: davidgoodwin/debian-buster-php74:latest
5 | volumes:
6 | - ./provisioning/apache-site.conf:/etc/apache2/sites-enabled/000-default.conf
7 | - ./:/srv/pureftp-admin
8 | ports:
9 | - "08:80"
10 | networks:
11 | - testnet
12 | depends_on:
13 | - mysql
14 | environment:
15 | - DATABASE_DSN=mysql:host=mysql;dbname=pureftp
16 | - DATABASE_USER=username
17 | - DATABASE_PASS=password
18 |
19 | ftp:
20 | build:
21 | context: ./
22 | dockerfile: provisioning/Dockerfile_pureftp
23 | ports:
24 | - "21:21"
25 | networks:
26 | - testnet
27 | privileged: true
28 |
29 | mysql:
30 | image: mariadb:latest
31 | ports:
32 | - "3306:3306"
33 | networks:
34 | - testnet
35 | environment:
36 | MYSQL_INITDB_SKIP_TZINFO: non-empty
37 | MYSQL_ROOT_PASSWORD: test
38 | MYSQL_USER: username
39 | MYSQL_PASSWORD: password
40 | MYSQL_DATABASE: pureftp
41 | volumes:
42 | - ./schema.sql:/docker-entrypoint-initdb.d/pureftp-schema.sql
43 | networks:
44 | testnet:
45 |
--------------------------------------------------------------------------------
/templates/master.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PureUserAdmin - {{ page_title }}
6 |
11 |
12 |
13 |
14 |
15 |
23 |
24 | {% for message in messages.info %}
25 | {{ message }}
26 | {% endfor %}
27 | {% for message in messages.error %}
28 | {{ message }}
29 | {% endfor %}
30 |
31 |
32 |
33 |
34 |
35 |
36 | {% include body_template %}
37 |
38 |
39 |
40 |