You lock your front door. But why do you leave the back entrances open? This is the same with almost all Internet accesses to your IoT, webcams and other devices.
Hello, friends.
This is the first step for a completely rewritten version for access management via web browser to ensure access to internal networks via OpenVPN. This is NOT secure version at the moment. This will only be reached with version 1.1.0. But I would like to give you the opportunity to test it by yourself today, so that you can contribute ideas or even your own code.
An upgrade from the original, Release 0.8 and 1.0.x, will be available with Version 1.1.0.
The installation has been tested, but errors may still occur.
Actually, the defined constants should be self-explanatory by name. (Example valid from 1.1.0 and differs from the previous versions)
$dbhost = 'db.home';
$dbport = '3306';
$dbname = 'tester';
$dbuser = 'tester';
$dbpass = 'tester';
$dbtype = 'mysqli';
$dbdebug = FALSE;
$sessdebug = FALSE;
/* site name */
define('_SITE_NAME', "OVPN-WebAdmin");
define('HOME_URL', "vpn.home");
define('_DEFAULT_LANGUAGE','de_DE');
/** Login Site */
define('_LOGINSITE', 'login1');
The entry _LOGINSITE defines the content to be loaded for the login page, which you can print out yourself. The different login pages are stored under include/html/login/ [ folder ]. The login.php will be loaded and displayed automatically.
There are already some examples under login1, login2 and login3. You can realize every own idea. Condition for a correct functioning are 5 things:
include (REAL_BASE_DIR.'/include/html/login/login.functions.php');
With this entry you load the template functions which are needed for the transmission of the login data.
echo username();
echo password();
Loginfield: hidden Fields
echo hiddenfields();
echo button();
It often happens that bootstrap or other styles to be loaded require further information about the classes. You can easily pass the appropriate information in the following way:
echo button('btn-primary btn-block');
The system issues further specifications, which are briefly described below:
# The name of the website, entered in the config.php
echo _SITE_NAME;
By default, the content from the $message array is always displayed. The best way to call it is via:
echo GET_Lang::message("_LOGIN_DATA");
Since the class class.language.php is always loaded as well, the call can be done this way. The class then searches for the corresponding key, here _LOGIN_DATA and displays it. Keys that do not exist are automatically displayed with a LANGUAGE_ERROR and the passed wrong entry.
If you want to load other arrays from the language file, just pass the name of the array, the class will find the value and display it.
echo GET_Lang::message("4", "errormessage");
This entry would output key 4 from the array errormessage.
Since version 1.2.0 you have the possibility to create your own error pages. The error pages are always called up with the entry of the login page and must therefore also be available in the corresponding folder - see "Configuration file config.php" - as error.php.
Translated with www.DeepL.com/Translator (free version)