Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 122253
Collapse All | Expand All

(-)pfa/admin/create-admin.php (-1 / +1 lines)
Lines 79-85 Link Here
79
      $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text'];
79
      $pAdminCreate_admin_username_text = $PALANG['pAdminCreate_admin_username_text'];
80
80
81
81
82
      $result = db_query ("INSERT INTO admin (username,password,created,modified) VALUES ('$fUsername','$password',NOW(),NOW())");
82
      $result = db_query ("INSERT INTO admin (username,password,created,modified,active) VALUES ('$fUsername','$password',NOW(),NOW(),'t')");
83
      if ($result['rows'] != 1)
83
      if ($result['rows'] != 1)
84
      {
84
      {
85
         $tMessage = $PALANG['pAdminCreate_admin_result_error'] . "<br />($fUsername)<br />";
85
         $tMessage = $PALANG['pAdminCreate_admin_result_error'] . "<br />($fUsername)<br />";
(-)pfa/admin/create-domain.php (-3 / +3 lines)
Lines 81-94 Link Here
81
         $fAliases = -1;
81
         $fAliases = -1;
82
         $fMailboxes = -1;
82
         $fMailboxes = -1;
83
         $fMaxquota = -1;
83
         $fMaxquota = -1;
84
         $fBackupmx = 1;
84
         $fBackupmx = 't';
85
      }
85
      }
86
      else
86
      else
87
      {
87
      {
88
         $fBackupmx = 0;
88
         $fBackupmx = 'f';
89
      }
89
      }
90
      
90
      
91
      $result = db_query ("INSERT INTO domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport',$fBackupmx,NOW(),NOW())");
91
      $result = db_query ("INSERT INTO domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport','$fBackupmx',NOW(),NOW())");
92
      if ($result['rows'] != 1)
92
      if ($result['rows'] != 1)
