Conversion from MD5 to SHA-1. Passwords stored as SHA-1.
[openemr.git] / interface / login / validateUser.php
blob569571df7ef4fdba0f95b52e04f9a9cdba2a26b7
1 <?php
2 //VicarePlus :: This file checks the hashing algorithm used for the password in the initial login.
3 //VicarePlus :: This file is called by a jquery function in login.php
4 $ignoreAuth=true;
5 include_once("../globals.php");
6 include_once("$srcdir/sql.inc");
7 $user = $_GET['u'];
8 $authDB = sqlQuery("select password,length(password) as passlength from users where username = '$user'");
9 $passlength = $authDB['passlength'];
10 $pw = $authDB['password'];
11 //VicarePlus :: If the length of the password is 32, 'md5' hashing algorithm is used.
12 if ($passlength == 32)
14 echo "0";
16 //VicarePlus :: If the length of the password is 40, 'sha1' hashing algorithm is used.
17 else if($passlength == 40)
19 echo "1";