09 Auto Confirm User - Config Option

Started by Mindless, July 22, 2012, 01:54:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

Add to config.php :

Code (php) Select
//==Auto confirm no email
define ('EMAIL_CONFIRM',true);


So it goes like this..

Code (php) Select
$editsecret = ( !$arr[0] ? "" : make_passhash_login_key() );

Becomes

Code (php) Select
$editsecret = ( !$arr[0]  ? "" : EMAIL_CONFIRM ? make_passhash_login_key() : "");

This

Code (php) Select
$ret = sql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added, last_access, time_offset, dst_in_use) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, (!$arr[0]?'confirmed':'pending')))).
", ". (!$arr[0]?UC_SYSOP.", ":""). "". TIME_NOW ." ,". TIME_NOW ." , $time_offset, {$dst_in_use['tm_isdst']})");


Becomes :

Code (php) Select
$ret = sql_query("INSERT INTO users (username, passhash, secret, editsecret, email, status, ". (!$arr[0]?"class, ":"") ."added, last_access, time_offset, dst_in_use) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, (!$arr[0] || !EMAIL_CONFIRM ? 'confirmed' : 'pending')))).
", ". (!$arr[0] ? UC_SYSOP.", " : ""). "". TIME_NOW ." ,". TIME_NOW ." , $time_offset, {$dst_in_use['tm_isdst']})");


This

Code (php) Select
if($arr[0])

Becomes

Code (php) Select
if($arr[0] || EMAIL_CONFIRM)

This

Code (php) Select
header("Refresh: 0; url=ok.php?type=". (!$arr[0]?"sysop":("signup&email=" . urlencode($email))));

Becomes

Code (php) Select
header("Refresh: 0; url=ok.php?type=".(!$arr[0] ? "sysop" : EMAIL_CONFIRM ? ("signup&email=".urlencode($email)) :"confirm"));

Small matter of edit to lang_ok.php depending how your running job done. True is email confirm on - false is email confirm off.