mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-07 00:47:00 +03:00
Allow remote boxes to execute stuff, eventhough they don't really login
This commit is contained in:
parent
f047f60712
commit
262e3c76a8
2 changed files with 18 additions and 0 deletions
|
@ -10,6 +10,19 @@ function is_logged_in() {
|
|||
if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == "true") {
|
||||
return TRUE;
|
||||
} else {
|
||||
global $adminapikey;
|
||||
global $adminapiips;
|
||||
|
||||
if (isset($adminapikey) && isset($allowedips)) {
|
||||
if (array_search($_SERVER['REMOTE_ADDR'], $adminapiips) !== FALSE) {
|
||||
if ($_POST['adminapikey'] == $adminapikey) {
|
||||
# Allow this request, fake that we're logged in.
|
||||
set_logged_in('admin');
|
||||
set_is_adminuser();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue