-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
executable file
·45 lines (41 loc) · 2.01 KB
/
init.php
File metadata and controls
executable file
·45 lines (41 loc) · 2.01 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
41
42
43
44
45
<?php
require_once $_['fs_root'].'includes/lib/auth/classes/activate.php';
require_once $_['fs_root'].'includes/lib/auth/classes/auth.php';
require_once $_['fs_root'].'includes/lib/auth/classes/login.php';
require_once $_['fs_root'].'includes/lib/auth/classes/logout.php';
require_once $_['fs_root'].'includes/lib/auth/classes/protect.php';
require_once $_['fs_root'].'includes/lib/auth/classes/recaptchalib.php';
require_once $_['fs_root'].'includes/lib/auth/classes/register.php';
require_once $_['fs_root'].'includes/lib/auth/classes/validate_email.php';
require_once $_['fs_root'].'includes/lib/auth/classes/validate_password.php';
require_once $_['fs_root'].'includes/lib/auth/classes/validate_username.php';
require_once $_['fs_root'].'includes/lib/auth/localizations/'.$_['localization'].'.php';
if (
isset($auth['hash']['preference']) and
!$auth['hash']['preference'] == 'SHA512' and
!$auth['hash']['preference'] == 'SHA256' and
!$auth['hash']['preference'] == 'BLOWFISH')
{ // TODO: Switch to error throw function
core::error($_, 'Fatal error: Password hashing is user-defined, but the type of hashing has not been specified.', 'fatal');
}
if (file_exists($_['fs_root'].'includes/lib/auth/salt.php'))
{
require_once $_['fs_root'].'includes/lib/auth/salt.php';
}
if (array_key_exists('salt', $auth)) {
core::debug($_, '$salt obtained from salt.php');
} else {
$salt = substr(sha1(mt_rand()),0,22);
if (file_put_contents(
$_['fs_root'].'includes/lib/auth/salt.php',
'<?php'.PHP_EOL.'$auth[\'salt\']=\''.$salt.'\';'
)
) {
echo $_['fs_root'].'includes/lib/auth/salt.php';
core::debug($_, '$salt written to salt.php');
require_once $_['fs_root'].'includes/lib/auth/salt.php';
} else {
echo "CRITICAL ERROR: Variable 'salt' missing from salt.php, unable to write file.";
die();
}
}