Verschiedene Fixes

This commit is contained in:
Humorhenker 2019-11-25 23:45:57 +01:00
parent 1566aeaf2f
commit 212c76429a
4 changed files with 15 additions and 6 deletions

View File

@ -10,3 +10,11 @@ maildirencryption =
captcha = captcha =
allowregistration = allowregistration =
adminadress = adminadress =
deletedelrequestdaydiff =
sendactivationinfo =
prohibadminmailcreation =
[mailserver]
mailsmtpserver=""
mailadress=""
mailpw=''

View File

@ -70,6 +70,7 @@ if ($_SESSION['log'] == 1 and $_SESSION['admin'] == 1) {
echo '</select> (benutze nicht ' . "'" . ')</label> echo '</select> (benutze nicht ' . "'" . ')</label>
<label>Neues Passwort<input type="password" name="newmailpw"/>(min. 8 Zeichen, benutze nicht ' . "'" . ')</label> <label>Neues Passwort<input type="password" name="newmailpw"/>(min. 8 Zeichen, benutze nicht ' . "'" . ')</label>
<label>Neues Passwort wiederholen<input type="password" name="newmailpwrep"/></label> <label>Neues Passwort wiederholen<input type="password" name="newmailpwrep"/></label>
<label>Passwortänderung erzwingen:<input type="checkbox" name="forcepwreset"/></label>
<input type="submit" name="submit" value="Hinzufügen"/> <input type="submit" name="submit" value="Hinzufügen"/>
</form> </form>
<h3>Passwort einer Email-Adresse ändern:</h3> <h3>Passwort einer Email-Adresse ändern:</h3>

View File

@ -28,7 +28,7 @@ if ($_SESSION['log'] == 1 or $_SESSION['forcepwreset']) {
$oldmailpw = $_POST['oldmailpw']; $oldmailpw = $_POST['oldmailpw'];
if (strpos($newmailpw, "'") !== false) { if (strpos($newmailpw, "'") !== false) {
if ($_SESSION['forcepwreset']) header("Location: ../index.php?wrongsymbols=1"); if ($_SESSION['forcepwreset']) header("Location: ../index.php?wrongsymbols=1");
else header("Location: settings.php?wrongsymbols=1"); else header("Location: ../settings.php?wrongsymbols=1");
exit; exit;
} }
$mailusername = $_SESSION['username']; $mailusername = $_SESSION['username'];

View File

@ -21,7 +21,7 @@ try {
//echo 'Connection failled: '. $e->getMessage(); // Errormessage kann Sicherheitsrelevantes enthalen //echo 'Connection failled: '. $e->getMessage(); // Errormessage kann Sicherheitsrelevantes enthalen
echo 'Connection failed'; echo 'Connection failed';
} }
function createmailuser($newmailusername, $newmaildomainid, $newmailpw, $newmailpwrep, $admin) { function createmailuser($newmailusername, $newmaildomainid, $newmailpw, $newmailpwrep, $newmailforcepwreset, $admin) {
global $dbh; global $dbh;
global $config; global $config;
$abfrage = "SELECT domain FROM `domains` WHERE `id` LIKE :newmaildomainid"; $abfrage = "SELECT domain FROM `domains` WHERE `id` LIKE :newmaildomainid";
@ -84,9 +84,9 @@ function createmailuser($newmailusername, $newmaildomainid, $newmailpw, $newmail
// $eintrag = "UPDATE `mailserver`.`virtual_users` SET `active`='0' WHERE `email` LIKE :newmailusernamefull"; // $eintrag = "UPDATE `mailserver`.`virtual_users` SET `active`='0' WHERE `email` LIKE :newmailusernamefull";
// } // }
//else { //else {
$eintrag = "INSERT INTO `accounts` (`username`, `domain`, `password`, `quota`, `enabled`, `forcepwreset`, `sendonly`, `admin`) VALUES (:newmailusername, :newmaildomain, :newmailpwhashed, '2048', '1', '0', '0', '0')"; // Maildaten in MailServer DB eintragen $eintrag = "INSERT INTO `accounts` (`username`, `domain`, `password`, `quota`, `enabled`, `forcepwreset`, `sendonly`, `admin`) VALUES (:newmailusername, :newmaildomain, :newmailpwhashed, '2048', '1', :forcepwreset, '0', '0')"; // Maildaten in MailServer DB eintragen
$sth = $dbh->prepare($eintrag); $sth = $dbh->prepare($eintrag);
$sth->execute(array(':newmailusername' => $newmailusername, ':newmaildomain' => $newmaildomain, ':newmailpwhashed' => $newmailpwhashed)); $sth->execute(array(':newmailusername' => $newmailusername, ':newmaildomain' => $newmaildomain, ':newmailpwhashed' => $newmailpwhashed, ':forcepwreset' => $newmailforcepwreset));
//$maildirpath = $config['mailfolderpath'] . $newmailusername; //$maildirpath = $config['mailfolderpath'] . $newmailusername;
// umask(0); // umask(0);
// mkdir($maildirpath, 0770); // mkdir($maildirpath, 0770);
@ -139,13 +139,13 @@ function createmailuser($newmailusername, $newmaildomainid, $newmailpw, $newmail
session_start(); session_start();
if ($_SESSION['log'] == 1 AND $_SESSION['admin'] == 1) { if ($_SESSION['log'] == 1 AND $_SESSION['admin'] == 1) {
//print_r($_POST); //print_r($_POST);
createmailuser($_POST['newmailusername'], $_POST['newmaildomainid'], $_POST['newmailpw'], $_POST['newmailpwrep'], 1); createmailuser($_POST['newmailusername'], $_POST['newmaildomainid'], $_POST['newmailpw'], $_POST['newmailpwrep'], $_POST['forcepwreset'], 1);
header("Location: ../admin.php"); header("Location: ../admin.php");
exit; exit;
} }
if ($config['allowregistration']) { if ($config['allowregistration']) {
if ($_POST['captchacode'] == $_SESSION['captchacode']) { if ($_POST['captchacode'] == $_SESSION['captchacode']) {
createmailuser($_POST['newmailusername'], $_POST['newmaildomainid'], $_POST['newmailpw'], $_POST['newmailpwrep'], 0); createmailuser($_POST['newmailusername'], $_POST['newmaildomainid'], $_POST['newmailpw'], $_POST['newmailpwrep'], $_POST['forcepwreset'], 0);
} }
elseif ($_POST['captchacode'] != $_SESSION['captchacode']) { elseif ($_POST['captchacode'] != $_SESSION['captchacode']) {
header("Location: createmailpre.php?wrongcaptchacode=1"); header("Location: createmailpre.php?wrongcaptchacode=1");