View Single Post
  #2  
Old 18th August 2006, 20:25
julez julez is offline
Junior Member
 
Join Date: Jan 2006
Location: Berlin, Germany
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default FIXED: Generate username from email-address

Hi forum,

i found a quick'n'dirty solution on my own to make it work:

Code:
                // neuer Username
                if($user_prefix != '') {
                        // Mit User-Prefix
                        $len_textbox = ((30 - strlen($user_prefix)) < 10)? 10: 29 - strlen($user_prefix);
                        // PRE-MOD $out_user = $user_prefix.'<input type="text" name="plugin[user]" size="'.$len_textbox.'" maxlength="'.(32 - strlen($user_prefix)).'" class="text" >';
                        $out_user = $user_prefix.'<input type="text" name="plugin[user]" size="'.$len_textbox.'" maxlength="'.(32 - strlen($user_prefix)).'" class="text" readonly="readonly" >';
                } else {
                        //Ohne User-Prefix
                        $out_user = $user_prefix.'<input type="text" name="plugin[user]" size="30" maxlength="32" class="text">';
                }
        $go_api->renderer->element_jscript_nummer++;
        }

        /****************************************************
        * Emailadresse vorbereiten
        *****************************************************/

        //if($go_api->db->queryOneRecord("SELECT * FROM isp_isp_domain, isp_dep, isp_nodes WHERE isp_isp_domain.doc_id = isp_dep.child_doc_id AND isp_isp_domain.doctype_id = isp_dep.child_doctype_id AND isp_dep.parent_doctype_id = ".$web['doctype_id']." AND isp_dep.p
          //PRE-MOD $out_email = '<input type="text" name="plugin[email]" size="10" maxlength="32" class="text" value="'.$user["user_email"].'">@'.$web["web_domain"];
          $out_email = '<input type="text" name="plugin[email]" size="10" maxlength="32" class="text" value="'.$user["user_email"].'" onKeyUp="document.forms[0].elements[2].value = document.forms[0].elements[1].value" >@'.$web["web_domain"];
Just check the code parts marked in red and you'll see.

jz

Last edited by julez; 18th August 2006 at 20:32.
Reply With Quote