Ejemplo n.º 1
0
        $errors['smtp_error'] = $con->getMessage();
        $vars['bad_smtp_host'] = $smtpHost;
        $vars['smtphost'] = $smtpHost;
        $vars['admin_email'] = $adminEmail;
    } else {
        $smtp->disconnect();
    }
    if (!preg_match('/[a-zA-Z0-9\\-\\.]+@[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]+/', $adminEmail)) {
        $errors['admin_email_error'] = true;
    }
    if (!count($errors)) {
        // Send on to next stage
        if (defined('ATMAIL_OPEN_SOURCE')) {
            gotoStep(6);
        } else {
            gotoStep(4);
        }
    }
}
// Print the Step 3 page if no data submitted yet
// or there were errors in submitted data
// Find aspell binary
//$paths = exec('whereis aspell');
//list($trash, $bin) = explode(' ', $location);
//if (checkAspellBinary($bin))
//	$_SESSION['pref']['aspell_path'] = $bin;
//if (!$_SESSION['pref']['aspell_path'] || $errors['aspell_path_error'])
//	$vars['aspell_path'] = $bin;
// Create some default values
if (!$vars['smtphost']) {
    $vars['smtphost'] = 'localhost';
Ejemplo n.º 2
0
            }
            $db = DB::connect("sqlite:///{$dbName}");
            if (DB::isError($db)) {
                $errors['db_connect_error'] = $db->getDebugInfo();
            } else {
                $schema = dirname(__FILE__) . '/atmail.sqlite';
                $query = file_get_contents($schema);
                $res = sqlite_exec($query, $db->connection);
                if ($res === false) {
                    $errors['table_create_error'] = sqlite_last_error($db->connection);
                    unlink('../sqlite/atmail.db');
                }
            }
        }
        if (!count($errors)) {
            gotoStep(3);
        }
    }
}
// Print the step 2 page if no data submitted yet
// or there were errors in submitted data
// merge any pref values into $vars so if we are
// returning from a latter step the values are auto
// completed
if (isset($_SESSION['pref']['sql_type'])) {
    $vars = array_merge($vars, $_SESSION['pref']);
}
// Create some default values
$vars['sql_host'] = isset($sqlHost) ? $sqlHost : 'localhost';
// If running Darwin, mysql does not accept connections on localhost, needs 127.0.0.1
if (PHP_OS == 'Darwin') {
Ejemplo n.º 3
0
    $atmailMode = $_POST['mode'];
    $_SESSION['reg']['downloadid'] = $_POST['downloadid'];
    $_SESSION['reg']['serial'] = $_POST['serial'];
    $_SESSION['reg']['hostname'] = $_POST['hostname'];
    $_SESSION['reg']['expiry'] = 'never';
    $j8fk = "m1gg1dymack";
    $dlgh[] = $j8fk;
    $dlgh[] = $_SESSION['reg']['hostname'];
    $dlgh[] = $_SESSION['reg']['expiry'];
    $dlgh[] = $_SESSION['reg']['downloadid'];
    $f2h2 = md5(implode($dlgh, ''));
    if ($f2h2 != $_SESSION['reg']['serial']) {
        $errors['invalid'] = "Invalid serial key provided";
    }
    if (!count($errors)) {
        gotoStep(5);
    }
}
// Find the hostname via the hostname command , only if safe_mode is disabled
if (!$vars['hostname'] && !ini_get('safe_mode')) {
    exec('/bin/hostname', $vars['hostname']);
    $vars['hostname'] = trim($vars['hostname'][0]);
}
// If we can't find the hostname, grab it frm the server values
if (!$vars['hostname']) {
    $vars['hostname'] = $_SERVER['HTTP_HOST'];
}
// Save for the Config.pm
$_SESSION['pref']['hostname'] = $vars['hostname'];
preg_match('/(\\w+\\.\\w+)/', $_SESSION['pref']['version'], $m);
$vars['version'] = strtolower($m[1]);
Ejemplo n.º 4
0
// Make sure we are included from install/index.php, exit if not
if (!defined('ATMAIL_INSTALL_SCRIPT')) {
    // link to installer
    die("You cannot request this file directly, please use <a href=\"index.php\">the installer</a>");
}
$installDir = dirname(dirname(__FILE__));
if (isset($_POST['submit'])) {
    $pass = $_POST['password'];
    $username = $_POST['username'];
    if ($fh = @fopen("{$installDir}/webadmin/.htpasswd", 'w')) {
        // EOF error on file for some setups? Can print the page instead of exec code
        require_once "{$installDir}/libs/aprpwd.inc.php";
        // Need to verify the function loads.
        if (function_exists('crypt_apr_md5')) {
            $pass = crypt_apr_md5($pass);
            fwrite($fh, "{$username}:{$pass}\n");
            fclose($fh);
            // Add the .htaccess file if it does not exist.
            if (!file_exists("{$installDir}/webadmin/.htaccess")) {
                $fh = @fopen("{$installDir}/webadmin/.htaccess", 'w');
                fwrite($fh, "AuthUserFile {$installDir}/webadmin/.htpasswd\nAuthName WebAdmin\nAuthType Basic\nrequire valid-user\n");
                fclose($fh);
            }
        }
    } else {
        $_SESSION['webadmin_insecure'] = true;
    }
    gotoStep(6);
}
$vars['installDir'] = $installDir;
$vars['output'] = parse("{$htmlPath}/step5.phtml", $vars);