本文整理汇总了PHP中Domain::getAllDomains方法的典型用法代码示例。如果您正苦于以下问题:PHP Domain::getAllDomains方法的具体用法?PHP Domain::getAllDomains怎么用?PHP Domain::getAllDomains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::getAllDomains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: domain_list
function domain_list($tmp, $page)
{
$domains_a =& Domain::getAllDomains();
$domains = array();
foreach ($domains_a as $domain) {
$domains[] = array('id' => $domain->getId(), 'dname' => $domain->getName(), 'sname' => $domain->getServerName(), 'sip' => $domain->getServerIP(), 'sport' => $domain->getServerPort(), 'sadmin' => $domain->getServerAdmin(), 'salias' => $domain->getAlias(), 'isactive' => $domain->isActive());
}
$tmp->assign('data', $domains);
$tmp->assign('tab_page', $page);
}
示例2: wb_manage
function wb_manage($tmp, $page, $TABLE)
{
global $RS;
$manage[] = array_values($RS['LIST_MANAGEMENT_TYPE']);
$manages = array_shift($manage);
$mchoise = null;
if ($_POST['mchoise']) {
$mchoise = $_POST['mchoise'];
}
$db = new DBConnection();
if ($mchoise) {
$db->addManagements($mchoise);
}
$mvalues = $db->getAllManagements();
if ($mvalues) {
$mkeys = array_keys($mvalues);
}
foreach ($manages as $key => $value) {
if ($key) {
if ($mkeys) {
if (in_array($key, $mkeys)) {
$checked[] = $key;
}
}
$mvalues[$key] ? $m = $mvalues[$key] : ($m = '0000-00-00 00:00:00');
$checkbox[$key] = "<b>{$value}</b> (<i>{$m}</i>)";
}
}
$file = "webekci_conf";
if (is_dir("{$file}")) {
//chown($file, 'apache');
//chgrp($file, 'apache');
deleteDirectory("{$file}");
mkdir("{$file}");
// if(is_array($mvalues)) {
$mkeys = array_keys($mvalues);
foreach ($mkeys as $m) {
if ($m == 1) {
mkdir("{$file}/virtualhosts");
$domains_a =& Domain::getAllDomains();
$domains = array();
foreach ($domains_a as $domain) {
$vhost_file_name = $domain->getServerName();
$vhost_info = null;
$vhost_file = fopen("{$file}/virtualhosts/{$vhost_file_name}", "w+");
if ($domain->getServerIP() && $domain->getServerPort() && $domain->getServerName()) {
$vhost_info .= '<VirtualHost ' . $domain->getServerIP() . ':' . $domain->getServerPort() . '>' . "\n";
$vhost_info .= 'ServerName ' . $domain->getServerName() . "\n";
if ($domain->getAlias()) {
$vhost_info .= 'ServerAlias ' . $domain->getAlias() . "\n";
}
if ($domain->getServerAdmin()) {
$vhost_info .= 'ServerAdmin ' . $domain->getServerIP() . "\n";
}
$vhost_info .= $domain->getOther() . "\n";
if ($domain->getModSecConf()) {
$vhost_info .= 'Include ../modsecurityconfs/' . $domain->getModSecConfName() . ".conf\n";
}
$vhost_info .= '</VirtualHost>' . "\n";
fwrite($vhost_file, $vhost_info);
}
fclose($vhost_file);
}
}
if ($m == 2) {
mkdir("{$file}/modsecurityconfs");
}
if ($m == 3) {
mkdir("{$file}/rules");
}
if ($m == 4) {
mkdir("{$file}/whitelists");
}
}
} else {
print "no dir (webekci_conf)";
}
$tmp->assign('wb_list', $checkbox);
$tmp->assign('selected_wb', $checked);
$tmp->assign('tab_page', $page);
}