<?php
/* $Id: sql.inc.php,v 1.9 2003/09/27 17:01:08 k-fish Exp $ */

function authentify_user($user, $pass, $encrypted_pwd=''){
    global $conn;

    if ($encrypted_pwd == '') $encrypted_pwd = md5($pass);

    $sql = "SELECT id FROM mgw_users WHERE username=".$conn->QMagic($user)." AND pw=".$conn->QMagic($encrypted_pwd);
    if(!$res = $conn->Execute($sql)) exit(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));

    return $res->NumRows();
}
?>
