Example #1
0
function transfer_pm(&$data)
{
	global $xoopsModule, $xoopsConfig, $xoopsUser, $xoopsModuleConfig;
	global $xoopsLogger, $xoopsOption, $xoopsTpl, $xoopsblock;

	$_config = require(dirname(__FILE__)."/config.php");
	
	$hiddens["to_userid"] = $data["uid"];
	$hiddens["subject"] = $data["title"];
	$content  = str_replace("<br />", "\n\r", $data["content"]);
	$content  = str_replace("<br>", "\n\r", $content);
	$content  = "[quote]\n".forum_html2text($content)."\n[/quote]";
	$content = $data["title"]."\n\r".$content."\n\r\n\r"._MORE."\n\r".$data["url"];
	$hiddens["message"] = $content;
	
	include XOOPS_ROOT_PATH."/header.php";
	if(!empty($_config["module"]) && is_dir(XOOPS_ROOT_PATH."/modules/".$_config["module"])){
		$action = XOOPS_URL."/modules/".$_config["module"]."/pmlite.php";
	}else{
		$action = XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$data["uid"];
	}
	xoops_confirm($hiddens, $action, $_config["title"]);
	$GLOBALS["xoopsOption"]['output_type'] = "plain";
	include XOOPS_ROOT_PATH."/footer.php";
	exit();
}
Example #2
0
function deleteResolved()
{
    global $oAdminButton;
    if (!isset($_POST['ok'])) {
        xoops_cp_header();
        echo $oAdminButton->renderButtons('manFiles');
        xoops_confirm(array('op' => 'deleteResolved', 'ok' => 1), XHELP_BASE_URL . '/admin/file.php', _AM_XHELP_MSG_DELETE_RESOLVED);
        xoops_cp_footer();
    } else {
        $hTicket =& xhelpGetHandler('ticket');
        $hFile =& xhelpGetHandler('file');
        $tickets =& $hTicket->getObjectsByState(1);
        // Memory saver - unresolved should be less tickets
        $aTickets = array();
        foreach ($tickets as $ticket) {
            $aTickets[$ticket->getVar('id')] = $ticket->getVar('id');
        }
        // Retrieve all unresolved ticket attachments
        $crit = new CriteriaCompo();
        foreach ($aTickets as $ticket) {
            $crit->add(new Criteria('ticketid', $ticket, "!="));
        }
        if ($hFile->deleteAll($crit)) {
            header("Location: " . XHELP_ADMIN_URL . "/file.php?op=manageFiles");
        } else {
            redirect_header(XHELP_ADMIN_URL . "/file.php?op=manageFiles", 3, _XHELP_MESSAGE_DELETE_FILE_ERR);
        }
    }
}
Example #3
0
function transfer_blog(&$data)
{
	global $xoopsModule, $xoopsConfig, $xoopsUser, $xoopsModuleConfig;
	global $xoopsLogger, $xoopsOption, $xoopsTpl, $xoopsblock;

	$_config = require(dirname(__FILE__)."/config.php");
	
	$hiddens["art_author"] = $data["author"];
	$hiddens["art_title"] = $data["title"];
	$hiddens["art_source"] = $data["url"];
	$hiddens["text"] = $data["content"];
	
	include XOOPS_ROOT_PATH."/header.php";
	xoops_confirm($hiddens, XOOPS_URL."/modules/".$_config["module"]."/action.article.php", $_config["title"]);
	$GLOBALS["xoopsOption"]['output_type'] = "plain";
	include XOOPS_ROOT_PATH."/footer.php";
	exit();
}
Example #4
0
function transfer_print(&$data)
{
	global $xoopsModule, $xoopsConfig, $xoopsUser, $xoopsModuleConfig;
	global $xoopsLogger, $xoopsOption, $xoopsTpl, $xoopsblock;

	$_config = require(dirname(__FILE__)."/config.php");
	
	$post_data["subject"] = $data["title"];
	$post_data["author"] = $data["author"];
	$post_data["date"] = $data["time"];
	$post_data["text"] = $data["content"];
	$post_data["url"] = $data["url"];

	$hiddens["post_data"] = base64_encode(serialize($post_data));
		
	include XOOPS_ROOT_PATH."/header.php";
	xoops_confirm($hiddens, XOOPS_URL."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname")."/print.php", $_config["title"]);
	$GLOBALS["xoopsOption"]['output_type'] = "plain";
	include XOOPS_ROOT_PATH."/footer.php";
	exit();
}
Example #5
0
function transfer_wordpress(&$data)
{
	global $xoopsModule, $xoopsConfig, $xoopsUser, $xoopsModuleConfig;
	global $xoopsLogger, $xoopsOption, $xoopsTpl, $xoopsblock;

	$_config = require(dirname(__FILE__)."/config.php");

		
	$hiddens["action"] = "post";
	$hiddens["post_status"] = "draft";
	$content = $data["content"] . "<p><a href=\"".$data["url"]."\">"._MORE."</a></p>";
	$hiddens["content"] = $content;
	$hiddens["post_title"] = $data["title"];
	$hiddens["post_author"] = empty($xoopsUser)?0:$xoopsUser->getVar("uid");
	//$hiddens["advanced"] = 1;
	$hiddens["save"] = 1;
	$hiddens["post_from_xoops"] = 1;
	
	include_once XOOPS_ROOT_PATH."/header.php";
	xoops_confirm($hiddens, XOOPS_URL."/modules/".$_config["module"]."/wp-admin/post.php", $_config["title"]);
	$GLOBALS["xoopsOption"]['output_type'] = "plain";
	include_once XOOPS_ROOT_PATH."/footer.php";
	exit();
}
Example #6
0
         }
     }
     xoops_cp_header();
     echo '<code>';
     foreach ($msg as $m) {
         echo $m . '<br />';
     }
     echo '</code><br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset=' . $tplset . '&amp;moddir=' . $moddir . '">' . _MD_AM_BTOTADMIN . '</a>';
     xoops_cp_footer();
     break;
 case 'importtpl':
     xoops_cp_header();
     if (!empty($id)) {
         xoops_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'id' => $id, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT);
     } elseif (isset($file)) {
         xoops_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'file' => $file, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT);
     }
     xoops_cp_footer();
     break;
 case 'importtpl_go':
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('admin.php?fct=tplsets', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     $tpltpl_handler =& xoops_gethandler('tplfile');
     $tplfile = '';
     if (!empty($id)) {
         $tplfile =& $tpltpl_handler->get($id, true);
     } else {
         $tplfiles =& $tpltpl_handler->find('default', null, null, null, trim($file), true);
         $tplfile = count($tplfiles) > 0 ? $tplfiles[0] : '';
     }
Example #7
0
             xoops_error(sprintf(_AM_SYSTEM_USERS_NO_ADMINSUPP, $user->getVar("uname")));
         } elseif (!$member_handler->deleteUser($user)) {
             xoops_error(sprintf(_AM_SYSTEM_USERS_NO_SUPP, $user->getVar("uname")));
         } else {
             $online_handler =& xoops_gethandler('online');
             $online_handler->destroy($uid);
             // RMV-NOTIFY
             xoops_notification_deletebyuser($uid);
             redirect_header("admin.php?fct=users", 1, _AM_SYSTEM_DBUPDATED);
         }
     } else {
         //Assign Breadcrumb menu
         $xoBreadCrumb->addHelp(system_adminVersion('users', 'help') . '#delete');
         $xoBreadCrumb->addLink(_AM_SYSTEM_USERS_NAV_DELETE_USER);
         $xoBreadCrumb->render();
         xoops_confirm(array('ok' => 1, 'uid' => $uid, 'op' => 'users_delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_SYSTEM_USERS_FORM_SURE_DEL, $user->getVar('uname')));
     }
     break;
     // Delete users
 // Delete users
 case "action_group":
     if (@isset($_REQUEST['memberslist_id']) || @$_REQUEST['memberslist_id'] != '') {
         $xoBreadCrumb->render();
         $error = '';
         foreach ($_REQUEST['memberslist_id'] as $del) {
             $del = intval($del);
             $user =& $member_handler->getUser($del);
             $groups = $user->getGroups();
             if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
                 $error .= sprintf(_AM_SYSTEM_USERS_NO_ADMINSUPP, $user->getVar("uname"));
             } elseif (!$member_handler->deleteUser($user)) {
Example #8
0
     if ($cid > 0) {
         $obj = $banner_client_Handler->get($cid);
         if (isset($_POST['ok']) && $_POST['ok'] == 1) {
             if (!$GLOBALS['xoopsSecurity']->check()) {
                 redirect_header('admin.php?fct=banners', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
             }
             if ($banner_client_Handler->delete($obj)) {
                 // Delete client banners
                 $banner_Handler->deleteAll(new Criteria('cid', $cid));
                 $banner_finish_Handler->deleteAll(new Criteria('cid', $cid));
                 redirect_header('admin.php?fct=banners', 3, _AM_SYSTEM_BANNERS_DBUPDATED);
             } else {
                 xoops_error($obj->getHtmlErrors());
             }
         } else {
             xoops_confirm(array('ok' => 1, 'cid' => $cid, 'op' => 'banner_client_delete'), 'admin.php?fct=banners', _AM_SYSTEM_BANNERS_SUREDELBNR);
         }
     } else {
         redirect_header('admin.php?fct=banners', 1, _AM_SYSTEM_DBERROR);
     }
     break;
 case 'new_banner':
     // Form: New Banner
     $xoBreadCrumb->addLink(_AM_SYSTEM_BANNERS_NAV_ADDBNR);
     $xoBreadCrumb->addHelp(system_adminVersion('banners', 'help') . '#new_banner');
     $xoBreadCrumb->addTips(_AM_SYSTEM_BANNERS_NAV_TIPS);
     $xoBreadCrumb->render();
     $obj = $banner_Handler->create();
     $form = $obj->getForm();
     $xoopsTpl->assign('form', $form->render());
     break;
Example #9
0
function delete_block($bid)
{
    $myblock = new XoopsBlock($bid);
    if ($myblock->getVar('block_type') == 'S') {
        $message = _AM_SYSTEMCANT;
        redirect_header('admin.php?fct=blocksadmin', 4, $message);
        exit;
    } elseif ($myblock->getVar('block_type') == 'M') {
        // Fix for duplicated blocks created in 2.0.9 module update
        // A module block can be deleted if there is more than 1 that
        // has the same func_num/show_func which is mostly likely
        // be the one that was duplicated in 2.0.9
        if (1 >= ($count = XoopsBlock::countSimilarBlocks($myblock->getVar('mid'), $myblock->getVar('func_num'), $myblock->getVar('show_func')))) {
            $message = _AM_MODULECANT;
            redirect_header('admin.php?fct=blocksadmin', 4, $message);
            exit;
        }
    }
    xoops_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')), 'admin.php', sprintf(_AM_RUSUREDEL, $myblock->getVar('title')));
}
Example #10
0
        if ($link_handler->insert($link_obj)) {
            redirect_header('admin.links.php?sort=' . $sort, 3, $message);
        } else {
            redirect_header('admin.links.php?sort=' . $sort, 3, _AM_LINKS_ACTIVEERROR);
        }
        break;
    case 'delete':
        $link_obj =& $link_handler->get($link_id);
        if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
            if (!$GLOBALS['xoopsSecurity']->check()) {
                redirect_header('admin.links.php?sort=' . $sort, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
            }
            $link_image = $link_obj->getVar('link_image');
            $link_dir = XOOPS_ROOT_PATH . $xoopsModuleConfig['logo_dir'];
            if ($link_handler->delete($link_obj)) {
                if (!empty($link_image)) {
                    unlink($link_dir . $link_image);
                }
                redirect_header('admin.links.php?sort=' . $sort, 3, _AM_LINKS_DELETESUCCESS);
            } else {
                echo $link_obj->getHtmlErrors();
            }
        } else {
            xoops_confirm(array('ok' => 1, 'link_id' => $link_id, 'sort' => $sort, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_LINKS_RESUREDELLIK, $link_obj->getVar('link_title')));
        }
        break;
    default:
        redirect_header('admin.links.php?sort=' . $sort);
        break;
}
include "footer.php";
Example #11
0
                 $member_handler->deleteGroup($group);
                 $gperm_handler =& xoops_gethandler('groupperm');
                 $gperm_handler->deleteByGroup($groups_id);
                 redirect_header('admin.php?fct=groups', 1, _AM_SYSTEM_GROUPS_DBUPDATED);
             } else {
                 redirect_header('admin.php?fct=groups', 2, _AM_SYSTEM_GROUPS_ERROR_DELETE);
             }
         } else {
             // Define Stylesheet
             $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
             // Define Breadcrumb and tips
             $xoBreadCrumb->addLink(_AM_SYSTEM_GROUPS_NAV_DELETE);
             $xoBreadCrumb->addHelp(system_adminVersion('groups', 'help') . '#edit');
             $xoBreadCrumb->render();
             // Display message
             xoops_confirm(array("ok" => 1, "groups_id" => $_REQUEST["groups_id"], "op" => "groups_delete"), 'admin.php?fct=groups', sprintf(_AM_SYSTEM_GROUPS_SUREDEL) . '<br \\>' . $obj->getVar("name") . '<br \\>');
         }
     } else {
         redirect_header('admin.php?fct=groups', 1, _AM_SYSTEM_DBERROR);
     }
     break;
     //Add users group
 //Add users group
 case 'action_group':
     $error = true;
     if (isset($_REQUEST['edit_group'])) {
         if (isset($_REQUEST['edit_group']) && $_REQUEST['edit_group'] == 'add_group' && isset($_REQUEST['selgroups'])) {
             foreach ($_REQUEST['memberslist_id'] as $uid) {
                 $member_handler->addUserToGroup($_REQUEST['selgroups'], $uid);
                 $error = false;
             }
Example #12
0
    $config_handler =& xoops_gethandler('config');
    $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
    if (!$GLOBALS['xoopsUser'] || $GLOBALS['xoopsConfigUser']['self_delete'] != 1) {
        redirect_header(XOOPS_URL . '/', 5, _US_NOPERMISS);
        exit;
    } else {
        $groups = $GLOBALS['xoopsUser']->getGroups();
        if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
            // users in the webmasters group may not be deleted
            redirect_header(XOOPS_URL . '/', 5, _US_ADMINNO);
            exit;
        }
        $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']);
        if ($ok != 1) {
            include $GLOBALS['xoops']->path('header.php');
            xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
            include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php';
        } else {
            $del_uid = $GLOBALS['xoopsUser']->getVar("uid");
            $member_handler =& xoops_gethandler('member');
            if (false != $member_handler->deleteUser($GLOBALS['xoopsUser'])) {
                $online_handler =& xoops_gethandler('online');
                $online_handler->destroy($del_uid);
                xoops_notification_deletebyuser($del_uid);
                redirect_header(XOOPS_URL . '/', 5, _US_BEENDELED);
            }
            redirect_header(XOOPS_URL . '/', 5, _US_NOPERMISS);
        }
        exit;
    }
}
Example #13
0
     $id = isset($_GET['id']) ? intval($_GET['id']) : $id;
     $clientObj = new SmartclientClient($id);
     $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
     $title = isset($_POST['title']) ? $_POST['title'] : '';
     if ($confirm) {
         if (!$client_handler->delete($clientObj)) {
             redirect_header("client.php", 2, _AM_SCLIENT_CLIENT_DELETE_ERROR);
             exit;
         }
         redirect_header("client.php", 2, sprintf(_AM_SCLIENT_CLIENT_DELETE_SUCCESS, $clientObj->title()));
         exit;
     } else {
         // no confirm: show deletion condition
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
         xoops_cp_header();
         xoops_confirm(array('op' => 'del', 'id' => $clientObj->id(), 'confirm' => 1, 'name' => $clientObj->title()), 'client.php', _AM_SCLIENT_DELETETHISP . " <br />'" . $clientObj->title() . "' <br /> <br />", _AM_SCLIENT_DELETE);
         xoops_cp_footer();
     }
     exit;
     break;
 case "default":
 default:
     xoops_cp_header();
     smartclient_adminMenu(1, _AM_SCLIENT_CLIENTS);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
     global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule;
     echo "<br />\n";
     smartclient_collapsableBar('toptable', 'toptableicon');
     echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SCLIENT_ACTIVE_CLIENTS . "</h3>";
     echo "<div id='toptable'>";
Example #14
0
        $uid = intval($HTTP_GET_VARS['uid']);
    }
}
switch ($op) {
    case "modifyUser":
        modifyUser($uid);
        break;
    case "updateUser":
        // RMV-NOTIFY
        updateUser($uid, $uname, $name, $url, $email, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar, $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method, $notify_mode, $timezone_offset, $user_mailok);
        break;
    case "delUser":
        xoops_cp_header();
        $member_handler =& xoops_gethandler('member');
        $userdata =& $member_handler->getUser($uid);
        xoops_confirm(array('fct' => 'users', 'op' => 'delUserConf', 'del_uid' => $userdata->getVar('uid')), 'admin.php', sprintf(_AM_AYSYWTDU, $userdata->getVar('uname')));
        xoops_cp_footer();
        break;
    case "delete_many":
        xoops_cp_header();
        $count = count($memberslist_id);
        if ($count > 0) {
            $list = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $memberslist_id[0] . "' target='_blank'>" . $memberslist_uname[$memberslist_id[0]] . "</a>";
            $hidden = "<input type='hidden' name='memberslist_id[]' value='" . $memberslist_id[0] . "' />\n";
            for ($i = 1; $i < $count; $i++) {
                $list .= ", <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $memberslist_id[$i] . "' target='_blank'>" . $memberslist_uname[$memberslist_id[$i]] . "</a>";
                $hidden .= "<input type='hidden' name='memberslist_id[]' value='" . $memberslist_id[$i] . "' />\n";
            }
            echo "<div><h4>" . sprintf(_AM_AYSYWTDU, " " . $list . " ") . "</h4>";
            echo _AM_BYTHIS . "<br /><br />\r\n\t\t<form action='admin.php' method='post'>\r\n\t\t<input type='hidden' name='fct' value='users' />\r\n\t\t<input type='hidden' name='op' value='delete_many_ok' />\r\n\t\t<input type='submit' value='" . _YES . "' />\r\n\t\t<input type='button' value='" . _NO . "' onclick='javascript:location.href=\"admin.php?op=adminMain\"' />";
            echo $hidden;
Example #15
0
     $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : $faqid;
     $faqObj = new sfFaq($faqid);
     $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
     $question = isset($_POST['question']) ? $_POST['question'] : '';
     if ($confirm) {
         if (!$faq_handler->delete($faqObj)) {
             redirect_header("question.php", 2, _AM_SF_FAQ_DELETE_ERROR);
             exit;
         }
         redirect_header("question.php", 2, sprintf(_AM_SF_QUESTIONISDELETED, $faqObj->question()));
         exit;
     } else {
         // no confirm: show deletion condition
         $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0;
         xoops_cp_header();
         xoops_confirm(array('op' => 'del', 'faqid' => $faqObj->faqid(), 'confirm' => 1, 'name' => $faqObj->question()), 'question.php', _AM_SF_DELETETHISQUESTION . " <br />'" . $faqObj->question() . "'. <br /> <br />", _AM_SF_DELETE);
         xoops_cp_footer();
     }
     exit;
     break;
 case "default":
 default:
     xoops_cp_header();
     sf_adminMenu(3, _AM_SF_OPEN_QUESTIONS);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
     global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule;
     echo "<br />\n";
     sf_collapsableBar('toptable', 'toptableicon');
     echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_OPENED_TITLE . "</h3>";
     echo "<div id='toptable'>";
Example #16
0
function delCat()
{
    global $xoopsDB, $eh, $mytree, $xoopsModule;
    $cid = isset($_POST['cid']) ? intval($_POST['cid']) : intval($_GET['cid']);
    $ok = isset($_POST['ok']) ? intval($_POST['ok']) : 0;
    if ($ok == 1) {
        //get all subcategories under the specified category
        $arr = $mytree->getAllChildId($cid);
        $dcount = count($arr);
        for ($i = 0; $i < $dcount; $i++) {
            //get all links in each subcategory
            $result = $xoopsDB->query("select lid from " . $xoopsDB->prefix("mylinks_links") . " where cid=" . $arr[$i] . "") or $eh->show("0013");
            //now for each link, delete the text data and vote ata associated with the link
            while (list($lid) = $xoopsDB->fetchRow($result)) {
                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $lid);
                $xoopsDB->query($sql) or $eh->show("0013");
                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $lid);
                $xoopsDB->query($sql) or $eh->show("0013");
                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
                $xoopsDB->query($sql) or $eh->show("0013");
                xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
                xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
            }
            xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $arr[$i]);
            //all links for each subcategory is deleted, now delete the subcategory data
            $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mylinks_cat"), $arr[$i]);
            $xoopsDB->query($sql) or $eh->show("0013");
        }
        //all subcategory and associated data are deleted, now delete category data and its associated data
        $result = $xoopsDB->query("select lid from " . $xoopsDB->prefix("mylinks_links") . " where cid=" . $cid . "") or $eh->show("0013");
        while (list($lid) = $xoopsDB->fetchRow($result)) {
            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
            $xoopsDB->query($sql) or $eh->show("0013");
            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $lid);
            $xoopsDB->query($sql) or $eh->show("0013");
            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $lid);
            $xoopsDB->query($sql) or $eh->show("0013");
            // delete comments
            xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
            // delete notifications
            xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
        }
        $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mylinks_cat"), $cid);
        $xoopsDB->query($sql) or $eh->show("0013");
        xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $cid);
        redirect_header("index.php", 1, _MD_CATDELETED);
        exit;
    } else {
        xoops_cp_header();
        xoops_confirm(array('op' => 'delCat', 'cid' => $cid, 'ok' => 1), 'index.php', _MD_WARNING);
        xoops_cp_footer();
    }
}
Example #17
0
             }
         }
         if ($_POST['op'] == 'save') {
             $xoopsTpl->assign('msg', _PM_UNSAVED);
         } elseif (isset($total_save) && !$xoopsUser->isAdmin()) {
             $xoopsTpl->assign('msg', sprintf(_PM_SAVED_PART, $xoopsModuleConfig['max_save'], $i));
         } else {
             $xoopsTpl->assign('msg', _PM_SAVED_ALL);
         }
     }
 }
 if (isset($_REQUEST['empty_messages'])) {
     if (!$GLOBALS['xoopsSecurity']->check()) {
         $xoopsTpl->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     } elseif (empty($_REQUEST['ok'])) {
         xoops_confirm(array('ok' => 1, 'empty_messages' => 1, 'op' => $_REQUEST['op']), $_SERVER['REQUEST_URI'], _PM_RUSUREEMPTY);
         include XOOPS_ROOT_PATH . "/footer.php";
         exit;
     } else {
         if ($_POST['op'] == 'save') {
             $crit_to = new CriteriaCompo(new Criteria('to_delete', 0));
             $crit_to->add(new Criteria('to_save', 1));
             $crit_to->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
             $crit_from = new CriteriaCompo(new Criteria('from_delete', 0));
             $crit_from->add(new Criteria('from_save', 1));
             $crit_from->add(new Criteria('from_userid', $xoopsUser->getVar('uid')));
             $criteria = new CriteriaCompo($crit_to);
             $criteria->add($crit_from, "OR");
         } elseif ($_POST['op'] == 'out') {
             $criteria = new CriteriaCompo(new Criteria('from_delete', 0));
             $criteria->add(new Criteria('from_userid', $xoopsUser->getVar('uid')));
    exit;
}
if ($op == 'delete') {
    xoops_cp_header();
    // delete_block($bid); GIJ imported from blocksadmin.php
    $myblock = new XoopsBlock($bid);
    if ($myblock->getVar('block_type') == 'S') {
        $message = _AM_SYSTEMCANT;
        redirect_header('admin.php?fct=blocksadmin', 4, $message);
        exit;
    } elseif ($myblock->getVar('block_type') == 'M') {
        $message = _AM_MODULECANT;
        redirect_header('admin.php?fct=blocksadmin', 4, $message);
        exit;
    } else {
        xoops_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')) + $xoopsGTicket->getTicketArray(__LINE__, 1800, 'myblocksadmin'), 'admin.php', sprintf(_AM_RUSUREDEL, $myblock->getVar('title')));
    }
    // end of delete_block() GIJ
    xoops_cp_footer();
    exit;
}
if ($op == 'edit') {
    xoops_cp_header();
    // edit_block($bid); GIJ imported from blocksadmin.php
    $myblock = new XoopsBlock($bid);
    $db =& Database::getInstance();
    $sql = 'SELECT module_id FROM ' . $db->prefix('block_module_link') . ' WHERE block_id=' . intval($bid);
    $result = $db->query($sql);
    $modules = array();
    while ($row = $db->fetchArray($result)) {
        $modules[] = intval($row['module_id']);
Example #19
0
            redirect_header('admin.greenep.php', 3, _AM_CATALOG_ACTIVSUCCESS);
        } else {
            redirect_header('admin.greenep.php', 3, _AM_CATALOG_ACTIVEERROR);
        }
        break;
    case "delete":
        $greenep_obj =& $greenep_handler->get($greenep_id);
        $greenep_logo = $greenep_obj->getVar('greenep_logo');
        $logo_dir = XOOPS_ROOT_PATH . "/uploads/";
        if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
            if (!$GLOBALS['xoopsSecurity']->check()) {
                redirect_header('admin.greenep.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
            }
            $criteria = new Criteria('greenep_id', $greenep_id);
            if ($item_handler->getCount($criteria) > 0) {
                redirect_header('admin.greenep.php', 3, _AM_CATALOG_DELETEGREENTIPS);
            }
            if ($greenep_handler->delete($greenep_obj)) {
                if ($greenep_logo) {
                    unlink($logo_dir . $greenep_logo);
                }
                redirect_header('admin.greenep.php', 3, _AM_CATALOG_DELETESUCCESS);
            } else {
                echo $greenep_obj->getHtmlErrors();
            }
        } else {
            xoops_confirm(array('ok' => 1, 'id' => $greenep_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_CATALOG_RESUREDELIT, $greenep_obj->getVar('greenep_rank')));
        }
        break;
}
include 'footer.php';
Example #20
0
                $version_array = explode(".", $_POST['version']);
                if (!isset($version_array[2])) {
                    $version_array[2] = 0;
                }
                include_once XOOPS_ROOT_PATH . "/header.php";
                xoops_confirm(array('op' => 'delversions', 'submit' => 1, 'ok' => 1, 'storyid' => $_POST['storyid'], 'version' => $version_array[0], 'revision' => $version_array[1], 'revisionminor' => $version_array[2]), 'versions.php', _AMS_NW_RUSUREDELVERSIONS);
            }
            break;
        case "delallversions":
            $story = new AmsStory(intval($_POST['storyid']));
            $gperm_handler =& xoops_gethandler('groupperm');
            if (!$xoopsUser || !$gperm_handler->checkRight("ams_approve", $story->topicid(), $xoopsUser->getGroups(), $xoopsModule->mid())) {
                redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, _NOPERM);
                exit;
            }
            if (!empty($_POST['ok'])) {
                include_once XOOPS_ROOT_PATH . "/header.php";
                $story->delallversions($_POST['version'], $_POST['revision'], $_POST['revisionminor']);
                redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, sprintf(_AMS_NW_VERSIONUPDATED, $_POST['version'] . "." . $_POST['revision'] . "." . $_POST['revisionminor']));
            } else {
                $version_array = explode(".", $_POST['version']);
                if (!isset($version_array[2])) {
                    $version_array[2] = 0;
                }
                include_once XOOPS_ROOT_PATH . "/header.php";
                xoops_confirm(array('op' => 'delallversions', 'submit' => 1, 'ok' => 1, 'storyid' => $_POST['storyid'], 'version' => $version_array[0], 'revision' => $version_array[1], 'revisionminor' => $version_array[2]), 'versions.php', _AMS_NW_RUSUREDELALLVERSIONS);
            }
            break;
    }
}
include '../../footer.php';
Example #21
0
     $image =& $image_handler->get($image_id);
     if (!is_object($image)) {
         redirect_header('admin.php?fct=images', 1);
     }
     if (!$image_handler->delete($image)) {
         xoops_cp_header();
         xoops_error(sprintf(_MD_FAILDEL, $image->getVar('image_id')));
         xoops_cp_footer();
         exit;
     }
     @unlink(XOOPS_UPLOAD_PATH . '/' . $image->getVar('image_name'));
     redirect_header('admin.php?fct=images', 2, _MD_AM_DBUPDATED);
 }
 if ($op == 'delcat') {
     xoops_cp_header();
     xoops_confirm(array('op' => 'delcatok', 'imgcat_id' => $imgcat_id, 'fct' => 'images'), 'admin.php', _MD_RUDELIMGCAT);
     xoops_cp_footer();
     exit;
 }
 if ($op == 'delcatok') {
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('admin.php?fct=images', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     $imgcat_id = intval($imgcat_id);
     if ($imgcat_id <= 0) {
         redirect_header('admin.php?fct=images', 1);
     }
     $imgcat_handler = xoops_gethandler('imagecategory');
     $imagecategory =& $imgcat_handler->get($imgcat_id);
     if (!is_object($imagecategory)) {
         redirect_header('admin.php?fct=images', 1);
Example #22
0
     // How about one line per ID, showing category, name, id, and list of
     // events...
     // TODO: it would also be useful to provide links to other available
     // options so we can say switch from new_message to 'bookmark' if we
     // are receiving too many emails.  OR, if we click on 'change options'
     // we get a form for that page...
     // TODO: option to specify one-time??? or other modes??
     break;
 case 'delete_ok':
     if (empty($_POST['del_not'])) {
         redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
     }
     include $GLOBALS['xoops']->path('header.php');
     $hidden_vars = array('uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not']);
     echo '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>';
     xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL);
     include $GLOBALS['xoops']->path('footer.php');
     // FIXME: There is a problem here... in xoops_confirm it treats arrays as
     // optional radio arguments on the confirmation page... change this or
     // write new function...
     break;
 case 'delete':
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('notifications.php', 2, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     if (empty($_POST['del_not'])) {
         redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
     }
     $notification_handler =& xoops_gethandler('notification');
     foreach ($_POST['del_not'] as $n_array) {
         foreach ($n_array as $n) {
Example #23
0
     }
     redirect_header("item.php", 2, $redirect_msg);
     break;
 case "del":
     $itemObj = $publisher->getHandler('item')->get($itemid);
     $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
     if ($confirm) {
         if (!$publisher->getHandler('item')->delete($itemObj)) {
             redirect_header("item.php", 2, _AM_PUBLISHER_ITEM_DELETE_ERROR . publisher_formatErrors($itemObj->getErrors()));
             exit;
         }
         redirect_header("item.php", 2, sprintf(_AM_PUBLISHER_ITEMISDELETED, $itemObj->title()));
         exit;
     } else {
         xoops_cp_header();
         xoops_confirm(array('op' => 'del', 'itemid' => $itemObj->itemid(), 'confirm' => 1, 'name' => $itemObj->title()), 'item.php', _AM_PUBLISHER_DELETETHISITEM . " <br />'" . $itemObj->title() . "'. <br /> <br />", _AM_PUBLISHER_DELETE);
         xoops_cp_footer();
     }
     exit;
     break;
 case "default":
 default:
     publisher_cpHeader();
     //publisher_adminMenu(2, _AM_PUBLISHER_ITEMS);
     xoops_load('XoopsPageNav');
     echo "<br />\n";
     echo "<form><div style=\"margin-bottom: 12px;\">";
     echo "<input type='button' name='button' onclick=\"location='item.php?op=mod'\" value='" . _AM_PUBLISHER_CREATEITEM . "'>&nbsp;&nbsp;";
     echo "</div></form>";
     $orderBy = 'datesub';
     $ascOrDesc = 'DESC';
Example #24
0
         } elseif ($block->getVar('block_type') == 'M') {
             // Fix for duplicated blocks created in 2.0.9 module update
             // A module block can be deleted if there is more than 1 that
             // has the same func_num/show_func which is mostly likely
             // be the one that was duplicated in 2.0.9
             if (1 >= ($count = $block_handler->countSimilarBlocks($block->getVar('mid'), $block->getVar('func_num'), $block->getVar('show_func')))) {
                 redirect_header('admin.php?fct=blocksadmin', 4, _AM_SYSTEM_BLOCKS_MODULECANT);
                 exit;
             }
         }
         // Define main template
         $xoopsOption['template_main'] = 'system_header.html';
         // Call Header
         xoops_cp_header();
         // Display Question
         xoops_confirm(array('op' => 'delete_ok', 'fct' => 'blocksadmin', 'bid' => $block->getVar('bid')), 'admin.php', sprintf(_AM_SYSTEM_BLOCKS_RUSUREDEL, $block->getVar('title')));
         // Call Footer
         xoops_cp_footer();
     }
     break;
 case 'delete_ok':
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('admin.php?fct=blocksadmin', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
         exit;
     }
     // Initialize blocks handler
     $block_handler =& xoops_getmodulehandler('block');
     // Get avatar id
     $block_id = system_CleanVars($_POST, 'bid', 0, 'int');
     if ($block_id > 0) {
         $block = $block_handler->get($block_id);
Example #25
0
             $gperm_handler->insert($modperm);
         }
         foreach ($read_bids as $r_bid) {
             $blockperm =& $gperm_handler->create();
             $blockperm->setVar('gperm_groupid', $groupid);
             $blockperm->setVar('gperm_itemid', $r_bid);
             $blockperm->setVar('gperm_name', 'block_read');
             $blockperm->setVar('gperm_modid', 1);
             $gperm_handler->insert($blockperm);
         }
         redirect_header("admin.php?fct=groups&amp;op=adminMain", 1, _MD_AM_DBUPDATED);
     }
     break;
 case "del":
     xoops_cp_header();
     xoops_confirm(array('fct' => 'groups', 'op' => 'delConf', 'g_id' => $g_id), 'admin.php', _AM_AREUSUREDEL);
     xoops_cp_footer();
     break;
 case "delConf":
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header("admin.php?fct=groups&amp;op=adminMain", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     if (intval($g_id) > 0 && !in_array($g_id, array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS))) {
         $member_handler =& xoops_gethandler('member');
         $group =& $member_handler->getGroup($g_id);
         $member_handler->deleteGroup($group);
         $gperm_handler =& xoops_gethandler('groupperm');
         $gperm_handler->deleteByGroup($g_id);
     }
     redirect_header("admin.php?fct=groups&amp;op=adminMain", 1, _MD_AM_DBUPDATED);
     break;
