From 38f73720eaec5f49752589ac088b04b3fa734117 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 5 Jan 2009 18:01:06 -0500 Subject: Integreated Fourm users --- pages/admin.php | 18 +++++++++--------- pages/login.php | 46 ---------------------------------------------- pages/logout.php | 28 ---------------------------- pages/post.php | 6 +++--- 4 files changed, 12 insertions(+), 86 deletions(-) delete mode 100755 pages/login.php delete mode 100755 pages/logout.php (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php index a3b1783..60bc73d 100755 --- a/pages/admin.php +++ b/pages/admin.php @@ -26,7 +26,7 @@ $pageCategory = 'panel'; if (isLoggedIn()) { - if (getUserlevel() == 1) + if (isAdmin()) { if (!isset($_GET['page'])) { @@ -41,7 +41,7 @@ if (isLoggedIn()) if ($_POST['type'] == 'draft') { - $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . sess_get('uname') . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; + $insdraft = "INSERT INTO drafts (title,author,text,slug) VALUES (\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; $insdraft2 = mysql_query($insdraft); $id = mysql_insert_id(); @@ -51,7 +51,7 @@ if (isLoggedIn()) $template->add('ID', $id); } else if ($_POST['type'] == 'instant') { - $id = postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); + $id = postBlogPost($_POST['title'], getSessionUsername(), $tags, $_POST['text']); $getpost = "SELECT * FROM updates WHERE id = " . $id; $getpost2 = mysql_query($getpost); @@ -87,7 +87,7 @@ if (isLoggedIn()) generateError(404); } - $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . sess_get('uname') . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; + $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; $inspending2 = mysql_query($inspending); addTags($id, $tags, 'pending'); @@ -140,7 +140,7 @@ if (isLoggedIn()) $template->add('ID', $_GET['id']); } else if ($_POST['type'] == 'instant') { - $id = postBlogPost($_POST['title'], sess_get('uname'), $tags, $_POST['text']); + $id = postBlogPost($_POST['title'], getSessionUsername(), $tags, $_POST['text']); $deldraft = "DELETE FROM drafts WHERE id = " . $_GET['id']; $deldraft2 = mysql_query($deldraft); @@ -179,7 +179,7 @@ if (isLoggedIn()) generateError(404); } - $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . sess_get('uname') . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; + $inspending = "INSERT INTO pending (id,title,author,text,slug) VALUES (" . $id . ",\"" . mysql_real_escape_string($_POST['title']) . "\",\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\",\"" . generateSlug($_POST['title'],'updates') . "\")"; $inspending2 = mysql_query($inspending); addTags($id, $tags, 'pending'); @@ -539,14 +539,14 @@ if (isLoggedIn()) if ($getcomment3['id'] == $_GET['id']) { - $getuser = "SELECT * FROM users WHERE username = \"" . $getcomment3['author'] . "\""; + $getuser = "SELECT * FROM phpbb_users WHERE username = \"" . $getcomment3['author'] . "\""; $getuser2 = mysql_query($getuser); $getuser3 = mysql_fetch_array($getuser2); $template = new FITemplate('admin/viewComment'); $template->add('ID', $_GET['id']); $template->add('USERNAME', $getcomment3['author']); - $template->add('CODEDEMAIL', md5(strtolower($getuser3['email']))); + $template->add('CODEDEMAIL', md5(strtolower($getuser3['user_email']))); $template->add('TEXT', parseText($getcomment3['comment'])); $template->add('DATE', date("F dS Y \a\\t g:i:s a",strtotime($getcomment3['pubDate']))); } else { @@ -601,7 +601,7 @@ if (isLoggedIn()) $template = new FITemplate('admin/pollrss'); } else if ($_GET['step'] == 2) { - $insrss = "INSERT INTO pollrss (author,rss) VALUES (\"" . sess_get('uname') . "\",\"" . mysql_real_escape_string($_POST['text']) . "\")"; + $insrss = "INSERT INTO pollrss (author,rss) VALUES (\"" . getSessionUsername() . "\",\"" . mysql_real_escape_string($_POST['text']) . "\")"; $insrss2 = mysql_query($insrss); $template = new FITemplate('admin/newPoll'); diff --git a/pages/login.php b/pages/login.php deleted file mode 100755 index a787729..0000000 --- a/pages/login.php +++ /dev/null @@ -1,46 +0,0 @@ -add('REDIRECT',$_GET['redirect']); -} else { - if (verifyUser($_POST['username'], $_POST['password'])) - { - sess_set('uname',$_POST['username']); - header('Location: ' . rawurldecode($_POST['redirect'])); - exit; - } else { - $template = new FITemplate('login'); - $template->add('REDIRECT',$_POST['redirect']); - $template->adds_block('ERROR',array('MSG' => "The username/password pair didn't resolve to a real user. Try logging on again, spelling the password right, or making sure you actually have an a account.")); - } -} - -$template->display(); - -?> diff --git a/pages/logout.php b/pages/logout.php deleted file mode 100755 index 69b9386..0000000 --- a/pages/logout.php +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/pages/post.php b/pages/post.php index 1b89fa4..48239cf 100755 --- a/pages/post.php +++ b/pages/post.php @@ -84,10 +84,10 @@ if (!isset($_GET['id'])) } } } else { - $setcomment = "INSERT INTO comments SET page_id = \"" . $_GET['id'] . "\", username = \"" . sess_get('uname') . "\", comment = \"" . $_POST['comment'] . "\""; + $setcomment = "INSERT INTO comments SET page_id = \"" . $_GET['id'] . "\", username = \"" . getSessionUsername() . "\", comment = \"" . $_POST['comment'] . "\""; $setcomment2 = mysql_query($setcomment); - mail('hatkirby@fourisland.com', 'New comment on Four Island!', sess_get('uname') . ' has posted a comment on Four Island under the "page id" ' . $_GET['id']); + mail('hatkirby@fourisland.com', 'New comment on Four Island!', getSessionUsername() . ' has posted a comment on Four Island under the "page id" ' . $_GET['id']); $page_id = $_GET['id']; $comType = substr($page_id,0,strpos($page_id,'-')); @@ -97,7 +97,7 @@ if (!isset($_GET['id'])) recalcPop($comID); } - $template->add('MSG',"Thank you, " . sess_get('uname') . ", for posting your valuable comment!"); + $template->add('MSG',"Thank you, " . getSessionUsername() . ", for posting your valuable comment!"); } } } -- cgit 1.4.1