Subject: How to add support for password sign-up (gl-2.1.0)

Posted on: 15/07/2015 01:35pm
By: testaccount2

The following steps will disable sending the signup password by email, and allow users to enter their own password on signup.

public/layout/modern_curve/users/registrationform.thtml:
> Add password element to form:
> Also remove second email input.
PHP Formatted Code
<dt><label for="registrationform-passwd">{lang_passwd}</label></dt>
<dd><input type="password" size="32" maxlength="96" name="passwd" value="{passwd}" id="registrationform-passwd" class="text"{xhtml}></dd>


public/users.php:
-Disable mail submission by faking result confirm @Ln:84
PHP Formatted Code
$mailresult = true;


-Add $passwd variable to function createuser @Ln:197:
PHP Formatted Code
function createuser ($username, $email, $email_conf, $passwd)


-Add $passwd variable to $uid var; @Ln:247
PHP Formatted Code
$uid = USER_createAccount ($username, $email, $passwd);


-Add label:@Ln:358
PHP Formatted Code
$user_templates->set_var('lang_passwd', "Password");


-Add to form build:@Ln:381
PHP Formatted Code
$passwd = '';
    if (!empty ($_POST['passwd'])) {
        $passwd = COM_applyFilter ($_POST['passwd']);
    }
$user_templates->set_var ('passwd', $passwd);


-Add $passwd and $display under case 'create':@Ln:671:
PHP Formatted Code
} else {
$email = COM_applyFilter ($_POST['email']);
$email_conf = COM_applyFilter ($_POST['email_conf']);
$passwd = COM_applyFilter ($_POST['passwd']);
$display .= createuser(COM_applyFilter ($_POST['username']), $email, $email_conf, $passwd);
}


-Remove "&& ($email === $email_conf)" from email check @ Ln:211:
PHP Formatted Code
if (COM_isEmail ($email) && !empty ($username)
    && !USER_emailMatches ($email, $_CONF['disallow_domains'])
    && (strlen ($username) <= 16)) {
 


private/system/lib-user.php:
-Remove [= ''] definition from $password line 238:
PHP Formatted Code
function USER_createAccount($username, $email, $passwd, $fullname = ''[...]


Confirmed working on fresh install of Geeklog v2.1.0

If anything is unclear, let me know!

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=96119