5 if(!chdir(
"/usr/share/alternc/panel"))
7 require(
"/usr/share/alternc/panel/class/config_nochk.php");
14 # Use the dbusers file if exist, else use default alternc configuration
15 if ( is_readable(
"/etc/alternc/dbusers.cnf") ) {
16 $mysqlconf=file_get_contents(
"/etc/alternc/dbusers.cnf");
18 $mysqlconf=file_get_contents(
"/etc/alternc/my.cnf");
22 # Read the configuration
24 # First, read the "standard" configuration
25 if (preg_match(
'/^([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $regs)) {
38 # Then, read specific alternc configuration
39 if (preg_match(
'/^#alternc_var ([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $regs)) {
44 # Set value of human_host if unset
45 if (! isset($human_hostname) || empty($human_hostname)) {
47 $human_hostname = gethostbyaddr(
$host);
49 $human_hostname =
$host;
54 $db->query(
"select * from db_servers;");
55 if (
$db->num_rows()==0) {
56 $db->query(
" insert into db_servers (name, host, login, password, client) values ('".mysql_escape_string($human_hostname).
"','".mysql_escape_string(
$host).
"','".mysql_escape_string(
$user).
"','".mysql_escape_string(
$password).
"','".mysql_escape_string($L_MYSQL_CLIENT).
"');");
60 $db->query(
" update membres set db_server_id = (select max(id) from db_servers) where db_server_id is null ;");
checkipv6($ip)
Check that $ip is a correct ipv6 ip.
checkip($ip)
Check that $ip is a correct 4 Dotted ip.