Advertisement
Guest User

Kod php

a guest
Feb 18th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.47 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. session_start();
  4. include_once('db_inc.php');
  5. include_once($basefilepath.'functions/general.php');
  6. include_once($basefilepath.'classes/ado.php');
  7. include_once($basefilepath.'classes/core.php');
  8. include_once($basefilepath.'classes/user.php');
  9. include_once($basefilepath.'classes/file_manager.php');
  10.  
  11.  
  12. $redirect_to =  $siteName."download/".$_GET['file_id']."-".urlencode($file->getFileName($_GET['file_id']));
  13. if(!$objuser->isUserLoggedIn()){
  14.    
  15.     $core->setMessage('You Should Be Logged In For Premium Download',-1);
  16.     header("location:$siteName");  
  17.     exit();
  18. }
  19.  
  20. if(isset($_GET['file_id'])){
  21.  
  22.     if($objuser->isPremiumUser($_SESSION['user_id'])){ // checks if the user is premium member
  23.        
  24.         if($objuser->isSubscriptionPlanValid($_SESSION['user_id'])){// checks if the plan has been expired
  25.        
  26.             if(!$objuser->isMaximumDownloadExceeded($_SESSION['user_id'])){     // checks if the max download per day exceeded
  27.                
  28.                 header("location:$siteName"."includes/download_new.php?id=$_GET[file_id]&dtype=premium&extra=extra");
  29.                 exit();
  30.             }
  31.             else{
  32.                 $core->setMessage('Maximum Download For Today Exceeded.','-1');
  33.                 header("location:$redirect_to");   
  34.                 exit();
  35.             }  
  36.         }
  37.         else{
  38.             $core->setMessage('Your Premium Member Subsrciption Plan Has Been Expired.','-1');
  39.             header("location:$redirect_to");   
  40.             exit();
  41.         }  
  42.     }
  43.     else{
  44.         $core->setMessage('You Are Not A Premium Member.','-1');
  45.         header("location:$redirect_to");   
  46.         exit();
  47.     }  
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement