add trace to database error-log-message (it just helps a lot finding the error); fixed queries in fpm und fcgid class; minor cosmetic changes
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -251,6 +251,7 @@ class Database {
|
||||
$sl_file = makeCorrectFile($sl_dir."/sql-error.log");
|
||||
$sqllog = @fopen($sl_file, 'a');
|
||||
@fwrite($sqllog, date('d.m.Y H:i', time())." --- ".str_replace("\n", " ", $error->getMessage())."\n");
|
||||
@fwrite($sqllog, date('d.m.Y H:i', time())." --- DEBUG: \n".$error->getTraceAsString()."\n");
|
||||
@fclose($sqllog);
|
||||
|
||||
if ($showerror) {
|
||||
|
||||
@@ -254,7 +254,7 @@ class phpinterface_fcgid {
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if (!isset($this->_admin_cache[$adminid])) {
|
||||
$stmt = Database::prepare("TABLE_PANEL_ADMINS
|
||||
$stmt = Database::prepare("
|
||||
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id"
|
||||
);
|
||||
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array('id' => $adminid));
|
||||
|
||||
@@ -348,7 +348,7 @@ class phpinterface_fpm {
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if (!isset($this->_admin_cache[$adminid])) {
|
||||
$stmt = Database::prepare("TABLE_PANEL_ADMINS
|
||||
$stmt = Database::prepare("
|
||||
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id"
|
||||
);
|
||||
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array('id' => $adminid));
|
||||
|
||||
@@ -787,7 +787,6 @@ class apache
|
||||
*/
|
||||
public function createVirtualHosts()
|
||||
{
|
||||
//$result_domains = $this->db->query("SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, `d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled`, `d`.`mod_fcgid_starter`, `d`.`mod_fcgid_maxrequests` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) " . "WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> 1 ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC");
|
||||
$query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`,
|
||||
`d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`,
|
||||
`c`.`documentroot` AS `customerroot`, `c`.`deactivated`,
|
||||
@@ -809,7 +808,7 @@ class apache
|
||||
GROUP BY `id_domain`
|
||||
) AS p ON p.`id_domain` = `d`.`id`
|
||||
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` = '0'
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
||||
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;";
|
||||
|
||||
$result_domains = $this->db->query($query);
|
||||
|
||||
@@ -324,7 +324,7 @@ class lighttpd
|
||||
GROUP BY `id_domain`
|
||||
) AS p ON p.`id_domain` = `d`.`id`
|
||||
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` = '0'
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
||||
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;";
|
||||
|
||||
$included_vhosts = array();
|
||||
|
||||
@@ -284,7 +284,7 @@ class nginx
|
||||
GROUP BY `id_domain`
|
||||
) AS p ON p.`id_domain` = `d`.`id`
|
||||
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` = '0'
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
||||
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;";
|
||||
|
||||
$result_domains = $this->db->query($query);
|
||||
|
||||
Reference in New Issue
Block a user