imanager_addfile(); break; case 'save': imanager_updateimage(); break; case 'delfile': icmsPopupHeader(); $image_handler = icms::handler('icms_image'); $image =& $image_handler->get($image_id); $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get($image->getVar('imgcat_id')); $src = '<img src="' . ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $image->getVar('image_name') . '" title="' . $image->getVar('image_nicename') . '" /><br />'; echo '<div style="margin:5px;" align="center">' . $src . '</div>'; icms_core_Message::confirm(array('op' => 'delfileok', 'image_id' => $image_id, 'imgcat_id' => $imgcat_id, 'target' => $target, 'type' => $type), 'browser.php', _MD_RUDELIMG); icmsPopupFooter(); break; case 'delfileok': imanager_delfileok($image_id, $imgcat_id); break; case 'cloneimg': imanager_clone(); break; case 'save_edit_ok': $msg = isset($_GET['msg']) ? urldecode($_GET['msg']) : NULL; redir($imgcat_id, $msg); break;
} icms_cp_header(); echo '<code>' . implode('<br />', $msg) . '<br />'; echo '</code><br /><a href="admin.php?fct=tplsets&op=listtpl&tplset=' . urlencode($tplset) . '&moddir=' . $moddir . '">' . _MD_AM_BTOTADMIN . '</a>'; icms_cp_footer(); break; case 'importtpl': icms_cp_header(); if (!empty($id)) { icms_core_Message::confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'id' => $id, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT); } elseif (isset($file)) { icms_core_Message::confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'file' => $file, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT); } icms_cp_footer(); break; case 'importtpl_go': if (!icms::$security->check()) { redirect_header('admin.php?fct=tplsets', 3, implode('<br />', icms::$security->getErrors())); } $tpltpl_handler =& icms::handler('icms_view_template_file'); $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] : '';
} else { $err = array_merge($err, $uploader->getErrors(FALSE)); } if (count($err) > 0) { icms_cp_header(); icms_core_Message::error($err); icms_cp_footer(); exit(); } redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED); } if ($op == 'delfile') { icms_cp_header(); $user_id = isset($_GET['user_id']) ? (int) ($_GET['user_id']) : 0; icms_core_Message::confirm(array('op' => 'delfileok', 'avatar_id' => (int) ($_GET['avatar_id']), 'fct' => 'avatars', 'user_id' => $user_id), 'admin.php', _MD_RUDELIMG); icms_cp_footer(); exit(); } if ($op == 'delfileok') { if (!icms::$security->check()) { redirect_header('admin.php?fct=avatars', 1, 3, implode('<br />', icms::$security->getErrors())); } $avatar_id = (int) ($avatar_id); if ($avatar_id <= 0) { redirect_header('admin.php?fct=avatars', 1); } $avt_handler = icms::handler('icms_data_avatar'); $avatar =& $avt_handler->get($avatar_id); if (!is_object($avatar)) {
} if ($op == 'update') { $module_handler = icms::handler('icms_module'); $mod =& $module_handler->getByDirname($module); if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') { $msgs = '<img src="' . ICMS_MODULES_URL . '/' . $mod->getVar('dirname') . '/' . trim($mod->getInfo('image')) . '" alt="" />'; } $msgs .= '<br /><span style="font-size:smaller;">' . $mod->getVar('name') . '</span><br /><br />' . _MD_AM_RUSUREUPD; icms_cp_header(); if (icms_getModuleInfo('system')->getDBVersion() < 14 && (!is_writable(ICMS_PLUGINS_PATH) || !is_dir(ICMS_ROOT_PATH . '/plugins/preloads') || !is_writable(ICMS_ROOT_PATH . '/plugins/preloads'))) { icms_core_Message::error(sprintf(_MD_AM_PLUGINSFOLDER_UPDATE_TEXT, ICMS_PLUGINS_PATH, ICMS_ROOT_PATH . '/plugins/preloads'), _MD_AM_PLUGINSFOLDER_UPDATE_TITLE, TRUE); } if (icms_getModuleInfo('system')->getDBVersion() < 37 && !is_writable(ICMS_IMANAGER_FOLDER_PATH)) { icms_core_Message::error(sprintf(_MD_AM_IMAGESFOLDER_UPDATE_TEXT, str_ireplace(ICMS_ROOT_PATH, "", ICMS_IMANAGER_FOLDER_PATH)), _MD_AM_IMAGESFOLDER_UPDATE_TITLE, TRUE); } icms_core_Message::confirm(array('module' => $module, 'op' => 'update_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _MD_AM_UPDATE); icms_cp_footer(); exit; } if ($op == 'update_ok') { $ret = array(); $ret[] = icms_module_update($module); $contents = impresscms_get_adminmenu(); if (!xoops_module_write_admin_menu($contents)) { $ret[] = "<p>" . _MD_AM_FAILWRITE . "</p>"; } icms_cp_header(); if (count($ret) > 0) { foreach ($ret as $msg) { if ($msg != '') { echo $msg;
redirect_header(ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . '/userinfo.php?uid=' . $uid, 2, _MD_PROFILE_PROFUPDATED); } break; case 'delete': if (!icms::$user || $icmsConfigUser['self_delete'] != 1) { redirect_header(ICMS_URL, 3, _MD_PROFILE_NOPERMISS); } // users in the webmasters group may not be deleted $groups = icms::$user->getGroups(); if (in_array(ICMS_GROUP_ADMIN, $groups)) { redirect_header(ICMS_URL, 3, _MD_PROFILE_ADMINNO); } $ok = !isset($_POST['ok']) ? 0 : (int) $_POST['ok']; if ($ok != 1) { include ICMS_ROOT_PATH . '/header.php'; icms_core_Message::confirm(array('op' => 'delete', 'ok' => 1), ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . '/edituser.php', _MD_PROFILE_SURETODEL . '<br/>' . _MD_PROFILE_REMOVEINFO); include ICMS_ROOT_PATH . '/footer.php'; } else { $del_uid = (int) icms::$user->getVar("uid"); if (false != icms::handler('icms_member')->deleteUser(icms::$user)) { icms::handler('icms_core_Online')->destroy($del_uid); xoops_notification_deletebyuser($del_uid); //logout user $_SESSION = array(); session_destroy(); if ($icmsConfig['use_mysession'] && $icmsConfig['session_name'] != '') { setcookie($icmsConfig['session_name'], '', time() - 3600, '/', '', 0); } redirect_header(ICMS_URL, 3, _MD_PROFILE_BEENDELED); } redirect_header(ICMS_URL, 3, _MD_PROFILE_NOPERMISS);
// 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 ICMS_ROOT_PATH . '/header.php'; $hidden_vars = array('uid'=>$uid, 'delete_ok'=>1, 'del_not'=>$_POST['del_not']); print '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; icms_core_Message::confirm($hidden_vars, '', _NOT_RUSUREDEL); include ICMS_ROOT_PATH . '/footer.php'; // FIXME: There is a problem here... in icms_core_Message::confirm it treats arrays as // optional radio arguments on the confirmation page... change this or // write new function... break; case 'delete': if (!icms::$security->check()) { redirect_header('notifications.php', 2, implode('<br />', icms::$security->getErrors())); } if (empty($_POST['del_not'])) { redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); }
if (!function_exists($comment_config['callback']['update'])) { $skip = true; } } else { $skip = true; } } if (!$skip) { $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('com_modid', $com_modid)); $criteria->add(new icms_db_criteria_Item('com_itemid', $com_itemid)); $criteria->add(new icms_db_criteria_Item('com_status', XOOPS_COMMENT_ACTIVE)); $comment_count = $comment_handler->getCount($criteria); $comment_config['callback']['update']($com_itemid, $comment_count); } } include ICMS_ROOT_PATH . '/header.php'; icms_core_Message::result($msgs); echo '<br /><a href="' . $redirect_page . '=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '">' . _BACK . '</a>'; include ICMS_ROOT_PATH . '/footer.php'; break; case 'delete': default: include ICMS_ROOT_PATH . '/header.php'; $comment_confirm = array('com_id' => $com_id, 'com_mode' => $com_mode, 'com_order' => $com_order, 'op' => array(_CM_DELETEONE => 'delete_one', _CM_DELETEALL => 'delete_all')); if (!empty($comment_confirm_extra) && is_array($comment_confirm_extra)) { $comment_confirm = $comment_confirm + $comment_confirm_extra; } icms_core_Message::confirm($comment_confirm, 'comment_delete.php', _CM_DELETESELECT); include ICMS_ROOT_PATH . '/footer.php'; break; }
/** * Logic and rendering for modifying a member profile * * @param object $user */ function modifyUser($user) { global $icmsConfig, $icmsModule; icms_cp_header(); echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />'; $member_handler = icms::handler('icms_member'); $user =& $member_handler->getUser($user); if (is_object($user)) { if (!$user->isActive()) { icms_core_Message::confirm(array('fct' => 'users', 'op' => 'reactivate', 'uid' => $user->getVar('uid')), 'admin.php', _AM_NOTACTIVE); icms_cp_footer(); exit(); } $uid_value = $user->getVar('uid'); $uname_value = $user->getVar('uname', 'E'); $login_name_value = $user->getVar('login_name', 'E'); $name_value = $user->getVar('name', 'E'); $email_value = $user->getVar('email', 'E'); $email_cbox_value = $user->getVar('user_viewemail') ? 1 : 0; $openid_value = $user->getVar('openid', 'E'); $openid_cbox_value = $user->getVar('user_viewoid') ? 1 : 0; $url_value = $user->getVar('url', 'E'); $temp = $user->getVar('theme'); $timezone_value = $user->getVar('timezone_offset'); $icq_value = $user->getVar('user_icq', 'E'); $aim_value = $user->getVar('user_aim', "E"); $yim_value = $user->getVar('user_yim', "E"); $msnm_value = $user->getVar('user_msnm', 'E'); $location_value = $user->getVar('user_from', 'E'); $occ_value = $user->getVar('user_occ', 'E'); $interest_value = $user->getVar('user_intrest', 'E'); $sig_value = $user->getVar('user_sig', 'E'); $sig_cbox_value = ($user->getVar('attachsig') == 1) ? 1 : 0; $umode_value = $user->getVar('umode'); $uorder_value = $user->getVar('uorder'); $notify_method_value = $user->getVar('notify_method'); $notify_mode_value = $user->getVar('notify_mode'); $bio_value = $user->getVar('bio', 'E'); $rank_value = $user->rank(FALSE); $mailok_value = $user->getVar('user_mailok', 'E'); $pass_expired_value = $user->getVar('pass_expired') ? 1 : 0; $op_value = 'updateUser'; $form_title = _AM_UPDATEUSER . ': ' . $user->getVar('uname'); $language_value = $user->getVar('language'); $form_isedit = TRUE; $groups = array_values($user->getGroups()); include ICMS_MODULES_PATH . '/system/admin/users/userform.php'; echo "<br /><strong>" . _AM_USERPOST . "</strong><br /><br />\n" . "<table>\n" . "<tr><td>" . _AM_COMMENTS . "</td><td>" . icms_conv_nr2local($user->getVar('posts')) . "</td></tr>\n" . "</table>\n" . "<br />" . _AM_PTBBTSDIYT . "<br />\n" . "<form action=\"admin.php\" method=\"post\">\n" . "<input type=\"hidden\" name=\"id\" value=\"" . $user->getVar('uid') . "\">" . "<input type=\"hidden\" name=\"type\" value=\"user\">\n" . "<input type=\"hidden\" name=\"fct\" value=\"users\">\n" . "<input type=\"hidden\" name=\"op\" value=\"synchronize\">\n" . icms::$security->getTokenHTML() . "\n" . "<input type=\"submit\" value=\"" . _AM_SYNCHRONIZE . "\">\n" . "</form>\n"; } else { echo "<h4 style='text-align:" . _GLOBAL_LEFT . ";'>" . _AM_USERDONEXIT . "</h4>"; } icms_cp_footer(); }
imanager_addfile(); break; case 'save': imanager_updateimage(); break; case 'delfile': icms_cp_header(); $image_handler = icms::handler('icms_image'); $image =& $image_handler->get($image_id); $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get($image->getVar('imgcat_id')); $src = '<img src="' . ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $image->getVar('image_name') . '" title="' . $image->getVar('image_nicename') . '" /><br />'; echo '<div style="margin:5px;" align="center">' . $src . '</div>'; icms_core_Message::confirm(array('op' => 'delfileok', 'image_id' => $image_id, 'imgcat_id' => $imgcat_id, 'fct' => 'images'), 'admin.php', _MD_RUDELIMG); icms_cp_footer(); break; case 'delfileok': imanager_delfileok($image_id, $imgcat_id); break; case 'cloneimg': imanager_clone(); break; case 'save_edit_ok': $msg = isset($_GET['msg']) ? urldecode($_GET['msg']) : NULL; redir($imgcat_id, $msg); break;
$groups = array_unique(array_merge($groups, $groups_hidden)) ; } updateUser($uid, $username, $login_name, $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, $password, $pass2, $rank, $bio, $uorder, $umode, $notify_method, $notify_mode, $timezone_offset, $user_mailok, $language, $openid, $user_viewoid, $pass_expired, $groups ); break; case 'delUser': icms_cp_header(); $member_handler = icms::handler('icms_member'); $userdata =& $member_handler->getUser($uid); icms_core_Message::confirm(array('fct' => 'users', 'op' => 'delUserConf', 'del_uid' => $userdata->getVar('uid') ), 'admin.php', sprintf(_AM_AYSYWTDU, $userdata->getVar('uname'))); icms_cp_footer(); break; case 'delete_many': icms_cp_header(); $count = count($memberslist_id); if ($count > 0) { $list = "<a href='" . ICMS_URL . "/userinfo.php?uid=" . $memberslist_id[0] . "' rel='external'>" . $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='" . ICMS_URL . "/userinfo.php?uid=" . $memberslist_id[$i] . "' rel='external'>" . $memberslist_uname[$memberslist_id[$i]] . "</a>"; $hidden .= "<input type='hidden' name='memberslist_id[]' value='" . $memberslist_id[$i] . "' />\n";
} 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", 1, _AM_DBUPDATED); } break; case "del": icms_cp_header(); icms_core_Message::confirm(array('fct' => 'groups', 'op' => 'delConf', 'g_id' => $g_id), 'admin.php', _AM_AREUSUREDEL); icms_cp_footer(); break; case "delConf": if (!icms::$security->check()) { redirect_header("admin.php?fct=groups", 3, implode('<br />', icms::$security->getErrors())); } if ((int) ($g_id) > 0 && !in_array($g_id, array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS))) { $member_handler = icms::handler('icms_member'); $group =& $member_handler->getGroup($g_id); $member_handler->deleteGroup($group); $gperm_handler = icms::handler('icms_member_groupperm'); $gperm_handler->deleteByGroup($g_id); } redirect_header("admin.php?fct=groups", 1, _AM_DBUPDATED);
/** * Deletes a client * @param int $cid client id */ function BannerClientDelete($cid) { global $icmsConfig, $icmsModule; icms_cp_header(); $result = icms::$xoopsDB->query("SELECT cid, name FROM " . icms::$xoopsDB->prefix("bannerclient") . " WHERE cid='". (int) $cid . "'"); list($cid, $name) = icms::$xoopsDB->fetchRow($result); $name = icms_core_DataFilter::htmlSpecialChars($name); echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<h4>" . _AM_DELEADC . "</h4>" . sprintf(_AM_SUREDELCLI, $name) . "<br /><br />"; $result2 = icms::$xoopsDB->query("SELECT imageurl, clickurl, htmlbanner, htmlcode FROM " . icms::$xoopsDB->prefix("banner") . " WHERE cid='". (int) $cid . "'"); $numrows = icms::$xoopsDB->getRowsNum($result2); if ($numrows == 0) { echo "" . _AM_NOBNRRUN . "<br /><br />"; } else { echo "<font color='#ff0000'><strong>" . _AM_WARNING . "</strong></font><br />" . _AM_ACTBNRRUN . "<br /><br />"; } while (list($imageurl, $clickurl, $htmlbanner, $htmlcode) = icms::$xoopsDB->fetchRow($result2)) { $imageurl = htmlspecialchars($imageurl, ENT_QUOTES); $clickurl = htmlspecialchars($clickurl, ENT_QUOTES); $bannerobject = ""; if ($htmlbanner) { $bannerobject = icms_core_DataFilter::checkVar($htmlcode, 'html', 'output'); } else { $bannerobject = '<div><a href="' . $clickurl . '" rel="external">'; if (strtolower(substr($imageurl, strrpos($imageurl, ".")))==".swf") { $bannerobject = $bannerobject; echo '<object type="application/x-shockwave-flash" data="' . $imageurl . '" width="468" height="60">'; echo '<param name="movie" value="' . $imageurl . '" />'; echo '<param name="quality" value="high" />'; echo '</object>'; } else { $bannerobject = $bannerobject . '<img src="' . $imageurl . '" alt="" />'; } $bannerobject = $bannerobject . '</a></div>'; } echo $bannerobject . "<a href='" . $clickurl . "'>" . $clickurl . "</a><br /><br />"; } icms_core_Message::confirm(array('fct' => 'banners', 'op' => 'BannerClientDelete2', 'cid' => $cid), 'admin.php', _AM_SUREDELBNR); echo "</td></tr></table>"; icms_cp_footer(); }
$allowed = true; break; } } if (!$allowed) { redirect_header(ICMS_URL . '/', 1, _NOPERM); } } $user->setVar('last_login', time()); if (!$member_handler->insertUser($user)) { } $_SESSION = array(); $_SESSION['xoopsUserId'] = $user->getVar('uid'); $_SESSION['xoopsUserGroups'] = $user->getGroups(); if (!empty($xoopsConfig['use_ssl'])) { icms_core_Message::confirm(array($xoopsConfig['sslpost_name'] => session_id()), ICMS_URL . '/misc.php?action=showpopups&type=ssllogin', _US_PRESSLOGIN, _LOGIN); } else { echo sprintf(_US_LOGGINGU, $user->getVar('uname')); echo '<div style="text-align:center;"><input value="' . _CLOSE . '" type="button" onclick="document.window.opener.location.reload();document.window.close();" /></div>'; } } else { icms_core_Message::error(_US_INCORRECTLOGIN . '<br /><a href="login.php">' . _BACK . '</a>'); } } if ($op == 'login') { echo ' <div style="text-align: center; padding: 5; margin: 0"> <form action="login.php" method="post"> <table class="outer" width="95%"> <tr> <td class="head">' . _USERNAME . '</td>
// 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': //case 'delete': case 'delete_ok': if (empty($_POST['del_not'])) { redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); } include ICMS_ROOT_PATH . '/header.php'; $hidden_vars = array('uid' => $uid, 'delete_ok' => 1, 'del_not' => $_POST['del_not']); print '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; icms_core_Message::confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL); include ICMS_ROOT_PATH . '/footer.php'; // FIXME: There is a problem here... in icms_core_Message::confirm it treats arrays as // optional radio arguments on the confirmation page... change this or // write new function... break; //case 'delete_ok': //case 'delete_ok': case 'delete': if (!icms::$security->check()) { redirect_header('notifications.php', 2, implode('<br />', icms::$security->getErrors())); } if (empty($_POST['del_not'])) { redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); } $notification_handler = icms::handler('icms_data_notification');
} $profile_handler = icms_getmodulehandler('profile', basename(dirname(dirname(__FILE__))), 'profile'); $profile = $profile_handler->get($obj->getVar('uid')); if ($profile->isNew() || $profile_handler->delete($profile)) { if ($member_handler->deleteUser($obj)) { redirect_header('user.php', 3, sprintf(_AM_PROFILE_DELETEDSUCCESS, $obj->getVar('uname') . ' (' . $obj->getVar('email') . ')'), false); } else { icms::$module->displayAdminMenu(0, _MI_PROFILE_USERS); echo $obj->getHtmlErrors(); } } else { icms::$module->displayAdminMenu(0, _MI_PROFILE_USERS); echo $profile->getHtmlErrors(); } } else { icms_core_Message::confirm(array('ok' => 1, 'id' => (int) $_REQUEST['id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_PROFILE_RUSUREDEL, $obj->getVar('uname') . ' (' . $obj->getVar('email') . ')')); } break; case 'masquerade': /* * Allows an admin user to masquerade as a different user. * This allows the admin to see and do what the other user sees/can-do. * A confirm box will also be created at the footer to allow the admin * to revert the masqerading effect [formulize\footer.php] */ // Revert masquerade effect if (isset($_SESSION['masquerade_end']) && $_SESSION['masquerade_end'] == 1) { $masqueradeUser = new icms_member_user_Object($_SESSION['masquerade_xoopsUserId']); unset($_SESSION['masquerade_xoopsUserId']); unset($_SESSION['masquerade_end']); } else {
$db->query($sql); redirect_header('admin.php?fct=banners&op=BannersAdmin#top', 1, _AM_DBUPDATED); break; case 'BannerAddClient': if (!icms::$security->check()) { redirect_header('admin.php?fct=banners&op=BannersAdmin#top', 3, implode('<br />', icms::$security->getErrors())); } $db =& icms_db_Factory::instance(); $newid = $db->genId(icms::$xoopsDB->prefix('bannerclient') . '_cid_seq'); $sql = sprintf("INSERT INTO %s (cid, name, contact, email, login, passwd, extrainfo) VALUES ('%d', %s, %s, %s, %s, %s, %s)", $db->prefix("bannerclient"), (int) $newid, $db->quoteString(icms_core_DataFilter::stripSlashesGPC($name)), $db->quoteString(icms_core_DataFilter::stripSlashesGPC($contact)), $db->quoteString(icms_core_DataFilter::stripSlashesGPC($email)), $db->quoteString(icms_core_DataFilter::stripSlashesGPC($login)), $db->quoteString(icms_core_DataFilter::stripSlashesGPC($passwd)), $db->quoteString(icms_core_DataFilter::stripSlashesGPC($extrainfo))); $db->query($sql); redirect_header('admin.php?fct=banners&op=BannersAdmin#top', 1, _AM_DBUPDATED); break; case 'BannerFinishDelete': icms_cp_header(); icms_core_Message::confirm(array('op' => 'BannerFinishDelete2', 'bid' => (int) $bid, 'fct' => 'banners'), 'admin.php', _AM_SUREDELE); icms_cp_footer(); break; case 'BannerFinishDelete2': if ($bid <= 0 | !icms::$security->check()) { redirect_header('admin.php?fct=banners&op=BannersAdmin#top', 3, implode('<br />', icms::$security->getErrors())); } $db =& icms_db_Factory::instance(); $sql = sprintf('DELETE FROM %s WHERE bid = %u', $db->prefix('bannerfinish'), $bid); $db->query($sql); redirect_header('admin.php?fct=banners&op=BannersAdmin#top', 1, _AM_DBUPDATED); break; case 'BannerDelete': if ($bid > 0) { BannerDelete($bid); }
/** * Generates a confirm form * * Will render (echo) the form so no return in this function * * @param array $hiddens Array of Hidden values * @param string $action The Form action * @param string $msg The message in the confirm form * @param string $submit The text on the submit button * @param bool $addtoken Whether or not to add a security token * * @deprecated Use icms_core_Message::confirm, instead * @todo Remove in version 1.4 - all occurrences have been removed from the core */ function xoops_confirm($hiddens, $action, $msg, $submit = '', $addtoken = true) { icms_core_Debug::setDeprecated('icms_core_Message::confirm', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); return icms_core_Message::confirm($hiddens, $action, $msg, $submit, $addtoken); }
/** * * @param bool $confirm_msg * @param string $op */ public function handleObjectDeletionFromUserSide($confirm_msg = false, $op = 'del') { global $icmsTpl, $impresscms; $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; $icmsObj = $this->handler->get($objectid); if ($icmsObj->isNew()) { redirect_header("javascript:history.go(-1)", 3, _CO_ICMS_NOT_SELECTED); exit; } $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; if ($confirm) { if (!$this->handler->delete($icmsObj)) { redirect_header($_POST['redirect_page'], 3, _CO_ICMS_DELETE_ERROR . $icmsObj->getHtmlErrors()); exit; } redirect_header($_POST['redirect_page'], 3, _CO_ICMS_DELETE_SUCCESS); exit; } else { // no confirm: show deletion condition if (!$confirm_msg) { $confirm_msg = _CO_ICMS_DELETE_CONFIRM; } ob_start(); icms_core_Message::confirm(array('op' => $op, $this->handler->keyName => $icmsObj->getVar($this->handler->keyName), 'confirm' => 1, 'redirect_page' => $impresscms->urls['previouspage']), xoops_getenv('SCRIPT_NAME'), sprintf($confirm_msg, $icmsObj->getVar($this->handler->identifierName)), _CO_ICMS_DELETE); $icmspersistable_delete_confirm = ob_get_clean(); $icmsTpl->assign('icmspersistable_delete_confirm', $icmspersistable_delete_confirm); } }
} exit(); break; case 'delete': if (!icms::$user || $icmsConfigUser['self_delete'] != 1) { redirect_header('index.php',5,_US_NOPERMISS); } else { $groups = icms::$user->getGroups(); if (in_array(XOOPS_GROUP_ADMIN, $groups)) { redirect_header('user.php', 5, _US_ADMINNO); } $ok = !isset($_POST['ok']) ? 0 : (int) $_POST['ok']; if ($ok != 1) { include 'header.php'; icms_core_Message::confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO); include 'footer.php'; } else { $del_uid = (int) icms::$user->getVar('uid'); $member_handler = icms::handler('icms_member'); if (FALSE != $member_handler->deleteUser(icms::$user)) { $online_handler = icms::handler('icms_core_Online'); $online_handler->destroy($del_uid); xoops_notification_deletebyuser($del_uid); redirect_header('index.php', 5, _US_BEENDELED); } redirect_header('index.php',5,_US_NOPERMISS); } exit(); } break;
} } if (!isset($err)) { redirect_header('admin.php?fct=smilies&op=SmilesAdmin', 2, _AM_DBUPDATED); } else { icms_cp_header(); icms_core_Message::error($err); icms_cp_footer(); exit; } break; case "SmilesDel": $id = isset($_GET['id']) ? (int) $_GET['id'] : 0; if ($id > 0) { icms_cp_header(); icms_core_Message::confirm(array('fct' => 'smilies', 'op' => 'SmilesDelOk', 'id' => $id), 'admin.php', _AM_WAYSYWTDTS); icms_cp_footer(); } break; case "SmilesDelOk": $id = isset($_POST['id']) ? (int) $_POST['id'] : 0; if ($id <= 0 | !icms::$security->check()) { redirect_header('admin.php?fct=smilies', 3, implode('<br />', icms::$security->getErrors())); } $db =& icms_db_Factory::instance(); $sql = sprintf("DELETE FROM %s WHERE id = '%u'", $db->prefix('smiles'), $id); $db->query($sql); redirect_header("admin.php?fct=smilies&op=SmilesAdmin", 2, _AM_DBUPDATED); break; case "SmilesAdmin": default: