Advertisement
Corey

Untitled

Jun 23rd, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <?php
  2.     defined('IN_CMS') || die("Don't access this file directly.");
  3.     $profileId = $main->clean($_GET['profileDest']);
  4.     $newsId = $main->clean($_GET['newsDest']);
  5.     $teamId = $main->clean($_GET['teamDest']);
  6.  
  7.     if ($_POST)
  8.     {
  9.         unset($me);
  10.         $_SESSION['username'] = strtolower($_POST['username']);
  11.         $_SESSION['password'] = $main->clean($_POST['password']);
  12.         $user_info = array('username' => $_SESSION['username']);
  13.         $me = new user($user_info, check_login);
  14.         $me->info['username_clean'] = $_SESSION['username'];
  15.  
  16.         $tpl_vars['username'] = $main->clean($_SESSION['username']);
  17.  
  18.         if(is_numeric($profileId) && $me->check_login())
  19.         {
  20.             header("Location:?module=Community&file=Users&id=" . $profileId . "#add_comment");
  21.         }
  22.  
  23.         if(is_numeric($newsId) && $me->check_login())
  24.         {
  25.             header("Location:?module=News&file=Article&id=" . $newsId ."#add_comment");
  26.         }
  27.  
  28.         if(is_numeric($teamId) && $me->check_login())
  29.         {
  30.             header("Location:?module=Community&file=Teams&id=" . $teamId ."#add_comment");
  31.         }
  32.  
  33.         if(empty($_POST['username']))
  34.         {
  35.             $messages[] = "Please enter a username.";
  36.         }
  37.  
  38.         if(empty($_POST['password']))
  39.         {
  40.             $messages[] = "Please enter a password.";
  41.         }
  42.  
  43.         if ($me->check_login())
  44.         {
  45.             $messages[] = "Successful Login.<br /><br />Continue to the <a href='?module=Your_Account'>User Cp</a>.";
  46.             $tpl_vars['success'] = true;
  47.         }
  48.         else
  49.         {
  50.             if(!empty($_POST['username']) && !empty($_POST['password']))
  51.             $messages[] = "Invalid login. Try again.";
  52.         }
  53.         $tpl_vars['messages'] = $messages;
  54.     }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement