[Phpslash-commit] CVS: phpslash-ft/public_html/admin submissionAdmin.php3,1.6,1.7
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-06-17 15:31:23
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv26666/phpslash-ft/public_html/admin Modified Files: submissionAdmin.php3 Log Message: submission method returns Index: submissionAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/submissionAdmin.php3,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** submissionAdmin.php3 3 Feb 2002 22:09:12 -0000 1.6 --- submissionAdmin.php3 17 Jun 2002 15:31:19 -0000 1.7 *************** *** 2,6 **** // $id: submissionAdmin.php3,v 1.0 2000/04/25 12:08:03 ajay Exp $ ! $pagetitle = "Administration"; # The name to be displayed in the header $xsiteobject = "Administration";#Defines The META TAG Page Type --- 2,6 ---- // $id: submissionAdmin.php3,v 1.0 2000/04/25 12:08:03 ajay Exp $ ! $pagetitle = "Submission Administration"; # The name to be displayed in the header $xsiteobject = "Administration";#Defines The META TAG Page Type *************** *** 19,103 **** *****************************/ ! slashhead($pagetitle,$xsiteobject); ! debug("HTTP_POST_VARS" , $HTTP_POST_VARS); ! debug("HTTP_GET_VARS" , $HTTP_GET_VARS); ! debug("topic_id_ary" , $topic_id_ary); ! debug("submission_id_ary" , $submission_id_ary); ! $submission = new Submission; ! /* this is all really unsecure code. TODO, secure it! */ ! if ($perm->have_perm("submission")) { switch ($submit) { case "delete": ! $count = count($submission_id_ary); ! if ($count > 0 ) { ! for ($i = 0 ; $i < $count ; $i++) { ! $submission->deleteSubmission($submission_id_ary[$i]); } ! echo "$count record deleted<BR>\n"; ! $submission->listSubmission(0); ! } else { ! echo "<BR><BR>This would work <B>SO</B> much better if ! you actually selected something to delete!<BR>\n"; ! } break; case "save": ! /* this code is duplicated below for the people with no security ! priviliges */ ! if ($submission->saveSubmission($HTTP_POST_VARS)) { ! logwrite("Story Submission", "$REMOTE_ADDR submitted a story as an admin"); ! echo "Thanks for this submission. We have it and will set our fearless editorial staff upon it right this second.<br>\n"; ! } else { ! echo "<FONT COLOR=RED>Something broke, I'm not sure what though??</FONT>\n"; ! } break; case "preview": ! $submission->showSubmission($HTTP_POST_VARS); ! titlebar("100%","Edit Submission"); ! $submission->newSubmission($HTTP_POST_VARS,"array"); break; case "editasstory": ! # echo "<B>EDIT AS STORY</B><BR>\n"; ! $submission->editasStory($submission_id); ! if ($_PSL['submission_autodelete']) { ! $submission->deleteSubmission($submission_id); ! }; break; case "edit": ! # echo "<B>EDIT SUBMISSION</B><BR>\n"; ! $submission->displaySubmission($submission_id); ! titlebar("100%","Edit Submission"); ! $ary['submission_id'] = $submission_id; ! $submission->newSubmission($ary,"database"); break; ! case "new": ! # echo "<B>NEW SUBMISSION</B><BR>\n"; ! $submission->newSubmission($HTTP_POST_VARS,"array"); break; default: ! if (!$submission->listSubmission($next)) { ! echo "when you don't see the submission, it means there aren't any.<BR>\n"; } } /* end of switch */ ! } else { ! echo "no permissions..."; ! }; slashfoot(); page_close(); ?> --- 19,180 ---- *****************************/ ! $auth->login_if(!$perm->have_perm('submissionEdit')); ! $content = ''; ! // debug("HTTP_POST_VARS" , $HTTP_POST_VARS); ! // debug("HTTP_GET_VARS" , $HTTP_GET_VARS); ! // debug("topic_id_ary" , $topic_id_ary); ! // debug("submission_id_ary" , $submission_id_ary); ! $submission = new Submission; ! if ($perm->have_perm("submissionEdit")) { switch ($submit) { case "delete": ! if ($perm->have_perm("submissionDelete")) { ! $count = count($submission_id_ary); ! if ($count > 0 ) { ! for ($i = 0 ; $i < $count ; $i++) { ! $submission->deleteSubmission($submission_id_ary[$i]); ! } ! $content .= "$count record deleted<BR>\n"; ! } else { ! $content .= "<BR><BR>This would work <B>SO</B> much better if you actually selected something to delete!<BR>\n"; } ! } break; case "save": ! if ($perm->have_perm("submissionSave")) { ! if ($submission->saveSubmission($HTTP_POST_VARS)) { ! logwrite("Story Submission", "$REMOTE_ADDR submitted a story as an admin"); ! $content .= pslgetText('Submission Saved'); ! } else { ! $content .= getError($submission->getMessage()); ! } ! } break; case "preview": ! if ($perm->have_perm("submissionEdit")) { ! $content .= getTitlebar("100%","Submission Preview"); ! $content .= $submission->showSubmission($HTTP_POST_VARS); ! $content .= getTitlebar("100%","Edit Submission"); ! $content .= $submission->newSubmission($HTTP_POST_VARS,"array"); ! } break; case "editasstory": ! if ($perm->have_perm("submissioneditasstory")) { ! if($submission->editasStory($submission_id)) { ! $content .= $submission->getMessage(); ! if ($_PSL['submission_autodelete']) { ! $submission->deleteSubmission($submission_id); ! } ! } ! } break; case "edit": ! if ($perm->have_perm("submissionEdit")) { ! if($submission->displaySubmission($submission_id)) { ! $content .= getTitlebar("100%","Submission Preview"); ! $content .= $submission->getMessage(); ! } ! $content .= getTitlebar("100%","Edit Submission"); ! $ary['submission_id'] = $submission_id; ! $content .= $submission->newSubmission($ary,"database"); ! } break; ! case "new": ! if ($perm->have_perm("submissionNew")) { ! $content .= $submission->newSubmission($HTTP_POST_VARS,"array"); ! } break; default: ! /* ! $returned = $submission->listSubmission($next); ! if($returned) { ! $content .= $returned; ! } else { ! $content .= pslgetText("When you don't see the submission, it means there aren't any."); } + */ + break; } /* end of switch */ + $returned = $submission->listSubmission($next); + if($returned) { + $content .= getTitlebar("100%","Current Submissions"); + $content .= $returned; + } else { + $content .= pslgetText("When you don't see the submission, it means there aren't any."); + } ! } else { ! $content = getTitlebar("100%","Error! Invalid Privileges"); ! $content .= "Sorry. You do not have the necessary privilege to view this page."; ! } ! $block = new Block_i; ! $ary['section'] = "Admin"; ! ! $breadcrumb = breadcrumb($ary); ! $_PSL['metatags']['object'] = $xsiteobject; ! ! slashhead($pagetitle,$_PSL['metatags']); ! ! $leftblocks = $block->getBlocks($ary, "left"); ! $centerblocks = $block->getBlocks($ary, "center"); ! $rightblocks = $block->getBlocks($ary, "right"); ! ! if (empty($leftblocks)) { ! if (empty($rightblocks)) { ! // $centerblocks = $block->getBlocks($ary); ! $tplfile = "index1col.tpl"; ! } else { ! $tplfile = 'index2colright.tpl'; ! } ! } elseif (empty($rightblocks)) { ! $tplfile = 'index2colleft.tpl'; ! } else { ! $tplfile = 'index3col.tpl'; ! } ! ! $template = new Template($_PSL['templatedir']); ! $template->debug = 0; ! $template->set_file(array( ! 'index' => $tplfile //"index3col.tpl" ! )); ! ! if( !empty($GLOBALS['QUERY_STRING'])) { ! $QUERY_STRING = '?'.$GLOBALS['QUERY_STRING']; ! } else { ! $QUERY_STRING = ''; ! } ! ! $template->set_var(array( ! 'QUERYSTRING' => $QUERY_STRING, ! 'ROOTDIR' => $_PSL['rooturl'], ! 'IMAGEDIR' => $_PSL['imageurl'], ! 'BREADCRUMB' => $breadcrumb, ! 'STORY_COLUMN' => $content, ! 'LEFT_BLOCK_COLUMN' => $leftblocks, ! 'CENTER_BLOCK_COLUMN' => $centerblocks, ! 'RIGHT_BLOCK_COLUMN' => $rightblocks ! )); ! ! $template->parse('OUT','index'); ! $template->p('OUT'); slashfoot(); page_close(); + + ?> |