Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 6th March 2012, 14:13
Matt43 Matt43 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm also having this same MySQL Database Update Password Problem via API.

This is what i've noticed.

Updating password from ISPConfig to "test" works fine:
web_database database_password field value is updated to:
*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29

Updating password via API sites_database_update to "test" does not work:
web_database database_password field value is updated to:
098f6bcd4621d373cade4e832627b4f6

Looks like the encryption/hash used is different.
During API sites_database_add, the password is added properly.

Any help/assistance here?
Reply With Quote
Sponsored Links
  #12  
Old 6th March 2012, 14:19
Matt43 Matt43 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Just an update.

I see in database.tform.php:
Quote:
'database_password' => array (
'datatype' => 'VARCHAR',
'formtype' => 'PASSWORD',
'encryption' => 'MYSQL',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
However, there is no "encryption" type of "MYSQL" here in remoting_lib.inc.php:
Quote:
if($field['formtype'] == 'PASSWORD') {
if($field['encryption'] == 'CRYPT') {
$record[$key] = $app->auth->crypt_password(stripslashes($record[$key]));
} else {
$record[$key] = md5($record[$key]);
}
$sql_update .= "`$key` = '".$record[$key]."', ";
}
First time i've looked at the actual coding of ISPConfig so i may be wrong but i assume the lib file is missing an elseif encryption == "MYSQL"? Please advise
Reply With Quote
  #13  
Old 6th March 2012, 14:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

There is nothing missing in the current ISPConfig version and the database update function works fine. If there is something missing in your files, then you should update your server to ISPConfig 3.0.4.3.

Beside that, if you use the database update function, the password field has to be empty in case that that password has not been changed.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #14  
Old 6th March 2012, 14:27
Matt43 Matt43 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for your reply.

Did you see my last post right before your reply?

should this not be instead the following (SIMILAR to the code to INSERT):
Quote:
if($field['formtype'] == 'PASSWORD') {
if($field['encryption'] == 'CRYPT') {
$record[$key] = $app->auth->crypt_password(stripslashes($record[$key]));
$sql_update .= "`$key` = '".$record[$key]."', ";
} else if($field['encryption'] == 'MYSQL') {
$record[$key] = md5($record[$key]);
$sql_update .= "`$key` = PASSWORD('".$app->db->quote($record[$key])."'), ";
} else {
$record[$key] = md5($record[$key]);
$sql_update .= "`$key` = '".$record[$key]."', ";
}
}
Reply With Quote
  #15  
Old 6th March 2012, 14:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Yes, your right. I did not see your post. I just looked at the insert branch which has all functions and not the update branch. I will fix that in svn stable.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Matt43 (6th March 2012)
  #16  
Old 6th March 2012, 14:33
Matt43 Matt43 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

Glad i could help
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My Centos is terribly slow Galled Server Operation 9 7th December 2010 16:31
Virtual users... Ubuntu 8.04 spaceuser HOWTO-Related Questions 12 19th June 2008 09:04
LAMP System Fedora Core 6 MySQL start error gavino HOWTO-Related Questions 13 21st November 2007 20:13
postfix mysql on fedora core5 igongora Installation/Configuration 7 17th April 2007 05:40
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04


All times are GMT +2. The time now is 05:14.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.