Beispiel #1
0
    }
    redirect_header("admin.php?fct=blocksadmin&selmod=" . $_REQUEST["selmod"], 2, _AM_ERRORDURINGSAVE);
    exit;
}
if ($op == "save") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    if (!isset($instanceid)) {
        $instanceid = 0;
    }
    $options = isset($options) ? $options : array();
    $bmodule = isset($bmodule) ? $bmodule : array();
    $groups = isset($groups) ? $groups : array();
    if (save_block($instanceid, $bside, $bvisible, $bweight, $btitle, $bid, $bcachetime, $bmodule, $groups, $options)) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 2, _MD_AM_DBUPDATED);
    }
    redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 2, _AM_ERRORDURINGSAVE);
    exit;
}
if ($op == "delete_ok") {
    if (!$GLOBALS['xoopsSecurity']->check()) {
        redirect_header("admin.php?fct=blocksadmin&amp;selmod=" . $_REQUEST["selmod"], 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    delete_block_ok($bid);
    exit;
}
if ($op == "delete") {
    xoops_cp_header();
            $visible[$i] = 0;
            $side[$i] = -1;
        } else {
            $visible[$i] = 1;
        }
        $bmodule[$i] = isset($bmodule[$i]) && is_array($bmodule[$i]) ? $bmodule[$i] : array(-1);
        myblocksadmin_update_block($i, $side[$i], $weight[$i], $visible[$i], $title[$i], '', '', $bcachetime[$i], $bmodule[$i], array());
        //		if ( $oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i] )
        //		order_block($bid[$i], $weight[$i], $visible[$i], $side[$i]); GIJ
    }
    //	redirect_header("admin.php?fct=blocksadmin",1,_AM_DBUPDATED); GIJ
    redirect_header("myblocksadmin.php", 1, _AM_DBUPDATED);
    exit;
}
if ($op == "save") {
    save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime);
    exit;
}
if ($op == "update") {
    $bcachetime = isset($bcachetime) ? intval($bcachetime) : 0;
    $options = isset($options) ? $options : array();
    $bcontent = isset($bcontent) ? $bcontent : '';
    $bctype = isset($bctype) ? $bctype : '';
    $bmodule = isset($bmodule) && is_array($bmodule) ? $bmodule : array(-1);
    // GIJ +
    $msg = myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options);
    // GIJ c
    redirect_header('myblocksadmin.php', 1, $msg);
    // GIJ +
}
if ($op == "delete_ok") {
Beispiel #3
0
 $user->setVar('email', addslashes($adminmail));
 $user->setVar('pass', md5($adminpass));
 $user->setVar('user_avatar', 'blank.gif');
 $user->setVar('rank', 7);
 $user->setVar('level', 5);
 $user->setVar('user_regdate', time());
 if (!$member_handler->insertUser($user)) {
     echo $user->getHtmlErrors();
 }
 $block_handler =& xoops_gethandler('block');
 $blocks_to_install =& $block_handler->getObjects(new Criteria('show_func', "(" . implode(',', array("'b_system_user_show'", "'b_system_login_show'", "'b_system_main_show'")) . ")", "IN"));
 //Install login, main menu and user menu blocks
 include_once XOOPS_ROOT_PATH . "/modules/system/admin/blocksadmin/blocksadmin.php";
 if (count($blocks_to_install) > 0) {
     foreach ($blocks_to_install as $block) {
         if (save_block(0, 0, 0, $block->getVar('name'), $block->getVar('bid'), 0, array("0-0"), array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS), array())) {
             //success
             $html .= "<br />" . sprintf(_INSTALL_L165, $block->getVar('name'));
         } else {
             //failure
             $html .= "<br />" . sprintf(_INSTALL_L166, $block->getVar('name'));
         }
     }
 } else {
     $html .= "Blocks not inserted";
 }
 $content .= $dbm->report();
 $content .= $cm->report();
 include_once "./class/mainfilemanager.php";
 $mm = new mainfile_manager("../mainfile.php");
 foreach ($group as $key => $val) {