<?php
// $Id: isAdmin.php,v 1.1 2004/07/11 10:28:45 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: i-Tech (Half-Dead)
// Author Website : http://www.i-Technology.NET
// License Type   : LGPL: See /manual/LICENSES/LGPL.txt
// ------------------------------------------------------------------------- //

// Change to fit your servers access scheme:
function login($user, $pass) {
global $db;

$query = $db->query("SELECT uid FROM " .$db->prefix("users"). " WHERE uname='$user' AND pass=MD5('$pass')");
list($uid) = $db->fetch_row($query);

if (!$uid) {
	trigger_error(_phpRPC_NoSuch, E_USER_ERROR);
}

$xoopsUser   = new XoopsUser($uid);
$xoopsModule = XoopsModule::getByDirname("news");

if ( $xoopsModule && $xoopsUser->isAdmin($xoopsModule->mid()) ) {
	define("isAdmin", 1);
}

return $uid;
}
?>
