Overview
Comment:Possibilité d'automatiser l'installation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 35f1482326973a951a2d5984b467112a15a5595b
User & Date: bohwaz on 2014-04-18 00:13:48
Other Links: manifest | tags
Context
2014-04-18
03:48
Ne pas laisser la possibilité d'automatiser comme ça, c'est trop bancal check-in: 249da9228e user: bohwaz tags: trunk
00:13
Possibilité d'automatiser l'installation check-in: 35f1482326 user: bohwaz tags: trunk
2014-04-17
12:50
Meilleur style des icônes du menu check-in: 4f5e0d6488 user: bohwaz tags: trunk
Changes

Modified src/www/admin/install.php from [90e52f272b] to [e5c3b5dcb2].

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
else
{
    $tpl->assign('disabled', false);
    $error = false;

    if (!empty($_POST['save']))
    {
        if (!utils::CSRF_check('install'))
        {
            $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
        }
        elseif (utils::post('passe_membre') != utils::post('repasse_membre'))
        {
            $error = 'La vérification ne correspond pas au mot de passe.';
        }







|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
else
{
    $tpl->assign('disabled', false);
    $error = false;

    if (!empty($_POST['save']))
    {
        if (!defined('Garradin\AUTOMATED_INSTALL') && !utils::CSRF_check('install'))
        {
            $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
        }
        elseif (utils::post('passe_membre') != utils::post('repasse_membre'))
        {
            $error = 'La vérification ne correspond pas au mot de passe.';
        }
225
226
227
228
229
230
231













232

233
234
235
236







237

238
239
240
241
242
243
244
245
246

247
248
249
                    'libelle'   =>  'Premier exercice',
                    'debut'     =>  date('Y-01-01'),
                    'fin'       =>  date('Y-12-31')
                ]);

                $config->save();














                utils::redirect('/admin/login.php');

            }
            catch (UserException $e)
            {
                @unlink(DB_FILE);







                $error = $e->getMessage();

            }
        }
    }

    $tpl->assign('error', $error);
}

$tpl->assign('passphrase', utils::suggestPassword());


$tpl->display('admin/install.tpl');

?>







>
>
>
>
>
>
>
>
>
>
>
>
>
|
>




>
>
>
>
>
>
>
|
>







|
|
>
|
|
<
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271

                    'libelle'   =>  'Premier exercice',
                    'debut'     =>  date('Y-01-01'),
                    'fin'       =>  date('Y-12-31')
                ]);

                $config->save();

                // Installation automatique des plugins fournis
                $plugins = Plugin::listDownloaded();

                if (!empty($plugins))
                {
                    foreach ($plugins as $plugin)
                    {
                        Plugin::install($plugin);
                    }
                }

                if (!defined('Garradin\AUTOMATED_INSTALL'))
                {
                    utils::redirect('/admin/login.php');
                }
            }
            catch (UserException $e)
            {
                @unlink(DB_FILE);

                if (defined('Garradin\AUTOMATED_INSTALL'))
                {
                    throw $e;
                }
                else
                {
                    $error = $e->getMessage();
                }
            }
        }
    }

    $tpl->assign('error', $error);
}

if (!defined('Garradin\AUTOMATED_INSTALL'))
{
    $tpl->assign('passphrase', utils::suggestPassword());
    $tpl->display('admin/install.tpl');
}