/** * Do this event when saving item * * @param array config array */ function eventAfterSaveSystemAdminPreferencesItems($array) { if (!isset($array[ICMS_CONF_AUTOTASKS])) return; $handler = icms_getModuleHandler('autotasks', 'system'); $handler->virtual_config = array(); $array = &$array[ICMS_CONF_AUTOTASKS]; $vconfig1 = array(); $vconfig2 = array(); foreach ($array as $key => $values) { $vconfig1[$key] = $values[0]; $vconfig2[$key] = $values[1]; } $handler->enableVirtualConfig($vconfig1); $system = $handler->getCurrentSystemHandler(true); if ($system->isEnabled()) { $system->stop(); } $handler->enableVirtualConfig($vconfig2); $system = $handler->getCurrentSystemHandler(true); if ($rez = $system->canRun()) { $time = (int) ($handler->getRealTasksRunningTime()); $rez = $system->start($time); } else { icms_loadLanguageFile('system', 'autotasks', true); icms_core_Message::error(_CO_ICMS_AUTOTASKS_INIT_ERROR); return false; } $handler->disableVirtualConfig(); }
/** * Admin Warnings Block * * @since ImpressCMS 1.2 * @author Gustavo Pilla (aka nekro) <*****@*****.**> * @return array * @todo This code is the copy of the one wich was in the admin.php, it should be improved. */ function b_system_admin_warnings_show() { $block = array(); $block['msg'] = array(); // ###### Output warn messages for security ###### if (is_dir(ICMS_ROOT_PATH . '/install/')) { array_push($block['msg'], icms_core_Message::error(sprintf(_WARNINSTALL2, ICMS_ROOT_PATH . '/install/'), '', FALSE)); } /** @todo make this dynamic, so the value is updated automatically */ if (getDbValue(icms::$xoopsDB, 'modules', 'version', 'version="120" AND mid="1"') !== FALSE) { array_push($block['msg'], icms_core_Message::error('<a href="' . ICMS_MODULES_URL . '/system/admin.php?fct=modulesadmin&op=update&module=system">' . _WARNINGUPDATESYSTEM . '</a>')); } if (is_writable(ICMS_ROOT_PATH . '/mainfile.php')) { array_push($block['msg'], icms_core_Message::error(sprintf(_WARNINWRITEABLE, ICMS_ROOT_PATH . '/mainfile.php'), '', FALSE)); } if (is_dir(ICMS_ROOT_PATH . '/upgrade/')) { array_push($block['msg'], icms_core_Message::error(sprintf(_WARNINSTALL2, ICMS_ROOT_PATH . '/upgrade/'), '', FALSE)); } if (!is_dir(XOOPS_TRUST_PATH)) { array_push($block['msg'], icms_core_Message::error(_TRUST_PATH_HELP)); } $sql1 = "SELECT conf_modid FROM `" . icms::$xoopsDB->prefix('config') . "` WHERE conf_name = 'dos_skipmodules'"; if ($result1 = icms::$xoopsDB->query($sql1)) { list($modid) = icms::$xoopsDB->FetchRow($result1); $protector_is_active = '0'; if (NULL !== $modid) { $sql2 = "SELECT isactive FROM `" . icms::$xoopsDB->prefix('modules') . "` WHERE mid =" . $modid; $result2 = icms::$xoopsDB->query($sql2); list($protector_is_active) = icms::$xoopsDB->FetchRow($result2); } } if (file_exists(ICMS_PLUGINS_PATH . '/csstidy/css_optimiser.php')) { array_push($block['msg'], icms_core_Message::error(sprintf(_CSSTIDY_VULN, ICMS_PLUGINS_PATH . '/csstidy/css_optimiser.php'), FALSE)); } if ($protector_is_active == 0) { array_push($block['msg'], icms_core_Message::error(_PROTECTOR_NOT_FOUND, '', FALSE)); echo '<br />'; } // ###### Output warn messages for correct functionality ###### if (!is_writable(ICMS_CACHE_PATH)) { array_push($block['msg'], icms_core_Message::warning(sprintf(_WARNINNOTWRITEABLE, ICMS_CACHE_PATH)), '', FALSE); } if (!is_writable(ICMS_UPLOAD_PATH)) { array_push($block['msg'], icms_core_Message::warning(sprintf(_WARNINNOTWRITEABLE, ICMS_UPLOAD_PATH)), '', FALSE); } if (!is_writable(ICMS_COMPILE_PATH)) { array_push($block['msg'], icms_core_Message::warning(sprintf(_WARNINNOTWRITEABLE, ICMS_COMPILE_PATH)), '', FALSE); } if (count($block['msg']) > 0) { return $block; } }
} 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;
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; }
/** * * @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); } }
/** * 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); }
// 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 (file_exists($filepath)) { if (FALSE !== $fp = fopen($filepath, 'r')) { $filesource = fread($fp, filesize($filepath)); fclose($fp); $tplfile->setVar('tpl_source', $filesource, TRUE); $tplfile->setVar('tpl_tplset', $tplset); $tplfile->setVar('tpl_lastmodified', time()); $tplfile->setVar('tpl_lastimported', time()); if (!$tpltpl_handler->insert($tplfile)) { } else { $error = FALSE; } } } } if (FALSE !== $error) { icms_cp_header(); icms_core_Message::error(_MD_TPLSET_IMPORT_FAILED . ' ' . $filepath); echo '<br /><a href="admin.php?fct=tplsets&op=listtpl&tplset=' . urlencode($tplset) . '&moddir=' . $moddir . '">' . _MD_AM_BTOTADMIN . '</a>'; icms_cp_footer(); exit(); } redirect_header('admin.php?fct=tplsets&op=listtpl&moddir=' . $tplfile->getVar('tpl_module') . '&tplset=' . urlencode($tplfile->getVar('tpl_tplset')), 2, _MD_AM_DBUPDATED); break; default: break; }
/** * Delete an image file after confirmation */ function imanager_delfileok($image_id, $redir = NULL) { global $target, $type; if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v); if (!icms::$security->check()) { redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 3, implode('<br />', icms::$security->getErrors())); } $image_id = (int) $image_id; if ($image_id <= 0) { redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1); } $image_handler = icms::handler('icms_image'); $image =& $image_handler->get($image_id); if (!is_object($image)) { redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1); } $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get($image->getVar('imgcat_id')); $categ_path = $imgcat_handler->getCategFolder($imagecategory); if (!$image_handler->delete($image)) { icmsPopupHeader(); icms_core_Message::error(sprintf(_MD_FAILDEL, $image->getVar('image_id'))); icmsPopupFooter(); exit(); } @unlink($categ_path . '/' . $image->getVar('image_name')); if (isset($redir)) { $redir = '?op=listimg&imgcat_id=' . $redir . '&target=' . $target . '&type=' . $type; } else { $redir = '?op=list&target=' . $target . '&type=' . $type; } redirect_header($_SERVER['SCRIPT_NAME'] . $redir, 2, _ICMS_DBUPDATED); }
/** * prepare HTML for output * * @return sting HTML */ function render() { //global $myts; $ret = ''; if (@(include_once ICMS_ROOT_PATH . $this->rootpath . "/fckeditor.php")) { $oFCKeditor = new FCKeditor($this->getName()); $oFCKeditor->BasePath = ICMS_URL . $this->rootpath . "/"; $oFCKeditor->Width = $this->_width; $oFCKeditor->Height = $this->_height; //$conv_pattern = array("/>/i", "/</i", "/"/i", "/'/i"/* , "/(\015\012)|(\015)|(\012)|(\r\n)/" */); //$conv_replace = array(">", "<", "\"", "'"/* , "<br />" */); //$this->Value = preg_replace($conv_pattern, $conv_replace, $this->_value); $oFCKeditor->Value = htmlspecialchars_decode($this->_value); //$oFCKeditor->Config['BaseHref'] = ICMS_URL.$this->rootpath. "/"; if (is_readable(ICMS_ROOT_PATH . $this->rootpath . '/editor/lang/' . $this->getLanguage() . '.js')) { $oFCKeditor->Config['DefaultLanguage'] = $this->getLanguage(); } if (defined("_XOOPS_EDITOR_FCKEDITOR_FONTLIST")) { $oFCKeditor->Config['FontNames'] = _XOOPS_EDITOR_FCKEDITOR_FONTLIST; } if (is_object($GLOBALS['icmsModule'])) { if (!file_exists($config_file = ICMS_CACHE_PATH . "/fckconfig." . $GLOBALS["icmsModule"]->getVar("dirname", "n") . ".js")) { if ($fp = fopen($config_file, "wt")) { $fp_content = "/* FCKconfig module configuration */\n"; if (is_readable($config_mod = ICMS_ROOT_PATH . "/modules/" . $GLOBALS["icmsModule"]->getVar("dirname") . "/fckeditor.config.js")) { $fp_content .= "/* Loaded from module local config file */\n" . implode("", file($config_mod)) . "\n\n"; } if (is_readable(ICMS_ROOT_PATH . "/modules/" . $GLOBALS["icmsModule"]->getVar("dirname") . "/fckeditor.connector.php")) { $fp_content .= "var browser_path = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=" . ICMS_URL . "/modules/" . $GLOBALS["icmsModule"]->getVar("dirname", "n") . "/fckeditor.connector.php';\n"; $fp_content .= "FCKConfig.LinkBrowserURL = browser_path ;\n"; $fp_content .= "FCKConfig.ImageBrowserURL = browser_path + '&Type=Image';\n"; $fp_content .= "FCKConfig.FlashBrowserURL = browser_path + '&Type=Flash';\n\n"; } if (is_readable(ICMS_ROOT_PATH . "/modules/" . $GLOBALS["icmsModule"]->getVar("dirname") . "/fckeditor.upload.php")) { $fp_content .= "var uploader_path = '" . ICMS_URL . "/modules/" . $GLOBALS["icmsModule"]->getVar("dirname", "n") . "/fckeditor.upload.php';\n"; $fp_content .= "FCKConfig.LinkUploadURL = uploader_path;\n"; $fp_content .= "FCKConfig.ImageUploadURL = uploader_path + '?Type=Image';\n"; $fp_content .= "FCKConfig.FlashUploadURL = uploader_path + '?Type=Flash';\n\n"; } if (empty($this->_upload)) { $fp_content .= "FCKConfig.LinkUpload = false;\n"; $fp_content .= "FCKConfig.ImageUpload = false;\n"; $fp_content .= "FCKConfig.FlashUpload = false;\n\n"; } fwrite($fp, $fp_content); fclose($fp); } else { icms_core_Message::error("Cannot create fckeditor config file"); } } if (is_readable($config_file = ICMS_CACHE_PATH . "/fckconfig." . $GLOBALS["icmsModule"]->getVar("dirname") . ".js")) { $oFCKeditor->Config['CustomConfigurationsPath'] = ICMS_URL . "/cache/fckconfig." . $GLOBALS["icmsModule"]->getVar("dirname", "n") . ".js"; } } foreach ($this->config as $key => $val) { $oFCKeditor->Config[$key] = $val; } //$oFCKeditor->SetVar('ToolbarSet', "Basic"); $ret = $oFCKeditor->CreateHtml(); } return $ret; }
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);
/** * Posts a notification of an install or update of the system module * * @todo Add language constants * * @param string $versionstring A string representing the version of the module * @param string $icmsroot A unique identifier for the site * @param string $modulename The module being installed or updated, 'system' for the core * @param string $action Action triggering the notification: install, uninstall, activate, deactivate, update */ public static function installation_notify($versionstring, $icmsroot, $modulename = 'system', $action = 'install') { $validActions = array('install', 'update', 'uninstall', 'activate', 'deactivate'); if (!in_array($action, $validActions)) { $action = 'install'; } // @todo: change the URL to an official ImpressCMS server //set POST variables $url = 'http://qc.impresscms.org/notify/notify.php?'; // this may change as testing progresses. $fields = array('siteid' => hash('sha256', $icmsroot), 'version' => urlencode($versionstring), 'module' => urlencode($modulename), 'action' => urlencode($action)); //url-ify the data for the POST $fields_string = ""; foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); try { //open connection - this causes a fatal error if the extension is not loaded if (!extension_loaded('curl')) { throw new Exception("cURL extension not loaded"); } $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_FAILONERROR, TRUE); //execute post if (curl_exec($ch)) { icms_core_Message::error($url . $fields_string, 'Notification Sent to'); } else { throw new Execption("Unable to contact update server"); } //close connection curl_close($ch); } catch (Exception $e) { icms_core_Message::error(sprintf($e->getMessage())); } }
} 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);
$abortUpdate = true; } /* New config options and values for mail settings */ $sql = 'UPDATE `' . icms::$xoopsDB->prefix('config') . '` SET `conf_order`=9 WHERE `conf_name`="sendmailpath"'; $result = icms::$xoopsDB->query($sql); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_MAILER, 'smtpsecure', '_MD_AM_SMTPSECURE', 'ssl', '_MD_AM_SMTPSECUREDESC', 'select', 'text', 7); $config_id = icms::$xoopsDB->getInsertId(); $sql = "INSERT INTO " . icms::$xoopsDB->prefix('configoption') . " (confop_id, confop_name, confop_value, conf_id)" . " VALUES" . " (NULL, 'None', 'none', {$config_id}), " . " (NULL, 'SSL', 'ssl', {$config_id}), " . " (NULL, 'TLS', 'tls', {$config_id})"; if (!icms::$xoopsDB->queryF($sql)) { $abortUpdate = true; } $icmsDatabaseUpdater->insertConfig(ICMS_CONF_MAILER, 'smtpauthport', '_MD_AM_SMTPAUTHPORT', '465', '_MD_AM_SMTPAUTHPORTDESC', 'textbox', 'int', 8); $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); echo sprintf(_DATABASEUPDATER_UPDATE_OK, icms_conv_nr2local($newDbVersion)) . '<br />'; } /* 1.2.2 release */ if (!$abortUpdate) { $newDbVersion = 40; } if ($dbVersion < $newDbVersion) { $file = ICMS_PLUGINS_PATH . '/csstidy/css_optimiser.php'; if (file_exists($file)) { if (unlink($file)) { echo sprintf(_FILE_DELETED, $file) . '<br />'; } else { icms_core_Message::error(sprintf(_CSSTIDY_VULN, $file)); } } $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); echo sprintf(_DATABASEUPDATER_UPDATE_OK, icms_conv_nr2local($newDbVersion)) . '<br />'; }
$xoopsMailer->assign('X_UEMAIL', $email); $xoopsMailer->setToEmails($email); $xoopsMailer->setFromEmail($icmsConfig['adminmail']); $xoopsMailer->setFromName($icmsConfig['sitename']); $xoopsMailer->setSubject(sprintf(_US_YOURREGISTRATION,icms_core_DataFilter::stripSlashesGPC($icmsConfig['sitename']))); $xoopsMailer->send(); /* Hack by marcan <INBOX> * Sending a confirmation email to the newly registered user */ redirect_header('admin.php?fct=users', 1,_AM_DBUPDATED); } } } } icms_cp_header(); icms_core_Message::error($adduser_errormsg); icms_cp_footer(); break; case 'synchronize': if (!icms::$security->check()) { redirect_header('admin.php?fct=users', 3, implode('<br />', icms::$security->getErrors())); } synchronize($id, $type); break; case 'reactivate': $result = icms::$xoopsDB->query( "UPDATE " . icms::$xoopsDB->prefix('users') . " SET level='1' WHERE uid='". (int) $uid . "'" ); if (!$result) {
/** * 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(); }
} } $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> <td class="even"><input type="text" name="username" value="" /></td> </tr> <tr> <td class="head">' . _PASSWORD . '</td> <td class="even"><input type="password" name="userpass" value="" /></td> </tr>
// 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');
* @since Xoops 1.00 * @package core * @version $Id: findusers.php 11572 2012-02-16 00:35:21Z skenow $ */ include "../mainfile.php"; xoops_header(false); $denied = true; if (!empty($_REQUEST['token'])) { if (icms::$security->validateToken($_REQUEST['token'], false)) { $denied = false; } } elseif (is_object(icms::$user) && icms::$user->isAdmin()) { $denied = false; } if ($denied) { icms_core_Message::error(_NOPERM); exit; } $token = @$_REQUEST["token"]; $name_form = 'memberslist'; $name_userid = 'uid' . (@$_REQUEST['multiple'] ? "[]" : ""); $name_username = '******' . (@$_REQUEST['multiple'] ? "[]" : ""); icms_loadLanguageFile('core', 'findusers'); $rank_handler = icms_getModuleHandler("userrank", "system"); $user_handler = icms::handler("icms_member"); $unsets = array("actkey", "pass", "theme", "umode", "uorder", "notify_mode"); foreach ($unsets as $var) { unset($user_handler->vars[$var]); } $items_match = array("uname" => _MA_USER_UNAME, "name" => _MA_USER_REALNAME, "email" => _MA_USER_EMAIL, "user_icq" => _MA_USER_ICQ, "user_aim" => _MA_USER_AIM, "user_yim" => _MA_USER_YIM, "user_msnm" => _MA_USER_MSNM); $items_range = array("user_regdate" => _MA_USER_RANGE_USER_REGDATE, "last_login" => _MA_USER_RANGE_LAST_LOGIN, "posts" => _MA_USER_RANGE_POSTS);
/** * 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(); }
/** * Automatic update of the system module * * @param object $module reference to the module object * @param int $oldversion The old version of the database * @param int $dbVersion The database version * @return mixed */ function xoops_module_update_system(&$module, $oldversion = NULL, $dbVersion = NULL) { global $icmsConfig, $xoTheme; $from_112 = $abortUpdate = FALSE; $oldversion = $module->getVar('version'); if ($oldversion < 120) { $result = icms::$xoopsDB->query("SELECT t1.tpl_id FROM " . icms::$xoopsDB->prefix('tplfile') . " t1, " . icms::$xoopsDB->prefix('tplfile') . " t2 WHERE t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_id > t2.tpl_id"); $tplids = array(); while (list($tplid) = icms::$xoopsDB->fetchRow($result)) { $tplids[] = $tplid; } if (count($tplids) > 0) { $tplfile_handler = icms::handler('icms_view_template_file'); $duplicate_files = $tplfile_handler->getObjects(new icms_db_criteria_Item('tpl_id', "(" . implode(',', $tplids) . ")", "IN")); if (count($duplicate_files) > 0) { foreach (array_keys($duplicate_files) as $i) { $tplfile_handler->delete($duplicate_files[$i]); } } } } $icmsDatabaseUpdater = icms_db_legacy_Factory::getDatabaseUpdater(); //$dbVersion = $module->getDBVersion(); //$oldversion = $module->getVar('version'); ob_start(); $dbVersion = $module->getDBVersion(); echo sprintf(_DATABASEUPDATER_CURRENTVER, icms_conv_nr2local($dbVersion)) . '<br />'; echo "<code>" . sprintf(_DATABASEUPDATER_UPDATE_TO, icms_conv_nr2local(ICMS_SYSTEM_DBVERSION)) . "<br />"; /* * DEVELOPER, PLEASE NOTE !!! * * Everytime we add a new upgrade block here, the dbversion of the System Module will get * incremented. It is very important to modify the ICMS_SYSTEM_DBVERSION accordingly * in htdocs/include/version.php * * When we start a new major release, move all the previous version's upgrade scripts to * a separate file, to minimize file size and memory usage */ $CleanWritingFolders = FALSE; if ($dbVersion < 40) { include 'update-112-to-122.php'; } /* Begin upgrade to version 1.3 */ if (!$abortUpdate) { $newDbVersion = 41; } if ($dbVersion < $newDbVersion) { /* Add new tables and data for the help suggestions and quick search */ $table = new icms_db_legacy_updater_Table('autosearch_cat'); if (!$table->exists()) { $table->setStructure("`cid` int(11) NOT NULL auto_increment,\n\t\t\t\t `cat_name` varchar(255) NOT NULL,\n\t\t\t\t `cat_url` text NOT NULL,\n\t\t\t\t PRIMARY KEY (`cid`)"); if (!$table->createTable()) { $abortUpdate = TRUE; $newDbVersion = 40; } if (!$abortUpdate) { icms_loadLanguageFile('system', 'admin'); $search_cats = array("NULL, '" . _MD_AM_ADSENSES . "', '/modules/system/admin.php?fct=adsense'", "NULL, '" . _MD_AM_AUTOTASKS . "', '/modules/system/admin.php?fct=autotasks'", "NULL, '" . _MD_AM_AVATARS . "', '/modules/system/admin.php?fct=avatars'", "NULL, '" . _MD_AM_BANS . "', '/modules/system/admin.php?fct=banners'", "NULL, '" . _MD_AM_BKPOSAD . "', '/modules/system/admin.php?fct=blockspadmin'", "NULL, '" . _MD_AM_BKAD . "', '/modules/system/admin.php?fct=blocksadmin'", "NULL, '" . _MD_AM_COMMENTS . "', '/modules/system/admin.php?fct=comments'", "NULL, '" . _MD_AM_CUSTOMTAGS . "', '/modules/system/admin.php?fct=customtag'", "NULL, '" . _MD_AM_USER . "', '/modules/system/admin.php?fct=users'", "NULL, '" . _MD_AM_FINDUSER . "', '/modules/system/admin.php?fct=finduser'", "NULL, '" . _MD_AM_ADGS . "', '/modules/system/admin.php?fct=groups'", "NULL, '" . _MD_AM_IMAGES . "', '/modules/system/admin.php?fct=images'", "NULL, '" . _MD_AM_MLUS . "', '/modules/system/admin.php?fct=mailusers'", "NULL, '" . _MD_AM_MIMETYPES . "', '/modules/system/admin.php?fct=mimetype'", "NULL, '" . _MD_AM_MDAD . "', '/modules/system/admin.php?fct=modulesadmin'", "NULL, '" . _MD_AM_PREF . "', '/modules/system/admin.php?fct=preferences'", "NULL, '" . _MD_AM_RATINGS . "', '/modules/system/admin.php?fct=rating'", "NULL, '" . _MD_AM_SMLS . "', '/modules/system/admin.php?fct=smilies'", "NULL, '" . _MD_AM_PAGES . "', '/modules/system/admin.php?fct=pages'", "NULL, '" . _MD_AM_TPLSETS . "', '/modules/system/admin.php?fct=tplsets'", "NULL, '" . _MD_AM_RANK . "', '/modules/system/admin.php?fct=userrank'", "NULL, '" . _MD_AM_VERSION . "', '/modules/system/admin.php?fct=version'"); foreach ($search_cats as $cat) { $table->setData($cat); } $table->addData(); } unset($table); } $table = new icms_db_legacy_updater_Table('autosearch_list'); if (!$table->exists() && !$abortUpdate) { $table->setStructure("`id` int(11) NOT NULL auto_increment,\n\t\t\t\t `cat_id` int(11) NOT NULL,\n\t\t\t\t `name` varchar(255) NOT NULL,\n\t\t\t\t `img` varchar(255) NOT NULL,\n\t\t\t\t `desc` text NOT NULL,\n\t\t\t\t `url` text NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)"); if (!$table->createTable()) { $abortUpdate = TRUE; $newDbVersion = 40; } if (!$abortUpdate) { icms_loadLanguageFile('system', 'admin'); icms_loadLanguageFile('system', 'preferences', TRUE); $search_items = array("NULL, 1, '" . _MD_AM_ADSENSES . "', '/modules/system/admin/adsense/images/adsense_small.png', '" . _MD_AM_ADSENSES_DSC . "', '/modules/system/admin.php?fct=adsense'", "NULL, 2, '" . _MD_AM_AUTOTASKS . "', '/modules/system/admin/autotasks/images/autotasks_small.png', '" . _MD_AM_AUTOTASKS_DSC . "', '/modules/system/admin.php?fct=autotasks'", "NULL, 3, '" . _MD_AM_AVATARS . "', '/modules/system/admin/avatars/images/avatars_small.png', '" . _MD_AM_AVATARS_DSC . "', '/modules/system/admin.php?fct=avatars'", "NULL, 4, '" . _MD_AM_BANS . "', '/modules/system/admin/banners/images/banners_small.png', '" . _MD_AM_BANS_DSC . "', '/modules/system/admin.php?fct=banners'", "NULL, 5, '" . _MD_AM_BKPOSAD . "', '/modules/system/admin/blockspadmin/images/blockspadmin_small.png', '" . _MD_AM_BKPOSAD_DSC . "', '/modules/system/admin.php?fct=blockspadmin'", "NULL, 6, '" . _MD_AM_BKAD . "', '/modules/system/admin/blocksadmin/images/blocksadmin_small.png', '" . _MD_AM_BKAD_DSC . "', '/modules/system/admin.php?fct=blocksadmin'", "NULL, 7, '" . _MD_AM_COMMENTS . "', '/modules/system/admin/comments/images/comments_small.png', '" . _MD_AM_COMMENTS_DSC . "', '/modules/system/admin.php?fct=comments'", "NULL, 8, '" . _MD_AM_CUSTOMTAGS . "', '/modules/system/admin/customtag/images/customtag_small.png', '" . _MD_AM_CUSTOMTAGS_DSC . "', '/modules/system/admin.php?fct=customtag'", "NULL, 9, '" . _MD_AM_USER . "', '/modules/system/admin/users/images/users_small.png', '" . _MD_AM_USER_DSC . "', '/modules/system/admin.php?fct=users'", "NULL, 10, '" . _MD_AM_FINDUSER . "', '/modules/system/admin/findusers/images/findusers_small.png', '" . _MD_AM_FINDUSER_DSC . "', '/modules/system/admin.php?fct=findusers'", "NULL, 11, '" . _MD_AM_ADGS . "', '/modules/system/admin/groups/images/groups_small.png', '" . _MD_AM_ADGS_DSC . "', '/modules/system/admin.php?fct=groups'", "NULL, 12, '" . _MD_AM_IMAGES . "', '/modules/system/admin/images/images/images_small.png', '" . _MD_AM_IMAGES_DSC . "', '/modules/system/admin.php?fct=images'", "NULL, 13, '" . _MD_AM_MLUS . "', '/modules/system/admin/mailusers/images/mailusers_small.png', '" . _MD_AM_MLUS_DSC . "', '/modules/system/admin.php?fct=mailusers'", "NULL, 14, '" . _MD_AM_MIMETYPES . "', '/modules/system/admin/mimetype/images/mimetype_small.png', '" . _MD_AM_MIMETYPES_DSC . "', '/modules/system/admin.php?fct=mimetype'", "NULL, 15, '" . _MD_AM_MDAD . "', '/modules/system/admin/modulesadmin/images/modulesadmin_small.png', '" . _MD_AM_MDAD_DSC . "', '/modules/system/admin.php?fct=modulesadmin'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_AUTHENTICATION . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_AUTHENTICATION_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=7'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_AUTOTASKS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_AUTOTASKS_PREF_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=13'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_CAPTCHA . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_CAPTCHA_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=11'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_GENERAL . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_GENERAL_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=1'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PURIFIER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PURIFIER_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=14'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_MAILER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_MAILER_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=6'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_METAFOOTER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_METAFOOTER_DSC . "', '/modules/system/admin/preferences/images/preferences_small.png'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_MULTILANGUAGE . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_MULTILANGUAGE_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=8'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PERSON . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PERSON_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=10'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PLUGINS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PLUGINS_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=12'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_SEARCH . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_SEARCH_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=5'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_USERSETTINGS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_USERSETTINGS_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=2'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_CENSOR . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_CENSOR_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=4'", "NULL, 17, '" . _MD_AM_RATINGS . "', '/modules/system/admin/rating/images/rating_small.png', '" . _MD_AM_RATINGS_DSC . "', '/modules/system/admin.php?fct=rating'", "NULL, 18, '" . _MD_AM_SMLS . "', '/modules/system/admin/smilies/images/smilies_small.png', '" . _MD_AM_SMLS_DSC . "', '/modules/system/admin.php?fct=smilies'", "NULL, 19, '" . _MD_AM_PAGES . "', '/modules/system/admin/pages/images/pages_small.png', '" . _MD_AM_PAGES_DSC . "', '/modules/system/admin.php?fct=pages'", "NULL, 20, '" . _MD_AM_TPLSETS . "', '/modules/system/admin/tplsets/images/tplsets_small.png', '" . _MD_AM_TPLSETS_DSC . "', '/modules/system/admin.php?fct=tplsets'", "NULL, 21, '" . _MD_AM_RANK . "', '/modules/system/admin/userrank/images/userrank_small.png', '" . _MD_AM_RANK_DSC . "', '/modules/system/admin.php?fct=userrank'", "NULL, 22, '" . _MD_AM_VRSN . "', '/modules/system/admin/version/images/version_small.png', '" . _MD_AM_VRSN_DSC . "', '/modules/system/admin.php?fct=version'"); foreach ($search_items as $item) { $table->setData($item); } $table->addData(); } unset($table); } /* Optimize old tables and fix data structures */ $table = new icms_db_legacy_updater_Table('config'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX conf_mod_cat_id, ADD INDEX mod_cat_order(conf_modid, conf_catid, conf_order)", 'Successfully altered the indexes on table config', ''); unset($table); $table = new icms_db_legacy_updater_Table('group_permission'); $table->addAlteredField('gperm_modid', "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'gperm_modid'); $table->alterTable(); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX itemid, DROP INDEX groupid, DROP INDEX gperm_modid", 'Successfully dropped the indexes on table group_permission', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` ADD INDEX name_mod_group (gperm_name(10), gperm_modid, gperm_groupid)", 'Successfully added the indexes on table group_permission', ''); unset($table); $table = new icms_db_legacy_updater_Table('modules'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX hasmain, DROP INDEX hasadmin, DROP INDEX hassearch, DROP INDEX hasnotification, DROP INDEX name, DROP INDEX dirname", 'Successfully dropped the indexes on table modules', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` ADD INDEX dirname (dirname(5)), ADD INDEX active_main_weight (isactive, hasmain, weight)", 'Successfully added the indexes on table modules', ''); unset($table); $table = new icms_db_legacy_updater_Table('users'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX email, DROP INDEX uiduname, DROP INDEX unamepass", 'Successfully dropped the indexes on table users', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX login_name, ADD UNIQUE INDEX login_name (login_name)", 'Successfully added the indexes on table users', ''); unset($table); $table = new icms_db_legacy_updater_Table('priv_msgs'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX to_userid", 'Successfully dropped the indexes on table priv_msgs', ''); unset($table); $table = new icms_db_legacy_updater_Table('ranks'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX rank_min", 'Successfully dropped the indexes on table ranks', ''); unset($table); /* Corrects an error from db version 4 */ $table = new icms_db_legacy_updater_Table('users'); if ($table->fieldExists('pass')) { $table->addAlteredField('pass', "varchar(255) NOT NULL default ''", 'pass'); $table->alterTable(); } unset($table); /* change IP address to varchar(64) in session to accomodate IPv6 addresses */ $table = new icms_db_legacy_updater_Table('session'); if ($table->fieldExists('sess_ip')) { $table->addAlteredField('sess_ip', "varchar(64) NOT NULL default ''", 'sess_ip'); $table->alterTable(); } unset($table); /* add modname and ipf to modules table */ $table = new icms_db_legacy_updater_Table("modules"); $alter = FALSE; if (!$table->fieldExists("modname")) { $table->addNewField("modname", "varchar(25) NOT NULL default ''"); $alter = TRUE; } if (!$table->fieldExists("ipf")) { $table->addNewField("ipf", "tinyint(1) unsigned NOT NULL default '0'"); $alter = TRUE; } if ($alter) { $table->addNewFields(); } unset($table, $alter); $module_handler = icms::handler('icms_module'); $modules = $module_handler->getObjects(); foreach ($modules as $module) { if ($module->getInfo("modname") !== FALSE) { $module->setVar("modname", $module->getInfo("modname")); } if ($module->getInfo("object_items") !== FALSE) { $module->setVar("ipf", 1); } $module_handler->insert($module); } unset($module_handler, $modules); /* add slot for adsense and rename fields */ $table = new icms_db_legacy_updater_Table('system_adsense'); if (!$table->fieldExists("slot")) { $table->addNewField("slot", "varchar(12) NOT NULL default ''"); $table->addNewFields(); } if ($table->fieldExists("border_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE border_color color_border varchar(6) NOT NULL default ''"); } if ($table->fieldExists("background_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE background_color color_background varchar(6) NOT NULL default ''"); } if ($table->fieldExists("link_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE link_color color_link varchar(6) NOT NULL default ''"); } if ($table->fieldExists("url_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE url_color color_url varchar(6) NOT NULL default ''"); } if ($table->fieldExists("text_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE text_color color_text varchar(6) NOT NULL default ''"); } unset($table); /* rename content field for customtag */ $table = new icms_db_legacy_updater_Table("system_customtag"); if ($table->fieldExists("content")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE content customtag_content text NOT NULL"); } unset($table); /* rename gperm_name from view to view_customtag for system module */ $table = new icms_db_legacy_updater_Table("group_permission"); $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET gperm_name = 'view_customtag' WHERE gperm_name = 'view' AND gperm_modid = 1", "", ""); unset($table); /* reset default source editor if jsvi is used */ $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "sourceeditor_default"))); if (count($configs) == 1 && $configs[0]->getVar("conf_value") == "jsvi") { $configs[0]->setVar("conf_value", "editarea"); icms::$config->insertConfig($configs[0]); } unset($configs); /* New HTML Purifier options - * purifier_HTML_FlashAllowFullScreen, after purifier_HTML_AttrNameUseCDATA * purifier_Output_FlashCompat, after purifier_HTML_FlashAllowFullScreen * purifier_Filter_AllowCustom, after purifier_Filter_YouTube * purifier_Core_NormalizeNewlines, after purifier_Core_RemoveInvalidImg */ $table = new icms_db_legacy_updater_Table("config"); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_HTML_AttrNameUseCDATA"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 2 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_HTML_FlashAllowFullScreen', '_MD_AM_PURIFIER_HTML_FLASHFULLSCRN', '0', '_MD_AM_PURIFIER_HTML_FLASHFULLSCRNDSC', 'yesno', 'int', $p); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Output_FlashCompat', '_MD_AM_PURIFIER_OUTPUT_FLASHCOMPAT', '0', '_MD_AM_PURIFIER_OUTPUT_FLASHCOMPATDSC', 'yesno', 'int', $p++); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_Filter_YouTube"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 1 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Filter_AllowCustom', '_MD_AM_PURIFIER_FILTER_ALLOWCUSTOM', '0', '_MD_AM_PURIFIER_FILTER_ALLOWCUSTOMDSC', 'yesno', 'int', $p); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_Core_RemoveInvalidImg"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 1 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Core_NormalizeNewlines', '_MD_AM_PURIFIER_CORE_NORMALNEWLINES', '1', '_MD_AM_PURIFIER_CORE_NORMALNEWLINESDSC', 'yesno', 'int', $p); unset($table); /* Finish up this portion of the db update */ if (!$abortUpdate) { $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); echo sprintf(_DATABASEUPDATER_UPDATE_OK, icms_conv_nr2local($newDbVersion)) . '<br />'; } } /* 1.3 beta|rc|final release */ /* * This portion of the upgrade must remain as the last section of code to execute * Place all release upgrade steps above this point */ echo "</code>"; if ($abortUpdate) { icms_core_Message::error(sprintf(_DATABASEUPDATER_UPDATE_ERR, icms_conv_nr2local($newDbVersion)), _DATABASEUPDATER_UPDATE_DB, TRUE); } if ($from_112 && !$abortUpdate) { /** * @todo create a language constant for this text */ echo _DATABASEUPDATER_MSG_FROM_112; echo '<script>setTimeout("window.location.href=\'' . ICMS_MODULES_URL . '/system/admin.php?fct=modulesadmin&op=install&module=content&from_112=1\'",20000);</script>'; } $feedback = ob_get_clean(); if (method_exists($module, "setMessage")) { $module->messages = $module->setMessage($feedback); } else { echo $feedback; } $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); return icms_core_Filesystem::cleanFolders(array('templates_c' => ICMS_COMPILE_PATH . "/", 'cache' => ICMS_CACHE_PATH . "/"), $CleanWritingFolders); }
$errors[] = sprintf(_US_PWDTOOSHORT, $icmsConfigUser['minpass']); } if (!empty($vpass)) { $vpass = icms_core_DataFilter::stripSlashesGPC(trim($vpass)); } if ($password != $vpass) { $errors[] = _US_PASSNOTSAME; } if ($password == $username || $password == icms_core_DataFilter::utf8_strrev($username, TRUE) || strripos($password, $username) === TRUE) { $errors[] = _US_BADPWD; } } if (count($errors) > 0) { /** Include the header that starts page rendering */ include ICMS_ROOT_PATH . '/header.php'; icms_core_Message::error($errors); echo "<a href='edituser.php' title='" . _US_EDITPROFILE . "'>" . _US_EDITPROFILE . "</a>"; include ICMS_ROOT_PATH . '/footer.php'; } else { $member_handler = icms::handler('icms_member'); $edituser =& $member_handler->getUser($uid); $edituser->setVar('name', $name); if ($icmsConfigUser['allow_chgmail'] == 1) { $edituser->setVar('email', $email, TRUE); } if ($icmsConfigUser['allow_chguname'] == 1) { $edituser->setVar('uname', $uname, TRUE); } $edituser->setVar('url', formatURL($url)); $edituser->setVar('user_icq', $user_icq); $edituser->setVar('user_from', $user_from);
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)) { redirect_header('admin.php?fct=avatars', 1); } if (!$avt_handler->delete($avatar)) { icms_cp_header(); icms_core_Message::error(sprintf(_MD_FAILDEL, $avatar->getVar('avatar_id'))); icms_cp_footer(); exit(); } $file = $avatar->getVar('avatar_file'); @unlink(ICMS_UPLOAD_PATH . '/' . $file); if (isset($user_id) && $avatar->getVar('avatar_type') == 'C') { icms::$xoopsDB->query("UPDATE " . icms::$xoopsDB->prefix('users') . " SET user_avatar='blank.gif' WHERE uid='". (int) ($user_id) . "'"); } else { icms::$xoopsDB->query("UPDATE " . icms::$xoopsDB->prefix('users') . " SET user_avatar='blank.gif' WHERE user_avatar='" . $file . "'"); } redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED); } }
function protector_oninstall_base($module, $mydirname) { // transations on module install global $ret; // TODO :-D // for Cube 2.1 if (defined('XOOPS_CUBE_LEGACY')) { $root =& XCube_Root::getSingleton(); $root->mDelegateManager->add('Legacy.Admin.Event.ModuleInstall.' . ucfirst($mydirname) . '.Success', 'protector_message_append_oninstall'); $ret = array(); } else { if (!is_array($ret)) { $ret = array(); } } $db =& icms_db_Factory::instance(); $mid = $module->getVar('mid'); // TABLES (loading mysql.sql) $sql_file_path = dirname(__FILE__) . '/sql/mysql.sql'; $prefix_mod = $db->prefix() . '_' . $mydirname; if (file_exists($sql_file_path)) { $ret[] = "SQL file found at <b>" . htmlspecialchars($sql_file_path) . "</b>.<br /> Creating tables..."; $sqlutil = new icms_db_legacy_mysql_Utility(); $sql_query = trim(file_get_contents($sql_file_path)); $sqlutil->splitMySqlFile($pieces, $sql_query); $created_tables = array(); foreach ($pieces as $piece) { $prefixed_query = $sqlutil->prefixQuery($piece, $prefix_mod); if (!$prefixed_query) { $ret[] = "Invalid SQL <b>" . htmlspecialchars($piece) . "</b><br />"; return false; } if (!$db->query($prefixed_query[0])) { $ret[] = '<b>' . htmlspecialchars($db->error()) . '</b><br />'; //var_dump( $db->error() ) ; return false; } else { if (!in_array($prefixed_query[4], $created_tables)) { $ret[] = 'Table <b>' . htmlspecialchars($prefix_mod . '_' . $prefixed_query[4]) . '</b> created.<br />'; $created_tables[] = $prefixed_query[4]; } else { $ret[] = 'Data inserted to table <b>' . htmlspecialchars($prefix_mod . '_' . $prefixed_query[4]) . '</b>.</br />'; } } } } // TEMPLATES $tplfile_handler =& new icms_view_template_file_Handler(icms::$xoopsDB); $tpl_path = dirname(__FILE__) . '/templates'; if ($handler = @opendir($tpl_path . '/')) { while (($file = readdir($handler)) !== false) { if (substr($file, 0, 1) == '.') { continue; } $file_path = $tpl_path . '/' . $file; if (is_file($file_path) && in_array(strrchr($file, '.'), array('.html', '.css', '.js'))) { $mtime = intval(@filemtime($file_path)); $tplfile =& $tplfile_handler->create(); $tplfile->setVar('tpl_source', file_get_contents($file_path), true); $tplfile->setVar('tpl_refid', $mid); $tplfile->setVar('tpl_tplset', 'default'); $tplfile->setVar('tpl_file', $mydirname . '_' . $file); $tplfile->setVar('tpl_desc', '', true); $tplfile->setVar('tpl_module', $mydirname); $tplfile->setVar('tpl_lastmodified', $mtime); $tplfile->setVar('tpl_lastimported', 0); $tplfile->setVar('tpl_type', 'module'); if (!$tplfile_handler->insert($tplfile)) { $ret[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>' . htmlspecialchars($mydirname . '_' . $file) . '</b> to the database.</span><br />'; } else { $tplid = $tplfile->getVar('tpl_id'); $ret[] = 'Template <b>' . htmlspecialchars($mydirname . '_' . $file) . '</b> added to the database. (ID: <b>' . $tplid . '</b>)<br />'; // generate compiled file if (!icms_view_Tpl::template_touch($tplid)) { $ret[] = '<span style="color:#ff0000;">ERROR: Failed compiling template <b>' . htmlspecialchars($mydirname . '_' . $file) . '</b>.</span><br />'; } else { $ret[] = 'Template <b>' . htmlspecialchars($mydirname . '_' . $file) . '</b> compiled.</span><br />'; } } } } closedir($handler); } /* Fixes Bug #619 : parse Error */ if (defined('ICMS_PRELOAD_PATH') && !file_exists(ICMS_PRELOAD_PATH . '/protector.php') && (!defined('PROTECTOR_POSTCHECK_INCLUDED') || !defined('PROTECTOR_PRECHECK_INCLUDED'))) { if (icms_core_Filesystem::copyRecursive(ICMS_TRUST_PATH . '/modules/protector/patches/ImpressCMS1.1/preload_protector.php', ICMS_PRELOAD_PATH . '/protector.php')) { $ret[] = 'Successfully moved protector preload<br />'; } else { $ret[] = icms_core_Message::error("Failed to move protector preload - your site is not protected.", "", FALSE); } } icms_view_Tpl::template_clear_module_cache($mid); return true; }
} $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 {
/** * Logic and rendering for deleting an image * @param int $image_id Unique ID for the image to be deleted * @param int $redir Optional. If set, the image category to display after deleting the image */ function imanager_delfileok($image_id, $redir = NULL) { if (!icms::$security->check()) { redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors())); } $image_id = (int) $image_id; if ($image_id <= 0) { redirect_header('admin.php?fct=images', 1); } $image_handler = icms::handler('icms_image'); $image =& $image_handler->get($image_id); if (!is_object($image)) { redirect_header('admin.php?fct=images', 1); } $imgcat_handler = icms::handler('icms_image_category'); $imagecategory =& $imgcat_handler->get((int) $image->getVar('imgcat_id')); $categ_path = $imgcat_handler->getCategFolder($imagecategory); if (!$image_handler->delete($image)) { icms_cp_header(); icms_core_Message::error(sprintf(_MD_FAILDEL, $image->getVar('image_id'))); icms_cp_footer(); exit(); } @unlink($categ_path . '/' . $image->getVar('image_name')); if (isset($redir)) { $redir = '&op=listimg&imgcat_id=' . $redir; } else { $redir = ''; } redirect_header('admin.php?fct=images' . $redir, 2, _MD_AM_DBUPDATED); }
} $comment_url .= $extra_params; } $comment_url .= $com_config['itemName']; } $comment_tags['X_COMMENT_URL'] = ICMS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; $notification_handler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, FALSE, $not_modid); } if (!isset($comment_post_results)) { // if the comment is active, redirect to posted comment if ($comment->getVar('com_status') == XOOPS_COMMENT_ACTIVE) { redirect_header($redirect_page . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid, 2, _CM_THANKSPOST); } else { // not active, so redirect to top comment page redirect_header($redirect_page . '=' . $com_itemid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid, 2, _CM_THANKSPOST); } } } else { if (!isset($purge_comment_post_results)) { include ICMS_ROOT_PATH . '/header.php'; icms_core_Message::error($comment->getHtmlErrors()); include ICMS_ROOT_PATH . '/footer.php'; } else { $comment_post_results = $comment->getErrors(); } } break; default: redirect_header(ICMS_URL . '/', 3, implode('<br />', icms::$security->getErrors())); break; }
$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); }
} 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: