Browse Source

#19 - permission check in system files

Alex Trofimov 13 years ago
parent
commit
0e8bf16934

+ 2 - 2
inc/classes/BxDolAccount.php

@@ -281,7 +281,7 @@ class BxDolAccount extends BxDol {
      */
     static public function isAllowedCreate ($iProfileId, $isPerformAction = false) {
         $aCheck = checkActionModule($iProfileId, 'create account', 'system', $isPerformAction);
-        if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED)
+        if ($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
             return MsgBox($aCheck[CHECK_ACTION_MESSAGE]);
         return CHECK_ACTION_RESULT_ALLOWED;
     }
@@ -308,7 +308,7 @@ class BxDolAccount extends BxDol {
      */
     static public function isAllowedDelete ($iProfileId, $aContentInfo, $isPerformAction = false) {
         $aCheck = checkActionModule($iProfileId, 'delete account', 'system', $isPerformAction);
-        if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED)
+        if ($aCheck[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED)
             return MsgBox($aCheck[CHECK_ACTION_MESSAGE]);
         return CHECK_ACTION_RESULT_ALLOWED;
     }

+ 1 - 1
inc/classes/BxDolAcl.php

@@ -167,7 +167,7 @@ class BxDolAcl extends BxDol implements iBxDolSingleton {
      * $aResult[CHECK_ACTION_MESSAGE] contains a message with detailed information about the result,
      * already processed by the language file
      *
-     * if $aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED then this node contains
+     * if $aResult[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED then this node contains
      * an empty string
      *
      * The error messages themselves are stored in the language file. Additional variables are

+ 2 - 2
inc/classes/BxDolCmts.php

@@ -391,14 +391,14 @@ class BxDolCmts extends BxDol
     {
         $iId = $this->_getAuthorId();
         $check_res = checkAction($iId, $iAction, $isPerformAction);
-        return $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
+        return $check_res[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED;
     }
 
     function checkActionErrorMsg ($iAction)
     {
         $iId = $this->_getAuthorId();
         $check_res = checkAction($iId, $iAction);
-        return $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED ? $check_res[CHECK_ACTION_MESSAGE] : '';
+        return $check_res[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $check_res[CHECK_ACTION_MESSAGE] : '';
     }
 
     function isRateAllowed ($isPerformAction = false)

+ 1 - 1
inc/classes/BxDolTwigModule.php

@@ -1593,7 +1593,7 @@ class BxDolTwigModule extends BxDolModule {
         if (!defined($sMembershipActionConstant))
             return false;
         $aCheck = checkAction(getLoggedId(), constant($sMembershipActionConstant));
-        return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
+        return $aCheck[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED;
     }
 
     function _formatSnippetText ($aEntryData, $iMaxLen = 300) {