} /* ===== */ cot_block($usr['auth_write']); if ($structure['page'][$c]['locked']) { cot_die_message(602, TRUE); } $sys['parser'] = $cfg['page']['parser']; $parser_list = cot_get_parsers(); if ($a == 'add') { cot_shield_protect(); /* === Hook === */ foreach (cot_getextplugins('page.add.add.first') as $pl) { include $pl; } /* ===== */ $rpage = cot_page_import('POST', array(), $usr); list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('page', $rpage['page_cat']); cot_block($usr['auth_write']); /* === Hook === */ foreach (cot_getextplugins('page.add.add.import') as $pl) { include $pl; } /* ===== */ cot_page_validate($rpage); /* === Hook === */ foreach (cot_getextplugins('page.add.add.error') as $pl) { include $pl; } /* ===== */ if (!cot_error_found()) { $id = cot_page_add($rpage, $usr);
$sql_page = $db->query("SELECT * FROM {$db_pages} WHERE page_id={$id} LIMIT 1"); if ($sql_page->rowCount() == 0) { cot_die_message(404); } $row_page = $sql_page->fetch(); list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('page', $row_page['page_cat']); $parser_list = cot_get_parsers(); $sys['parser'] = $row_page['page_parser']; if ($a == 'update') { /* === Hook === */ foreach (cot_getextplugins('page.edit.update.first') as $pl) { include $pl; } /* ===== */ cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $row_page['page_ownerid']); $rpage = cot_page_import('POST', $row_page, $usr); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $rpagedelete = cot_import('rpagedelete', 'P', 'BOL'); } else { $rpagedelete = cot_import('delete', 'G', 'BOL'); cot_check_xg(); } if ($rpagedelete) { cot_page_delete($id, $row_page); cot_redirect(cot_url('page', "c=" . $row_page['page_cat'], '', true)); } /* === Hook === */ foreach (cot_getextplugins('page.edit.update.import') as $pl) { include $pl; } /* ===== */