93
      {
93
      {
94
         $tMessage = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
94
         $tMessage = $PALANG['pAdminCreate_domain_result_error'] . "<br />($fDomain)<br />";
(-)pfa/admin/edit-active-admin.php (-2 / +2 lines)
Lines 25-32 Link Here
25
if ($_SERVER['REQUEST_METHOD'] == "GET")
25
if ($_SERVER['REQUEST_METHOD'] == "GET")
26
{
26
{
27
   if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
27
   if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
28
   
28
29
   $result = db_query ("UPDATE admin SET active=1-active WHERE username='$fUsername'");
29
   $result = db_query ("UPDATE admin SET active=NOT active WHERE username='$fUsername'");
30
   if ($result['rows'] != 1)
30
   if ($result['rows'] != 1)
31
   {
31
   {
32
      $error = 1;
32
      $error = 1;
(-)pfa/admin/edit-active-domain.php (-1 / +1 lines)
Lines 26-32 Link Here
26
{
26
{
27
   if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
27
   if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
28
   
28
   
29
   $result = db_query ("UPDATE domain SET active=1-active WHERE domain='$fDomain'");
29
   $result = db_query ("UPDATE domain SET active=NOT active WHERE domain='$fDomain'");
30
   if ($result['rows'] != 1)
30
   if ($result['rows'] != 1)
31
   {
31
   {
32
      $error = 1;
32
      $error = 1;
(-)pfa/admin/edit-active.php (-1 / +1 lines)
Lines 28-34 Link Here
28
   if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
28
   if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
29
   if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
29
   if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
30
   
30
   
31
   $result = db_query ("UPDATE mailbox SET active=1-active WHERE username='$fUsername' AND domain='$fDomain'");
31
   $result = db_query ("UPDATE mailbox SET active= NOT active WHERE username='$fUsername' AND domain='$fDomain'");
32
   if ($result['rows'] != 1)
32
   if ($result['rows'] != 1)
33
   {
33
   {
34
      $error = 1;
34
      $error = 1;
(-)pfa/admin/edit-admin.php (-2 / +4 lines)
Lines 75-87 Link Here
75
75
76
      if (empty ($fPassword) and empty ($fPassword2))
76
      if (empty ($fPassword) and empty ($fPassword2))
77
      {
77
      {
78
         if ($fActive == "on") $fActive = 1;
78
         if ($fActive == "on") $fActive = 't';
79
	 else $fActive = 'f';
79
         $result = db_query ("UPDATE admin SET modified=NOW(),active='$fActive' WHERE username='$username'");
80
         $result = db_query ("UPDATE admin SET modified=NOW(),active='$fActive' WHERE username='$username'");
80
      }
81
      }
81
      else
82
      else
82
      {
83
      {
83
         $password = pacrypt ($fPassword);
84
         $password = pacrypt ($fPassword);
84
         if ($fActive == "on") $fActive = 1;
85
         if ($fActive == "on") $fActive = 't';
86
	 else $fActive = 'f';
85
         $result = db_query ("UPDATE admin SET password='$password',modified=NOW(),active='$fActive' WHERE username='$username'");
87
         $result = db_query ("UPDATE admin SET password='$password',modified=NOW(),active='$fActive' WHERE username='$username'");
86
      }
88
      }
87
89
(-)pfa/admin/viewlog.php (-2 / +2 lines)
Lines 30-36 Link Here
30
30
31
   if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) $fDomain = $list_domains[0];
31
   if ((is_array ($list_domains) and sizeof ($list_domains) > 0)) $fDomain = $list_domains[0];
32
32
33
   $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10");
33
   $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 100");
34
   if ($result['rows'] > 0)
34
   if ($result['rows'] > 0)
35
   {
35
   {
36
      while ($row = db_array ($result['result']))
36
      while ($row = db_array ($result['result']))
Lines 49-55 Link Here
49
{
49
{
50
   $fDomain = escape_string ($_POST['fDomain']);
50
   $fDomain = escape_string ($_POST['fDomain']);
51
   
51
   
52
   $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10");
52
   $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 100");
53
   if ($result['rows'] > 0)
53
   if ($result['rows'] > 0)
54
   {
54
   {
55
      while ($row = db_array ($result['result']))
55
      while ($row = db_array ($result['result']))
(-)pfa/edit-active.php (-1 / +1 lines)
Lines 37-43 Link Here
37
   }
37
   }
38
   else
38
   else
39
   {
39
   {
40
      $result = db_query ("UPDATE mailbox SET active=1-active WHERE username='$fUsername' AND domain='$fDomain'");
40
      $result = db_query ("UPDATE mailbox SET active=NOT active WHERE username='$fUsername' AND domain='$fDomain'");
41
      if ($result['rows'] != 1)
41
      if ($result['rows'] != 1)
42
      {
42
      {
43
         $error = 1;
43
         $error = 1;
(-)pfa/templates/admin_list-virtual.tpl (-1 / +1 lines)
Lines 95-101 Link Here
95
         print "      <td>" . $tMailbox[$i]['name'] . "</td>\n";
95
         print "      <td>" . $tMailbox[$i]['name'] . "</td>\n";
96
         if ($CONF['quota'] == 'YES') print "      <td>" . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "</td>\n";
96
         if ($CONF['quota'] == 'YES') print "      <td>" . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "</td>\n";
97
         print "      <td>" . $tMailbox[$i]['modified'] . "</td>\n";
97
         print "      <td>" . $tMailbox[$i]['modified'] . "</td>\n";
98
         $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
98
         $active = ($tMailbox[$i]['active'] == 't') ? $PALANG['YES'] : $PALANG['NO'];
99
         print "      <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
99
         print "      <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
100
         print "      <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
100
         print "      <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
101
         print "      <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
101
         print "      <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
(-)pfa/templates/overview.tpl (-1 / +1 lines)
Lines 127-133 Link Here
127
            print "</td>\n";
127
            print "</td>\n";
128
         }
128
         }
129
         print "      <td>" . $tMailbox[$i]['modified'] . "</td>\n";
129
         print "      <td>" . $tMailbox[$i]['modified'] . "</td>\n";
130
         $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
130
         $active = ($tMailbox[$i]['active'] == 't') ? $PALANG['YES'] : $PALANG['NO'];
131
         print "      <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
131
         print "      <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
132
         print "      <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
132
         print "      <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
133
         print "      <td><a href=\"delete.php?delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
133
         print "      <td><a href=\"delete.php?delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";

Return to bug 122253