[Phpslash-commit] CVS: phpslash-ft/public_html/admin authorAdmin.php3,1.6,1.7
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-06-03 18:04:58
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft/public_html/admin Modified Files: authorAdmin.php3 Log Message: author admin method cleanup Index: authorAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/authorAdmin.php3,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** authorAdmin.php3 20 May 2002 19:54:17 -0000 1.6 --- authorAdmin.php3 3 Jun 2002 18:04:55 -0000 1.7 *************** *** 13,83 **** *****************************/ ! $auth->login_if(!$perm->have_perm('author')); ! ! slashhead($pagetitle,$xsiteobject); ! ! /* DEBUG */ ! ! debug("HTTP_POST_VARS", $HTTP_POST_VARS); ! debug("HTTP_GET_VARS", $HTTP_GET_VARS); ! debug("author_id_ary", $author_id_ary); ! debug("author_name_ary", $author_name_ary); ! debug("real_name_ary", $author_name_ary); ! debug("email", $email); ! debug("quote", $quote); ! debug("password", $password); ! debug("permission", $permission); ! /* DEBUG */ $author = new Author; ! if ($perm->have_perm("author")) { ! switch ($submit) { ! case "delete": ! $success = $author->deleteAuthor($id, $auth->auth["uid"]); ! if($success) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } - $author->newAuthor(); - $author->listAuthor(); break; case "edit": ! $author->editAuthor($id); ! $author->listAuthor(); ! break; case "lostpw": ! $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); ! if($success) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } ! $author->newAuthor(); ! $author->listAuthor(); ! break; case "update": case "new": ! $success = $author->saveAuthor($HTTP_POST_VARS); ! if(isset($success)) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } default: ! $author->newAuthor(); ! $author->listAuthor(); } } else { ! titlebar("100%","Error! Invalid Privileges"); ! echo "Sorry. You do not have the necessary privilege to view this page."; } ! slashfoot(); page_close(); --- 13,148 ---- *****************************/ ! $auth->login_if(!$perm->have_perm('authorList')); ! $content = ''; $author = new Author; ! switch ($submit) { ! case "delete": ! if ($perm->have_perm("deleteAuthor")) { ! $success = $author->deleteAuthor($id, $auth->auth["uid"]); ! if($success) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } ! } ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); } break; case "edit": ! if ($perm->have_perm("authorEdit")) { ! $content .= $author->editAuthor($id); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } ! break; case "lostpw": ! if ($perm->have_perm("authorLostPW")) { ! $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); ! if($success) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } } ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } ! break; case "update": case "new": ! if ($perm->have_perm("authorSave")) { ! $success = $author->saveAuthor($HTTP_POST_VARS); ! if(isset($success)) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } } default: ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } } + if($content == '') { + $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, "leftadmin"); + $centerblocks = $block->getBlocks($ary, "centeradmin"); + $rightblocks = $block->getBlocks($ary, "rightadmin"); + + if (empty($leftblocks)) { + if (empty($rightblocks)) { + // $centerblocks = $block->getBlocks($ary); + // $tplfile = "index1col.tpl"; + // default to 2 column for transparent upgrade + if(empty($centerblocks)) { + $rightblocks = $block->getBlocks($ary); + $tplfile = 'index2colright.tpl'; + } else { + $tplfile = 'index3col.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(); |