apply initial-fixes-make-compatible-with-Debian-Ubuntu-php from https://github.com/zedzedtop/mailzu

This commit is contained in:
Mario Fetka
2016-02-04 17:03:27 +01:00
parent 401edac1a7
commit 180aa514e9
22 changed files with 203 additions and 199 deletions

View File

@@ -17,7 +17,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* PEAR::Net_Socket Library

View File

@@ -356,7 +356,7 @@ class CmnFns {
global $conf;
?>
<select name="language" class="textbox" onchange="changeLanguage(this);">
<?
<?php
$languages = get_language_list();
foreach ($languages as $lang => $settings) {
echo '<option value="' . $lang . '"'
@@ -365,7 +365,7 @@ class CmnFns {
}
?>
</select>
<?
<?php
}
/**
@@ -452,10 +452,10 @@ class CmnFns {
$query_string = CmnFns::array_to_query_string( $_GET, array( 'page' ) );
$query_string_first = $query_string . '&page=0';
$query_string_previous = $query_string . '&page=' . ($page-1);
$pager_html .= $link->getLink($php_self . '?' . $query_string_first, translate('first'), '', '', translate('Go to first page')) . " | ";
$pager_html = $link->getLink($php_self . '?' . $query_string_first, translate('first'), '', '', translate('Go to first page')) . " | ";
$pager_html .= $link->getLink($php_self . '?' . $query_string_previous, translate('previous'), '', '', translate('Go to previous page')) . " | ";
} else {
$pager_html .= translate('first') . " | " . translate('previous') ." | ";
$pager_html = translate('first') . " | " . translate('previous') ." | ";
}
$pager_html .= '&nbsp;&nbsp;';
@@ -466,7 +466,7 @@ class CmnFns {
for( $i=0; $i<$count; $i+=$sizeLimit ) {
$page_num = $i/$sizeLimit;
if( $count > $size_limit * 20 && abs( $page_num - $page ) > 10 ) {
if( $count > $sizeLimit * 20 && abs( $page_num - $page ) > 10 ) {
if( ! $elipsis_printed ) {
$pager_html .= '...&nbsp;&nbsp;';
$elipsis_printed = true;
@@ -486,8 +486,8 @@ class CmnFns {
if( $page+1 < $total_pages ) {
$query_string = CmnFns::array_to_query_string( $_GET, array( 'page' ) );
$query_string_next .= $query_string . '&page=' . ($page+1);
$query_string_last .= $query_string . '&page=' . (ceil($total_pages)-1);
$query_string_next = $query_string . '&page=' . ($page+1);
$query_string_last = $query_string . '&page=' . (ceil($total_pages)-1);
$pager_html .= ' | ' . $link->getLink($php_self . '?' . $query_string_next, strtolower(translate('Next')), '', '', translate('Go to next page'));
$pager_html .= ' | ' . $link->getLink($php_self . '?' . $query_string_last, translate('last'), '', '', translate('Go to last page'));
} else {
@@ -514,11 +514,11 @@ class CmnFns {
?>
<table border=0 width="100%">
<form action="<? echo $submit_page ?>" method="get" name="quarantine">
<form action="<?php echo $submit_page ?>" method="get" name="quarantine">
<tr><td colspan=2 align="center"><? echo translate('Search for messages whose:'); ?>&nbsp;</td></tr>
<tr><td colspan=2 align="center"><?php echo translate('Search for messages whose:'); ?>&nbsp;</td></tr>
<tr><td align="right">&nbsp;
<?
<?php
$i = 1;
$array_size = count($fields_array);
foreach ($fields_array as $k => $name) {
@@ -543,34 +543,34 @@ class CmnFns {
$i ++;
}
?>
<? echo translate('Content Type'); ?>:
<?php echo translate('Content Type'); ?>:
<select name="ctype" class="button">
<option value="A" <? echo ($content_type == 'A' ? ' selected="true"':''); ?>>
<? echo translate('All'); ?></option>
<option value="S" <? echo ($content_type == 'S' ? ' selected="true"':''); ?>>
<? echo translate('Spam'); ?></option>
<option value="B" <? echo ($content_type == 'B' ? ' selected="true"':''); ?>>
<? echo translate('Banned'); ?></option>
<? if ((Auth::isMailAdmin() || Auth::isDomainAdmin()) || $conf['app']['allowViruses']) { ?>
<option value="V" <? echo ($content_type == 'V' ? ' selected="true"':''); ?>>
<? echo translate('Virus'); ?></option>
<? }
<option value="A" <?php echo ($content_type == 'A' ? ' selected="true"':''); ?>>
<?php echo translate('All'); ?></option>
<option value="S" <?php echo ($content_type == 'S' ? ' selected="true"':''); ?>>
<?php echo translate('Spam'); ?></option>
<option value="B" <?php echo ($content_type == 'B' ? ' selected="true"':''); ?>>
<?php echo translate('Banned'); ?></option>
<?php if ((Auth::isMailAdmin() || Auth::isDomainAdmin()) || $conf['app']['allowViruses']) { ?>
<option value="V" <?php echo ($content_type == 'V' ? ' selected="true"':''); ?>>
<?php echo translate('Virus'); ?></option>
<?php }
if ((Auth::isMailAdmin() || Auth::isDomainAdmin()) || $conf['app']['allowBadHeaders']) { ?>
<option value="H" <? echo ($content_type == 'H' ? ' selected="true"':''); ?>>
<? echo translate('Bad Header'); ?></option>
<? }
<option value="H" <?php echo ($content_type == 'H' ? ' selected="true"':''); ?>>
<?php echo translate('Bad Header'); ?></option>
<?php }
echo "</select>";
$i ++;
echo ($i % 2) ? "&nbsp;</td></tr>\n\t\t\t<tr><td colspan='2' align='center'>&nbsp\n" : "&nbsp;</td><td align='left'>&nbsp";
?>
<input type="submit" class="button" name="search_action" value="<? echo translate('Search'); ?>" />
<? if (CmnFns::didSearch())
<input type="submit" class="button" name="search_action" value="<?php echo translate('Search'); ?>" />
<?php if (CmnFns::didSearch())
echo "<input type=\"submit\" class=\"button\" name=\"search_action\" value=\"" . translate('Clear search results') . "\" />";
?>
&nbsp;</td></tr>
</form>
</table>
<?
<?php
}

View File

@@ -19,7 +19,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Pear::DB
*/

View File

@@ -23,7 +23,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Auth class
*/
@@ -496,7 +496,7 @@ class DBEngine {
$join_type = ' INNER JOIN';
}
$recipEmailClause = $this->convertEmailaddresses2SQL($emailaddresses);
$recipEmailClause = $this->convertEmailaddresses2SQL($emailaddress);
$return = array();
@@ -640,6 +640,7 @@ class DBEngine {
if ($result->numRows() <= 0){
return false;
}
$return = "";
while ($rs = $result->fetchRow()) {
$return .= $rs['mail_text'];
}

View File

@@ -15,7 +15,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Provide all database access/manipulation functionality for Exchange Auth

View File

@@ -15,7 +15,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Provide all database access/manipulation functionality for IMAP Auth

View File

@@ -15,7 +15,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
class LDAPEngine {

View File

@@ -15,7 +15,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Pear::DB
*/

View File

@@ -15,7 +15,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Pear::DB
*/
@@ -91,14 +91,14 @@ function MsgParseBody($struct) {
break;
}
break;
case "text":
// Do not display attached text types
if ($attachment = $struct->d_parameters['filename'] or
$attachment = $struct->d_parameters['name']) {
if (property_exists($struct, "d_parameters")) {
if ($attachment = $struct->d_parameters['filename'] or $attachment = $struct->d_parameters['name']) {
array_push($filelist, $attachment);
break;
}
}
switch ($ctype_s) {
// Plain text
case "plain":

View File

@@ -16,7 +16,7 @@
/**
* CmnFns class
*/
include_once('CmnFns.class.php');
include_once('lib/CmnFns.class.php');
/**
* Include AmavisdEngine class
*/
@@ -123,8 +123,7 @@ function releaseMessages($emailaddresses, $mail_id_array) {
global $conf;
// If release request needs to be sent to Admins
if ( is_array($release_req_messages) && !empty($release_req_messages)
&& $conf['app']['notifyAdmin'] )
if ( is_array($release_req_messages) && !empty($release_req_messages) && $conf['app']['notifyAdmin'] )
sendMailToAdmin(translate('Request release'), $release_req_messages);
// If release needs to be done
@@ -252,15 +251,14 @@ function updateMessages($flag, $content_type, $emailaddresses, $mail_id_array, $
}
} else {
$i = 0;
foreach ($mail_id_array as $mail_id_recip) {
// Get mail_id and recipient email address
$temp = preg_split('/_/', $mail_id_recip);
$mail_id = str_replace("_" . $temp[(sizeof($temp) - 1)], "", $mail_id_recip);
$recip_email = $temp[(sizeof($temp) - 1)];
//$temp = preg_split('/_/', $mail_id_recip, 2);
//$mail_id = $temp[0];
//$recip_email = $temp[1];
$mail_id = substr($mail_id_recip, 0, 12);
$recip_email = substr($mail_id_recip, 13);
// Check if logged in user is admin or logged in user is trying to delete his own messages
if ( Auth::isMailAdmin() || Auth::isDomainAdmin() || in_array($recip_email, $emailaddresses) ) {

View File

@@ -57,21 +57,21 @@ class Template {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$languages[$lang][2]?>" lang="<?=$languages[$lang][2]?>">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $languages[$lang][2]?>" lang="<?php echo $languages[$lang][2]?>">
<head>
<title>
<?=$this->title?>
<?php echo $this->title?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset?>" />
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<script language="JavaScript" type="text/javascript" src="<?=$path?>functions.js"></script>
<!--<link href="<?=$path?>css.css" rel="stylesheet" type="text/css" />-->
<script language="JavaScript" type="text/javascript" src="<?php echo $path?>functions.js"></script>
<!--<link href="<?php echo $path?>css.css" rel="stylesheet" type="text/css" />-->
<style type="text/css">
@import url(<?=$path?>css.css);
@import url(<?php echo $path?>css.css);
</style>
</head>
<body>
<?
<?php
}
@@ -96,31 +96,31 @@ class Template {
<tr>
<td class="mainBkgrdClr">
<h4 class="welcomeBack">
<?=
translate('Welcome Back', array($_SESSION['sessionName'], 1));
<?php
echo translate('Welcome Back', array($_SESSION['sessionName'], 1));
// Notify if the person logged in is admin
echo (Auth::isMailAdmin() ? ' (' . translate('Administrator') . ')' : '');
?>
</h4>
<!--<p>
<? $this->link->doLink($this->dir_path . 'index.php?logout=true', translate('Log Out')) ?>
<?php $this->link->doLink($this->dir_path . 'index.php?logout=true', translate('Log Out')) ?>
|
<? $this->link->doLink($this->dir_path . 'summary.php', translate('My Control Panel')) ?>
<?php $this->link->doLink($this->dir_path . 'summary.php', translate('My Control Panel')) ?>
</p>-->
</td>
<td class="mainBkgrdClr" valign="top">
<div align="right">
<p>
<?= translate_date('header', mktime());?>
<?php echo translate_date('header', mktime());?>
</p>
<!--<p>
<? $this->link->doLink('javascript: help();', translate('Help')) ?>
<?php $this->link->doLink('javascript: help();', translate('Help')) ?>
</p>-->
</div>
</td>
</tr>
</table>
<?
<?php
}
@@ -134,7 +134,7 @@ class Template {
<table width="100%" border="0" cellspacing="0" cellpadding="10" style="border: solid #CCCCCC 1px;">
<tr>
<td bgcolor="#FAFAFA">
<?
<?php
}
@@ -147,7 +147,7 @@ class Template {
</td>
</tr>
</table>
<?
<?php
}
@@ -160,10 +160,10 @@ class Template {
function printHTMLFooter() {
global $conf;
?>
<p align="center"><a href="http://www.mailzu.net"><?=$conf['app']['title']?> v<?=$conf['app']['version']?></a></p>
<p align="center"><a href="http://www.mailzu.net"><?php echo $conf['app']['title']?> v<?php $conf['app']['version']?></a></p>
</body>
</html>
<?
<?php
}
/**