$line";
}
if ($_REQUEST['action'] == "regist") {
if (($_REQUEST['old_pw'] &&
(crypt($_REQUEST['old_pw'], 'root') == $Init['root'] ||
crypt($_REQUEST['old_pw'], $System['superadmin']) == $System['superadmin'])) &&
($_REQUEST['new_pw'] && $_REQUEST['new_pw'] == $_REQUEST['new_pw2'])) {
$root = crypt($_REQUEST['new_pw'], 'root');
$root = str_replace("=", "=", $root);
} else {
$root = $Init['root'];
}
!preg_match("/\/$/", $_REQUEST['news']) && $_REQUEST['news'] .= "/";
!preg_match("/\/$/", $_REQUEST['find']) && $_REQUEST['find'] .= "/";
$newsdir = $_SERVER['DOCUMENT_ROOT']. $_REQUEST['news']. "news";
$finddir = $_SERVER['DOCUMENT_ROOT']. $_REQUEST['find']. "find";
$downloaddir = $_SERVER['DOCUMENT_ROOT']. $_REQUEST['download']. "download";
if ($_REQUEST['nonExt']) {
if ($_REQUEST['htaccess_update']) {
$cmd = array('news', 'find');
$handler = $Init['Handler'];
$Init['Handler2'] = $handler = $Init['Handler'];
add_Htaccess($cmd, $handler);
}
} else {
$newsdir .= ".php";
$finddir .= ".php";
$downloaddir .= ".php";
}
if (!is_dir($newsdir) && !is_file($newsdir)) {
$script = join("\n", array(
""
));
$script = str_replace("\t", "", $script);
eval("file_put_contents(\$newsdir, \$script);");
}
if (!is_dir($finddir) && !is_file($finddir)) {
$script = join("\n", array(
""
));
$script = str_replace("\t", "", $script);
eval("file_put_contents(\$finddir, \$script);");
}
if (!is_dir($downloaddir) && !is_file($downloaddir)) {
$script = join("\n", array(
""
));
$script = str_replace("\t", "", $script);
eval("file_put_contents(\$downloaddir, \$script);");
}
if (!is_dir($_SERVER['DOCUMENT_ROOT']. "/". $_REQUEST['Mobiledir'])) {
mkdir($_SERVER['DOCUMENT_ROOT']. "/". $_REQUEST['Mobiledir']);
}
$_REQUEST['Template'] = str_replace("
", "\n", $_REQUEST['Template']);
$_REQUEST['Depart'] = str_replace("
", "\n", $_REQUEST['Depart']);
$_REQUEST['Post'] = str_replace("
", "\n", $_REQUEST['Post']);
$_REQUEST['Nondir'] = str_replace("
", "\n", $_REQUEST['Nondir']);
$_REQUEST['accessIP'] = str_replace("
", "\n", $_REQUEST['accessIP']);
$_REQUEST['Css'] = preg_replace("/(
|\r)/", ",", $_REQUEST['Css']);
is_array($_REQUEST['Approval']) && $approval = join("\n", $_REQUEST['Approval']);
$value = join("\n", array(
"[Init]",
"root=$root",
"Title=". $_REQUEST['Title'],
"Company=". $_REQUEST['Company'],
"Zip=". $_REQUEST['Zip'],
"Pre=". $_REQUEST['Pre'],
"City=". $_REQUEST['City'],
"Addr=". $_REQUEST['Addr'],
"Buill=". $_REQUEST['Buill'],
"Tel=". $_REQUEST['Tel'],
"Fax=". $_REQUEST['Fax'],
"theme=". $_REQUEST['theme'],
"Adminname=". $_REQUEST['Adminname'],
"Adminmail=". $_REQUEST['Adminmail'],
"Signature=". $_REQUEST['Signature'],
"nonExt=". $_REQUEST['nonExt'],
"Handler=". $_REQUEST['Handler'],
"Handler2=". $_REQUEST['Handler2'],
"Url=". $_REQUEST['Url'],
"Summary=". $_REQUEST['Summary'],
"Encode=". $_REQUEST['Encode'],
"Css=". $_REQUEST['Css'],
"ssiurl=". $_REQUEST['ssiurl'],
"Mobiledir=". $_REQUEST['Mobiledir'],
"serverEncode=". $_REQUEST['serverEncode'],
"sendmail=". $_REQUEST['sendmail'],
"mailEncode=". $_REQUEST['mailEncode'],
"Key=". $_REQUEST['Key'],
"Update=". $_REQUEST['Update'],
"startupNews=". $_REQUEST['startupNews'],
"nontree=". $_REQUEST['nontree'],
"Cols=". $_REQUEST['Cols'],
"unzip=". $_REQUEST['unzip'],
"zip=". $_REQUEST['zip'],
"lha=". $_REQUEST['lha'],
"FTPserver=". $_REQUEST['FTPserver'],
"FTPaccount=". $_REQUEST['FTPaccount'],
"FTPpasswd=". $_REQUEST['FTPpasswd'],
"FTProot=". $_REQUEST['FTProot'],
"Newslist=". $_REQUEST['Newslist'],
"subject_tinymce=". $_REQUEST['subject_tinymce'],
"mce_skin=".$_REQUEST['mce_skin'],
"news_edit_auth=". $_REQUEST['news_edit_auth'],
"[Exe]",
"news=". $_REQUEST['news'],
"find=". $_REQUEST['find'],
"download=". $_REQUEST['download'],
"[Template]",
$_REQUEST['Template'],
"[Depart]",
$_REQUEST['Depart'],
"[Post]",
$_REQUEST['Post'],
"[Approval]",
$approval,
"[Nondir]",
$_REQUEST['Nondir'],
"[accessIP]",
$_REQUEST['accessIP']
));
$value = str_replace("\t", "", $value);
file_put_contents($System['datadir']. "/initialize.cgi", $value);
logregist($Language->init->logmsg);
$javascript = "
document.getElementById('confirmdialog').innerHTML='
設定を反映するためブラウザを再起動します。';
$(function() {
$('#confirmdialog').dialog({
title: '". $Language->system->caption->confirm. "',
resizable: false,
width: 400,
height:180,
modal: true,
show: 'blind',
hide: 'explode',
buttons: {
". $Language->button->yes. ": function() {
$(this).dialog('close');
parent.location.href='./';
},
". $Language->button->no. ": function() { $(this).dialog('close'); }
}
});
});";
} else {
foreach ($Encoding as $e) {
$select = "";
$Init['Encode'] == $e && $select = "selected";
$encode_options .= "
";
}
is_array($Template) && $template = join("\r", $Template);
is_array($Depart) && $depart = join("\r", $Depart);
is_array($Post) && $post = join("\r", $Post);
is_array($Nondir) && $nondir = join("\r", $Nondir);
is_array($accessIP) && $accessip = join("\r", $accessIP);
!$Exe['news'] && $Exe['news'] = "/";
!$Exe['find'] && $Exe['find'] = "/";
!$Exe['download'] && $Exe['download'] = "/";
$client = new window;
$client->name = 'client';
$client->width = '100%';
$client->display = 'block';
$client->caption = $Language->init->caption;
$client->drag = false;
$client->resize = false;
$client->closebutton = true;
$client->closeFunc = '';
$client->smallbutton = true;
$client->height = '';
$client->border = false;
$client->bgcolor = '';
$client->statusbar = false;
$client->bgcolor = '';
$client->date = false;
$client->time = false;
$client->copy = false;
$client->help = $help->$_REQUEST['cmd'];
$client->Lang = $Language;
$Language->init->address->memo = str_replace("\n", "
", $Language->init->address->memo);
$Language->init->group->memo = str_replace("\n", "
", $Language->init->group->memo);
$Language->init->post->memo = str_replace("\n", "
", $Language->init->post->memo);
$Language->init->auth->memo = str_replace("\n", "
", $Language->init->auth->memo);
$Language->init->access->memo = str_replace("\n", "
", $Language->init->access->memo);
$Language->init->template->memo = str_replace("\n", "
", $Language->init->template->memo);
$Language->init->style->memo = str_replace("\n", "
", $Language->init->style->memo);
$client->body = "