Merge remote-tracking branch 'origin/0.9.31'

This commit is contained in:
Michael Kaufmann (d00p)
2013-12-10 07:23:42 +01:00
11 changed files with 41 additions and 15 deletions

View File

@@ -269,7 +269,7 @@ if ($page == 'customers'
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid` = :id");
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `customerid` = :id AND `adminsession` = '0'");
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = :id AND `adminsession` = '0'");
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = :id");
Database::pexecute($stmt, array('id' => $id));

View File

@@ -175,7 +175,7 @@ class paging {
&& (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext'])
|| $_REQUEST['searchtext'] === '')
) {
$this->searchtext = $_REQUEST['searchtext'];
$this->searchtext = trim($_REQUEST['searchtext']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['searchtext'])
@@ -279,8 +279,27 @@ class paging {
}
$searchfield = implode('.', $searchfield);
// check for logical operators and whether searchtext is a number
// in any other case the logical-operators would make no sense
$ops = array('<', '>', '=');
if (in_array(substr($this->searchtext, 0, 1), $ops) && is_numeric(substr($this->searchtext, 1))) {
// if we're checking on traffic or diskspace, we need to adjust the search-value
if (strpos($searchfield, 'diskspace') > 0) {
// anything with diskspace is *1024
$searchtext = ((int)substr($this->searchtext, 1))*1024;
} elseif (strpos($searchfield, 'traffic') > 0) {
// anything with traffic is *1024*1024
$searchtext = ((int)substr($this->searchtext, 1))*1024*1024;
} else {
// any other field
$searchtext = substr($this->searchtext, 1);
}
// now as we use >, < or = we use the given operator and not LIKE
$condition.= $searchfield . " ".substr($this->searchtext, 0, 1)." " . Database::quote($searchtext);
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
$condition.= $searchfield . " LIKE " . Database::quote($searchtext);
}
} else {
$condition = '';
}

View File

@@ -19,5 +19,9 @@
* Generates a random password
*/
function generatePassword() {
return substr(md5(uniqid(microtime(), 1)), 24, 10);
global $settings;
return substr(
base64_encode(sha1(md5(uniqid(microtime(), 1))).md5(uniqid(microtime(), 1)).sha1(md5(uniqid(microtime(), 1)))),
rand(5, 50), ($settings['panel']['password_min_length'] > 0 ? $settings['panel']['password_min_length'] : 10)
);
}

View File

@@ -257,6 +257,9 @@ class bind
/*&& $domain['spf'] == '1' */
) {
$zonefile.= $this->settings['spf']['spf_entry'] . "\n";
if (in_array('mail', $records)) {
$zonefile.= str_replace('@', 'mail', $this->settings['spf']['spf_entry']) . "\n";
}
}
/**

View File

@@ -1,4 +1,4 @@
protocols = imap pop3 <SSLPROTOCOLS>
#protocols = imap pop3 <SSLPROTOCOLS>
listen = *
mail_access_groups = vmail
mail_debug = no
@@ -26,7 +26,7 @@ protocol pop3 {
}
protocol lda {
# postmaster is the one in charge of the mail system. MUST be set to a valid address!
postmaster_address = <postmaster-address>
postmaster_address = postmaster@<SERVERNAME>
auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = quota
sendmail_path = /usr/sbin/sendmail

View File

@@ -4,7 +4,7 @@
# Address to use when sending rejection mails.
# Default is postmaster@<your domain>.
#postmaster_address = <postmaster-address>
#postmaster_address = postmaster@<SERVERNAME>
# Hostname to use in various parts of sent mails, eg. in Message-Id.
# Default is the system's real hostname.

View File

@@ -133,6 +133,6 @@ protocol imap {
protocol lmtp {
mail_plugins = $mail_plugins
postmaster_address = postmaster@example.net
postmaster_address = postmaster@<SERVERNAME>
}

View File

@@ -59,7 +59,7 @@ protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = quota
# postmaster is the one in charge of the mail system. MUST be set to a valid address!
postmaster_address = admin@<SERVERNAME>
postmaster_address = postmaster@<SERVERNAME>
sendmail_path = /usr/sbin/sendmail
lda_mailbox_autocreate = 1
}

View File

@@ -26,7 +26,7 @@ protocol pop3 {
}
protocol lda {
# postmaster is the one in charge of the mail system. MUST be set to a valid address!
postmaster_address = <postmaster-address>
postmaster_address = postmaster@<SERVERNAME>
auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = quota
sendmail_path = /usr/sbin/sendmail

View File

@@ -28,7 +28,7 @@ protocol pop3 {
# LDA configuration
protocol lda {
# postmaster is the one in charge of the mail system. MUST be set to a valid address!
postmaster_address = <postmaster-address>
postmaster_address = postmaster@<SERVERNAME>
mail_plugins = quota
deliver_log_format = msgid=%m: %$
rejection_reason = Your message to <%t> was automatically rejected:%n%r

View File

@@ -25,7 +25,7 @@ protocol pop3 {
# LDA configuration
protocol lda {
postmaster_address = postmaster
postmaster_address = postmaster@<SERVERNAME>
mail_plugins = sieve quota
quota_full_tempfail = yes
deliver_log_format = msgid=%m: %$