Beispiel #1
0
require_once __DIR__ . "/../../../autoload.php";
?>
<!DOCTYPE html>
<html>
<head>
    <title>install two factor dir</title>
</head>
<body>
<?php 
if (isset($_POST['dir'])) {
    if (!is_dir($_POST['dir'])) {
        print $_POST['dir'] . " is not a valid dir<br>\n";
    } else {
        if (!is_writable($_POST['dir'])) {
            print $_POST['dir'] . " is not a writable dir<br>\n";
        } else {
            it\thecsea\twofactorDir\twofactorDir::install($_POST['dir']);
            print "Script installed correctly if there are not php error. In case of php errors you have to perform uninstallation of the partial installation<br>\n";
        }
    }
}
?>
The directory must be writable by php<br>
You also have to enable mod rewrite and .htaccess<br>
you have to don't change the twofactor-dir package directory after an installation
<form action="" method="post">
    <label for="dir">directory (preferably absolute link)</label>: <input type="text" id="dir" name="dir"><br>
    <input type="submit" value="install">
</form>
</body>
</html>
<?php

/**
 * Created by PhpStorm.
 * User: claudio
 * Date: 29/07/15
 * Time: 1.40
 */
require_once "vendor/autoload.php";
it\thecsea\twofactorDir\twofactorDir::install("vendor/phpmyadmin/phpmyadmin");