Hanno Böck
php 5.5 default
Hanno Böck commited 1be61d6 at 2013-10-28 16:29:37
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
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.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
http://creativecommons.org/publicdomain/zero/1.0/
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.
*/
require_once("inc/base.php");
require_once("inc/error.php");
require_once("inc/security.php");
require_once('class/domain.php');
require_once("certs.php");
function traffic_month($vhost_id)
{
$vhost_id = (int) $vhost_id;
$result = db_query("SELECT sum(mb_in+mb_out) as mb FROM vhosts.traffic where date > CURDATE() - INTERVAL 1 MONTH AND vhost_id = {$vhost_id}");
$data = mysql_fetch_assoc($result);
return $data['mb'];
}
function autoipv6_address($vhost_id, $mode = 1)
{
$result = db_query("SELECT uid, v6_prefix FROM vhosts.v_vhost LEFT JOIN system.servers ON (servers.hostname = server) WHERE v_vhost.id={$vhost_id}");
$data = mysql_fetch_assoc($result);
if (!$data['v6_prefix'])
{
warning("IPv6-Adresse nicht verfügbar, Server unterstützt kein IPv6");
return "";
}
list($prefix, $null) = explode('/', $data['v6_prefix']);
$vh = ':1';
if ($mode == 2) {
$vh = implode(':', str_split(sprintf("%08x", $vhost_id), 4));
}
$ipv6 = $prefix . sprintf("%04s", $data['uid']) . ':' . $vh;
return $ipv6;
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX