' . $tpl->compile('register.html') ); exit; } if ( empty( $_POST['username'] ) || ( ! empty( $Config['checkEmailOnRegistration'] ) && empty( $_POST['email'] ) ) || empty( $_POST['password'] ) || empty( $_POST['password2'] ) ){ $message = empty( $_POST ) ? '' : 'Unvollständige Angaben'; eval( '?'.'>' . $tpl->compile('register.html') ); exit; } if ( $_POST['password'] != $_POST['password2'] ) { $message = empty( $_POST ) ? '' : 'Die Passwörter stimmen nicht überein'; eval( '?'.'>' . $tpl->compile('register.html') ); exit; } require_once "{$BaseDir}/lib/users.class.php"; $auth = new User_Authentication( $StorageDir ); $user = $auth->create_user( $_POST['username'], $_POST['password'], $_POST['email'] ?? '', empty( $Config['checkEmailOnRegistration'] ) ? 1 : 0 ); if ( ! isset( $user['id'] ) ){ if ( $user === FALSE ) { $message = 'Der Benutzername ist bereits vergeben. Bitte wählen Sie einen anderen.'; } else { $message = "Datenbankfehler: {$user}"; } eval( '?'.'>' . $tpl->compile('register.html') ); exit; } if ( empty( $Config['checkEmailOnRegistration'] ) ){ $user = $auth->login( $_POST['username'], $_POST['password'] ); session_regenerate_id(); $newSession = session_id(); session_write_close(); session_id( $newSession ); session_start(); $_SESSION['user'] = $user; header( "Location: {$BaseUrl}/server" ); exit; } require_once 'lib/smtp_mailer.class.php'; $mailer = new SMTP_Mailer( $Config['smtpHost'], $Config['smtpPort'], $Config['smtpUser'], $Config['smtpPassword'], $Config['smtpSecurity'] ?? NULL ); $result = $mailer->mail( $_POST['email'], 'Deine Registrierung bei pas.partcp.org', "Klicke hier, um Deine Registrierung zu bestätigen:\n" . "{$BaseUrl}/activate/{$user['id']}/{$user['token']}", 'info@partcp.org' ); if ( ! $result ){ die( "Bestätigungsmail konnte nicht versendet werden (Fehler {$mailer->lastError}" ); } $title = 'Registrierung durchgeführt'; $content = 'Schau bitte in Dein Postfach'; eval( '?'.'>' . $tpl->compile('standard.html') ); // end of file register.php