-
Notifications
You must be signed in to change notification settings - Fork 787
Expand file tree
/
Copy pathpostinstall_submit.php
More file actions
executable file
·40 lines (32 loc) · 1.49 KB
/
postinstall_submit.php
File metadata and controls
executable file
·40 lines (32 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Post-installation submit
*/
# functions
require_once( dirname(__FILE__) . '/../../functions/functions.php' );
if (!defined('VERSION_VISIBLE') || Config::ValueOf('disable_installer')) { print _("Install scripts disabled"); exit(0); }
# objects
$Database = new Database_PDO;
$Admin = new Admin ($Database, false);
$Install = new Install ($Database);
$User = new User ($Database);
$Result = new Result;
# only permit if Admin user has default pass !!!
$admin = $Admin->fetch_object ("users","username","Admin");
if($admin->password!='$6$rounds=3000$JQEE6dL9NpvjeFs4$RK5X3oa28.Uzt/h5VAfdrsvlVe.7HgQUYKMXTJUsud8dmWfPzZQPbRbk8xJn1Kyyt4.dWm4nJIYhAV2mbOZ3g.') {
$Result->show("danger", "Not allowed!", true);
}
# update
else {
# check lengths
if(strlen($POST->password1)<8) { $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
if(strlen($POST->password2)<8) { $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
# check password match
if($POST->password1!=$POST->password2) { $Result->show("danger", _("Passwords do not match"), true); }
# Crypt password
$POST->password1 = $User->crypt_user_pass ($POST->password1);
# all good, update password!
$Install->postauth_update($POST->password1, $POST->siteTitle, $POST->siteURL);
# ok
$Result->show("success", _("Settings updated, installation complete!") . "<hr><a class='btn btn-sm btn-default' href='" . create_link("login") . "'>" . _("Proceed to login.") . "</a>", false);
}