Ignore:
Timestamp:
Apr 6, 2020, 11:56:19 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Do not use parenthesis around returned value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/UserModel.php

    r873 r874  
    3030  function Hash($Password, $Salt)
    3131  {
    32     return (sha1(sha1($Password).$Salt));
     32    return sha1(sha1($Password).$Salt);
    3333  }
    3434
    3535  function Verify($Password, $Salt, $StoredHash)
    3636  {
    37     return ($this->Hash($Password, $Salt) == $StoredHash);
     37    return $this->Hash($Password, $Salt) == $StoredHash;
    3838  }
    3939
     
    177177      }
    178178    }
    179     return ($Result);
     179    return $Result;
    180180  }
    181181
     
    195195      } else $Output = PASSWORDS_UNMATCHED;
    196196    } else $Output = USER_NOT_FOUND;
    197     return ($Output);
     197    return $Output;
    198198  }
    199199
     
    231231      }
    232232    } else $Result = USER_NOT_REGISTRED;
    233     return ($Result);
     233    return $Result;
    234234  }
    235235
     
    240240    $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']);
    241241    $this->Check();
    242     return (USER_LOGGED_OUT);
     242    return USER_LOGGED_OUT;
    243243  }
    244244
     
    271271      $Result[$DbRow['Description']][$DbRow['Title']] = $Value;
    272272    }
    273     return ($Result);
     273    return $Result;
    274274  }
    275275
     
    296296      {
    297297        if ($DbRow['AssignedGroup'] != '')
    298         if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true);
     298        if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
    299299      }
    300300    }
     
    314314    if ($PermissionExists)
    315315    {
    316       return ($this->PermissionGroupCacheOp[$GroupId.','.$OperationId]);
    317     }
    318     return (false);
     316      return $this->PermissionGroupCacheOp[$GroupId.','.$OperationId];
     317    }
     318    return false;
    319319  }
    320320
     
    327327      $DbRow = $DbResult->fetch_assoc();
    328328      $ModuleId = $DbRow['Id'];
    329     } else return (false);
     329    } else return false;
    330330
    331331    // First try to check cache
     
    358358      // Check user-operation relation
    359359      $DbResult = $this->Database->select('PermissionUserAssignment', '*', $UserCondition.' AND (`AssignedOperation`="'.$OperationId.'")');
    360       if ($DbResult->num_rows > 0) return (true);
     360      if ($DbResult->num_rows > 0) return true;
    361361
    362362      // Check user-group relation
     
    364364      while ($DbRow = $DbResult->fetch_array())
    365365      {
    366        if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true);
    367       }
    368       return (false);
    369     } else return (false);
     366       if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true;
     367      }
     368      return false;
     369    } else return false;
    370370  }
    371371
     
    394394      $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
    395395    } else $Output = USER_PASSWORD_RECOVERY_FAIL;
    396     return ($Output);
     396    return $Output;
    397397  }
    398398
     
    414414      } else $Output = PASSWORDS_UNMATCHED;
    415415    } else $Output = USER_NOT_FOUND;
    416     return ($Output);
     416    return $Output;
    417417  }
    418418
     
    425425      $User = new User($this->System);
    426426      $User->User = array('Id' => $DbRow['User']);
    427       return ($User->CheckPermission($Module, $Operation));
    428     } else return (false);
     427      return $User->CheckPermission($Module, $Operation);
     428    } else return false;
    429429  }
    430430}
Note: See TracChangeset for help on using the changeset viewer.