1359faae58486f92f9b472d115efbb22c9a71beb
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php   1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

class/domain.php    2) /*
class/domain.php    3) This file belongs to the Webinterface of schokokeks.org Hosting
class/domain.php    4) 
Bernd Wurst Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

class/domain.php    5) Written 2008-2014 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

class/domain.php    6)   Bernd Wurst <bernd@schokokeks.org>
class/domain.php    7)   Hanno Böck <hanno@schokokeks.org>
class/domain.php    8) 
class/domain.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.
class/domain.php   10) 
class/domain.php   11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
class/domain.php   12) http://creativecommons.org/publicdomain/zero/1.0/
class/domain.php   13) 
class/domain.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.
class/domain.php   15) */
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  16) 
class/domains.php  17) require_once('inc/base.php');
class/domains.php  18) require_once('inc/debug.php');
class/domains.php  19) 
class/domains.php  20) require_once('class/keksdata.php');
class/domains.php  21) 
class/domains.php  22) 
class/domains.php  23) class Domain extends KeksData
class/domains.php  24) {
class/domains.php  25)   function __construct($init = NULL)
class/domains.php  26)   {
class/domains.php  27)     $this->default_table = 'kundendaten.domains';
class/domains.php  28)     $this->setup();
class/domains.php  29)     switch (gettype($init))
class/domains.php  30)     {
class/domains.php  31)       case 'string':
class/domains.php  32)         $this->loadByName($init);
class/domains.php  33)         break;
class/domains.php  34)       case 'integer':
class/domains.php  35)         $this->loadByID($init);
class/domains.php  36)         break;
class/domains.php  37)       case 'NULL':
class/domains.php  38)         break;
class/domains.php  39)     }
class/domains.php  40)   }
class/domains.php  41) 
class/domains.php  42)   function loadByName($name)
class/domains.php  43)   {
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

class/domain.php   44)     $name = db_escape_string($name);
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  45)     $res = $this->getData("*", "CONCAT_WS('.', domainname, tld)='{$name}' LIMIT 1");
bernd Domain-Klasse benutzen

bernd authored 17 years ago

class/domain.php   46)     if (count($res) < 1)
class/domain.php   47)       return false;
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  48)     $this->parse($res[0]);
class/domains.php  49)   }
class/domains.php  50) 
bernd Mehr config-optionen und co...

bernd authored 15 years ago

class/domain.php   51)   function ensure_customerdomain()
class/domain.php   52)   {
class/domain.php   53)     if (! $this->is_customerdomain() )
Bernd Wurst Entferne den FQDN aus Fehle...

Bernd Wurst authored 7 years ago

class/domain.php   54)       system_failure('Diese Domain gehört nicht Ihrem Kundenaccount.');
bernd Mehr config-optionen und co...

bernd authored 15 years ago

class/domain.php   55)   }
class/domain.php   56) 
class/domain.php   57)   function ensure_userdomain()
class/domain.php   58)   {
class/domain.php   59)     if (! $this->is_userdomain() )
Bernd Wurst Entferne den FQDN aus Fehle...

Bernd Wurst authored 7 years ago

class/domain.php   60)       system_failure('Diese Domain gehört nicht Ihrem Benutzeraccount.');
bernd Mehr config-optionen und co...

bernd authored 15 years ago

