Hello @till and other dev users. I want to extend the Mail module and add a new tab inside "Email Mailbox" with additional options to use with an external APP, in this case Nextcloud, but I want to do this without modifying the core files, so, mi question is: Is it possible to do that? I can't find any info/tutorial in the ISPConfig documentation or hook in the code to do that. I know I can make a new module outside the Mail module and implement this functions, but what I want is a tab inside the Email Mailbox, so when I create a new email for a user I can add options like cloud quota etc. and get that information using the remote API with a modded version of the Nextcloud-ISPConfig module developed by @theWeird Thank you!
There is a custom module created by our member that eases a creation of new sites in a single tab without modifying ISPConfig core but I think it was quite old and was added to the main menu tab instead of any sub menu tab. However, I can't remember where the module thread is for now as I am on mobile, but may be other can help you to find it.
Basically, we currently have a thread on the same topic: https://forum.howtoforge.com/thread...nces-of-getting-it-integrated-upstream.92752/ You can extend a form using interface events and plugins.
Thank you @till and @ahrasis for your help. There is indeed a lot of information there to do what I need. I'm going to continue the discussion there and leave this open to post the results.
Update. The plugin is finished and work ok. Some SS at the end. I'm going to post the plugin when I finish the Nextcloud part (working right now in this). Continuing with the core files and my comment here: https://forum.howtoforge.com/thread...-integrated-upstream.92752/page-2#post-459307 This isn't true, all the custom fields are loaded from the db and sent to the remote API call, so, no problem here, but I modded the loadFormDef function in the core file remoting_lib.inc.php to allow the plugins "fields" to be loaded. I don't see where this fields are used, but if the code say it must be loaded, well, the custom fields must be loaded to, right? Expand: remoting_lib.inc.php loadFormDef function: PHP: //* Load the form definition from file. - special version for remoting // module parameter is only for compatibility with base class function loadFormDef($file, $module = '') { global $app; include $file; // Search for module name by path because $_SESSION['s']['module']['name'] // isn't set in a remote call. $module_path = array_reverse(explode('/', $file)); $module_name = isset($module_path[2]) && $module_path[1] == 'form' && preg_match("/^[a-z]{2,20}$/i", $module_path[2]) ? $module_path[2] : ''; // Allow plugins to be loaded if ($module_name) { $app->plugin->raiseEvent($module_name.':'.$form['name'] . ':on_remote_before_formdef', $this); } $this->formDef = $form; unset($this->formDef['tabs']); //* Copy all fields from all tabs into one form definition foreach($form['tabs'] as $tab) { foreach($tab['fields'] as $key => $value) { $this->formDef['fields'][$key] = $value; } } unset($form); // Allow plugins to be loaded if ($module_name) { $app->plugin->raiseEvent($module_name.':'.$this->formDef['name'] . ':on_remote_after_formdef', $this); } $this->dateformat = 'Y-m-d'; //$app->lng('conf_format_dateshort'); $this->datetimeformat = 'Y-m-d H:i:s'; //$app->lng('conf_format_datetime'); return true; }
Hello. Tested and working fine here The ISPConfig Plugin: https://github.com/mediabox-cl/ispconfig-nextcloud-plugin The Nextcloud APP: https://github.com/mediabox-cl/nextcloud-user-ispconfig-api Please, test and report. Thank you.
By the way, I find it a bit sad that you have chosen a license that is incompatible with ISPConfig's BSD license. GPL infects other code with its license policy, so it is incompatible with more free licenses like the BSD license, which ISPConfig uses. I hope you consider to change the license of your code to BSD too.
Btw. I just featured the plugin on the ISPConfig blog: https://www.ispconfig.org/blog/new-ispconfig-nextcloud-plugin-for-user-and-password-synchronization/
@till I did not pay attention to the license. Sure I can change it. I think I must do this just for the ISPConfig plug-in, or both? Thank you for the blog post!!!
Perfect. I do this today. @till I made a lot of changes before release. Please update the images in the blog with this:
Ok. License changed to https://opensource.org/license/BSD-2-Clause At last here https://www.ispconfig.org/ispconfig/ the "Open Source software (BSD license)" links to this license. Thank you!
You can find our license here https://git.ispconfig.org/ispconfig/ispconfig3/-/blob/develop/LICENSE, we use the BSD-3_clause license. But using the two clauses one is perfectly fine, too. The third clause is just about not naming derived software ISPConfig without permission.