Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
ISPConfig 3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 488
    • Issues 488
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 27
    • Merge Requests 27
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #6032

Closed
Open
Opened Jan 26, 2021 by Cédric@gody

API event support

Hello Guys,

Original post : https://www.howtoforge.com/community/threads/working-with-plugin-control-panel-vs-api.86218/

It's appear the API have some event support missing. image

How to try it:

  1. Add error login to your ispconfig vhost (/etc/apache2/sites-enabled/000-ispconfig.vhost)
    • add / edit the line : ErrorLog /var/log/ispconfig/httpd/YourVHOST.DOMAIN.TLS/error.log
  2. Plugin demonstration :
<?php
class exemple_plugin {
 	var $plugin_name = 'exemple_plugin';
 	var $class_name = 'exemple_plugin';

 	function onLoad() {
 		global $app;
 		$app->plugin->registerEvent('mail:mail_user:on_before_insert', 'exemple_plugin', 'fonction_edit');
 		$app->plugin->registerEvent('mail:mail_user:on_before_update', 'exemple_plugin', 'fonction_edit');
 		$app->plugin->registerEvent('mail:mail_user:on_before_delete', 'exemple_plugin', 'fonction_del');
 	}

 	function fonction_edit($event_name, $page_form){
		error_log('You should see this line in the log when you add / edit an email');
 	}

 	function fonction_del($event_name, $page_form){
 		error_log('You should see this line in the log when you remove an email');
 	}

 }
  1. IMPORTANT : Relog into your ISPConfig control panel
  2. Time to try
    1. Go to Ispconfig;
      • Email > Email Mailbox > Select an existing mailbox > Change something > Save
      • When you do that you should see this inside your logfile image
    2. When you make the same change by the API, nothing is wrote inside the logfile.
      • That mean the plugin isn't call by the API.

Also the support of multi event would be great (before/after)

Regards,

Assignee
Assign to
Planned features
Milestone
Planned features
Assign milestone
Time tracking
None
Due date
None
Reference: ispconfig/ispconfig3#6032