$err['domain'] = t('Domain Invalid.'); if ($res == 'occupied') { $err['domain'] = t('Domain Occupied.'); } $break = true; } // check docroot if (!in_array($docroot, $dirs)) { $err['docroot'] = t('Please select a valid document root.'); $break = true; } $docroot = str_replace('~/', "/home/{$me}/", $docroot); if ($break) { break; } if (!ZVhosts::addsite($me, $domain, $docroot)) { setmsg(t('Can not add this site to system.')); } setmsg(t('New site created!'), 'notice'); } break; case 'edit': $name = preg_replace("/[^0-9a-z\\-\\.]/", '', $_REQUEST['name']); if (!$name || $name == 'default') { $name = ''; } if (!in_array($name, ZVhosts::listMyVhosts(true)) && !isadmin()) { setmsg(t('No such domain hosted.')); } if (checktoken() && 'alias' == $_REQUEST['op']) { $alias = strtolower(trim($_REQUEST['alias']));
function addsite($user, $domain, $docroot) { return ZVhosts::addsite($user, $domain, $docroot); }