Skip to content

Commit

Permalink
Fix broken signup
Browse files Browse the repository at this point in the history
- Fix php error when user clicks signup.
- Revert change to `auth_can_change_password` custom function.

Fixes #22744
  • Loading branch information
vboctor committed Apr 19, 2017
1 parent 4de6f28 commit 3f7aa4b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
9 changes: 1 addition & 8 deletions core/authentication_api.php
Expand Up @@ -257,14 +257,7 @@ function auth_can_set_password( $p_user_id = null ) {
return false;
}

$t_can_change = array(
PLAIN,
CRYPT,
CRYPT_FULL_SALT,
MD5,
);

return in_array( config_get( 'login_method' ), $t_can_change );
return helper_call_custom_function( 'auth_can_change_password', array() );
}

/**
Expand Down
9 changes: 8 additions & 1 deletion core/custom_function_api.php
Expand Up @@ -269,7 +269,14 @@ function custom_function_default_issue_delete_notify( $p_issue_id ) {
* @return boolean
*/
function custom_function_default_auth_can_change_password() {
return auth_can_set_password();
$t_can_change = array(
PLAIN,
CRYPT,
CRYPT_FULL_SALT,
MD5,
);

return in_array( config_get( 'login_method' ), $t_can_change );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion signup.php
Expand Up @@ -72,7 +72,7 @@
}

if( ON == config_get( 'signup_use_captcha' ) && get_gd_version() > 0 &&
auth_can_set_password( NO_USER ) ) {
helper_call_custom_function( 'auth_can_change_password', array() ) ) {
# captcha image requires GD library and related option to ON
require_lib( 'securimage/securimage.php' );

Expand Down
5 changes: 3 additions & 2 deletions signup_page.php
Expand Up @@ -103,7 +103,7 @@
</label>

<?php
$t_allow_passwd_change = auth_can_set_password( NO_USER );
$t_allow_passwd_change = helper_call_custom_function( 'auth_can_change_password', array() );

# captcha image requires GD library and related option to ON
if( ON == config_get( 'signup_use_captcha' ) && get_gd_version() > 0 && $t_allow_passwd_change ) {
Expand Down Expand Up @@ -141,10 +141,11 @@

<?php
}

if( !$t_allow_passwd_change ) {
echo '<div class="space-10"></div>';
echo '<div class="alert alert-danger">';
echo auth_password_managed_elsewhere_message();
echo lang_get( 'no_password_change' );;
echo '</div>';
}
?>
Expand Down

0 comments on commit 3f7aa4b

Please sign in to comment.