Example #26
0
             if ($ok == 2 && isset($post)) {
                 $post_handler->delete($post, true);
             }
             sync($post->getVar('forum_id'), "forum");
             sync($post->getVar('topic_id'), "topic");
         }
         if ($post->istopic()) {
             redirect_header("index.php", 2, _AM_NEWBB_POSTSDELETED);
             exit;
         } else {
             redirect_header("index.php", 2, _AM_NEWBB_POSTSDELETED);
             exit;
         }
     } else {
         xoops_cp_header();
         xoops_confirm(array('post_id' => $post_id, 'op' => 'del', 'ok' => 2), 'index.php', _AM_NEWBB_DEL_ONE);
         xoops_cp_footer();
     }
     exit;
     break;
 case "approve":
     if (isset($post_id) && $post_id > 0) {
         $post_handler =& xoops_getmodulehandler('post', 'newbb');
         if ($post_handler->approve($post_id)) {
             redirect_header("index.php", 1, _AM_NEWBB_POSTAPPROVED);
         } else {
             redirect_header("index.php", 1, _AM_NEWBB_POSTNOTAPPROVED);
         }
     } elseif (isset($topic_id) && $topic_id > 0) {
         $topic_handler =& xoops_getmodulehandler('topic', 'newbb');
         if ($topic_handler->approve($topic_id)) {
         if ($auto_toggle == 'Y' && $link_visible == 'Y') {
             $criteria = new Criteria('link_category', $link_category);
             $linkHandler->updateAll('link_visible', 'N', $criteria);
         }
     }
     header('Location: ' . $this_file);
     break;
 case 'confirmdelete':
     $title = 'Delete Link';
     $standalone = 0;
     require_once 'admin-header.php';
     init_param('GET', 'link_id', 'integer', NO_DEFAULT_PARAM, true);
     $delete_confirm = array('action' => 'Delete', 'link_id' => $link_id);
     $delete_confirm += $xoopsWPTicket->getTicketArray(__LINE__);
     $msg = _LANG_P_CONFIRM_DELETE;
     xoops_confirm($delete_confirm, $this_file, $msg);
     include 'admin-footer.php';
     break;
 case 'Delete':
     if (!$xoopsWPTicket->check()) {
         redirect_header($siteurl . '/wp-admin/' . $this_file, 3, $xoopsWPTicket->getErrors());
     }
     if ($user_level < get_settings('links_minadminlevel')) {
         redirect_header($siteurl . '/wp-admin/', 5, _LANG_P_CHEATING_ERROR);
     }
     init_param('POST', 'link_id', 'integer', NO_DEFAULT_PARAM, true);
     $linkRecord =& $linkHandler->create(false);
     $linkRecord->setVar('link_id', $link_id);
     if (!$linkHandler->delete($linkRecord)) {
         redirect_header("", 3, $linkHandler->getErrors());
     }
         xoops_confirm(array('op' => 'del', 'typeid' => $typeid, 'confirm' => 1, 'name' => $HotelServiceTypeObj->service_type_name()), '?action=typedel', _DELETE . " '" . $HotelServiceTypeObj->service_type_name() . "'. <br /> <br /> " . _AM_MARTIN_OK_TO_DELETE_SERVICE_CATEGORY, _DELETE);
     } else {
         if ($hotelservicetype_handler->delete($HotelServiceTypeObj)) {
             $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
             $redirect_to = "martin.hotel.service.php?action=typelist";
         } else {
             $redirect_msg = _AM_MARTIN_DELETE_FAILED;
             $redirect_to = "javascript:history.go(-1);";
         }
         redirect_header($redirect_to, 2, $redirect_msg);
     }
     break;
 case "hoteldel":
     $Relation = $hotelservice_handler->getHotelServiceRelation($hotel_id, $service_id);
     if (!$confirm) {
         xoops_confirm(array('op' => 'del', 'hotel_id' => $hotel_id, 'confirm' => 1, 'name' => $Relation['hotel_name']), "?action=hoteldel&hotel_id={$hotel_id}&service_id={$service_id}", _DELETE . " '" . $Relation['hotel_name'] . " : " . $Relation['service_name'] . "'. <br /> <br />" . _AM_MARTIN_SURE_TO_DELETE_RELATION, _DELETE);
     } else {
         if ($hotelservice_handler->DeleteServiceRelation($hotel_id, $service_id)) {
             $redirect_msg = _AM_MARTIN_OK_TO_DELETE_THE_ORDER;
             $redirect_to = "martin.hotel.service.php?action=hotellist";
         } else {
             $redirect_msg = _AM_MARTIN_DELETE_FAILED;
             $redirect_to = "javascript:history.go(-1);";
         }
         redirect_header($redirect_to, 2, $redirect_msg);
     }
     break;
 case "list":
     martin_collapsableBar('createtable', 'createtableicon', _AM_MARTIN_SERVICE_LIST, _AM_MARTIN_SERVICE_LIST);
     CreateButton();
     $HotelServiceObjs = $hotelservice_handler->getHotelServices($xoopsModuleConfig['perpage'], $start, 0);
