Welcome to Geeklog Saturday, October 21 2017 @ 11:01 pm EDT


Status: offline

testaccount2

Forum User
Newbie
Registered: 27/05/2015
Posts: 2
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!

All times are EDT. The time is now 11:01 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content