class/domain.php   61)   }
class/domain.php   62) 
class/domain.php   63)   function is_customerdomain()
class/domain.php   64)   {
class/domain.php   65)     if (! isset($_SESSION['customerinfo']) )
class/domain.php   66)       return false;
class/domain.php   67)     $customerno = (int) $_SESSION['customerinfo']['customerno'];
class/domain.php   68)     return ($this->kunde == $customerno);
class/domain.php   69)   }
class/domain.php   70) 
class/domain.php   71)   function is_userdomain()
class/domain.php   72)   {
class/domain.php   73)     if (! isset($_SESSION['userinfo']) )
class/domain.php   74)       return false;
class/domain.php   75)     $uid = (int) $_SESSION['userinfo']['uid'];
class/domain.php   76)     return ($this->useraccount == $uid);
class/domain.php   77)   }
class/domain.php   78) 
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  79)   function parse($data)
class/domains.php  80)   {
bernd some updates

bernd authored 16 years ago

class/domain.php   81)     DEBUG($data);
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  82)     foreach (array_keys($this->data) as $key)
class/domains.php  83)       if (array_key_exists($key, $data))
class/domains.php  84)         $this->data[$key] = $data[$key];
class/domains.php  85)     $this->data['fqdn'] = $data['domainname'].'.'.$data['tld'];
Bernd Wurst Punycode-Konvertierung find...

Bernd Wurst authored 6 years ago

class/domain.php   86)     $this->data['punycode'] = idn_to_ascii($this->data['fqdn'], 0, INTL_IDNA_VARIANT_UTS46);
class/domain.php   87)     $this->data['is_idn'] = ($this->data['fqdn'] != $this->data['punycode']);
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php  88)     $this->data['reg_date'] = $data['registrierungsdatum'];
class/domains.php  89)     $this->data['cancel_date'] = $data['kuendigungsdatum'];
class/domains.php  90)   }
class/domains.php  91) 
class/domains.php  92) }
class/domains.php  93) 
class/domains.php  94) 
class/domains.php  95) 
class/domains.php  96) 
class/domains.php  97) 
class/domains.php  98) 
class/domains.php  99) 
class/domains.php 100) function get_domain_list($customerno, $uid = NULL)
class/domains.php 101) {
class/domains.php 102)   $customerno = (int) $customerno;
class/domains.php 103)   $query = "SELECT id FROM kundendaten.domains WHERE";
class/domains.php 104)   if ($uid !== NULL)
class/domains.php 105)   {
class/domains.php 106)     $uid = (int) $uid;
bernd Domains alphabetisch sortieren

bernd authored 17 years ago

class/domain.php  107)     $query .= " useraccount={$uid}";
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php 108)   }
class/domains.php 109)   else
class/domains.php 110)   {
bernd Domains alphabetisch sortieren

bernd authored 17 years ago

class/domain.php  111)     $query .= " kunde={$customerno}";
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php 112)   }
bernd Domains alphabetisch sortieren

bernd authored 17 years ago

class/domain.php  113)   $query .= " ORDER BY domainname,tld";
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

class/domain.php  114)   $result = db_query($query, array()); // FIXME Übergebe leeren array um die Warnung zu unterdrücken
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php 115)   $domains = array();
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

class/domain.php  116)   DEBUG('Result set is '.$result->rowCount()." rows.<br />\n");
class/domain.php  117)   if ($result->rowCount() > 0)
class/domain.php  118)     while ($domain = $result->fetch(PDO::FETCH_OBJ))
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 15 years ago

class/domain.php  119)       array_push($domains, new Domain((int) $domain->id));
bernd Ein paar neue Klassen

bernd authored 17 years ago

class/domains.php 120)   DEBUG($domains);
class/domains.php 121) 	return $domains;	
class/domains.php 122) }
class/domains.php 123) 
class/domains.php 124) 
class/domains.php 125) 
class/domains.php 126) function get_jabberable_domains()
class/domains.php 127) {
class/domains.php 128)   require_role(ROLE_CUSTOMER);
class/domains.php 129)   $customerno = (int) $_SESSION['customerinfo']['customerno'];
class/domains.php 130) 
class/domains.php 131)   $domains = get_domain_list($customerno);
class/domains.php 132)   DEBUG($domains);
class/domains.php 133)   $result = array( new Domain() );
class/domains.php 134)   $result[0]->id = 0;
bernd Mehr config-optionen und co...

bernd authored 15 years ago

class/domain.php  135)   $result[0]->fqdn = config('masterdomain');