Login: Difference between revisions
No edit summary |
|||
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Logging into nuBuilder Forte == | |||
There are multiple ways to log in to nuBuilder Forte, which can be done either manually or automatically using URL parameters. | |||
=== Manual Login === | |||
To log in manually, follow these steps: | |||
# Navigate to the web directory where nuBuilder Forte is installed. | |||
# Enter your username. | |||
# Enter your password. | |||
# Press Enter or click "Log in". | |||
=== Auto Login === | |||
You can automate the login process by passing specific parameters in the URL. Below are the available parameters and their descriptions: | |||
By | * '''u''': Username | ||
*Login | * '''p''': Password | ||
*Login | * '''f''': Form ID | ||
* '''r''': Record ID | |||
* | * '''h''': Home Page ID | ||
==== Parameter Passing in GET URL ==== | |||
By including certain parameters in the URL for '''index.php''', you can achieve different types of automatic logins: | |||
* '''Login to the User's Home Page:''' | |||
<nowiki>index.php?u=1&p=1</nowiki> | |||
* '''Login to a specific Form and Record:''' | |||
<nowiki>index.php?u=1&p=1&f=nublank&r=-1</nowiki> | |||
* '''Login to a specific Form and Record with a link to the User's Home Page:''' | |||
<nowiki>index.php?u=1&p=1&f=nublank&r=-1&h=nuuserhome</nowiki> | |||
* '''Prompt for the user's password before logging into the User's Home Page:''' | |||
<nowiki>index.php?u=1</nowiki> | |||
* '''Prompt for the user's password before logging into a specific Form and Record:''' | |||
<nowiki>index.php?u=1&f=nublank&r=-1</nowiki> | |||
* '''Prompt for the user's password before logging into a specific Form and Record with a link to the User's Home Page:''' | |||
<nowiki>index.php?u=1&f=nublank&r=-1&h=nuuserhome</nowiki> | |||
=== Custom Parameters === | |||
All the parameters, including custom parameters, can be retrieved with the PHP function [[PHP#nuGetURLParams|nuGetURLParams()]]. | |||
The password value (parameter 'p') cannot be retrieved by this function. | |||
=== Single-Use Password Token === | |||
It is possible to use a single-use token instead of the the normal password when logging in. This may be preferable when using the auto-login where the password is included in the URL. | |||
After a successful login, the token is replaced with a new random value and so it will only work once. It is stored as a JSON key-value pair in '''zzzzsys_user.sus_json''' and can be extracted using the following code. | |||
<pre> | |||
$user_id = '5f958ad8b8c613d'; | |||
$j = db_fetch_value('zzzzsys_user', 'zzzzsys_user_id', $user_id , 'sus_json'); | |||
$login_token = nuJsonDecode($j, true)['LOGIN_TOKEN']; | |||
</pre> | |||
For more information, including Purpose of the Token System, Use Cases, please see [[Single-User_Password_Token|Single-Use Password Token]]. | |||
=== Customizing Login HTML === | |||
You can customize the login page HTML by modifying the '''nuconfig.php''' file. Within this file, there is a commented-out variable named '''$nuWelcomeBodyInnerHTML'''. This variable can be customized and utilized as the login page content. | |||
The HTML login form code, stored in the '''$welcome''' variable in '''index.php''', escapes the value of '''$nuWelcomeBodyInnerHTML'''. This is then used in the JavaScript function '''nuLogin(nuconfigNuWelcomeBodyInnerHTML)''' defined in the '''nucommon.js''' file. If '''$nuWelcomeBodyInnerHTML''' is not set, a default value within the '''nuLogin''' function is used. | |||
The JavaScript function '''nuLoginRequest(u, p)''', defined in '''index.php''', processes the login credentials. This function uses AJAX to call the nuBuilder API functions in the '''nuapi.php''' file. |
Latest revision as of 13:48, 13 June 2024
Logging into nuBuilder Forte
There are multiple ways to log in to nuBuilder Forte, which can be done either manually or automatically using URL parameters.
Manual Login
To log in manually, follow these steps:
- Navigate to the web directory where nuBuilder Forte is installed.
- Enter your username.
- Enter your password.
- Press Enter or click "Log in".
Auto Login
You can automate the login process by passing specific parameters in the URL. Below are the available parameters and their descriptions:
- u: Username
- p: Password
- f: Form ID
- r: Record ID
- h: Home Page ID
Parameter Passing in GET URL
By including certain parameters in the URL for index.php, you can achieve different types of automatic logins:
- Login to the User's Home Page:
index.php?u=1&p=1
- Login to a specific Form and Record:
index.php?u=1&p=1&f=nublank&r=-1
- Login to a specific Form and Record with a link to the User's Home Page:
index.php?u=1&p=1&f=nublank&r=-1&h=nuuserhome
- Prompt for the user's password before logging into the User's Home Page:
index.php?u=1
- Prompt for the user's password before logging into a specific Form and Record:
index.php?u=1&f=nublank&r=-1
- Prompt for the user's password before logging into a specific Form and Record with a link to the User's Home Page:
index.php?u=1&f=nublank&r=-1&h=nuuserhome
Custom Parameters
All the parameters, including custom parameters, can be retrieved with the PHP function nuGetURLParams(). The password value (parameter 'p') cannot be retrieved by this function.
Single-Use Password Token
It is possible to use a single-use token instead of the the normal password when logging in. This may be preferable when using the auto-login where the password is included in the URL.
After a successful login, the token is replaced with a new random value and so it will only work once. It is stored as a JSON key-value pair in zzzzsys_user.sus_json and can be extracted using the following code.
$user_id = '5f958ad8b8c613d'; $j = db_fetch_value('zzzzsys_user', 'zzzzsys_user_id', $user_id , 'sus_json'); $login_token = nuJsonDecode($j, true)['LOGIN_TOKEN'];
For more information, including Purpose of the Token System, Use Cases, please see Single-Use Password Token.
Customizing Login HTML
You can customize the login page HTML by modifying the nuconfig.php file. Within this file, there is a commented-out variable named $nuWelcomeBodyInnerHTML. This variable can be customized and utilized as the login page content.
The HTML login form code, stored in the $welcome variable in index.php, escapes the value of $nuWelcomeBodyInnerHTML. This is then used in the JavaScript function nuLogin(nuconfigNuWelcomeBodyInnerHTML) defined in the nucommon.js file. If $nuWelcomeBodyInnerHTML is not set, a default value within the nuLogin function is used.
The JavaScript function nuLoginRequest(u, p), defined in index.php, processes the login credentials. This function uses AJAX to call the nuBuilder API functions in the nuapi.php file.