Current time: 05-23-2024, 01:12 PM Hello There, Guest! (LoginRegister)


Post Reply 
Password generator for reseller when add user
Author Message
floreno Offline


Posts: 1
Joined: Jul 2009
Reputation: 0
Post: #7
RE: Password generator for reseller when add user
I proged another quicker method.
Function: On Click on Button "PWD-Gen", the password is generated and inserted in both password-fields; after that, it is allerted with JS for human-reading.
Just copy&paste the followind JS-Function to your file "/var/www/ispcp/gui/themes/omega_original/css/ispcp.js"

Code:
function pwd_gen(f){
        chars = "234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        sp = '';
        for (i=0; i < 10; i++) {
                sp = sp + chars.charAt(Math.random()*chars.length);
        }
        if(document.getElementsByName(f)[0])document.getElementsByName(f)[0].value = sp;
        if(document.getElementsByName(f+'_repeat')[0])document.getElementsByName(f+'_repeat')[0].value = sp;
        if(document.getElementsByName(f+'_rep')[0])document.getElementsByName(f+'_rep')[0].value = sp;
        alert("Neues Zufallspasswort: \""+sp+"\"");
}

Everywhere you want the "PWD-Gen" button just copy&paste the following HTML-Tag:

Code:
<input type="button" value="PW-Gen" onclick="pwd_gen('pass');">

Example:
Original-Code from "/var/www/ispcp/gui/themes/omega_original/client/mail_add.tpl":
Code:
<tr>
                <td nowrap="nowrap" class="content2" width="200">&nbsp;&nbsp;&nbsp;&nbsp;{TR_PASSWORD}</td>
                <td nowrap="nowrap" class="content"><input type="password" name="pass" value="" style="width:210px" class="textinput"></td>
              </tr>

Changed-Code:
Added <input type="button" value="PW-Gen" onclick="pwd_gen('pass');">
Code:
<tr>
                <td nowrap="nowrap" class="content2" width="200">&nbsp;&nbsp;&nbsp;&nbsp;{TR_PASSWORD}</td>
                <td nowrap="nowrap" class="content"><input type="password" name="pass" value="" style="width:210px" class="textinput"><input type="button" value="PW-Gen" onclick="pwd_gen('pass');"></td>
              </tr>
(This post was last modified: 09-14-2009 10:05 PM by floreno.)
09-14-2009 10:03 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Password generator for reseller when add user - floreno - 09-14-2009 10:03 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)