Beispiel #1
0
     if ($res->numRows() == 0) {
         $smarty->assign('if_no_data', 'y');
     } else {
         $smarty->assign('if_no_data', 'n');
     }
     while ($row = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
         array_push($table_data, array('email' => $row['email']));
         $i++;
     }
     $smarty->assign('if_del_ok', 'n');
 } else {
     if (isset($_POST['del_ok']) && $_POST['del_ok'] == 'y') {
         $sql = sprintf("SELECT id,email FROM users WHERE domainid='%d'", $db->escapeSimple($_POST['did']));
         $result =& $db->query($sql);
         while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {
             delete_emailaddress($row['id'], $row['email']);
         }
         $sql = sprintf("SELECT dnsname,id FROM domains WHERE id='%s'", $db->escapeSimple($_POST['did']));
         $result =& $db->query($sql);
         $data = $result->fetchrow(DB_FETCHMODE_ASSOC);
         $sql = sprintf("DELETE FROM users WHERE domainid='%d'", $db->escapeSimple($_POST['did']));
         $db->query($sql);
         $sql = sprintf("SELECT id FROM lists WHERE domainid='%d'", $db->escapeSimple($_POST['did']));
         $result =& $db->query($sql);
         while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {
             $sql = sprintf("DELETE FROM list_recp WHERE id='%d'", $db->escapeSimple($row['id']));
             $db->query($sql);
         }
         $sql = sprintf("DELETE FROM lists WHERE domainid='%d'", $db->escapeSimple($_POST['did']));
         $db->query($sql);
         $sql = sprintf("DELETE FROM sa_wb_listing WHERE domainid='%d'", $db->escapeSimple($_POST['did']));
Beispiel #2
0
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
******************************************************************************/
if (isset($_SESSION['superadmin']) && isset($_GET['id']) && is_numeric($_GET['did']) && $_SESSION['superadmin'] == '1' || $_SESSION['admin'] == '1' && isset($_GET['id']) && is_numeric($_GET['did']) && $access_domain) {
    $sql = sprintf("SELECT email FROM users WHERE id='%s'", $db->escapeSimple($_GET['id']));
    $result =& $db->query($sql);
    $edata = $result->fetchrow(DB_FETCHMODE_ASSOC);
    $smarty->assign('email', $edata['email']);
    if (isset($_POST['del_ok']) && $_POST['del_ok'] == "true") {
        $smarty->assign('if_del_ok', 'y');
        delete_emailaddress($_GET['id'], $edata['email']);
        header("Location: ?module=domain_view&did=" . $_GET['did']);
    }
}
// ENDE ACCESS OK
// Menuansicht
$smarty->assign('if_domain_view', 'y');
$smarty->assign('domain_id', $_GET['did']);
$smarty->assign('id', $_GET['id']);
$smarty->assign('did', $_GET['did']);