Customer Signup Configuration

Moderator: crythias

Locked
aolgin
Znuny newbie
Posts: 21
Joined: 03 Jun 2013, 17:44
Znuny Version: 3.2.7

Customer Signup Configuration

Post by aolgin »

I've been attempting to make it so that when a customer signs up, he defines and confirms his own password. Also, I would like to implement certain criteria for a password, seeing as there is not one by default. I've set up the text boxes in HTML, but I lack much experience in Javascript and MySQL. How would I go about setting this up? I know the defaults are that the password is randomly generated and sent to the customer's email, but if I can manage to get this up and running, it will be much better for my company. Any help is appreciated.

Also, assuming I can get the define your own password to work, how can I make it check that the two passwords are the same?

My OTRS version is 3.2.7 and is installed on a Windows 2008 R2 Datacenter 64-bit server.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: Customer Signup Configuration

Post by eandrex »

I have been messing with otrs configuration to get working what you just said(user set his own password)

first off: i read this: http://doc.otrs.org/3.2/en/html/custome ... ation.html

so in my config.pm i have something like..

Code: Select all

# CustomerUser
# (customer database backend and settings)
$Self->{CustomerUser} = {
    Name => 'Database Backend',
    Module => 'Kernel::System::CustomerUser::DB',
    Params => {
        # if you want to use an external database, add the
        # required settings
#        DSN => 'DBI:odbc:yourdsn',
#        DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
#        User => '',
#        Password => '',
        Table => 'customer_user',
    },
    # customer unique id
    CustomerKey => 'login',
    # customer #
    CustomerID => 'customer_id',
    CustomerValid => 'valid_id',
    CustomerUserListFields => ['first_name', 'last_name', 'email'],
#    CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
    CustomerUserSearchFields => ['login', 'last_name', 'customer_id'],
    CustomerUserSearchPrefix => '',
    CustomerUserSearchSuffix => '*',
    CustomerUserSearchListLimit => 250,
    CustomerUserPostMasterSearchFields => ['email'],
    CustomerUserNameFields => ['title', 'first_name', 'last_name'],
    CustomerUserEmailUniqCheck => 1,
#    # show not own tickets in customer panel, CompanyTickets
#    CustomerUserExcludePrimaryCustomerID => 0,
#    # generate auto logins
#    AutoLoginCreation => 0,
#    AutoLoginCreationPrefix => 'auto',
#    # admin can change customer preferences
#    AdminSetPreferences => 1,
#    # cache time to live in sec. - cache database queries
#    CacheTTL => 0,
#    # just a read only source
#    ReadOnly => 1,
    Map => [

        # note: Login, Email and CustomerID needed!
        # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
        [ 'UserTitle',      'Title',      'title',       1, 0, 'var', '', 0 ],
        [ 'UserFirstname',  'Firstname',  'first_name',  1, 1, 'var', '', 0 ],
        [ 'UserLastname',   'Lastname',   'last_name',   1, 1, 'var', '', 0 ],
        [ 'UserLogin',      'Username',   'login',       1, 1, 'var', '', 0 ],
        [ 'UserPassword',   'Password',   'pw',          1, 1, 'var', '', 0 ],
        [ 'UserEmail',      'Email',      'email',       1, 1, 'var', '', 0 ],
        [ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
        [ 'UserPhone',      'Phone',      'phone',       1, 0, 'var', '', 0 ],
        [ 'UserFax',        'Fax',        'fax',         1, 0, 'var', '', 0 ],
        [ 'UserMobile',     'Mobile',     'mobile',      1, 0, 'var', '', 0 ],
        [ 'UserRoom',       'Room',       'room',        1, 0, 'var', '', 0 ],
        [ 'UserStreet',     'Street',     'street',      1, 0, 'var', '', 0 ],
        [ 'UserZip',        'Zip',        'zip',         1, 0, 'var', '', 0 ],
        [ 'UserCity',       'City',       'city',        1, 0, 'var', '', 0 ],
        [ 'UserCountry',    'Country',    'country',     1, 0, 'var', '', 0 ],
        [ 'UserComment',    'Comment',    'comments',    1, 0, 'var', '', 0 ],
        [ 'ValidID',        'Valid',      'valid_id',    0, 1, 'int', '', 0 ],
    ],
    # default selections
    Selections => {
        UserTitle => {
            'Mr.' => 'Mr.',
            'Mrs.' => 'Mrs.',
        },
    },
};
 
notice [ 'UserPassword', 'Password', 'pw', 1, 1, 'var', '', 0 ]

so password is shown and it is required

after that, i edited CustomerLogin.dtl

and i added this before submit button:
<div class="NewLine">
<label class="Mandatory" for="Password"><span class="Marker">*</span> $Text{"Password"}</label>
<input name="Password" type="password" id="Password" value="$QData{"UserPassword"}" class="W50pc Validate_Required" />
<div id="PasswordError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
</div>
and now i can see the password input in my singup form..however, when user submits the form, otrs still keep generating a random password..

and by the way, i think otrs is not taking my changes of my config.pm because i set CustomerUserEmailUniqCheck to 0, and i cant create two users with same email..

and finally, i took a look at
\Kernel\System\CustomerUser\DB.pm

and there is a method(sub) called CustomerUserAdd
where at the end it "asks" for user password(i guess)

Code: Select all

if ( $Param{UserPassword} ) {
        $Self->SetPassword( UserLogin => $Param{UserLogin}, PW => $Param{UserPassword} );
    }
so if i send my password via post, why is it still creating a random password?

if someone can help..thank you :)

edit: otrs 3.2.9 running on windows server(iis and sql server)
Locked