Compare commits

...

6 commits

Author SHA1 Message Date
David Prevot 8b1e791d2f .Jenkinsfile: tfix
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
2024-04-19 10:57:44 +02:00
David Prevot bd6e653b19 Move export-dir to CI specific hack
Some checks failed
gitea/evoadmin-mail/pipeline/head There was a failure building this commit
2024-04-19 10:32:11 +02:00
David Prevot f9ee642682 Fix PHP 8 related issues
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
gitea/evoadmin-mail/pipeline/tag This commit looks good
2024-02-20 11:50:03 +01:00
David Prevot 0257f25e92 php-twig is psr-4 only since Bullseye
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
gitea/evoadmin-mail/pipeline/tag This commit looks good
2024-02-13 10:09:16 +01:00
David Prevot 2d312b605a Force system dependencies loading 2024-02-13 10:00:14 +01:00
David Prevot 65449431f9 Fix typo in FormController.php
All checks were successful
gitea/evoadmin-mail/pipeline/tag This commit looks good
gitea/evoadmin-mail/pipeline/head This commit looks good
2023-07-26 16:55:47 +02:00
4 changed files with 24 additions and 30 deletions

View file

@ -7,7 +7,7 @@ pipeline {
}
steps {
script {
sh 'gbp buildpackage'
sh 'gbp buildpackage --git-export-dir=build-area'
}
archiveArtifacts allowEmptyArchive: true, artifacts: 'build-area/*.gz,build-area/*.bz2,build-area/*.xz,build-area/*.deb,build-area/*.dsc,build-area/*.changes,build-area/*.buildinfo,build-area/*.build,build-area/lintian.txt'
}

View file

@ -98,11 +98,13 @@ class FormController {
,'mailaccept' => array('filter' => FILTER_DEFAULT, 'flags' => FILTER_FORCE_ARRAY)
), true);
self::$form['mailaccept'] = array_map(function($value) {
if (!empty($value)) {
return $value.'@'.self::$form['domain'];
}
}, self::$form['mailaccept']);
if (!empty(self::$form['mailaccept'])) {
self::$form['mailaccept'] = array_map(function($value) {
if (!empty($value)) {
return $value.'@'.self::$form['domain'];
}
}, self::$form['mailaccept']);
}
if (!empty(self::$form['password'])) { self::filterPassword(); }
@ -150,7 +152,7 @@ class FormController {
PageController::$alerts[] = array('type' => 1, 'message' => 'Suppression du compte '.self::$form['uid'].'...');
try {
self::$domain->delAccount(self::$form['uid'],self::$form['domain']);
PageController::$alerts[] = array('type' => 0, 'message' => "Suppression effectuée."));
PageController::$alerts[] = array('type' => 0, 'message' => "Suppression effectuée.");
} catch (Exception $e) {
PageController::$alerts[] = array('type' => 2, 'message' => $e->getMessage());
}

View file

@ -1,18 +1,13 @@
<?php
if (file_exists(stream_resolve_include_path('Twig/autoload.php'))) {
require_once 'Twig/autoload.php';
} elseif (stream_resolve_include_path(file_exists('Twig/Autoloader.php'))) {
require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();
}
require_once '/usr/share/php/Twig/autoload.php';
class MailNotify {
private static $twig, $adminmail;
public static function init() {
$loader = new Twig_Loader_Filesystem('tpl/mail');
self::$twig = new Twig_Environment($loader, array(
$loader = new Twig\Loader\FilesystemLoader('tpl/mail');
self::$twig = new Twig\Environment($loader, array(
'cache' => false
));

View file

@ -1,11 +1,6 @@
<?php
if (file_exists(stream_resolve_include_path('Twig/autoload.php'))) {
require_once 'Twig/autoload.php';
} elseif (stream_resolve_include_path(file_exists('Twig/Autoloader.php'))) {
require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();
}
require_once '/usr/share/php/Twig/autoload.php';
class PageController {
public static $alerts=array();
@ -14,8 +9,8 @@ class PageController {
public static function init(LdapServer $server=NULL) {
self::$server = $server;
$loader = new Twig_Loader_Filesystem('tpl/page');
self::$twig = new Twig_Environment($loader, array(
$loader = new Twig\Loader\FilesystemLoader('tpl/page');
self::$twig = new Twig\Environment($loader, array(
'cache' => false
));
@ -65,12 +60,14 @@ class PageController {
if (!empty($_GET['domain']) && in_array($_GET['domain'], $allowed_params)) { self::$params['domain'] = $_GET['domain']; }
if (!empty($_GET['account']) && in_array($_GET['account'], $allowed_params)) { self::$params['account'] = $_GET['account']; }
if (!empty($_GET['alias']) && in_array($_GET['alias'], $allowed_params)) { self::$params['alias'] = $_GET['alias']; }
self::$params = array_merge(filter_input_array(INPUT_GET, array(
'domain' => FILTER_SANITIZE_URL
,'account' => FILTER_SANITIZE_EMAIL
,'alias' => array('filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FLAG_STRIP_HIGH)
), true)
, self::$params);
if (!empty($_GET['domain'])) {
self::$params = array_merge(filter_input_array(INPUT_GET, array(
'domain' => FILTER_SANITIZE_URL
,'account' => FILTER_SANITIZE_EMAIL
,'alias' => array('filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FLAG_STRIP_HIGH)
), true)
, self::$params);
}
unset($_GET);
//die(var_dump(self::$params));
@ -102,7 +99,7 @@ class PageController {
}
private static function logout() {
session_unset('EVOADMIN_SESS');
session_unset();
session_destroy();
print self::$twig->render('login.html', array(
'page_name' => Config::getName().' - Login'