Changing from GET to POST.

This commit is contained in:
green-ponies (jgen) 2012-02-08 14:10:33 -05:00
parent 795160f8eb
commit 2da3cb2812
2 changed files with 26 additions and 23 deletions

View file

@ -137,32 +137,32 @@ class Pools extends SimpleExtension {
break;
case "edit":
$poolID = int_escape($event->get_arg(1));
$pools = $this->get_pool($poolID);
//$poolID = int_escape($event->get_arg(1));
//$pools = $this->get_pool($poolID);
foreach($pools as $pool) {
//foreach($pools as $pool) {
if ($this->have_permission($user, $pool)) {
$this->theme->edit_pool($page, $this->get_pool($poolID), $this->edit_posts($poolID));
} else {
$page->set_mode("redirect");
$page->set_redirect(make_link("pool/view/".$poolID));
}
}
//}
break;
case "order":
if($_SERVER["REQUEST_METHOD"] == "GET") {
$poolID = int_escape($event->get_arg(1));
$pools = $this->get_pool($poolID);
if (isset($_POST["order_view"])) {
//$poolID = int_escape($event->get_arg(1));
//$pools = $this->get_pool($poolID);
foreach($pools as $pool) {
//foreach($pools as $pool) {
if ($this->have_permission($user, $pool)) {
$this->theme->edit_order($page, $this->get_pool($poolID), $this->edit_order($poolID));
} else {
$page->set_mode("redirect");
$page->set_redirect(make_link("pool/view/".$poolID));
}
}
//}
}
else {
if ($this->have_permission($user, $pool)) {

View file

@ -168,21 +168,24 @@ class PoolsTheme extends Themelet {
public function sidebar_options(Page $page, $pool, $check_all) {
global $user;
$editor = "
".make_form(make_link("pool/import"))."
<input type='text' name='pool_tag' id='edit_pool_tag' value='Please enter a tag' onclick='this.value=\"\";'/>
<input type='submit' name='edit' id='edit_pool_import_btn' value='Import'/>
<input type='hidden' name='pool_id' value='".$pool['id']."'>
$editor = "\n".make_form( make_link('pool/import') ).'
<input type="text" name="pool_tag" id="edit_pool_tag" value="Please enter a tag" onclick="this.value=\'\';"/>
<input type="submit" name="edit" id="edit_pool_import_btn" value="Import"/>
<input type="hidden" name="pool_id" value="'.$pool['id'].'">
</form>
<form method='GET' action='".make_link("pool/edit/".$pool['id'])."'>
<input type='submit' name='edit' id='edit_pool_btn' value='Edit Pool'/>
'.make_form( make_link('pool/edit') ).'
<input type="submit" name="edit" id="edit_pool_btn" value="Edit Pool"/>
<input type="hidden" name="edit_pool" value="yes">
<input type="hidden" name="pool_id" value="'.$pool['id'].'">
</form>
<form method='GET' action='".make_link("pool/order/".$pool['id'])."'>
<input type='submit' name='edit' id='edit_pool_order_btn' value='Order Pool'/>
'.make_form( make_link('pool/order') ).'
<input type="submit" name="edit" id="edit_pool_order_btn" value="Order Pool"/>
<input type="hidden" name="order_view" value="yes">
<input type="hidden" name="pool_id" value="'.$pool['id'].'">
</form>
";
';
if($user->id == $pool['user_id'] || $user->is_admin()){
$editor .= "