initial semi release
This commit is contained in:
23
public_html/entreaulas/_incl/auth_redir.php
Executable file
23
public_html/entreaulas/_incl/auth_redir.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
// UserAgent
|
||||
$ua = $_SERVER['HTTP_USER_AGENT'];
|
||||
if (str_starts_with($ua, "EntreAulasAuth/")) {
|
||||
// Bypass authentication for this specific user agent (used by Ortuella tablets)
|
||||
session_start([ 'cookie_lifetime' => 604800 ]);
|
||||
$username = explode("/", $ua)[1];
|
||||
$userpass = explode("/", $ua)[2];
|
||||
$_SESSION["entreaulas_auth_user"] = $username;
|
||||
$_SESSION["entreaulas_auth_data"] = json_decode(file_get_contents("/srv/storage/entreaulas/Usuarios/$username.json"), true);
|
||||
$_SESSION["entreaulas_auth_ok"] = true;
|
||||
session_regenerate_id();
|
||||
ini_set("session.use_only_cookies", "true");
|
||||
ini_set("session.use_trans_sid", "false");
|
||||
}
|
||||
session_start([ 'cookie_lifetime' => 604800 ]);
|
||||
session_regenerate_id();
|
||||
ini_set("session.use_only_cookies", "true");
|
||||
ini_set("session.use_trans_sid", "false");
|
||||
if (!$_SESSION["entreaulas_auth_ok"]) {
|
||||
header("Location: /entreaulas/_login.php");
|
||||
die();
|
||||
}
|
||||
3
public_html/entreaulas/_incl/post-body.php
Executable file
3
public_html/entreaulas/_incl/post-body.php
Executable file
@@ -0,0 +1,3 @@
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
5
public_html/entreaulas/_incl/pre-body.php
Executable file
5
public_html/entreaulas/_incl/pre-body.php
Executable file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$APP_CODE = "entreaulas";
|
||||
$APP_NAME = "EntreAulas";
|
||||
$APP_TITLE = "EntreAulas";
|
||||
require_once "/var/www/_incl/pre-body.php";
|
||||
Reference in New Issue
Block a user