4001177cdf61d3b431c544ff2fc18183f4398639
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));
modules/handles/include/handles.php    19) 
Bernd Wurst $usage ist ein array

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    20) /*
modules/handles/include/handles.php    21) require_once('external/http.net/domainRobotApi.php');
modules/handles/include/handles.php    22) 
modules/handles/include/handles.php    23) function api_fetch_contact($nic_id)
modules/handles/include/handles.php    24) {
modules/handles/include/handles.php    25)   if (! config('http.net-apikey')) {
modules/handles/include/handles.php    26)     system_failure("Kein API-Key vorhanden!");
modules/handles/include/handles.php    27)   }
modules/handles/include/handles.php    28)   $api = new domainRobotApi(config('http.net-apikey'));
modules/handles/include/handles.php    29) }
modules/handles/include/handles.php    30) */
modules/handles/include/handles.php    31) 
modules/handles/include/handles.php    32) 
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  33) function new_contact() {
modules/contacts/include/contacts.php  34)     return array("id" => NULL,
modules/contacts/include/contacts.php  35)         "state" => NULL,
modules/contacts/include/contacts.php  36)         "lastchange" => time(),
modules/contacts/include/contacts.php  37)         "nic_handle" => NULL,
modules/contacts/include/contacts.php  38)         "nic_id" => NULL,
modules/contacts/include/contacts.php  39)         "company" => NULL,
modules/contacts/include/contacts.php  40)         "name" => NULL,
modules/contacts/include/contacts.php  41)         "address" => NULL,
modules/contacts/include/contacts.php  42)         "zip" => NULL,
modules/contacts/include/contacts.php  43)         "city" => NULL,
modules/contacts/include/contacts.php  44)         "country" => "DE",
modules/contacts/include/contacts.php  45)         "phone" => NULL,
modules/contacts/include/contacts.php  46)         "mobile" => NULL,
modules/contacts/include/contacts.php  47)         "fax" => NULL,
modules/contacts/include/contacts.php  48)         "email" => NULL,
modules/contacts/include/contacts.php  49)         "pgp_id" => NULL,
modules/contacts/include/contacts.php  50)         "pgp_key" => NULL,
modules/contacts/include/contacts.php  51)         "customer" => $_SESSION['customerinfo']['customerno']);
modules/contacts/include/contacts.php  52) }
modules/contacts/include/contacts.php  53) 
modules/contacts/include/contacts.php  54) 
modules/contacts/include/contacts.php  55) function get_contact($id)
modules/contacts/include/contacts.php  56) {
modules/contacts/include/contacts.php  57)     $args = array(
modules/contacts/include/contacts.php  58)         "cid" => (int) $_SESSION['customerinfo']['customerno'],
modules/contacts/include/contacts.php  59)         "id" => (int) $id);
modules/contacts/include/contacts.php  60)     $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  61)     if ($result->rowCount() == 0) {
modules/contacts/include/contacts.php  62)         system_failure("Kontakt nicht gefunden oder gehört nicht diesem Kunden");
modules/contacts/include/contacts.php  63)     }
modules/contacts/include/contacts.php  64)     $res = $result->fetch()
modules/contacts/include/contacts.php  65)     $contact = $res[0];
modules/contacts/include/contacts.php  66)     return $contact;
modules/contacts/include/contacts.php  67) }
modules/contacts/include/contacts.php  68) 
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    70)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  71)     $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 customer=? ORDER BY id", array($cid));
Bernd Wurst In neues Modul ausgelagert

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    75)     }
modules/handles/include/handles.php    76)     DEBUG($ret);
modules/handles/include/handles.php    77)     return $ret;
modules/handles/include/handles.php    78) }
modules/handles/include/handles.php    79) 
modules/handles/include/handles.php    80) 
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  83)     $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    84)     $res = $result->fetch();
Bernd Wurst Umbenennung Datenbank handl...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/handles/include/handles.php    88)     return $ret;
modules/handles/include/handles.php    89) }
modules/handles/include/handles.php    90) 
Bernd Wurst E-Mail-Adresse verifizieren...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

modules/contacts/include/contacts.php  92) function update_pending($contactid) {
modules/contacts/include/contacts.php  93)     $contactid = (int) $contactid;
modules/contacts/include/contacts.php  94)     $result = db_query("SELECT email FROM kundendaten.mailaddress_token WHERE contact=?", array($contactid));