diff options
Diffstat (limited to 'pages/content/Pages:Edit.xml')
-rw-r--r-- | pages/content/Pages:Edit.xml | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/pages/content/Pages:Edit.xml b/pages/content/Pages:Edit.xml index dfe9a51..beaa0b3 100644 --- a/pages/content/Pages:Edit.xml +++ b/pages/content/Pages:Edit.xml @@ -3,7 +3,7 @@ <info> <name>Pages:Edit</name> <template>phpexec</template> - <access>0:0</access> + <access>9:0</access> <type>c</type> </info> <data> @@ -11,32 +11,22 @@ <![CDATA[ <?PHP require_once('code/pages.inc.php'); - require_once('code/links.inc.php'); require_once('code/util.inc.php'); - if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e') + if($_GET['type'] != 'c' && $_GET['type'] != 'n' && $_GET['type'] != 'e') exit(); - if($_POST['back']) { - header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false)); - exit(); - } - - if(!$_POST['name']) exit(); - - $data = array(); + if(!$_GET['name'] || !$_GET['backlink']) exit(); - foreach($_POST as $key => $val) { - if(substr($key, 0, 5) != 'data_') continue; - - $data[substr($key, 5)] = Unquote($val); - } - - $GLOBALS['pages']->Edit(Unquote($_POST['name']), $_POST['type'], $data); + if(!$GLOBALS['pages']->HasWriteAccess(Unquote($_GET['name']), $_GET['type'])) + exit(); - header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false)); - exit(); + $data = $GLOBALS['pages']->GetEditor(Unquote($_GET['name']), $_GET['type'], Unquote($_GET['backlink'])); + + $title = $data['title']; + + echo $data['content']; ?> ]]> </code> |