Пример #1
0
 function getDomains()
 {
     global $pdo;
     $sql = "SELECT name FROM site";
     $domains = $pdo->fetchList($sql, 'name');
     $aliases = ZVhosts::getAliases('all');
     return array_merge($domains, $aliases);
 }
Пример #2
0
     } else {
         setmsg(t('Error'));
     }
 }
 if (checktoken() && 'default' == $_REQUEST['op'] && isadmin()) {
     if (ZVhosts::setDefaultSite($name)) {
         setmsg('Updated', 'notice');
     } else {
         setmsg(t('Error'));
     }
 }
 $deny_begin = '####ZHPANEL DENY BEGIN';
 $deny_end = '####ZHPANEL DENY END';
 $token = token();
 $vhost = ZVhosts::getVhost($name);
 $aliases = ZVhosts::getAliases($name);
 $htaccess = "{$home}/{$vhost->owner}/{$name}/.htaccess";
 if (checktoken() && 'denyips' == $_REQUEST['op']) {
     $denyips = $_REQUEST['denyips'];
     $patten_ip = "@^[0-9\\./a-f:]+\$@";
     $arr_ips = explode("\n", $denyips);
     foreach ($arr_ips as $k => $ip) {
         $arr_ips[$k] = $ip = trim($ip);
         if (!preg_match($patten_ip, $ip)) {
             unset($arr_ips[$k]);
         }
     }
     $arr_ips[] = '0.0.0.0';
     $ips = 'Deny from ' . join(' ', (array) $arr_ips);
     if (file_exists($htaccess)) {
         $content = file_get_contents($htaccess);
Пример #3
0
function getAliases($domain)
{
    return ZVhosts::getAliases($domain);
}