Пример #1
0
use WriteIniFile\WriteIniFile;
/* check authentication */
if (isset($_SERVER['REMOTE_USER']) || isset($_SERVER['PHP_AUTH_USER'])) {
    $userName = isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : $_SERVER['PHP_AUTH_USER'];
} else {
    die('Le script n\'est pas prot&eacute;g&eacute; par une authentification.<br>
         V&eacute;rifiez la configuration de votre serveur web.');
}
/* check install */
if (false === is_writable('../conf/users')) {
    require 'install/installation.php';
    exit(1);
} elseif (file_exists('../conf/users/' . $userName . '/config.ini')) {
    $file_user_ini = '../conf/users/' . $userName . '/config.ini';
} else {
    Install::create_new_user($userName);
    $file_user_ini = '../conf/users/' . $userName . '/config.ini';
}
/* REQUEST POST */
if (isset($_POST['reboot'])) {
    $user = new Users($file_user_ini, $userName);
    $rebootRtorrent = $user->rebootRtorrent();
}
if (isset($_POST['conf_user'])) {
    $post = $_POST;
    $update = new WriteIniFile($file_user_ini);
    $update->update(['user' => ['active_bloc_info' => @$post['active_bloc_info'], 'theme' => $post['theme']], 'ftp' => ['active_ftp' => @$post['active_ftp']], 'rtorrent' => ['active_reboot' => @$post['active_reboot']], 'support' => ['active_support' => @$post['active_support']], 'logout' => ['url_redirect' => $post['url_redirect']]]);
    $update_ini_file_log = $update->write();
}
if (isset($_POST['config_admin'])) {
    $post = $_POST;
Пример #2
0
<?php

use app\Lib\Install;
$user_name_php = Install::get_user_php();
$root_path = substr(getcwd(), 0, -7);
?>
<!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <title>Installation - Seedbox Manager</title>
        <link href="components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link type="text/css" rel="stylesheet" href="install/style.css">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1">
        <!--[if lt IE 9]>
            <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    </head>

    <body>
        <div  class="container marg" style="margin-top:50px">
            <h1 class="page-header dashboard"><i class="glyphicon glyphicon-wrench"></i> Guide d'installation</h1>
            <section class="row">
                <article class="col-md-12">
                    <div class="well well-sm">
                        <h4 class="titre-head">Démarrage de l'application</h4>
                        <div class="trait"></div>
                        <p>Indiquez le bon propriétaire des fichiers de l'application, copiez cette commande et l'exécuter en ROOT (super utilisateur).</p>
                        <code>chown -R <?php 
echo $user_name_php['name'] . ':' . $user_name_php['name'] . ' ' . $root_path;
?>