0
Welcome Guest! Login
0 items Join Now

help needed with hacking attempt

  • help needed with hacking attempt

    Posted 17 years 9 months ago
    • Hi all,

      I'm trying to modify a module but am running into a prob:
      as soon as I enter a value for param 'user' nothing is being displayed any more.

      'submittedby' is a db field that holds the userID of the user who submitted an item
      param 'user' has been introduced so that a specific user's total downloads can be displayed

      does anybody have an idea how to fix that?
      ???
      <?php
      defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
      global $database;
      require_once ($mosConfig_absolute_path.'/components/com_remository/remository.utilities.php');
      require('components/com_remository/com_remository_settings.php');
      include_once($mosConfig_absolute_path.'/components/com_remository/language/' . $mosConfig_lang . '.php');
       
      $moduleclass_sfx = $params->get( 'moduleclass_sfx' );
      $user = $params->get( 'user' );
       
      if ($user <>'') {
      &nbsp; &nbsp; &nbsp;$sql = "SELECT SUM(downloads*count_files) from #__downloads_files WHERE submittedby == $user";
      }
      ELSE {
      &nbsp; &nbsp; &nbsp;$sql = "SELECT SUM(downloads*count_files) from #__downloads_files";
      }
       
      $database->setQuery( $sql );
      $total = $database->loadResult();
      echo "<div style=\"text-align:center\">"._DOWN_TOTAL."</div>";
      echo "<div style=\"text-align:center\">".$total."</div>";
      ?>
    • Last Edit: 17 years 9 months ago by chrissy6930.
  • Re: help needed with hacking attempt

    Posted 17 years 9 months ago
    • What is happening is you are sending '$user' to the database rather than sending the value inside $user.

      try this instead
      $sql = "SELECT SUM(downloads*count_files) from #__downloads_files WHERE submittedby == ".$user;

      Note the period between the " and $ that is for concatenating the two together.
    • www.ninjoomla.com - The Ninjoomla Open Source Extension Club
      Over 50 open source extensions and 100 videos to you build the site you want.
  • Re: help needed with hacking attempt

    Posted 17 years 9 months ago
    • thanks Daniel! that works like a charm! :D

Time to create page: 0.073 seconds