9086c9ad77db90633e0629e9e86a88366265ded0
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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

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');
Bernd Wurst Fehlendes Include eingetragen

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  18) require_once('inc/icons.php');
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    20) require_role(array(ROLE_CUSTOMER));
Bernd Wurst Security

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  27)     - Ausgabe-Funktion abstrahieren
modules/contacts/include/contacts.php  28)     - Telefonnummern bei Ausgabe durch filter_input_general schieben
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    30) */
modules/handles/include/handles.php    31) 
modules/handles/include/handles.php    32) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  33) function new_contact()
modules/contacts/include/contacts.php  34) {
modules/contacts/include/contacts.php  35)     return array("id" => null,
modules/contacts/include/contacts.php  36)         "state" => null,
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  37)         "lastchange" => time(),
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  38)         "nic_handle" => null,
modules/contacts/include/contacts.php  39)         "nic_id" => null,
modules/contacts/include/contacts.php  40)         "company" => null,
modules/contacts/include/contacts.php  41)         "name" => null,
modules/contacts/include/contacts.php  42)         "address" => null,
modules/contacts/include/contacts.php  43)         "zip" => null,
modules/contacts/include/contacts.php  44)         "city" => null,
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  45)         "country" => "DE",
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  46)         "phone" => null,
modules/contacts/include/contacts.php  47)         "mobile" => null,
modules/contacts/include/contacts.php  48)         "fax" => null,
modules/contacts/include/contacts.php  49)         "email" => null,
modules/contacts/include/contacts.php  50)         "pgp_id" => null,
modules/contacts/include/contacts.php  51)         "pgp_key" => null,
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  52)         "customer" => $_SESSION['customerinfo']['customerno']);
modules/contacts/include/contacts.php  53) }
modules/contacts/include/contacts.php  54) 
modules/contacts/include/contacts.php  55) 
modules/contacts/include/contacts.php  56) function get_contact($id)
modules/contacts/include/contacts.php  57) {
modules/contacts/include/contacts.php  58)     $args = array(
modules/contacts/include/contacts.php  59)         "cid" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php  60)         "id" => (int) $id);
modules/contacts/include/contacts.php  61)     $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  62)     if ($result->rowCount() == 0) {
modules/contacts/include/contacts.php  63)         system_failure("Kontakt nicht gefunden oder gehört nicht diesem Kunden");
modules/contacts/include/contacts.php  64)     }
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  66)     return $contact;
modules/contacts/include/contacts.php  67) }
modules/contacts/include/contacts.php  68) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  72)     $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    73)     $ret = array();
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    76)     }
modules/handles/include/handles.php    77)     DEBUG($ret);
modules/handles/include/handles.php    78)     return $ret;
modules/handles/include/handles.php    79) }
modules/handles/include/handles.php    80) 
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  81) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  82) function is_domainholder($contactid)
modules/contacts/include/contacts.php  83) {
Bernd Wurst Neue Darstellung der Kontak...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  84)     $contactid = (int) $contactid;
modules/contacts/include/contacts.php  85)     $result = db_query("SELECT id FROM kundendaten.domains WHERE owner=? OR admin_c=?", array($contactid, $contactid));
modules/contacts/include/contacts.php  86)     if ($result->rowCount() > 0) {
modules/contacts/include/contacts.php  87)         return true;
modules/contacts/include/contacts.php  88)     }
modules/contacts/include/contacts.php  89)     return false;
modules/contacts/include/contacts.php  90) }
modules/contacts/include/contacts.php  91) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php  92) function possible_domainholders()
modules/contacts/include/contacts.php  93) {
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  94)     $allcontacts = get_contacts();
modules/contacts/include/contacts.php  95)     $ret = array();
modules/contacts/include/contacts.php  96)     foreach ($allcontacts as $id => $c) {
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  98)             $ret[$id] = $c;
modules/contacts/include/contacts.php  99)         }
modules/contacts/include/contacts.php 100)     }
modules/contacts/include/contacts.php 101)     return $ret;
modules/contacts/include/contacts.php 102) }
modules/contacts/include/contacts.php 103) 
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 104) function possible_domainholder($c)
modules/contacts/include/contacts.php 105) {
modules/contacts/include/contacts.php 106)     if ($c['name'] && $c['address'] && $c['zip'] && $c['city'] && $c['country'] && $c['phone'] && $c['email']) {
modules/contacts/include/contacts.php 107)         return true;
modules/contacts/include/contacts.php 108)     }
modules/contacts/include/contacts.php 109)     return false;
modules/contacts/include/contacts.php 110) }
Bernd Wurst Prüfe Telefonnummer

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 111) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 112) function have_mailaddress($email)
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 113) {
modules/contacts/include/contacts.php 114)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 115)     $result = db_query("SELECT id FROM kundendaten.contacts WHERE customer=? AND email=?", array($cid, $email));
modules/contacts/include/contacts.php 116)     if ($result->rowCount() > 0) {
modules/contacts/include/contacts.php 117)         return true;
modules/contacts/include/contacts.php 118)     }
modules/contacts/include/contacts.php 119)     return false;
modules/contacts/include/contacts.php 120) }
modules/contacts/include/contacts.php 121) 
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   122) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 123) function possible_kundenkontakt($c)
modules/contacts/include/contacts.php 124) {
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 125)     if ($c['name'] && $c['email']) {
modules/contacts/include/contacts.php 126)         return true;
modules/contacts/include/contacts.php 127)     }
modules/contacts/include/contacts.php 128) }
modules/contacts/include/contacts.php 129) 
modules/contacts/include/contacts.php 130) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 131) function set_kundenkontakt($typ, $id)
modules/contacts/include/contacts.php 132) {
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 133)     if (! $id) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 134)         $id = null;
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 135)     } else {
modules/contacts/include/contacts.php 136)         $id = (int) $id;
modules/contacts/include/contacts.php 137)     }
modules/contacts/include/contacts.php 138)     $args = array(
modules/contacts/include/contacts.php 139)         "kunde" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php 140)         "contact" => $id
modules/contacts/include/contacts.php 141)         );
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 142)     $field = null;
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 143)     if ($typ == 'kunde') {
modules/contacts/include/contacts.php 144)         $field = 'contact_kunde';
modules/contacts/include/contacts.php 145)     } elseif ($typ == 'extern') {
modules/contacts/include/contacts.php 146)         $field = 'contact_extern';
modules/contacts/include/contacts.php 147)     } elseif ($typ == 'rechnung') {
modules/contacts/include/contacts.php 148)         $field = 'contact_rechnung';
Bernd Wurst Verwaltung eines betrieblic...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 149)     } elseif ($typ == 'dataprotection') {
modules/contacts/include/contacts.php 150)         $field = 'contact_dataprotection';
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 151)     } else {
modules/contacts/include/contacts.php 152)         system_failure("Falscher Typ!");
modules/contacts/include/contacts.php 153)     }
modules/contacts/include/contacts.php 154)     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 155)     sync_legacy_contactdata();
Bernd Wurst Setzen als Kundenkontakte e...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 156) }
modules/contacts/include/contacts.php 157) 
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 158) 
modules/contacts/include/contacts.php 159) function sync_legacy_contactdata()
modules/contacts/include/contacts.php 160) {
modules/contacts/include/contacts.php 161)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 162)     $kundenkontakte = get_kundenkontakte();
modules/contacts/include/contacts.php 163)     $kunde = get_contact($kundenkontakte['kunde']);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 164)     $vorname = null;
modules/contacts/include/contacts.php 165)     $nachname = null;
Bernd Wurst Beim synchronisieren der le...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 166)     if ($kunde['name']) {
modules/contacts/include/contacts.php 167)         $vorname = explode(' ', $kunde['name'], 2)[0];
modules/contacts/include/contacts.php 168)         $nachname = explode(' ', $kunde['name'], 2)[1];
modules/contacts/include/contacts.php 169)     }
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 173)             "adresse" => $kunde['address'],
modules/contacts/include/contacts.php 174)             "plz" => $kunde['zip'],
modules/contacts/include/contacts.php 175)             "ort" => $kunde['city'],
modules/contacts/include/contacts.php 176)             "land" => $kunde['country'],
modules/contacts/include/contacts.php 177)             "telefon" => $kunde['phone'],
modules/contacts/include/contacts.php 178)             "mobile" => $kunde['mobile'],
modules/contacts/include/contacts.php 179)             "telefax" => $kunde['fax'],
modules/contacts/include/contacts.php 180)             "email" => $kunde['email'],
Bernd Wurst Synchronisiere pgp-key-date...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 181)             "pgp_id" => $kunde['pgp_id'],
modules/contacts/include/contacts.php 182)             "pgp_key" => $kunde['pgp_key'],
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 183)             "cid" => $cid);
modules/contacts/include/contacts.php 184)     db_query("UPDATE kundendaten.kunden SET firma=:firma, vorname=:vorname, nachname=:nachname, adresse=:adresse,
Bernd Wurst Synchronisiere pgp-key-date...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 185)             plz=:plz, ort=:ort, land=:land, telefon=:telefon, mobile=:mobile, telefax=:telefax, email=:email, 
modules/contacts/include/contacts.php 186)             pgp_id=:pgp_id, pgp_key=:pgp_key WHERE id=:cid", $args);
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 187)     if ($kundenkontakte['extern']) {
modules/contacts/include/contacts.php 188)         $extern = get_contact($kundenkontakte['extern'])['email'];
modules/contacts/include/contacts.php 189)         if ($extern) {
modules/contacts/include/contacts.php 190)             db_query("UPDATE kundendaten.kunden SET email_extern=? WHERE id=?", array($extern, $cid));
modules/contacts/include/contacts.php 191)         }
modules/contacts/include/contacts.php 192)     }
modules/contacts/include/contacts.php 193)     if ($kundenkontakte['rechnung']) {
modules/contacts/include/contacts.php 194)         $kunde = get_contact($kundenkontakte['rechnung']);
modules/contacts/include/contacts.php 195)         $args = array("firma" => $kunde['company'],
modules/contacts/include/contacts.php 196)                 "name" => $kunde['name'],
modules/contacts/include/contacts.php 197)                 "adresse" => $kunde['address'],
modules/contacts/include/contacts.php 198)                 "plz" => $kunde['zip'],
modules/contacts/include/contacts.php 199)                 "ort" => $kunde['city'],
modules/contacts/include/contacts.php 200)                 "email" => $kunde['email'],
modules/contacts/include/contacts.php 201)                 "cid" => $cid);
modules/contacts/include/contacts.php 202)         db_query("UPDATE kundendaten.kunden SET re_firma=:firma, re_name=:name, re_adresse=:adresse,
modules/contacts/include/contacts.php 203)                 re_plz=:plz, re_ort=:ort, email_rechnung=:email WHERE id=:cid", $args);
modules/contacts/include/contacts.php 204)     }
modules/contacts/include/contacts.php 205) }
modules/contacts/include/contacts.php 206) 
modules/contacts/include/contacts.php 207) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   210)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Verwaltung eines betrieblic...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 213)     $ret = array("kunde" => $res['contact_kunde'],
modules/contacts/include/contacts.php 214)                  "extern" => $res['contact_extern'],
Bernd Wurst Verwaltung eines betrieblic...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 215)                  "rechnung" => $res['contact_rechnung'],
modules/contacts/include/contacts.php 216)                  "dataprotection" => $res['contact_dataprotection']);
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   217)     return $ret;
modules/handles/include/handles.php   218) }
modules/handles/include/handles.php   219) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 220) function save_emailaddress($id, $email)
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 221) {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 222)     // 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 223)     $args = array("cid" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php 224)         "id" => (int) $id,
modules/contacts/include/contacts.php 225)         "email" => $email);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 226)     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 227) }
modules/contacts/include/contacts.php 228) 
modules/contacts/include/contacts.php 229) function save_contact($c)
modules/contacts/include/contacts.php 230) {
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 231)     if ($c['nic_id']) {
modules/contacts/include/contacts.php 232)         if (! possible_domainholder($c)) {
modules/contacts/include/contacts.php 233)             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 234)         }
modules/contacts/include/contacts.php 235)     }
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 236)     for ($i=0;array_key_exists($i, $c);$i++) {
modules/contacts/include/contacts.php 237)         unset($c[$i]);
modules/contacts/include/contacts.php 238)     }
modules/contacts/include/contacts.php 239)     unset($c['state']);
modules/contacts/include/contacts.php 240)     unset($c['lastchange']);
modules/contacts/include/contacts.php 241)     unset($c['email']);
modules/contacts/include/contacts.php 242)     $c['customer'] = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 243)     if ($c['id']) {
modules/contacts/include/contacts.php 244)         // Kontakt bestaht schon, Update
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 245)         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 246)     } else {
modules/contacts/include/contacts.php 247)         unset($c['id']);
modules/contacts/include/contacts.php 248)         // Neu anlegen
Bernd Wurst API-Funktionen um Kontakte...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 249)         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 250)         $c['id'] = db_insert_id();
modules/contacts/include/contacts.php 251)     }
Bernd Wurst Synchronisiere die Legacy-D...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 254)     return $c['id'];
modules/contacts/include/contacts.php 255) }
modules/contacts/include/contacts.php 256) 
modules/contacts/include/contacts.php 257) 
modules/contacts/include/contacts.php 258) function send_emailchange_token($id, $email)
modules/contacts/include/contacts.php 259) {
modules/contacts/include/contacts.php 260)     if (! check_emailaddr($email)) {
modules/contacts/include/contacts.php 261)         system_falure("Die E-Mail-Adresse scheint nicht gültig zu sein.");
modules/contacts/include/contacts.php 262)     }
modules/contacts/include/contacts.php 263)     $args = array("id" => (int) $id,
modules/contacts/include/contacts.php 264)         "email" => $email,
modules/contacts/include/contacts.php 265)         "token" => random_string(20));
modules/contacts/include/contacts.php 266) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 267)     db_query("INSERT INTO kundendaten.mailaddress_token (token, expire, contact, email) VALUES (:token, NOW() + INTERVAL 1 DAY, :id, :email)", $args);
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 268)     DEBUG('Token erzeugt: '.print_r($args, true));
modules/contacts/include/contacts.php 269)     $message = 'Diese E-Mail-Adresse wurde angegeben als möglicher Domaininhaber oder Kundenkontakt bei schokokeks.org Hosting.
modules/contacts/include/contacts.php 270) 
modules/contacts/include/contacts.php 271) 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 272) 
modules/contacts/include/contacts.php 273)     '.config('webinterface_url').'/verify'.$args['token'].'
modules/contacts/include/contacts.php 274) 
modules/contacts/include/contacts.php 275) Wenn Sie diesen Link nicht innerhalb von 24 Stunden abrufen, wird Ihre Adresse gelöscht und nicht verwendet.
modules/contacts/include/contacts.php 276) 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 277) 
modules/contacts/include/contacts.php 278) -- 
modules/contacts/include/contacts.php 279) schokokeks.org GbR, Bernd Wurst, Johannes Böck
modules/contacts/include/contacts.php 280) Köchersberg 32, 71540 Murrhardt
modules/contacts/include/contacts.php 281) 
modules/contacts/include/contacts.php 282) https://schokokeks.org
modules/contacts/include/contacts.php 283) ';
modules/contacts/include/contacts.php 284)     # send welcome message
modules/contacts/include/contacts.php 285)     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 286) }
Bernd Wurst E-Mail-Adresse verifizieren...

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   287) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 288) function update_pending($contactid)
modules/contacts/include/contacts.php 289) {
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 290)     $contactid = (int) $contactid;
modules/contacts/include/contacts.php 291)     $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   292)     if ($result->rowCount() == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 293)         return null;
Bernd Wurst E-Mail-Adresse verifizieren...

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php   294)     }
modules/handles/include/handles.php   295)     $res = $result->fetch();
modules/handles/include/handles.php   296)     return $res['email'];
modules/handles/include/handles.php   297) }
modules/handles/include/handles.php   298) 
modules/handles/include/handles.php   299) 
modules/handles/include/handles.php   300) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 301) function delete_contact($id)
modules/contacts/include/contacts.php 302) {
Bernd Wurst Neue Darstellung der Kontak...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 303)     $c = get_contact($id);
Bernd Wurst Zeige Kundenkontakte immer...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 304)     $kundenkontakte = get_kundenkontakte();
modules/contacts/include/contacts.php 305)     if ($id == $kundenkontakte['kunde']) {
modules/contacts/include/contacts.php 306)         system_failure("Die Stamm-Adresse kann nicht gelöscht werden, bitte erst eine andere Adresse als Stamm-Adresse festlegen!");
modules/contacts/include/contacts.php 307)     }
modules/contacts/include/contacts.php 308)     if ($id == $kundenkontakte['rechnung']) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 309)         set_kundenkontakt('rechnung', null);
Bernd Wurst Zeige Kundenkontakte immer...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 310)     }
modules/contacts/include/contacts.php 311)     if ($id == $kundenkontakte['extern']) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 312)         set_kundenkontakt('extern', null);
Bernd Wurst Zeige Kundenkontakte immer...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 314)     if ($c['nic_id']) {
modules/contacts/include/contacts.php 315)         // Lösche bei der Registry
modules/contacts/include/contacts.php 316)         $c['state'] = 'deleted';
modules/contacts/include/contacts.php 317)         upload_contact($c);
modules/contacts/include/contacts.php 318)     }
modules/contacts/include/contacts.php 319)     db_query("UPDATE kundendaten.contacts SET state='deleted' WHERE id=?", array($c['id']));
modules/contacts/include/contacts.php 320) }
modules/contacts/include/contacts.php 321) 
Bernd Wurst Security

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 322) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 323) function search_pgp_key($search)
modules/contacts/include/contacts.php 324) {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 325)     if (! check_emailaddr($search)) {
modules/contacts/include/contacts.php 326)         # Keine Ausgabe weil diese Funktion im AJAX-Call verwendet wird
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 327)         return null;
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 328)     }
modules/contacts/include/contacts.php 329)     $output = array();
modules/contacts/include/contacts.php 330)     exec('LC_ALL=C /usr/bin/gpg --batch --with-colons --keyserver hkp://pool.sks-keyservers.net --search-key '.escapeshellarg($search), $output);
modules/contacts/include/contacts.php 331)     DEBUG($output);
modules/contacts/include/contacts.php 332)     $keys = array();
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 333)     foreach ($output as $row) {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 334)         if (substr($row, 0, 4) === 'pub:') {
modules/contacts/include/contacts.php 335)             $parts = explode(':', $row);
modules/contacts/include/contacts.php 336)             if ($parts[5] && ($parts[5] < time())) {
modules/contacts/include/contacts.php 337)                 // abgelaufener key
modules/contacts/include/contacts.php 338)                 continue;
modules/contacts/include/contacts.php 339)             }
modules/contacts/include/contacts.php 340)             // array-key = create-timestamp
modules/contacts/include/contacts.php 341)             // array-value = key-id
modules/contacts/include/contacts.php 342)             $keys[$parts[4]] = $parts[1];
modules/contacts/include/contacts.php 343)         }
modules/contacts/include/contacts.php 344)     }
modules/contacts/include/contacts.php 345)     if (count($keys) == 0) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 346)         return null;
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 347)     }
modules/contacts/include/contacts.php 348)     ksort($keys, SORT_NUMERIC);
modules/contacts/include/contacts.php 349)     DEBUG(end($keys));
modules/contacts/include/contacts.php 350)     // liefert den neuesten Key
modules/contacts/include/contacts.php 351)     return end($keys);
modules/contacts/include/contacts.php 352) }
modules/contacts/include/contacts.php 353) 
modules/contacts/include/contacts.php 354) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 355) function fetch_pgp_key($pgp_id)
modules/contacts/include/contacts.php 356) {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 357)     $output = array();
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 358)     $ret = null;
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 359)     DEBUG('/usr/bin/gpg --batch --keyserver hkp://pool.sks-keyservers.net --recv-key '.escapeshellarg($pgp_id));
modules/contacts/include/contacts.php 360)     exec('/usr/bin/gpg --batch --keyserver hkp://pool.sks-keyservers.net --recv-key '.escapeshellarg($pgp_id), $output, $ret);
modules/contacts/include/contacts.php 361)     DEBUG($output);
modules/contacts/include/contacts.php 362)     DEBUG($ret);
modules/contacts/include/contacts.php 363)     if ($ret == 0) {
modules/contacts/include/contacts.php 364)         exec('/usr/bin/gpg --batch --with-colons --list-keys '.escapeshellarg($pgp_id), $output);
modules/contacts/include/contacts.php 365)         DEBUG($output);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 366)         foreach ($output as $row) {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 367)             if (substr($row, 0, 4) === 'fpr:') {
modules/contacts/include/contacts.php 368)                 $parts = explode(':', $row);
modules/contacts/include/contacts.php 369)                 // Fingerprint
modules/contacts/include/contacts.php 370)                 return $parts[9];
modules/contacts/include/contacts.php 371)             }
modules/contacts/include/contacts.php 372)         }
modules/contacts/include/contacts.php 373)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 374)     return null;
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 375) }
modules/contacts/include/contacts.php 376) 
modules/contacts/include/contacts.php 377) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 380)     $cid = (int) $_SESSION['customerinfo']['customerno'];
modules/contacts/include/contacts.php 381)     $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 382)     $ret = array();
modules/contacts/include/contacts.php 383)     while ($domain = $result->fetch()) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 384)         $ret[] = new Domain((int) $domain['id']);
Bernd Wurst Security

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 385)     }
modules/contacts/include/contacts.php 386)     return $ret;
modules/contacts/include/contacts.php 387) }
modules/contacts/include/contacts.php 388) 
modules/contacts/include/contacts.php 389) 
Bernd Wurst Choose-Funktion

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 391) {
modules/contacts/include/contacts.php 392)     $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 393)     if (! $contact['city']) {
modules/contacts/include/contacts.php 394)         $adresse = '';
modules/contacts/include/contacts.php 395)     }
modules/contacts/include/contacts.php 396)     $name = filter_input_general($contact['name']);
modules/contacts/include/contacts.php 397)     if ($contact['company']) {
modules/contacts/include/contacts.php 398)         $name = filter_input_general($contact['company'])."<br />".filter_input_general($contact['name']);
modules/contacts/include/contacts.php 399)     }
modules/contacts/include/contacts.php 400)     $email = filter_input_general($contact['email']);
modules/contacts/include/contacts.php 401)     $new_email = update_pending($contact['id']);
modules/contacts/include/contacts.php 402)     if ($new_email) {
modules/contacts/include/contacts.php 403)         $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 404)     }
modules/contacts/include/contacts.php 405)     $email = implode("<br>\n", array_filter(array($email, filter_input_general($contact['phone']), filter_input_general($contact['fax']), filter_input_general($contact['mobile']))));
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 406)     $pgp = '';
modules/contacts/include/contacts.php 407)     if ($contact['pgp_id']) {
modules/contacts/include/contacts.php 408)         $pgpid = $contact['pgp_id'];
modules/contacts/include/contacts.php 409)         if (strlen($pgpid) > 20) {
modules/contacts/include/contacts.php 410)             $pgpid = substr($pgpid, 0, 20).' '.substr($pgpid, 20);
modules/contacts/include/contacts.php 411)         }
modules/contacts/include/contacts.php 412)         $pgp = '<p class="contact-pgp">'.other_icon('key.png').' PGP ID:<br>'.$pgpid.'</p>';
modules/contacts/include/contacts.php 413)     }
Hanno remove whitespace in empty...

Hanno authored 6 years ago

modules/contacts/include/contacts.php 414) 
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 415)     $contact_string = "<p class=\"contact-id\">#{$contact['id']}</p><p class=\"contact-address\"><strong>$name</strong>$adresse</p><p class=\"contact-contact\">$email</p>$pgp";
Bernd Wurst Choose-Funktion

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php 416)     return $contact_string;
modules/contacts/include/contacts.php 417) }
modules/contacts/include/contacts.php 418) 
modules/contacts/include/contacts.php 419) function display_contact($contact, $additional_html='', $cssclass='')
modules/contacts/include/contacts.php 420) {
modules/contacts/include/contacts.php 421)     $html = contact_as_string($contact);
modules/contacts/include/contacts.php 422)     $contact_string = "<div class=\"contact {$cssclass}\" id=\"contact-{$contact['id']}\">{$html}{$additional_html}</div>";