You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
functions.inc.php: reindent, ensure alias_pgindex_count is initialised in get_domain_details()
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@21 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -59,7 +59,10 @@ function session_fixid ()
|
|||||||
{
|
{
|
||||||
if (!isset($_SESSION['exist']))
|
if (!isset($_SESSION['exist']))
|
||||||
{
|
{
|
||||||
if ( !session_regenerate_id() ) die("Couldn't regenerate your session id.");
|
if ( !session_regenerate_id() )
|
||||||
|
{
|
||||||
|
die("Couldn't regenerate your session id.");
|
||||||
|
}
|
||||||
$_SESSION['exist'] = true;
|
$_SESSION['exist'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,13 +265,14 @@ function get_domain_properties ($domain)
|
|||||||
|
|
||||||
$list['alias_pgindex']=array ();
|
$list['alias_pgindex']=array ();
|
||||||
$list['mbox_pgindex']=array ();
|
$list['mbox_pgindex']=array ();
|
||||||
|
$list['mbox_pgindex_count'] = 0;
|
||||||
//while loop to figure index names. use page_size and loop of queries
|
//while loop to figure index names. use page_size and loop of queries
|
||||||
$i=0;
|
$i=0;
|
||||||
$current=0;
|
$current=0;
|
||||||
$page_size = $CONF['page_size'];
|
$page_size = $CONF['page_size'];
|
||||||
$tmpstr="";
|
$tmpstr="";
|
||||||
$idxlabel="";
|
$idxlabel="";
|
||||||
|
$list['alias_pgindex_count'] = 0;
|
||||||
|
|
||||||
if ( $list['alias_count'] > $page_size )
|
if ( $list['alias_count'] > $page_size )
|
||||||
{
|
{
|
||||||
@@ -330,19 +334,12 @@ function get_domain_properties ($domain)
|
|||||||
$list['mbox_pgindex_count']=$i;
|
$list['mbox_pgindex_count']=$i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// end mod
|
// end mod
|
||||||
|
|
||||||
$query="SELECT * FROM $table_domain WHERE domain='$domain'";
|
$query="SELECT * FROM $table_domain WHERE domain='$domain'";
|
||||||
if ('pgsql'==$CONF['database_type'])
|
if ('pgsql'==$CONF['database_type'])
|
||||||
{
|
{
|
||||||
$query="
|
$query=" SELECT *, EXTRACT(epoch FROM created) AS uts_created, EXTRACT(epoch FROM modified) AS uts_modified FROM $table_domain WHERE domain='$domain' ";
|
||||||
SELECT
|
|
||||||
*,
|
|
||||||
EXTRACT(epoch FROM created) AS uts_created,
|
|
||||||
EXTRACT(epoch FROM modified) AS uts_modified
|
|
||||||
FROM $table_domain
|
|
||||||
WHERE domain='$domain'
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
$result = db_query ($query);
|
$result = db_query ($query);
|
||||||
$row = db_array ($result['result']);
|
$row = db_array ($result['result']);
|
||||||
@@ -1156,23 +1153,23 @@ function smtp_get_response ($fh)
|
|||||||
{
|
{
|
||||||
$res ='';
|
$res ='';
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
$line = fgets($fh, 256);
|
$line = fgets($fh, 256);
|
||||||
$res .= $line;
|
$res .= $line;
|
||||||
}
|
}
|
||||||
while (preg_match("/^\d\d\d\-/", $line));
|
while (preg_match("/^\d\d\d\-/", $line));
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$DEBUG_TEXT = "\n
|
$DEBUG_TEXT = "\n
|
||||||
<p />\n
|
<p />\n
|
||||||
Please check the documentation and website for more information.\n
|
Please check the documentation and website for more information.\n
|
||||||
<p />\n
|
<p />\n
|
||||||
<a href=\"http://high5.net/postfixadmin/\">Postfix Admin</a><br />\n
|
<a href=\"http://high5.net/postfixadmin/\">Postfix Admin</a><br />\n
|
||||||
<a href=\"http://forums.high5.net/index.php?showforum=7\">Knowledge Base</a>\n
|
<a href=\"http://forums.high5.net/index.php?showforum=7\">Knowledge Base</a>\n
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1196,7 +1193,7 @@ function db_connect ()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p />DEBUG INFORMATION:<br />MySQL 3.x / 4.0 functions not available!<br />database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
print "<p />DEBUG INFORMATION:<br />MySQL 3.x / 4.0 functions not available!<br />database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1210,7 +1207,7 @@ function db_connect ()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p />DEBUG INFORMATION:<br />MySQL 4.1 functions not available!<br />database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
print "<p />DEBUG INFORMATION:<br />MySQL 4.1 functions not available!<br />database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1224,7 +1221,7 @@ function db_connect ()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
print "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT";
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1239,7 +1236,7 @@ function db_connect ()
|
|||||||
print "<br />\n";
|
print "<br />\n";
|
||||||
print "Make sure that you have set the correct database type in the config.inc.php file<br />\n";
|
print "Make sure that you have set the correct database type in the config.inc.php file<br />\n";
|
||||||
print $DEBUG_TEXT;
|
print $DEBUG_TEXT;
|
||||||
die;
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1422,7 +1419,7 @@ function table_by_pos ($pos)
|
|||||||
/*
|
/*
|
||||||
Called after a mailbox has been created in the DBMS.
|
Called after a mailbox has been created in the DBMS.
|
||||||
Returns: boolean.
|
Returns: boolean.
|
||||||
*/
|
*/
|
||||||
function mailbox_postcreation($username,$domain,$maildir)
|
function mailbox_postcreation($username,$domain,$maildir)
|
||||||
{
|
{
|
||||||
if (empty($username) || empty($domain) || empty($maildir))
|
if (empty($username) || empty($domain) || empty($maildir))
|
||||||
@@ -1457,7 +1454,7 @@ function mailbox_postcreation($username,$domain,$maildir)
|
|||||||
/*
|
/*
|
||||||
Called after a mailbox has been deleted in the DBMS.
|
Called after a mailbox has been deleted in the DBMS.
|
||||||
Returns: boolean.
|
Returns: boolean.
|
||||||
*/
|
*/
|
||||||
function mailbox_postdeletion($username,$domain)
|
function mailbox_postdeletion($username,$domain)
|
||||||
{
|
{
|
||||||
global $CONF;
|
global $CONF;
|
||||||
@@ -1494,7 +1491,7 @@ function mailbox_postdeletion($username,$domain)
|
|||||||
/*
|
/*
|
||||||
Called after a domain has been deleted in the DBMS.
|
Called after a domain has been deleted in the DBMS.
|
||||||
Returns: boolean.
|
Returns: boolean.
|
||||||
*/
|
*/
|
||||||
function domain_postdeletion($domain)
|
function domain_postdeletion($domain)
|
||||||
{
|
{
|
||||||
global $CONF;
|
global $CONF;
|
||||||
@@ -1543,7 +1540,7 @@ function domain_postdeletion($domain)
|
|||||||
|
|
||||||
Doesn't clean up, if only some of the folders could be
|
Doesn't clean up, if only some of the folders could be
|
||||||
created.
|
created.
|
||||||
*/
|
*/
|
||||||
function create_mailbox_subfolders($login,$cleartext_password)
|
function create_mailbox_subfolders($login,$cleartext_password)
|
||||||
{
|
{
|
||||||
global $CONF;
|
global $CONF;
|
||||||
|
Reference in New Issue
Block a user