How to Update User Role Passwords Using API: Difference between revisions

From wizarPOS
No edit summary
No edit summary
Line 9: Line 9:
== API Functions ==
== API Functions ==
=== <big>isUserPwd</big> ===
=== <big>isUserPwd</big> ===
* ''''boolean isUserPwd(String pwd)'''';
  <syntaxhighlight lang="java">boolean isUserPwd(String pwd);</syntaxhighlight>
* Checks if the provided string (''''pwd'''') is the current user password.
* Checks if the provided string (''''pwd'''') is the current user password.
{|class="wizarpostable"
{|class="wizarpostable"
Line 28: Line 28:
|}
|}
=== <big>forceModifyUserPwd</big> ===
=== <big>forceModifyUserPwd</big> ===
* ''''boolean forceModifyUserPwd(String newPwd)'''';
  <syntaxhighlight lang="java">boolean forceModifyUserPwd(String newPwd);</syntaxhighlight>
* Modifies the user role password to the new password (''''newPwd'''').
* Modifies the user role password to the new password (''''newPwd'''').
{|class="wizarpostable"
{|class="wizarpostable"
Line 47: Line 47:
|}
|}
=== <big>enableUserLogin</big> ===
=== <big>enableUserLogin</big> ===
* ''''boolean enableUserLogin(boolean enable)'''';
  <syntaxhighlight lang="java">boolean enableUserLogin(boolean eneable);</syntaxhighlight>
* Enables or disables user role login based on the boolean value (''''enable'''').
* Enables or disables user role login based on the boolean value (''''enable'''').
{|class="wizarpostable"
{|class="wizarpostable"

Revision as of 15:30, 4 January 2024

Interface Details

  • Package Name: 'com.wizarpos.wizarviewagentassistant'
  • Class Name: 'com.wizarpos.wizarviewagentassistant.AdminPwdMainService'
  • Before using the interface, ensure the package is imported and necessary permissions are added to the Android manifest file.

Required Permissions

  • Include the following permissions in your application's manifest:
    • 'android.permission.USER_PWD'
    • 'android.permission.USER_PWD_MODIFY'

API Functions

isUserPwd

boolean isUserPwd(String pwd);
  • Checks if the provided string ('pwd') is the current user password.
Parameters
pwd String: Not null.
Returns
boolean true of false.

forceModifyUserPwd

boolean forceModifyUserPwd(String newPwd);
  • Modifies the user role password to the new password ('newPwd').
Parameters
newPwd String: Not null.
Returns
boolean true of false.

enableUserLogin

boolean enableUserLogin(boolean eneable);
  • Enables or disables user role login based on the boolean value ('enable').
Parameters
name boolean: true to enable, false to disable.
Returns
boolean true of false.

Code Snippet and AIDL File

<!-- AdminPwdMainService -->
<uses-permission android:name="android.permission.USER_PWD"/>
<uses-permission android:name="android.permission.USER_PWD_MODIFY"/>

boolean result = adminPwdService.forceModifyUserPwd(newPwd);
boolean isUserPwd = adminPwdService.isUserPwd(newPwd);

ComponentName comp = new ComponentName (
        "com.wizarpos.wizarviewagentassistant",
        "com.wizarpos.wizarviewagentassistant.AdminPwdMainService");