public function checkForumPassword() { global $wgRequest, $wgOut, $awcUser; #awc_pdie($wgRequest); # fid # pw $fid = $wgRequest->getVal('fid'); $pw = $wgRequest->getVal('pw'); $pw = awcsf_encode_password($pw); $dbr = wfGetDB(DB_SLAVE); $r = $dbr->selectRow('awc_f_forums', array('f_password'), array('f_id' => $fid)); if ($pw == $r->f_password) { $_SESSION['forumPW'] = $_SESSION['forumPW'] . ',' . $fid; $awcUser->pw[$fid] = $fid; } $info['msg'] = 'word_CheckingPassword'; $info['url'] = awc_url . 'sf/id' . $fid; return awcf_redirect($info); #$str = $this->ShowThreads($fid); # return $wgOut->addHTML($str); }
function edit_forum_do() { global $wgRequest; $f_name = $wgRequest->getVal('f_name'); $f_desc = $wgRequest->getVal('f_desc'); $parent_id = $wgRequest->getVal('parent_id'); $f_wiki_read_perm = parent::wikigroup_check_for_save('f_wiki_read_perm'); $f_wiki_write_perm = parent::wikigroup_check_for_save('f_wiki_write_perm'); $f_order = $wgRequest->getVal('f_order'); $f_passworded = $wgRequest->getVal('f_passworded'); $f_password = awcsf_encode_password($wgRequest->getVal('f_password')); $f_top_tmplt = $wgRequest->getVal('f_top_tmplt'); $f_posting_mesage_tmpt = $wgRequest->getVal('f_posting_mesage_tmpt'); $f_id = $wgRequest->getVal('f_id'); if (strlen($f_desc) == 0) { $f_desc = ' '; } if (strlen($f_name) == 0) { $f_name = 'Forum Name ???'; } if (strlen($f_top_tmplt) == 0) { $f_top_tmplt = ' '; } if (strlen($f_posting_mesage_tmpt) == 0) { $f_posting_mesage_tmpt = ' '; } $dbw = wfGetDB(DB_MASTER); $dbw->update('awc_f_forums', array('f_name' => $f_name, 'f_desc' => $f_desc, 'f_parentid' => $parent_id, 'f_wiki_read_perm' => $f_wiki_read_perm, 'f_wiki_write_perm' => $f_wiki_write_perm, 'f_order' => $f_order, 'f_passworded' => $f_passworded, 'f_password' => $f_password, 'f_top_tmplt' => $f_top_tmplt, 'f_posting_mesage_tmpt' => $f_posting_mesage_tmpt), array('f_id' => $f_id), ''); $info['msg'] = 'forum_edited'; $info['url'] = awc_url . 'sc/id' . $parent_id; return awcf_redirect($info); }