aktuelle.kurse/oldies/m133/5_Vorlagen-und-Loesungen/Login_B/include/function.inc
Müller Harald 3fdacd20c0 muh
2022-07-28 09:14:44 +02:00

56 lines
1.5 KiB
PHP

<?php
/*************************************************/
/** M151 DB Multi DB Connection **/
/** Author: M. von Orelli **/
/** Datum: 5. 3.2014 **/
/** Version: 1.0 **/
/** Applikation:Theorie **/
/** **/
/** Filename: function.inc **/
/** Include Files:5_tier.php **/
/*************************************************/
/*************************************************/
/* Datum ¦ Aenderung **/
/* 3.03.14¦ **/
/* ¦ **/
/* ¦ **/
/* ¦ **/
/* ¦ **/
/*************************************************/
function check_user_password($cConnection, $cName, $cPassword)
{
// Check User Password conbination
// Return Value is true for valid User, Password Combination
// is false for invalid User, Password combination
// $Query = "CALL sps_check_login('". $cName. "','". $cPassword."')"; //MySQL Ausfuehrung
$Query = "EXEC sps_check_login '". $cName. "','". $cPassword."'"; //MSSQL Ausfuehrung
// echo $Query;
//Execution of Querry
$result = odbc_exec($cConnection,$Query );
//Read database date
while($row= odbc_fetch_array($result))
{
$logon_status = $row["logon_status"];
}
// Verify User, Password combination
if ($logon_status > 0)
{
return 1;
}
return -1;
}
?>