Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 108760 Details for
Bug 242011
mysql ENCRYPT not available on windows - hinders development
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch to allow authentication on both windows and linux
patch-242011.txt (text/plain), 3.26 KB, created by
Matthew Mazaika
on 2008-07-30 11:30:28 EDT
(
hide
)
Description:
patch to allow authentication on both windows and linux
Filename:
MIME Type:
Creator:
Matthew Mazaika
Created:
2008-07-30 11:30:28 EDT
Size:
3.26 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.babel >Index: server/classes/system/user.class.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/classes/system/user.class.php,v >retrieving revision 1.4 >diff -u -r1.4 user.class.php >--- server/classes/system/user.class.php 29 Nov 2007 21:00:26 -0000 1.4 >+++ server/classes/system/user.class.php 30 Jul 2008 15:23:11 -0000 >@@ -36,34 +36,50 @@ > $email = $App->sqlSanitize($email, $dbh); > $password = $App->sqlSanitize($password, $dbh); > >- $sql = "SELECT * >- FROM >- users >- WHERE email = '$email' >- AND password_hash = ENCRYPT('$password', password_hash)"; >- $result = mysql_query($sql, $dbh); >- if($result && mysql_num_rows($result) > 0) { >- $rValue = true; >- $myrow = mysql_fetch_assoc($result); >+ // since MySQL ENCRYPT is not supported on windows we have to move encryption >+ // from the database layer out to the application layer >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=242011 >+ >+ $hash_query = "SELECT users.password_hash FROM users WHERE email = '$email'"; >+ $hash_result = mysql_query($hash_query, $dbh); >+ >+ if ($hash_result && mysql_num_rows($hash_result) > 0) { > >- $this->userid = $myrow['userid']; >- $this->username = $myrow['username']; >- $this->first_name = $myrow['first_name']; >- $this->last_name = $myrow['last_name']; >- $this->email = $myrow['email']; >- $this->primary_language_id = $myrow['primary_language_id']; >- $this->is_committer = $myrow['is_committer']; >- $this->hours_per_week = $myrow['hours_per_week']; >- $this->updated_on = $myrow['updated_on']; >- $this->updated_at = $myrow['updated_at']; >- $this->created_on = $myrow['created_on']; >- $this->created_at = $myrow['created_at']; >- >- } >- else { >+ $hash_row = mysql_fetch_assoc($hash_result); >+ $hash = $hash_row['password_hash']; >+ >+ $sql = "SELECT * >+ FROM >+ users >+ WHERE email = '$email' >+ AND password_hash = '" . crypt($password, $hash) . "'"; >+ >+ $result = mysql_query($sql, $dbh); >+ if($result && mysql_num_rows($result) > 0) { >+ $rValue = true; >+ $myrow = mysql_fetch_assoc($result); >+ >+ $this->userid = $myrow['userid']; >+ $this->username = $myrow['username']; >+ $this->first_name = $myrow['first_name']; >+ $this->last_name = $myrow['last_name']; >+ $this->email = $myrow['email']; >+ $this->primary_language_id = $myrow['primary_language_id']; >+ $this->is_committer = $myrow['is_committer']; >+ $this->hours_per_week = $myrow['hours_per_week']; >+ $this->updated_on = $myrow['updated_on']; >+ $this->updated_at = $myrow['updated_at']; >+ $this->created_on = $myrow['created_on']; >+ $this->created_at = $myrow['created_at']; >+ >+ } else { >+ // password failed >+ $GLOBALS['g_ERRSTRS'][1] = mysql_error(); >+ } >+ } else { >+ // username failed > $GLOBALS['g_ERRSTRS'][1] = mysql_error(); >- } >- >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
denis.roy
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 242011
: 108760