MYSQL - isp_isp_user empty fields

Discussion in 'Installation/Configuration' started by kyriakos, Mar 3, 2006.

  1. kyriakos

    kyriakos New Member

    I notice that isp_isp_user/user_passwort and status are empty.
    This is hapening when I create a new or update an existing mail user.
    How can I fix it?
  2. falko

    falko Super Moderator ISPConfig Developer

    You don't have to fix it because it's intended like that. The password is stored in isp_isp_user only for a short moment after you've created the user; after it has been written to /etc/shadow it is removed from isp_isp_user for security reasons (imagine someone hacks your MySQL database and finds all those passwords...).
    The status field is only for internal use.
  3. kyriakos

    kyriakos New Member

    Thanks falko,
    I'm trying to setup postfix to use ispconfig db instead of a custom mysql database. I'm thinking that this is possible because all needed information are already stored on ispconfig db. I think a litle hack in ispconfig_isp_user.lib.php may help me. I don't know exactly and script comments in German don't help me.
    I can use some help here.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    First you will have to add a new password field. You cannot use the current field for postfix authentication because ISPConfig needs to prepend some chracters to the password to recognize if its encrypted.

    Then you will have to add some code in the file /home/admispconfig/ispconfig/lib/ispconfig_isp_user.lib.php

    in the functions user_insert and user_upadate

    after the lines:

    if($go_info["server"]["password_hash"] == 'crypt') {
    $passwort = "||||:".crypt($user["user_passwort"],substr($user["user_passwort"],0,2));
    } else {
    $passwort = "||||:". crypt(stripslashes($user["user_passwort"]), "$1$".md5(time()) );
    $go_api->db->query("UPDATE isp_isp_user SET user_passwort = '$passwort' where doc_id = '$doc_id'");

    That stores a password value without the prepended "||||:" in your password field. Do not change the way ISPConfig stores the values in the current password field or you will break the software!
  5. kyriakos

    kyriakos New Member

    I put these fiew lines under user_insert & user_update functions. Its working for password. What variable I have to use in order to create an mail address record? ($mailemail)

    ///Kyriakos hack 3-3-06<
    $mailpasswort = crypt($user["user_passwort"],substr($user["user_passwort"],0,2));
    $go_api->db->query("UPDATE isp_isp_user SET mail_passwort = '$mailpasswort' where doc_id = '$doc_id'");

    $mailemail = $user["user_email"]."@"."$?????????";
    $go_api->db->query("UPDATE isp_isp_user SET mail_email = '$mailemail' where doc_id = '$doc_id'");
    ///Kyriakos hack 3-3-06>


Share This Page