Skip to content

Commit

Permalink
Added: onBeforeSendCircular and onAfterSendCircular events
Browse files Browse the repository at this point in the history
Fixed #954: Bug - Mass mail is not working (admin and reseller interfaces)
Rewritten: Circular interface (admin and reseller levels)
  • Loading branch information
nuxwin committed Nov 5, 2013
1 parent 6c0db2c commit 6545b05
Show file tree
Hide file tree
Showing 9 changed files with 569 additions and 467 deletions.
17 changes: 10 additions & 7 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ Git Master
------------------------------------------------------------------------------------------------------------------------

GUI:
- Added: onBeforeSendCircular and onAfterSendCircular events
- Added: Option allowing to keep postfix configuration even when using external mail server
- Changed: EventsManager - Replaced Listener stack by a priority queue (Performance issues)
- Changed: EventsManager - listener stack become a priority queue (Performance issues)
- Fixed: Configuration variable `/var/log/rkhunter.log` is missing
- Fixed: Identity garbage on session timeout
- Updated plugin API (version 0.1.2)
- Rewritten: Circular interface (admin and reseller levels)
- Updated: plugin API (version 0.1.2)

SETUP:
- Fixed: ispCP migration script must not delete Web data while deleting unix users

Tickets:
- Fixed #935: Enhancement - Add option to keep the postfix configuration even when using external mail server
- Fixed #952: Bug - Backup script - several issues
- Fixed #954: Bug - Mass mail is not working (admin and reseller interfaces)

------------------------------------------------------------------------------------------------------------------------
1.1.0-rc4.6
Expand All @@ -31,7 +34,7 @@ ENGINE:
- Fixed: Several 'Can't use an undefined value as a HASH reference...' errors

GUI:
- Added IPv6 service status support
- Added: IPv6 service status support
- Changed: Any service port become editable
- Fixed: Service ports interface is broken
- Fixed: Unable to change admin settings
Expand Down Expand Up @@ -72,7 +75,7 @@ ENGINE:

GUI:
- Added: Option allowing to set Email quota synchronization mode
- Allow plugins to provide their own router
- Added: Per plugin router support
- Fixed: Do not show any quota information for mailboxes which have the quota limit set to 0 (unlimited)
- Fixed: Unable to edit domain (admin level)

Expand Down Expand Up @@ -162,13 +165,13 @@ Tickets:
- RELEASE i-MSCP 1.1.0-rc4

CONFIG:
- Added specific quota warning script for Dovecot 2.x.x branch
- Added: Specific quota warning script for Dovecot 2.x.x branch
- Added: Packages file for Debian Jessie (testing)
- Added: SPF Resource Record Type in bind template
- Added: php5-imap package (required by i-MSCP frontEnd)
- Changed: php5-mysql package to php5-mysqlnd (native driver) when available
- Removed: php5-adodb package
- Removed Dovecot sieve plugin configuration (Such parameter must be provided as plugin)
- Removed: Dovecot sieve plugin configuration (Such parameter must be provided as plugin)
- Updated: Apache templates to support 2.4.x branch
- Updated: Dovecot configuration files

Expand Down Expand Up @@ -352,7 +355,7 @@ i-MSCP 1.1.0-rc2.1
CONFIGS:
- Added: MariaDb support
- Added: named.conf.local and named.conf.options files
- Added: Skel directory for Web folder skeletons (Httpd server impls.)
- Added: Web folder skeletons (Httpd server impls.)
- Fixed: Useless section must be removed in generated Apache configuration files
- Fixed: diff package isn't available for Ubuntu > 12.04 (replaced by diffutils)
- Removed: packages file for Ubuntu Oneiric Ocelot (EOL 20130509)
Expand Down
14 changes: 14 additions & 0 deletions gui/library/admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,20 @@ function systemHasCustomers($minNbCustomers = 1)
return ($customersCount >= $minNbCustomers);
}

/**
* Whether or not system has registered admins (many), resellers or customers.
*
* @return bool
*/
function systemHasAdminsOrResellersOrCustomers()
{
if(systemHasManyAdmins() || systemHasResellers() || systemHasCustomers()) {
return true;
}

return false;
}

/**
* Whether or not system has registered resellers or customers.
*
Expand Down
28 changes: 28 additions & 0 deletions gui/library/iMSCP/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,32 @@ class iMSCP_Events
* @const string
*/
const onAfterChangeDomainStatus = 'onAfterChangeDomainStatus';

/**
* The onBeforeSendCircular event is triggered before an admin or reseller send a circular
*
* The listeners receive an iMSCP_Events_Event object with the following parameters
*
* - sender_name Sender name
* - sender_email Sender email
* - rcpt_to recipient type (all_users, aministrator_resellers, administrators_customers, resellers_customers,
* administrators, resellers, customers)
* - subject Circular subject
* - body Circular body
*/
const onBeforeSendCircular = 'onBeforeSendCircular';

/**
* The onAfterSendCircular event is triggered after an admin or reseller has sent a circular
* The listeners receive an iMSCP_Events_Event object with the following parameters
*
* - sender_name Sender name
* - sender_email Sender email
* - rcpt_to recipient type (all_users, aministrator_resellers, administrators_customers, resellers_customers,
* administrators, resellers, customers)
* - subject Circular subject
* - body Circular body
*/
const onAfterSendCircular = 'onAfterSendCircular';
}
9 changes: 3 additions & 6 deletions gui/library/shared-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -984,18 +984,15 @@ function encode($string, $charset = 'UTF-8')
$start = '=?' . $charset . '?B?';
$spacer = $end . "\r\n " . $start;

// determine length of encoded text within chunks
// and ensure length is even
// Determine length of encoded text withing chunks and ensure length is even
$length = 75 - strlen($start) - strlen($end);
$length = floor($length / 4) * 4;

// encode the string and split it into chunks
// with spacers after each chunk
// Encode the string and split it into chunks with spacers after each chunk
$string = base64_encode($string);
$string = chunk_split($string, $length, $spacer);

// remove trailing spacer and
// add start and end delimiters
// Remove trailing spacer and add start and end delimiters
$spacer = preg_quote($spacer);
$string = preg_replace('/' . $spacer . '$/', '', $string);
$string = $start . $string . $end;
Expand Down

0 comments on commit 6545b05

Please sign in to comment.