08011e96dc79c17a280b6498b215da5fdcb03042
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php     1) <?php
modules/handles/include/handles.php     2) /*
modules/handles/include/handles.php     3) This file belongs to the Webinterface of schokokeks.org Hosting
modules/handles/include/handles.php     4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php     5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php     6)   Bernd Wurst <bernd@schokokeks.org>
modules/handles/include/handles.php     7)   Hanno Böck <hanno@schokokeks.org>
modules/handles/include/handles.php     8) 
modules/handles/include/handles.php     9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
modules/handles/include/handles.php    10) 
modules/handles/include/handles.php    11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
modules/handles/include/handles.php    12) http://creativecommons.org/publicdomain/zero/1.0/
modules/handles/include/handles.php    13) 
modules/handles/include/handles.php    14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
modules/handles/include/handles.php    15) */
modules/handles/include/handles.php    16) 
modules/handles/include/handles.php    17) require_once('inc/debug.php');
modules/handles/include/handles.php    18) require_role(array(ROLE_CUSTOMER));
Bernd Wurst Security

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  19) require_once('class/domain.php');
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    20) 
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  21) require_once('contactapi.php');
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  22) 
Bernd Wurst $usage ist ein array

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    23) /*
Bernd Wurst Kontakt kopieren

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  24) Todo:
Bernd Wurst Abstrahieren der Anzeigefun...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  25)     - Ausgabe-Funktion abstrahieren
modules/contacts/include/contacts.php  26)     - Telefonnummern bei Ausgabe durch filter_input_general schieben
Bernd Wurst Kontakt kopieren

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  27)     - Domaininhaber festlegen    
Bernd Wurst $usage ist ein array

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    28) */
modules/handles/include/handles.php    29) 
modules/handles/include/handles.php    30) 
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  31) function new_contact() {
modules/contacts/include/contacts.php  32)     return array("id" => NULL,
modules/contacts/include/contacts.php  33)         "state" => NULL,
modules/contacts/include/contacts.php  34)         "lastchange" => time(),
modules/contacts/include/contacts.php  35)         "nic_handle" => NULL,
modules/contacts/include/contacts.php  36)         "nic_id" => NULL,
modules/contacts/include/contacts.php  37)         "company" => NULL,
modules/contacts/include/contacts.php  38)         "name" => NULL,
modules/contacts/include/contacts.php  39)         "address" => NULL,
modules/contacts/include/contacts.php  40)         "zip" => NULL,
modules/contacts/include/contacts.php  41)         "city" => NULL,
modules/contacts/include/contacts.php  42)         "country" => "DE",
modules/contacts/include/contacts.php  43)         "phone" => NULL,
modules/contacts/include/contacts.php  44)         "mobile" => NULL,
modules/contacts/include/contacts.php  45)         "fax" => NULL,
modules/contacts/include/contacts.php  46)         "email" => NULL,
modules/contacts/include/contacts.php  47)         "pgp_id" => NULL,
modules/contacts/include/contacts.php  48)         "pgp_key" => NULL,
modules/contacts/include/contacts.php  49)         "customer" => $_SESSION['customerinfo']['customerno']);
modules/contacts/include/contacts.php  50) }
modules/contacts/include/contacts.php  51) 
modules/contacts/include/contacts.php  52) 
modules/contacts/include/contacts.php  53) function get_contact($id)
modules/contacts/include/contacts.php  54) {
modules/contacts/include/contacts.php  55)     $args = array(
modules/contacts/include/contacts.php  56)         "cid" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php  57)         "id" => (int) $id);
modules/contacts/include/contacts.php  58)     $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE id=:id AND customer=:cid", $args);
modules/contacts/include/contacts.php  59)     if ($result->rowCount() == 0) {
modules/contacts/include/contacts.php  60)         system_failure("Kontakt nicht gefunden oder gehört nicht diesem Kunden");
modules/contacts/include/contacts.php  61)     }
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  62)     $contact = $result->fetch();
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  63)     return $contact;
modules/contacts/include/contacts.php  64) }
modules/contacts/include/contacts.php  65) 
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  66) function get_contacts() {
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    67)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Choose-Funktion

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  68)     $result = db_query("SELECT id, state, lastchange, nic_id, nic_handle, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id, pgp_key FROM kundendaten.contacts WHERE (state<>'deleted' OR state IS NULL) AND customer=? ORDER BY COALESCE(company, name)", array($cid));
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    69)     $ret = array();
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  70)     while ($contact = $result->fetch()) {
modules/contacts/include/contacts.php  71)         $ret[$contact['id']] = $contact;
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    72)     }
modules/handles/include/handles.php    73)     DEBUG($ret);
modules/handles/include/handles.php    74)     return $ret;
modules/handles/include/handles.php    75) }
modules/handles/include/handles.php    76) 
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  77) 
Bernd Wurst Neue Darstellung der Kontak...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  78) function is_domainholder($contactid) {
modules/contacts/include/contacts.php  79)     $contactid = (int) $contactid;
modules/contacts/include/contacts.php  80)     $result = db_query("SELECT id FROM kundendaten.domains WHERE owner=? OR admin_c=?", array($contactid, $contactid));
modules/contacts/include/contacts.php  81)     if ($result->rowCount() > 0) {
modules/contacts/include/contacts.php  82)         return true;
modules/contacts/include/contacts.php  83)     }
modules/contacts/include/contacts.php  84)     return false;
modules/contacts/include/contacts.php  85) }
modules/contacts/include/contacts.php  86) 
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  87) function possible_domainholders() {
modules/contacts/include/contacts.php  88)     $allcontacts = get_contacts();
modules/contacts/include/contacts.php  89)     $ret = array();
modules/contacts/include/contacts.php  90)     foreach ($allcontacts as $id => $c) {
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  91)         if (possible_domainholder($c)) {
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  92)             $ret[$id] = $c;
modules/contacts/include/contacts.php  93)         }
modules/contacts/include/contacts.php  94)     }
modules/contacts/include/contacts.php  95)     return $ret;
modules/contacts/include/contacts.php  96) }
modules/contacts/include/contacts.php  97) 
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  98) function possible_domainholder($c)
modules/contacts/include/contacts.php  99) {
modules/contacts/include/contacts.php 100)     if ($c['name'] && $c['address'] && $c['zip'] && $c['city'] && $c['country'] && $c['phone'] && $c['email']) {
modules/contacts/include/contacts.php 101)         return true;
modules/contacts/include/contacts.php 102)     }
modules/contacts/include/contacts.php 103)     return false;
modules/contacts/include/contacts.php 104) }
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 105) 
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 106) function have_mailaddress($email) 
modules/contacts/include/contacts.php 107) {
modules/contacts/include/contacts.php 108)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 109)     $result = db_query("SELECT id FROM kundendaten.contacts WHERE customer=? AND email=?", array($cid, $email));
modules/contacts/include/contacts.php 110)     if ($result->rowCount() > 0) {
modules/contacts/include/contacts.php 111)         return true;
modules/contacts/include/contacts.php 112)     }
modules/contacts/include/contacts.php 113)     return false;
modules/contacts/include/contacts.php 114) }
modules/contacts/include/contacts.php 115) 
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   116) 
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 117) function possible_kundenkontakt($c) {
modules/contacts/include/contacts.php 118)     if ($c['name'] && $c['email']) {
modules/contacts/include/contacts.php 119)         return true;
modules/contacts/include/contacts.php 120)     }
modules/contacts/include/contacts.php 121) }
modules/contacts/include/contacts.php 122) 
modules/contacts/include/contacts.php 123) 
modules/contacts/include/contacts.php 124) function set_kundenkontakt($typ, $id) {
modules/contacts/include/contacts.php 125)     if (! $id) {
modules/contacts/include/contacts.php 126)         $id = NULL;
modules/contacts/include/contacts.php 127)     } else {
modules/contacts/include/contacts.php 128)         $id = (int) $id;
modules/contacts/include/contacts.php 129)     }
modules/contacts/include/contacts.php 130)     $args = array(
modules/contacts/include/contacts.php 131)         "kunde" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php 132)         "contact" => $id
modules/contacts/include/contacts.php 133)         );
modules/contacts/include/contacts.php 134)     $field = NULL;
modules/contacts/include/contacts.php 135)     if ($typ == 'kunde') {
modules/contacts/include/contacts.php 136)         $field = 'contact_kunde';
modules/contacts/include/contacts.php 137)     } elseif ($typ == 'extern') {
modules/contacts/include/contacts.php 138)         $field = 'contact_extern';
modules/contacts/include/contacts.php 139)     } elseif ($typ == 'rechnung') {
modules/contacts/include/contacts.php 140)         $field = 'contact_rechnung';
modules/contacts/include/contacts.php 141)     } else {
modules/contacts/include/contacts.php 142)         system_failure("Falscher Typ!");
modules/contacts/include/contacts.php 143)     }
modules/contacts/include/contacts.php 144)     db_query("UPDATE kundendaten.kunden SET ".$field."=:contact WHERE id=:kunde", $args);
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 145)     sync_legacy_contactdata();
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 146) }
modules/contacts/include/contacts.php 147) 
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 148) 
modules/contacts/include/contacts.php 149) function sync_legacy_contactdata()
modules/contacts/include/contacts.php 150) {
modules/contacts/include/contacts.php 151)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 152)     $kundenkontakte = get_kundenkontakte();
modules/contacts/include/contacts.php 153)     $kunde = get_contact($kundenkontakte['kunde']);
Bernd Wurst Beim synchronisieren der le...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 154)     $vorname = NULL;
modules/contacts/include/contacts.php 155)     $nachname = NULL;
modules/contacts/include/contacts.php 156)     if ($kunde['name']) {
modules/contacts/include/contacts.php 157)         $vorname = explode(' ', $kunde['name'], 2)[0];
modules/contacts/include/contacts.php 158)         $nachname = explode(' ', $kunde['name'], 2)[1];
modules/contacts/include/contacts.php 159)     }
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 160)     $args = array("firma" => $kunde['company'],
Bernd Wurst Beim synchronisieren der le...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 161)             "vorname" => $vorname,
modules/contacts/include/contacts.php 162)             "nachname" => $nachname,
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 163)             "adresse" => $kunde['address'],
modules/contacts/include/contacts.php 164)             "plz" => $kunde['zip'],
modules/contacts/include/contacts.php 165)             "ort" => $kunde['city'],
modules/contacts/include/contacts.php 166)             "land" => $kunde['country'],
modules/contacts/include/contacts.php 167)             "telefon" => $kunde['phone'],
modules/contacts/include/contacts.php 168)             "mobile" => $kunde['mobile'],
modules/contacts/include/contacts.php 169)             "telefax" => $kunde['fax'],
modules/contacts/include/contacts.php 170)             "email" => $kunde['email'],
modules/contacts/include/contacts.php 171)             "cid" => $cid);
modules/contacts/include/contacts.php 172)     db_query("UPDATE kundendaten.kunden SET firma=:firma, vorname=:vorname, nachname=:nachname, adresse=:adresse,
modules/contacts/include/contacts.php 173)             plz=:plz, ort=:ort, land=:land, telefon=:telefon, mobile=:mobile, telefax=:telefax, email=:email
modules/contacts/include/contacts.php 174)             WHERE id=:cid", $args);
modules/contacts/include/contacts.php 175)     if ($kundenkontakte['extern']) {
modules/contacts/include/contacts.php 176)         $extern = get_contact($kundenkontakte['extern'])['email'];
modules/contacts/include/contacts.php 177)         if ($extern) {
modules/contacts/include/contacts.php 178)             db_query("UPDATE kundendaten.kunden SET email_extern=? WHERE id=?", array($extern, $cid));
modules/contacts/include/contacts.php 179)         }
modules/contacts/include/contacts.php 180)         
modules/contacts/include/contacts.php 181)     }
modules/contacts/include/contacts.php 182)     if ($kundenkontakte['rechnung']) {
modules/contacts/include/contacts.php 183)         $kunde = get_contact($kundenkontakte['rechnung']);
modules/contacts/include/contacts.php 184)         $args = array("firma" => $kunde['company'],
modules/contacts/include/contacts.php 185)                 "name" => $kunde['name'],
modules/contacts/include/contacts.php 186)                 "adresse" => $kunde['address'],
modules/contacts/include/contacts.php 187)                 "plz" => $kunde['zip'],
modules/contacts/include/contacts.php 188)                 "ort" => $kunde['city'],
modules/contacts/include/contacts.php 189)                 "email" => $kunde['email'],
modules/contacts/include/contacts.php 190)                 "cid" => $cid);
modules/contacts/include/contacts.php 191)         db_query("UPDATE kundendaten.kunden SET re_firma=:firma, re_name=:name, re_adresse=:adresse,
modules/contacts/include/contacts.php 192)                 re_plz=:plz, re_ort=:ort, email_rechnung=:email WHERE id=:cid", $args);
modules/contacts/include/contacts.php 193)     }
modules/contacts/include/contacts.php 194) }
modules/contacts/include/contacts.php 195) 
modules/contacts/include/contacts.php 196) 
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 197) function get_kundenkontakte() {
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   198)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 199)     $result = db_query("SELECT contact_kunde, contact_extern, contact_rechnung FROM kundendaten.kunden WHERE id=?", array($cid));
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   200)     $res = $result->fetch();
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 201)     $ret = array("kunde" => $res['contact_kunde'],
modules/contacts/include/contacts.php 202)                  "extern" => $res['contact_extern'],
modules/contacts/include/contacts.php 203)                  "rechnung" => $res['contact_rechnung']);
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   204)     return $ret;
modules/handles/include/handles.php   205) }
modules/handles/include/handles.php   206) 
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 207) function save_emailaddress($id, $email) 
modules/contacts/include/contacts.php 208) {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 209)     // Speichert eine E-Mail-Adresse direkt, z.B. wenn diese schonmal geprüft wurde
Bernd Wurst Speichere E-Mail-Adresse oh...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 210)     $args = array("cid" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php 211)         "id" => (int) $id,
modules/contacts/include/contacts.php 212)         "email" => $email);
modules/contacts/include/contacts.php 213)     db_query("UPDATE kundendaten.contacts SET email=:email WHERE id=:id AND customer=:cid", $args);    
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 214) }
modules/contacts/include/contacts.php 215) 
modules/contacts/include/contacts.php 216) function save_contact($c)
modules/contacts/include/contacts.php 217) {
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 218)     if ($c['nic_id']) {
modules/contacts/include/contacts.php 219)         if (! possible_domainholder($c)) {
modules/contacts/include/contacts.php 220)             system_failure("Sie haben ein Feld geleert, das für die Eigenschaft als Domaininhaber erhalten bleiben muss. Ihre Änderungen wurden nicht gespeichert.");
modules/contacts/include/contacts.php 221)         }
modules/contacts/include/contacts.php 222)     }
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 223)     for ($i=0;array_key_exists($i, $c);$i++) {
modules/contacts/include/contacts.php 224)         unset($c[$i]);
modules/contacts/include/contacts.php 225)     }
modules/contacts/include/contacts.php 226)     unset($c['state']);
modules/contacts/include/contacts.php 227)     unset($c['lastchange']);
modules/contacts/include/contacts.php 228)     unset($c['email']);
modules/contacts/include/contacts.php 229)     $c['customer'] = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 230)     if ($c['id']) {
modules/contacts/include/contacts.php 231)         // Kontakt bestaht schon, Update
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 232)         db_query("UPDATE kundendaten.contacts SET nic_id=:nic_id, nic_handle=:nic_handle, company=:company, name=:name, address=:address, zip=:zip, city=:city, country=:country, phone=:phone, mobile=:mobile, fax=:fax, pgp_id=:pgp_id, pgp_key=:pgp_key WHERE id=:id AND customer=:customer", $c);
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 233)     } else {
modules/contacts/include/contacts.php 234)         unset($c['id']);
modules/contacts/include/contacts.php 235)         // Neu anlegen
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 236)         db_query("INSERT INTO kundendaten.contacts (nic_id, nic_handle, customer, company, name, address, zip, city, country, phone, mobile, fax, pgp_id, pgp_key) VALUES (:nic_id, :nic_handle, :customer, :company, :name, :address, :zip, :city, :country, :phone, :mobile, :fax, :pgp_id, :pgp_key)", $c);
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 237)         $c['id'] = db_insert_id();
modules/contacts/include/contacts.php 238)     }
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 239)     // FIXME: Das sollte eigentlich nicht bei jedem einzelnen Speicherovrgang passieren
modules/contacts/include/contacts.php 240)     sync_legacy_contactdata();
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 241)     return $c['id'];
modules/contacts/include/contacts.php 242) }
modules/contacts/include/contacts.php 243) 
modules/contacts/include/contacts.php 244) 
modules/contacts/include/contacts.php 245) function send_emailchange_token($id, $email)
modules/contacts/include/contacts.php 246) {
modules/contacts/include/contacts.php 247)     if (! check_emailaddr($email)) {
modules/contacts/include/contacts.php 248)         system_falure("Die E-Mail-Adresse scheint nicht gültig zu sein.");
modules/contacts/include/contacts.php 249)     }
modules/contacts/include/contacts.php 250)     $args = array("id" => (int) $id,
modules/contacts/include/contacts.php 251)         "email" => $email,
modules/contacts/include/contacts.php 252)         "token" => random_string(20));
modules/contacts/include/contacts.php 253) 
modules/contacts/include/contacts.php 254)     db_query("INSERT INTO kundendaten.mailaddress_token (token, expire, contact, email) VALUES (:token, NOW() + INTERVAL 1 DAY, :id, :email)" , $args);
modules/contacts/include/contacts.php 255)     DEBUG('Token erzeugt: '.print_r($args, true));
modules/contacts/include/contacts.php 256)     $message = 'Diese E-Mail-Adresse wurde angegeben als möglicher Domaininhaber oder Kundenkontakt bei schokokeks.org Hosting.
modules/contacts/include/contacts.php 257) 
modules/contacts/include/contacts.php 258) Bitte bestätigen Sie mit einem Klick auf den nachfolgenden Link, dass diese E-Mail-Adresse funktioniert und verwendet werden soll:
modules/contacts/include/contacts.php 259) 
modules/contacts/include/contacts.php 260)     '.config('webinterface_url').'/verify'.$args['token'].'
modules/contacts/include/contacts.php 261) 
modules/contacts/include/contacts.php 262) Wenn Sie diesen Link nicht innerhalb von 24 Stunden abrufen, wird Ihre Adresse gelöscht und nicht verwendet.
modules/contacts/include/contacts.php 263) Sollten Sie mit der Verwendung Ihrer E-Mail-Adresse nicht einverstanden sein, so ignorieren Sie daher bitte diese Nachricht oder teilen Sie uns dies mit.
modules/contacts/include/contacts.php 264) 
modules/contacts/include/contacts.php 265) -- 
modules/contacts/include/contacts.php 266) schokokeks.org GbR, Bernd Wurst, Johannes Böck
modules/contacts/include/contacts.php 267) Köchersberg 32, 71540 Murrhardt
modules/contacts/include/contacts.php 268) 
modules/contacts/include/contacts.php 269) https://schokokeks.org
modules/contacts/include/contacts.php 270) ';
modules/contacts/include/contacts.php 271)     # send welcome message
modules/contacts/include/contacts.php 272)     mail($email, '=?UTF-8?Q?Best=C3=A4tigung_Ihrer_E-Mail-Adresse?=', $message, "X-schokokeks-org-message: verify\nFrom: ".config('company_name').' <'.config('adminmail').">\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\n");
modules/contacts/include/contacts.php 273)  
modules/contacts/include/contacts.php 274) }
Bernd Wurst E-Mail-Adresse verifizieren...

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   275) 
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 276) function update_pending($contactid) {
modules/contacts/include/contacts.php 277)     $contactid = (int) $contactid;
modules/contacts/include/contacts.php 278)     $result = db_query("SELECT email FROM kundendaten.mailaddress_token WHERE contact=?", array($contactid));
Bernd Wurst E-Mail-Adresse verifizieren...

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   279)     if ($result->rowCount() == 0) {
modules/handles/include/handles.php   280)         return NULL;
modules/handles/include/handles.php   281)     }
modules/handles/include/handles.php   282)     $res = $result->fetch();
modules/handles/include/handles.php   283)     return $res['email'];
modules/handles/include/handles.php   284) }
modules/handles/include/handles.php   285) 
modules/handles/include/handles.php   286) 
modules/handles/include/handles.php   287) 
Bernd Wurst Neue Darstellung der Kontak...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 288) function delete_contact($id) {
modules/contacts/include/contacts.php 289)     $c = get_contact($id);
Bernd Wurst Zeige Kundenkontakte immer...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 290)     $kundenkontakte = get_kundenkontakte();
modules/contacts/include/contacts.php 291)     if ($id == $kundenkontakte['kunde']) {
modules/contacts/include/contacts.php 292)         system_failure("Die Stamm-Adresse kann nicht gelöscht werden, bitte erst eine andere Adresse als Stamm-Adresse festlegen!");
modules/contacts/include/contacts.php 293)     }
modules/contacts/include/contacts.php 294)     if ($id == $kundenkontakte['rechnung']) {
modules/contacts/include/contacts.php 295)         set_kundenkontakt('rechnung', NULL);
modules/contacts/include/contacts.php 296)     }
modules/contacts/include/contacts.php 297)     if ($id == $kundenkontakte['extern']) {
modules/contacts/include/contacts.php 298)         set_kundenkontakt('extern', NULL);
modules/contacts/include/contacts.php 299)     }
Bernd Wurst Neue Darstellung der Kontak...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 300)     if ($c['nic_id']) {
modules/contacts/include/contacts.php 301)         // Lösche bei der Registry
modules/contacts/include/contacts.php 302)         $c['state'] = 'deleted';
modules/contacts/include/contacts.php 303)         upload_contact($c);
modules/contacts/include/contacts.php 304)     }
modules/contacts/include/contacts.php 305)     db_query("UPDATE kundendaten.contacts SET state='deleted' WHERE id=?", array($c['id']));
modules/contacts/include/contacts.php 306) }
modules/contacts/include/contacts.php 307) 
Bernd Wurst Security

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 308) 
modules/contacts/include/contacts.php 309) function domainlist_by_contact($c) {
Bernd Wurst Beim synchronisieren der le...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 310)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 311)     $result = db_query("SELECT id FROM kundendaten.domains WHERE (owner=? OR admin_c=?) AND kunde=?", array($c['id'], $c['id'], $cid));
Bernd Wurst Security

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 312)     $ret = array();
modules/contacts/include/contacts.php 313)     while ($domain = $result->fetch()) {
modules/contacts/include/contacts.php 314)         $ret[] = new Domain( (int) $domain['id'] );
modules/contacts/include/contacts.php 315)     }
modules/contacts/include/contacts.php 316)     return $ret;
modules/contacts/include/contacts.php 317) }
modules/contacts/include/contacts.php 318) 
modules/contacts/include/contacts.php 319) 
Bernd Wurst Choose-Funktion

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 320) function contact_as_string($contact)
Bernd Wurst Abstrahieren der Anzeigefun...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 321) {
modules/contacts/include/contacts.php 322)     $adresse = nl2br("\n".filter_input_general($contact['address'])."\n".filter_input_general($contact['country']).'-'.filter_input_general($contact['zip']).' '.filter_input_general($contact['city']));
modules/contacts/include/contacts.php 323)     if (! $contact['city']) {
modules/contacts/include/contacts.php 324)         $adresse = '';
modules/contacts/include/contacts.php 325)     }
modules/contacts/include/contacts.php 326)     $name = filter_input_general($contact['name']);
modules/contacts/include/contacts.php 327)     if ($contact['company']) {
modules/contacts/include/contacts.php 328)         $name = filter_input_general($contact['company'])."<br />".filter_input_general($contact['name']);
modules/contacts/include/contacts.php 329)     }
modules/contacts/include/contacts.php 330)     $email = filter_input_general($contact['email']);
modules/contacts/include/contacts.php 331)     $new_email = update_pending($contact['id']);
modules/contacts/include/contacts.php 332)     if ($new_email) {
modules/contacts/include/contacts.php 333)         $email = "<strike>$email</strike><br/>".filter_input_general($new_email).footnote('Die E-Mail-Adresse wurde noch nicht bestätigt');
modules/contacts/include/contacts.php 334)     }
modules/contacts/include/contacts.php 335)     $email = implode("<br>\n", array_filter(array($email, filter_input_general($contact['phone']), filter_input_general($contact['fax']), filter_input_general($contact['mobile']))));
modules/contacts/include/contacts.php 336)  
modules/contacts/include/contacts.php 337) 
Bernd Wurst Choose-Funktion

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 338)     $contact_string = "<p class=\"contact-id\">#{$contact['id']}</p><p class=\"contact-address\"><strong>$name</strong>$adresse</p><p class=\"contact-contact\">$email</p>";
modules/contacts/include/contacts.php 339)     return $contact_string;
modules/contacts/include/contacts.php 340) }
modules/contacts/include/contacts.php 341) 
modules/contacts/include/contacts.php 342) function display_contact($contact, $additional_html='', $cssclass='')
modules/contacts/include/contacts.php 343) {
modules/contacts/include/contacts.php 344)     $html = contact_as_string($contact);
modules/contacts/include/contacts.php 345)     $contact_string = "<div class=\"contact {$cssclass}\" id=\"contact-{$contact['id']}\">{$html}{$additional_html}</div>";