Commit 69582ab0 authored by andreymaximov's avatar andreymaximov Committed by hass
Browse files

[user:name-raw] token checks are incorrect

parent 18e71236
......@@ -51,7 +51,7 @@ function realname_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
if (!strpos(variable_get('user_mail_register_admin_created_body', FALSE), '[user:name-raw]')) {
if (strpos(variable_get('user_mail_register_admin_created_body', FALSE), '[user:name-raw]') === FALSE) {
$requirements['user_mail_register_admin_created_body'] = array(
'title' => t('E-mail: "Welcome (new user created by administrator)" template'),
'value' => t('Not configured'),
......@@ -59,7 +59,7 @@ function realname_requirements($phase) {
'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template, if using username for login.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-admin-created')))),
);
}
if (!strpos(variable_get('user_mail_register_no_approval_required_body', FALSE), '[user:name-raw]')) {
if (strpos(variable_get('user_mail_register_no_approval_required_body', FALSE), '[user:name-raw]') === FALSE) {
$requirements['user_mail_register_no_approval_required_body'] = array(
'title' => t('E-mail: "Welcome (no approval required)" template'),
'value' => t('Not configured'),
......@@ -67,7 +67,7 @@ function realname_requirements($phase) {
'description' => t('Replace the token <code>[user:name]</code> with <code>[user:name-raw]</code> in <a href="@people">e-mail</a> template, if using username for login.', array('@people' => url('admin/config/people/accounts', array('fragment' => 'edit-email-no-approval-required')))),
);
}
if (!strpos(variable_get('user_mail_status_activated_body', FALSE), '[user:name-raw]')) {
if (strpos(variable_get('user_mail_status_activated_body', FALSE), '[user:name-raw]') === FALSE) {
$requirements['user_mail_status_activated_body'] = array(
'title' => t('E-mail: "Account activation" template'),
'value' => t('Not configured'),
......
......@@ -430,7 +430,7 @@ function realname_form_user_admin_settings_alter(&$form, &$form_state, $form_id)
function realname_username_raw_token_validate(&$element, &$form_state) {
$value = isset($element['#value']) ? $element['#value'] : $element['#default_value'];
if (!strpos($value, '[user:name-raw]')) {
if (strpos($value, '[user:name-raw]') === FALSE) {
drupal_set_message(t('The %element-title does not contain the <code>[user:name-raw]</code> token, which is necessary when using username for login when the Real Name module is enabled.', array('%element-title' => $element['#title'])), 'warning');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment