Nextcloud WHMCS Module
Nextcloud WHMCS Module
Getting started with Nextcloud
We assume that you have successfully installed Nextcloud cloud server and configured that. This document guides you to install "whmcs_integration" App to Nextcloud & configure the WHMCS NextCloud Module:
Q.Why i need to install the "whmcs_integration" App in nextcloud?
Ans : This app will work as a bridge to communicate with WHMCS and Nextcloud.
Step 1: Upload "whmcs_integration" app to Nextcloud apps directory.
Step 2: Get log in to Nextcloud as an admin user.
Step 3: On home page, Click on Apps link in top left corner to open Nextcloud app management interface.
Step 4: Locate "whmcs_integration" third party app, enable it from here.
Step 5: Click on "WHMCS" link and you will open to a view, where you can manage account limit
Step 6: Click on top right corner dropdown, and select "Admin" option.
Step 7: Under WHMCS Integration App", Admin can update message to show for suspended users.
WHMCS Provisioning Module for Nextcloud
Configure Provisioning Module in WHMCS
Upload provisioning module "Nextcloud" directory in www.example.com/whmcs/modules/servers
Step 1: Setup server for "Nextcloud" module. Setup -> Products/Services -> Servers
Step 2: Create Product for "Nextcloud" and Proceed to configure "nextcloud" provisioning Module.
Step 3: Click on Tab "Module Settings", select "nextcloud".
Step 4: Module Configuration
- License Key will be validating from Admin Area Module automatically
- Enter "whmcs_integration" in APP ID field
- Enter "/ocs/v1.php/cloud/" in API URL
- Enter "groups" in Group API field
- Fill Server Name field with server name which you have made for "nextcloud" module in setup->product/services->servers
- Fill nextcloud login button name as you wish to show in client area.
- Select corresponding username, password, groups and quota fields from list, which are automatically created when you are configuring module.
- Under "Cloud Module Settings", Your edit product page will show you an option "Character Encoding". You do not need to know what the encoding of your string is, It can be Latin1 (iso 8859-1), Windows-1252 or UTF8, or the string can have a mix of them. You will have to check this option to encode your characters.
You can configure module in two modes
a. Choose Quota by Client during order
By default this option is enabled. When this option is enabled ("Manage Quota" check box is unchecked). A configurable option is there to select quota by client during order process. You can edit quota configurable option as per requirement.
b. Set Quota by Admin
You will see an option "Manage Quota" while configuring module from WHMCS admin area. When you enable this option, You will see an text box to enter quota value. You can select quota units from "Quota Units" under Cloud Module Settings section.
a. Choose Group by Client during order
By default this section is enabled. When this option is enabled ("Manage Group" checkbox is unchecked). A customfield is there to select to the right side of "Nextcloud Group" under Clientarea Fields section.Groups available in nextcloud will automatically add to Custom Field options, after click on "Save Changes" button. Make sure that type of product custom field is "dropdown" otherwise module will not work properly.
b. Choose Group by Admin
When "Manage Group" checkbox is ticked, Groups available in nextcloud will show to the right side of "Nextcloud Group" option. You can select a group for your customers.
c. Nextcloud users without Group
If you do not want to add users to any of available group i.e. An nextcloud user provisioning from WHMCS portal without assigning any group. Then you must need to tick the option "User Group" under Cloud Module Settings.
d. Group Limit
By default in nextcloud as well as in our module any number of accounts can be created under group. You can set account limit for groups upto two levels.
i) Can set account limit from Nextcloud App.
ii) Can set account from WHMCS for each product separately even for same group. But can't set it greater than account limit set in nextcloud app.
e. How checks can be performed on User Accounts limit under groups?
If you have check option "Group Limit" in module configuration, you can divide account limit for same group within more than one product. But you can't set account limit greater than the limit set in nextcloud app.
If no limit is set for group in nextcloud, then you can't do anything with limit in WHMCS module configuration.
If group limit option is unchecked, then account limit set in nextcloud will work.
f. Reseller Module Settings
If you want that your customers can create group of their own choice, then you must check "Custom Group Name" option. When this option is ticked, Make sure to change type of custom field for Nextcloud Group from "dropdown" to "text" otherwise module will not work properly.
If you want to make your customers admin of group what they will choose to create then make sure "Group Admin" option is ticked.
If you want to set a default group limit for groups will be create with user provision, then you must fill "Account Limit" field.
After configuring module for user provisioning, You will see a template named "Nextcloud Account Welcome Email" Go to setup-> Email Templates, Locate "Nextcloud Account Welcome Email" You can change contents as you wish.
In Module configuration, Make sure that you have filled "Email Template Name" field. Default value is "Nextcloud Account Welcome Email". If you have changed name of template then must update this field.
Step 5: Now move to Custom Fields Tab, You will see three custom fields:
Step 6: A configurable option of quantity type is also automatically created.
- Quantity Type
You can change its range and price as you required.
You can also change its type to any other available type. For e.g. Dropdown
Make sure that quota field forwarding a numeric value only.
If you are using a drop down and you want to show users custom options then use following format to
add options for configurable options.
Numeric value | Value for user
For Example: 1 | 1 GB Space
Client Area View
With active service in WHMCS with nextcloud module, Customer can change Nextcloud Email Address. Nextcloud Auto Login button will login to your nextcloud account with a single click.
Client Area: If module is not configured properly, then you will appear with error message on client area.
WHMCS Admin Area Module for Nextcloud
- Upload nextcloud directory of admin area addon
- Activate it
Setup > Addon Modules
After activating, Click on configure. All fields are required here. Do not try to change default values.
- License Key: Enter your valid license key.
- License Status: Do not try to change License Status, It will work according to your license validation. If you changed its value, then you are not able to configure provisioning module.
- Nextcloud APP ID: Fill "whmcs_integration" omitting quotes
- Nextcloud API URL: Fill "/ocs/v1.php/cloud/" omitting quotes
- Locate Nextcloud module
Addons > nextcloud
This will list all nextcloud users. You can change user's Display Name, Password, Groups, Group Admins and Quota. You can also Delete User from here.
You can see a dropdown in the right menu bar, This will show you the list servers that you have configured for nextcloud. If you have more than one nextcloud installations then you can add servers from setup -> products/services -> servers. Servers which are connected with nextcloud provisioning module will automatically show in the select box. You can easily switch your servers to manage nextcloud from WHMCS as an admin.
To manage Nextcloud Groups, Click on Manage Groups link. Admin user can set limit for groups except main admin group. By clicking on view link, can see users in a group and Admin users of the group.
To add new Nextcloud user, click on Add User link. You also can add order for client for Nextcloud product that you have configured already. If you want to create user only at only Nextcloud not to create order then don't select any client and product.
Important When Upgrade to Latest Version
Do not forget to remove 'NextcloudGroups.php' file from includes/hooks folder
How to change the language
Add the below variable in your whmcsdir/lang/english.php file and you can change the value as per your convenient.
$_LANG['NextcloudSettings'] = "Nextcloud Settings";
$_LANG['EmailAddress'] = "Email Address";
$_LANG['ChangeNextcloudEmailAddress'] = "Change Nextcloud Email Address";
$_LANG['NextcloudEmailAddress'] = "Nextcloud Email Address";