Skip to content
GitLab
Explore
Sign in
Register
Mladen B.
ISPConfig 3
Compare revisions
b517b7c5ad8f6b8237526c6fe0554ac453795a55 to 20a609227c8522e7d68372a2708a71a242830e14
Commits on Source (2)
Moved all the functions on top of the file.
· 8414f388
Mladen B.
authored
Jan 20, 2022
8414f388
Used file() instead of file_get_contents() and explode().
· 20a60922
Mladen B.
authored
Jan 20, 2022
20a60922
Hide whitespace changes
Inline
Side-by-side
interface/web/login/index.php
View file @
20a60922
...
...
@@ -28,34 +28,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once
'../../lib/config.inc.php'
;
require_once
'../../lib/app.inc.php'
;
include_once
'../common.php'
;
// Check if we have an active users session and no login_as.
if
(
$_SESSION
[
's'
][
'user'
][
'active'
]
==
1
&&
@
$_POST
[
'login_as'
]
!=
1
)
{
header
(
'Location: /index.php'
);
die
();
}
$app
->
uses
(
'tpl'
);
$app
->
tpl
->
newTemplate
(
'main_login.tpl.htm'
);
$app
->
tpl
->
setInclude
(
'content_tpl'
,
'templates/index.htm'
);
$error
=
''
;
$app
->
load_language_file
(
'web/login/lib/lang/'
.
$conf
[
"language"
]
.
'.lng'
);
// Maintenance mode
$maintenance_mode
=
false
;
$maintenance_mode_error
=
''
;
$server_config_array
=
$app
->
getconf
->
get_global_config
(
'misc'
);
if
(
$app
->
is_under_maintenance
())
{
$maintenance_mode
=
true
;
$maintenance_mode_error
=
$app
->
lng
(
'error_maintenance_mode'
);
}
/**
* @param app $app
* @param $error
...
...
@@ -210,8 +182,7 @@ function is_admin_ip_whitelisted($ip, $conf)
// if the file doesn't exist, we assume that webmaster doesn't use this feature
if
(
!
file_exists
(
$conf
[
'admin_ip_whitelist_file'
]))
return
true
;
$file_content
=
file_get_contents
(
$conf
[
'admin_ip_whitelist_file'
]);
$file_lines
=
explode
(
"
\n
"
,
$file_content
);
$file_lines
=
file
(
$conf
[
'admin_ip_whitelist_file'
]);
$matches
=
array_filter
(
$file_lines
,
function
(
$v
)
use
(
$ip
)
{
$line
=
trim
(
$v
);
...
...
@@ -408,6 +379,34 @@ function is_login_as(app $app, $username, $password)
return
$loginAs
;
}
require_once
'../../lib/config.inc.php'
;
require_once
'../../lib/app.inc.php'
;
include_once
'../common.php'
;
// Check if we have an active users session and no login_as.
if
(
$_SESSION
[
's'
][
'user'
][
'active'
]
==
1
&&
@
$_POST
[
'login_as'
]
!=
1
)
{
header
(
'Location: /index.php'
);
die
();
}
$app
->
uses
(
'tpl'
);
$app
->
tpl
->
newTemplate
(
'main_login.tpl.htm'
);
$app
->
tpl
->
setInclude
(
'content_tpl'
,
'templates/index.htm'
);
$error
=
''
;
$app
->
load_language_file
(
'web/login/lib/lang/'
.
$conf
[
"language"
]
.
'.lng'
);
// Maintenance mode
$maintenance_mode
=
false
;
$maintenance_mode_error
=
''
;
$server_config_array
=
$app
->
getconf
->
get_global_config
(
'misc'
);
if
(
$app
->
is_under_maintenance
())
{
$maintenance_mode
=
true
;
$maintenance_mode_error
=
$app
->
lng
(
'error_maintenance_mode'
);
}
//* Login Form was sent
if
(
count
(
$_POST
)
>
0
)
{
process_login_request
(
$app
,
$error
,
$conf
,
$module
);
...
...