diff --git a/admin_customers.php b/admin_customers.php index 87c7f0d4..f700bb59 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -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)); diff --git a/lib/classes/output/class.paging.php b/lib/classes/output/class.paging.php index 5bdf4d8b..ba3033ee 100644 --- a/lib/classes/output/class.paging.php +++ b/lib/classes/output/class.paging.php @@ -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); - $searchtext = str_replace('*', '%', $this->searchtext); - $condition.= $searchfield . " LIKE " . Database::quote($searchtext); + // 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 = ''; } diff --git a/lib/functions/froxlor/function.generatePassword.php b/lib/functions/froxlor/function.generatePassword.php index 132e24c7..3653cffb 100644 --- a/lib/functions/froxlor/function.generatePassword.php +++ b/lib/functions/froxlor/function.generatePassword.php @@ -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) + ); } diff --git a/scripts/jobs/cron_tasks.inc.dns.10.bind.php b/scripts/jobs/cron_tasks.inc.dns.10.bind.php index f79649ca..18b3d208 100644 --- a/scripts/jobs/cron_tasks.inc.dns.10.bind.php +++ b/scripts/jobs/cron_tasks.inc.dns.10.bind.php @@ -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"; + } } /** diff --git a/templates/misc/configfiles/debian_squeeze/dovecot/etc_dovecot_dovecot.conf b/templates/misc/configfiles/debian_squeeze/dovecot/etc_dovecot_dovecot.conf index 1f92f664..249b9280 100644 --- a/templates/misc/configfiles/debian_squeeze/dovecot/etc_dovecot_dovecot.conf +++ b/templates/misc/configfiles/debian_squeeze/dovecot/etc_dovecot_dovecot.conf @@ -1,4 +1,4 @@ -protocols = imap pop3 +#protocols = imap pop3 listen = * mail_access_groups = vmail mail_debug = no @@ -25,8 +25,8 @@ protocol pop3 { } protocol lda { - # postmaster is the one in charge of the mail system. MUST be set to a valid address! - postmaster_address = + # postmaster is the one in charge of the mail system. MUST be set to a valid address! + postmaster_address = postmaster@ auth_socket_path = /var/run/dovecot/auth-master mail_plugins = quota sendmail_path = /usr/sbin/sendmail diff --git a/templates/misc/configfiles/debian_wheezy/dovecot/etc_dovecot_conf.d_15-lda.conf b/templates/misc/configfiles/debian_wheezy/dovecot/etc_dovecot_conf.d_15-lda.conf index 6bae51a6..056da607 100644 --- a/templates/misc/configfiles/debian_wheezy/dovecot/etc_dovecot_conf.d_15-lda.conf +++ b/templates/misc/configfiles/debian_wheezy/dovecot/etc_dovecot_conf.d_15-lda.conf @@ -4,7 +4,7 @@ # Address to use when sending rejection mails. # Default is postmaster@. -#postmaster_address = +#postmaster_address = postmaster@ # Hostname to use in various parts of sent mails, eg. in Message-Id. # Default is the system's real hostname. diff --git a/templates/misc/configfiles/freebsd/dovecot2/usr_local_etc_dovecot_dovecot.conf b/templates/misc/configfiles/freebsd/dovecot2/usr_local_etc_dovecot_dovecot.conf index f9f14e9d..c1f8975f 100644 --- a/templates/misc/configfiles/freebsd/dovecot2/usr_local_etc_dovecot_dovecot.conf +++ b/templates/misc/configfiles/freebsd/dovecot2/usr_local_etc_dovecot_dovecot.conf @@ -133,6 +133,6 @@ protocol imap { protocol lmtp { mail_plugins = $mail_plugins - postmaster_address = postmaster@example.net + postmaster_address = postmaster@ } diff --git a/templates/misc/configfiles/gentoo/dovecot/etc_dovecot_dovecot.conf b/templates/misc/configfiles/gentoo/dovecot/etc_dovecot_dovecot.conf index 971b2628..b17f14e4 100644 --- a/templates/misc/configfiles/gentoo/dovecot/etc_dovecot_dovecot.conf +++ b/templates/misc/configfiles/gentoo/dovecot/etc_dovecot_dovecot.conf @@ -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@ + postmaster_address = postmaster@ sendmail_path = /usr/sbin/sendmail lda_mailbox_autocreate = 1 } diff --git a/templates/misc/configfiles/opensuse_11_x/dovecot/etc_dovecot_dovecot.conf b/templates/misc/configfiles/opensuse_11_x/dovecot/etc_dovecot_dovecot.conf index 39c87b06..8d05a371 100644 --- a/templates/misc/configfiles/opensuse_11_x/dovecot/etc_dovecot_dovecot.conf +++ b/templates/misc/configfiles/opensuse_11_x/dovecot/etc_dovecot_dovecot.conf @@ -25,8 +25,8 @@ protocol pop3 { } protocol lda { - # postmaster is the one in charge of the mail system. MUST be set to a valid address! - postmaster_address = + # postmaster is the one in charge of the mail system. MUST be set to a valid address! + postmaster_address = postmaster@ auth_socket_path = /var/run/dovecot/auth-master mail_plugins = quota sendmail_path = /usr/sbin/sendmail diff --git a/templates/misc/configfiles/ubuntu_lucid/dovecot/etc_dovecot_conf.d_01-dovecot-postfix.conf b/templates/misc/configfiles/ubuntu_lucid/dovecot/etc_dovecot_conf.d_01-dovecot-postfix.conf index 508402f9..0565b2c4 100644 --- a/templates/misc/configfiles/ubuntu_lucid/dovecot/etc_dovecot_conf.d_01-dovecot-postfix.conf +++ b/templates/misc/configfiles/ubuntu_lucid/dovecot/etc_dovecot_conf.d_01-dovecot-postfix.conf @@ -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@ mail_plugins = quota deliver_log_format = msgid=%m: %$ rejection_reason = Your message to <%t> was automatically rejected:%n%r diff --git a/templates/misc/configfiles/ubuntu_precise/dovecot/etc_dovecot_conf.d_01_mail_stack_delivery.conf b/templates/misc/configfiles/ubuntu_precise/dovecot/etc_dovecot_conf.d_01_mail_stack_delivery.conf index af58c910..1d812fb5 100644 --- a/templates/misc/configfiles/ubuntu_precise/dovecot/etc_dovecot_conf.d_01_mail_stack_delivery.conf +++ b/templates/misc/configfiles/ubuntu_precise/dovecot/etc_dovecot_conf.d_01_mail_stack_delivery.conf @@ -25,7 +25,7 @@ protocol pop3 { # LDA configuration protocol lda { - postmaster_address = postmaster + postmaster_address = postmaster@ mail_plugins = sieve quota quota_full_tempfail = yes deliver_log_format = msgid=%m: %$