Example #29
0
        $obj->setVar('cat_title', $_REQUEST['cat_title']);
        $obj->setVar('cat_description', $_REQUEST['cat_description']);
        $obj->setVar('cat_weight', $_REQUEST['cat_weight']);
        if ($handler->insert($obj)) {
            redirect_header('category.php', 3, sprintf(_PROFILE_AM_SAVEDSUCCESS, _PROFILE_AM_CATEGORY));
        }
        include_once '../include/forms.php';
        echo $obj->getHtmlErrors();
        $form =& $obj->getForm();
        $form->display();
        break;
    case "delete":
        $obj =& $handler->get($_REQUEST['id']);
        if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
            if (!$GLOBALS['xoopsSecurity']->check()) {
                redirect_header('category.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
            }
            if ($handler->delete($obj)) {
                redirect_header('category.php', 3, sprintf(_PROFILE_AM_DELETEDSUCCESS, _PROFILE_AM_CATEGORY));
            } else {
                echo $obj->getHtmlErrors();
            }
        } else {
            xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_PROFILE_AM_RUSUREDEL, $obj->getVar('cat_title')));
        }
        break;
}
if (isset($template_main)) {
    $GLOBALS['xoopsTpl']->display("db:{$template_main}");
}
include_once dirname(__FILE__) . '/admin_footer.php';
Example #30
0
        }
    }
}
//
//
//----------------------------------------------------------------------------//
// Delete
if (isset($_REQUEST['op']) and $_REQUEST['op'] == "delete") {
    //
    if (isset($_REQUEST['art_id'])) {
        $art_id = $_REQUEST['art_id'];
    }
    // confirm
    if (!isset($_REQUEST['subop'])) {
        xoops_cp_header();
        xoops_confirm(array('op' => 'delete', 'art_id' => $art_id, 'subop' => 'delok'), 'validate.php', _MD_CONFIRMDELETE);
        xoops_cp_footer();
    }
    //
    // Delete
    if (isset($_REQUEST['subop']) && $_REQUEST['subop'] == "delok") {
        $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("articles_main"), $art_id);
        if ($xoopsDB->queryF($sql)) {
            // delete comments for the article being deleted
            //xoops_comment_delete($xoopsModule->getVar('mid'), $cat_id);
            // delete notifications for deleted article
            //xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'global', $art_id);
            redirect_header("validate.php", 2, _MD_ITEMDELETED);
            //echo "deleted";
        } else {
            redirect_header("validate.php", 2, _MD_ITEMNOTDELETED);