function SelectSkin($path, $skin, $cookie) { $chk = new ValidateStrings(); $err = new GenerateErrors(); if ($chk->ValidateString($path) !== -1 || $chk->ValidateString($skin) !== -1) { $data = $path . "/" . $skin; if (empty($skin)) { $data = $path . "/red"; } if (!empty($cookie)) { $data = $path . "/" . $cookie; } } else { $data = $path . "/red"; } return $data; }
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage Pools", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage Master/Peer Failover Options", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage Backups of dhcpd.conf", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Enable Extra PXE Bootp Options", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Common Global DHCPD Options", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
$err = new GenerateErrors(); $val = new ValidateStrings(); $misc = new MiscFunctions(); // Assign some defaults since nothing is configured $TITLE = "phpDHCPAdmin-0.9.5-beta Setup Wizard"; $STYLE = "../templates/black"; $DESCRIPTION = "I am here to help you import the database structure and setup the application defaults"; $DISCLAIMER = "All rights reserved 2009 ® Jason Gerfen"; $TABLES = array('admin_backup_conf', 'admin_config_algorithm', 'admin_logs', 'admin_sessions', 'auth_groups', 'auth_levels', 'auth_users', 'conf_adapters', 'conf_classes', 'conf_classes_options', 'conf_classes_opts', 'conf_dnssec_opts', 'conf_dns_opts', 'conf_failover', 'conf_global_opts', 'conf_hosts', 'conf_leases', 'conf_leases_properties', 'conf_pools', 'conf_pxe_groups', 'conf_pxe_opts', 'conf_shared_networks', 'conf_subnets', 'conf_traffic'); $REGEX = array('/\\$defined[\'hostname\']\\s\\s\\s\\s=\\s\\"\\";/', '/\\$defined[\'dbhost\']\\s\\s\\s\\s\\s\\s=\\s\\"localhost\\";/', '/\\$defined[\'username\']\\s\\s\\s\\s=\\s\\"\\";/', '/\\$defined[\'password\']\\s\\s\\s\\s=\\s\\"\\";/', '/\\$defined[\'mail\']\\s\\s\\s\\s\\s\\s\\s\\s=\\s\\"\\";/', '/\\$defined[\'virpath\']\\s\\s\\s\\s\\s=\\s\\"\\";/'); // lets process the form if (!empty($_POST)) { // make sure we have a complete form submission if (!empty($_POST['mysql_root_user']) && !empty($_POST['mysql_root_passwd']) && !empty($_POST['defined_hostname']) && !empty($_POST['mysql_server_address']) && !empty($_POST['mysql_server_username']) && !empty($_POST['mysql_server_password']) && !empty($_POST['configuration_path']) && !empty($_POST['admin_email'])) { // ensure nothing screwy is going on in regards to input if ($val->ValidateString($_POST['mysql_root_user']) !== -1 && $val->ValidateParagraph($_POST['mysql_root_passwd']) !== -1 && $val->ValidateDomain($_POST['defined_hostname']) !== -1 && $val->ValidateDomain($_POST['mysql_server_address']) !== -1 && $val->ValidateParagraph($_POST['mysql_server_username']) !== -1 && $val->ValidateParagraph($_POST['mysql_server_password']) !== -1 && $val->ValidateParagraph($_POST['configuration_path']) !== -1 && $val->ValidateEmail($_POST['admin_email']) !== -1) { // ensure our root username & password is correct $dbconn = $db->dbConnectOnly($_POST['mysql_server_address'], $_POST['mysql_root_user'], $_POST['mysql_root_passwd']); echo $db->dbCatchError(); if ($dbconn === -1) { $error = $err->GenerateErrorLink("../help/help.html", "#app_setup", '../templates/images/error.jpg', "Error connecting to the database during initial connection. Wrong username/password combination", NULL, NULL); } else { // perform our .sql file import (this fails if it exists already) $cmd = "mysql -u " . $_POST['mysql_root_user'] . " --password="******" < phpDHCPAdmin.sql"; `{$cmd}`; // create a default user based on the form input $dbconn = $db->dbConnect($_POST['mysql_server_address'], $_POST['mysql_root_user'], $_POST['mysql_root_passwd'], 'phpDHCPAdmin'); if ($dbconn === -1) { $error = $err->GenerateErrorLink("../help/help.html", "#app_setup", '../templates/images/error.jpg', "Error connecting to the database. Wrong username/password combination", NULL, NULL); } else { $query = "GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,REFERENCES ON phpDHCPAdmin.* TO '" . $_POST['mysql_server_username'] . "'@'" . $_POST['mysql_server_address'] . "' IDENTIFIED BY '" . $_POST['mysql_server_password'] . "'";
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage Users", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage DNS Zones", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage DNSSEC Keys", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {
// initialize a db connection handle $dbconn = $db->dbConnect($defined['dbhost'], $defined['username'], $defined['password'], $defined['dbname']); // ensure our sessions are present if (empty($_SESSION['token'])) { $sessions = new dbSession(); } //define the template and cache directories $tpl->strTemplateDir = $defined['virpath'] . 'templates'; $tpl->strCacheDir = '/tmp'; if (!empty($_GET) || !empty($_POST)) { $flag = "TRUE"; } else { $flag = "FALSE"; } // setup our template style data if ($val->ValidateString($_GET['skin']) === -1 || empty($_GET['skin'])) { $style = $defined['templates'] . "/black"; if (!empty($_GET['skin'])) { $skin_err = $err->GenerateErrorLink("help/help.php", "#val_xss", $defined['error_small'], $errors['val_xss'], NULL, NULL); } } else { $style = $skin->SelectSkin($defined['templates'], $_GET['skin'], $_COOKIE['skin']); } // call our header file and pass it some variables $tpl->assign('TITLE', $defined['title'], NULL, NULL); $tpl->assign('DESCRIPTION', "Manage PXE Groups", NULL, NULL); $tpl->assign('STYLE', $style, NULL, NULL); // authentication template $FILE = "auth.tpl"; // default is no error just diplay login form if ($auth->AuthUser($_POST['user'], $_POST['pass'], $_SESSION['token']) === -1) {