Changeset 4376

Show
Ignore:
Timestamp:
Thu Jan 19 18:24:42 2006
Author:
mugur
Message:

fixed ticket:418 - Non-published articles are shown in List article when Preview Mode is used

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/campsite/implementation/management/priv/do_login.php

    r4245 r4376  
    14 14         incModFile ();  
    15 15     }  
    16       setcookie("TOL_UserId", $user->getUserId());  
    17       setcookie("TOL_UserKey", $user->getKeyId());  
      16     setcookie("LoginUserId", $user->getUserId());  
      17     setcookie("LoginUserKey", $user->getKeyId());  
    18 18     setcookie("TOL_Language", $selectLanguage);  
    19 19     Article::UnlockByUser($user->getUserId());  
  • trunk/campsite/implementation/management/priv/login.php

    r4242 r4376  
    7 7  
    8 8 // Delete any cookies they currently have.  
    9   setcookie("TOL_UserId", "", time() - 86400);  
    10   setcookie("TOL_UserKey", "", time() - 86400);  
      9 setcookie("LoginUserId", "", time() - 86400);  
      10 setcookie("LoginUserKey", "", time() - 86400);  
    11 11  
    12 12 // Special case for the login screen:  
  • trunk/campsite/implementation/management/priv/logout.php

    r4118 r4376  
    5 5  
    6 6 // Delete the cookies  
    7   setcookie("TOL_UserId", "", time() - 86400);  
    8   setcookie("TOL_UserKey", "", time() - 86400);  
      7 setcookie("LoginUserId", "", time() - 86400);  
      8 setcookie("LoginUserKey", "", time() - 86400);  
    9 9 session_destroy();  
    10 10  
  • trunk/campsite/implementation/management/priv/articles/preview.php

    r4122 r4376  
    38 38 }  
    39 39  
    40   setcookie("TOL_UserId", $User->getUserId(), null, "/");  
    41   setcookie("TOL_UserKey", $User->getKeyId(), null, "/");  
    42   setcookie("TOL_Access", "all", null, "/");  
    43   if ($User->hasPermission("ManageTempl") || $User->hasPermission("DeleteTempl"))  
    44       setcookie("TOL_Preview", "on", null, "/");  
    45    
    46 40 $templateObj =& new Template($templateId);  
    47 41  
      42 $accessParams = "LoginUserId=" . $User->getUserId() . "&LoginUserKey=" . $User->getKeyId()  
      43                 . "&AdminAccess=all";  
    48 44 $urlType = $publicationObj->getProperty('IdURLType');  
    49 45 if ($urlType == 1) {  
    50 46     $templateObj = & new Template($templateId);  
    51       $url = "/look/" . $templateObj->getName() . "?IdLanguage=$f_language_id"  
      47     $uri = "/look/" . $templateObj->getName() . "?IdLanguage=$f_language_id"  
    51 47         . "&IdPublication=$f_publication_id&NrIssue=$f_issue_number&NrSection=$f_section_number"  
    52           . "&NrArticle=$f_article_number";  
      48         . "&NrArticle=$f_article_number&$accessParams";  
    52 48 } else {  
    53       $url = "/" . $languageObj->getCode() . "/" . $issueObj->getUrlName()  
    54           . "/" . $sectionObj->getUrlName() . "/" . $articleObj->getUrlName();  
      49     $uri = "/" . $languageObj->getCode() . "/" . $issueObj->getUrlName()  
      50         . "/" . $sectionObj->getUrlName() . "/" . $articleObj->getUrlName() . "?$accessParams";  
    55 51 }  
    56 52  
     
    61 57 ?>  
    62 58     <FRAMESET ROWS="60%,*" BORDER="2">  
    63           <FRAME SRC="<?php print $url; ?>" NAME="body" FRAMEBORDER="1">  
      59         <FRAME SRC="<?php print "$uri&preview=on"; ?>" NAME="body" FRAMEBORDER="1">  
    63 59         <FRAME NAME="e" SRC="empty.php" FRAMEBORDER="1">  
    64 60     </FRAMESET>  
    69 65 ?>  
    70 66     <FRAMESET ROWS="100%">  
    71           <FRAME SRC="<?php print $url; ?>" NAME="body" FRAMEBORDER="1">  
      67         <FRAME SRC="<?php print $uri; ?>" NAME="body" FRAMEBORDER="1">  
    71 67     </FRAMESET>  
    72 68 <?php  
  • trunk/campsite/implementation/management/priv/issues/preview.php

    r4116 r4376  
    37 37 }  
    38 38  
    39   setcookie("TOL_UserId", $User->getUserId(), null, "/");  
    40   setcookie("TOL_UserKey", $User->getKeyId(), null, "/");  
    41   setcookie("TOL_Access", "all", null, "/");  
    42   if ($User->hasPermission("ManageTempl") || $User->hasPermission("DeleteTempl"))  
    43       setcookie("TOL_Preview", "on", null, "/");  
    44    
      39 $accessParams = "LoginUserId=" . $User->getUserId() . "&LoginUserKey=" . $User->getKeyId()  
      40                 . "&AdminAccess=all";  
    45 41 $urlType = $publicationObj->getProperty('IdURLType');  
    46 42 if ($urlType == 1) {  
    47 43     $templateObj = & new Template($templateId);  
    48       $url = "/look/" . $templateObj->getName()  
    49           . "?IdLanguage=$Language&IdPublication=$Pub&NrIssue=$Issue";  
      44     $uri = "/look/" . $templateObj->getName()  
      45         . "?IdLanguage=$Language&IdPublication=$Pub&NrIssue=$Issue&$accessParams";  
    50 46 } else {  
    51       $url = "/" . $languageObj->getCode() . "/" . $issueObj->getUrlName();  
      47     $uri = "/" . $languageObj->getCode() . "/" . $issueObj->getUrlName() . "?$accessParams";  
    51 47 }  
    52 48  
     
    56 52 ?>  
    57 53 <FRAMESET ROWS="60%,*" BORDER="1">  
    58       <FRAME SRC="<?php echo $url; ?>" NAME="body" FRAMEBORDER="1">  
      54     <FRAME SRC="<?php echo "$uri&preview=on"; ?>" NAME="body" FRAMEBORDER="1">  
    58 54     <FRAME NAME="e" SRC="empty.php" FRAMEBORDER="1">  
    59 55 </FRAMESET>  
    64 60 ?>  
    65 61     <FRAMESET ROWS="100%">  
    66           <FRAME SRC="<?php print $url; ?>" NAME="body" FRAMEBORDER="1">  
      62         <FRAME SRC="<?php print $uri; ?>" NAME="body" FRAMEBORDER="1">  
    66 62     </FRAMESET>  
    67 63 <?php  
  • trunk/campsite/implementation/management/classes/common.php

    r4085 r4376  
    30 30      
    31 31     // Check for required info.  
    32       if (!isset($p_request['TOL_UserId']) || !isset($p_request['TOL_UserKey'])  
    33           || !is_numeric($p_request['TOL_UserId']) || !is_numeric($p_request['TOL_UserKey'])) {  
      32     if (!isset($p_request['LoginUserId']) || !isset($p_request['LoginUserKey'])  
      33         || !is_numeric($p_request['LoginUserId']) || !is_numeric($p_request['LoginUserKey'])) {  
    34 34         return array($access, $user, $XPerm);  
    35 35     }  
    37 37     // Check if user exists in the table.  
    38 38     $queryStr = 'SELECT * FROM Users '  
    39                   .' WHERE Id='.$p_request['TOL_UserId'];  
    40                   //.' AND KeyId='.$p_request['TOL_UserKey'];  
      39                 .' WHERE Id='.$p_request['LoginUserId'];  
      40                 //.' AND KeyId='.$p_request['LoginUserKey'];  
    41 41     $query = mysql_query($queryStr);  
    42 42     if ($query && (mysql_num_rows($query) > 0)) {  
  • trunk/campsite/implementation/management/classes/Log.php

    r4262 r4376  
    36 36              
    37 37             // try to get the user name from the global environment  
    38               if (isset($_REQUEST['TOL_UserId'])) {  
    39                   $p_userId = $_REQUEST['TOL_UserId'];  
      38             if (isset($_REQUEST['LoginUserId'])) {  
      39                 $p_userId = $_REQUEST['LoginUserId'];  
    40 40             }  
    41 41         }  
  • trunk/campsite/implementation/parser/parser/cgiparams.h

    r1412 r4376  
    58 58 #define P_TOPIC_ID "tpid"  
    59 59 #define P_TEMPLATE_ID "tpl"  
      60 #define P_PREVIEW_MODE "preview"  
      61 #define P_DEBUG_MODE "debug"  
    60 62  
    61 63 #endif  
  • trunk/campsite/implementation/parser/parser/process_req.cpp

    r4220 r4376  
    210 210         pcoCtx->SetAddUserRes(nRes);  
    211 211         if (nRes == 0)  
    212               p_rOs << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"TOL_UserId="  
      212             p_rOs << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"LoginUserId="  
    212 212             << pcoCtx->User() << "; path=/\">\n"  
    213               << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"TOL_UserKey="  
      213             << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"LoginUserKey="  
    213 213             << pcoCtx->Key() << "; path=/\">\n";  
    214 214         pcoCtx->URL()->deleteParameter(P_USERADD);  
     
    232 232                 pcoCtx->DefURL()->deleteParameter(P_REMEMBER_USER);  
    233 233             }  
    234               p_rOs << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"TOL_UserId="  
      234             p_rOs << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"LoginUserId="  
    234 234             << pcoCtx->User() << "; path=/" << coExpires << "\">\n"  
    235               << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"TOL_UserKey="  
      235             << "<META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"LoginUserKey="  
    235 235             << pcoCtx->Key() << "; path=/" << coExpires << "\">\n";  
    236 236         }  
    240 240         pcoCtx->DefURL()->deleteParameter(P_LOGIN);  
    241 241     }  
    242       else if (p_pcoURL->getCookies().size() > 0)  
      242     else  
    242 242     {  
    243           if ((coStr = p_pcoURL->getCookie("TOL_UserId")) != "")  
      243         if ((coStr = p_pcoURL->getValue("LoginUserId")) != "")  
      244             pcoCtx->SetUser(atol(coStr.c_str()));  
      245         else if ((coStr = p_pcoURL->getCookie("LoginUserId")) != "")  
    244 246             pcoCtx->SetUser(atol(coStr.c_str()));  
    245           if ((coStr = p_pcoURL->getCookie("TOL_UserKey")) != "")  
      247         if ((coStr = p_pcoURL->getValue("LoginUserKey")) != "")  
    245 247             pcoCtx->SetKey(strtoul(coStr.c_str(), 0, 10));  
    246           if ((coStr = p_pcoURL->getCookie("TOL_Access")) != "")  
      248         else if ((coStr = p_pcoURL->getCookie("LoginUserKey")) != "")  
      249             pcoCtx->SetKey(strtoul(coStr.c_str(), 0, 10));  
      250         if ((coStr = p_pcoURL->getValue("AdminAccess")) != "")  
      251             bAccessAll = coStr == "all";  
      252         else if ((coStr = p_pcoURL->getCookie("AdminAccess")) != "")  
    247 253             bAccessAll = coStr == "all";  
    248           if ((coStr = p_pcoURL->getCookie("TOL_Preview")) != "")  
    249               bPreview = coStr == "on";  
    250           if ((coStr = p_pcoURL->getCookie("TOL_Debug")) != "")  
    251               bTechDebug = coStr == "on";  
      254         bPreview = p_pcoURL->getValue(P_PREVIEW_MODE) == "on";  
      255         bTechDebug = p_pcoURL->getValue(P_DEBUG_MODE) == "on";  
    252 256     }  
    253 257     if ((coStr = p_pcoURL->getValue(P_USERMODIFY)) != "")