aktuelle.kurse/m133/Weiteres/Modul_Unterlagen_133_VO/01 Modulinhalte/80 Beispiele/login 1/include/function.inc

56 lines
1.5 KiB
PHP
Raw Normal View History

2022-02-24 09:37:43 +01:00
<?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 <20> Aenderung **/
/* 3.03.14<EFBFBD> **/
/* <20> **/
/* <20> **/
/* <20> **/
/* <20> **/
/*************************************************/
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;
}
?>