gnuheter-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnuheter-dev] pollcomments: isRealUser() m m


From: Ulf Harnhammar
Subject: [Gnuheter-dev] pollcomments: isRealUser() m m
Date: Thu, 15 Aug 2002 22:43:21 +0200 (CEST)

Har commitat motsvarande ändring i pollcomments som i comments.

// Ulf, trött


--- pollcomments.php.old        2002-08-15 21:59:07.000000000 +0200
+++ pollcomments.php    2002-08-15 22:09:09.000000000 +0200
@@ -27,6 +27,14 @@
 
 if (!isset($config)) include('config.php');
 
+$savemainfile = $mainfile;
+if (ereg('/pollcomments\.php$', $SCRIPT_NAME))
+       include('mainfile.php');
+$mainfile = $savemainfile;
+
+isRealUser($HTTP_COOKIE_VARS['user']);
+
+
 function modone() {
        global $admin,$moderate,$REQUEST_URI;
        if (((isset($admin)) && ($moderate == 1)) || ($moderate == 2)) {
@@ -216,10 +224,9 @@
        global $user, $datetime, $cookie, $mainfile, $admin;
        global $bgcolor1, $bgcolor2, $bgcolor3;
        global $dbhost,$dbuname,$dbpass,$dbname;
-       if (address@hidden) {
-               include('mainfile.php');
+       if (address@hidden)
                include('header.php');
-       } else {
+       else {
                if (!isset($config)) include('config.php');
         }
        dbconnect();
@@ -253,7 +260,6 @@
 }
 
 function singlecomment($tid, $sid, $mode, $order, $thold) {
-       include('mainfile.php');
        include('header.php');
        global $user, $cookie;
        dbconnect();
@@ -269,11 +275,10 @@
 }
 
 function reply($pid, $sid, $mode, $order, $thold) {
-        global $dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;
-        if (address@hidden) {
-                include('mainfile.php');
+        global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;
+        if (address@hidden)
                 include('header.php');
-        } else {
+        else {
                 if (!isset($config)) include('config.php');
         }
        global $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3;
@@ -324,11 +329,10 @@
 }
 
 function replyPreview ($pid, $sid, $subject, $comment, $postanon, $mode, 
$order, $thold, $posttype) {
-        global $dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;
-       if(address@hidden) {
-                include('mainfile.php');
+        global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;
+       if(address@hidden)
                 include('header.php');
-        } else {
+        else {
                 if (!isset($config)) include('config.php');
         }
        global $user, $cookie;
@@ -383,8 +387,7 @@
 }
 
 function CreateTopic ($postanon, $subject, $comment, $pid, $sid, $host_name, 
$mode, $order, $thold, $posttype) {
-        global $dbhost,$dbuname,$dbpass,$dbname,$mainfile;
-       if (!$mainfile) include('mainfile.php');
+        global $dbhost,$dbuname,$dbpass,$dbname;
        global $user, $userinfo, $EditedMessage, $cookie;
        dbconnect();
        $author = FixQuotes($author);
@@ -446,6 +449,7 @@
        Header("Location: 
pollBooth.php?op=results&pollID=$sid&mode=$mode&order=$order&thold=$thold");
 }
 
+
 switch ($op) {
        case "Reply":
                reply($pid, $pollID, $mode, $order, $thold);
@@ -459,10 +463,8 @@
        case "moderate":
                if (isset($admin)) {
                        include('auth.inc.php');
-               } else {
-                       include('mainfile.php');
+               } else
                        dbconnect();
-               }
                if (($admintest==1) || ($moderate==2)) {
                        while (list($tdw, $emp) = each($HTTP_POST_VARS)) {
                                if (eregi("dkn",$tdw)) {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]