<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

//login
global $userID, $loggedin;

$userID = 0;

$loggedin=false;
if(isset($_SESSION['ws_auth'])) {
  if(stristr($_SESSION['ws_auth'], "userid")===FALSE){
    $authent = explode(":", $_SESSION['ws_auth']);
           $ws_user = $authent[0];
	  $ws_pwd = $authent[1];
           $check = safe_query("SELECT userID FROM ".PREFIX."user WHERE userID='$ws_user' AND password='$ws_pwd'");
	  while($ds=mysql_fetch_array($check)) {
             $loggedin=true;
	    $userID=$ds['userID'];
           }
  }
  else {
    die();
  }

}

?>