summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-12 04:30:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-12 04:30:09 +0000
commitf76acb2d9d421ff705be6fd2713b8cc2c007e1df (patch)
tree9fe17e06724737f1a6579cf1a889a1222885412f /modules/user
parenta765e882ebf89969e81335a6df4fddb23d27095f (diff)
downloadbrdo-f76acb2d9d421ff705be6fd2713b8cc2c007e1df.tar.gz
brdo-f76acb2d9d421ff705be6fd2713b8cc2c007e1df.tar.bz2
#282405 by Damien Tournoud, lilou, Dave Reid: Enforce coding standard on elseif.
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.admin.inc6
-rw-r--r--modules/user/user.module22
-rw-r--r--modules/user/user.pages.inc2
3 files changed, 15 insertions, 15 deletions
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 84a1c79c2..d2129da70 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -666,7 +666,7 @@ function user_admin_role_validate($form, &$form_state) {
form_set_error('name', t('The role name %name already exists. Please choose another role name.', array('%name' => $form_state['values']['name'])));
}
}
- else if ($form_state['values']['op'] == t('Add role')) {
+ elseif ($form_state['values']['op'] == t('Add role')) {
if (db_result(db_query("SELECT COUNT(*) FROM {role} WHERE name = '%s'", $form_state['values']['name']))) {
form_set_error('name', t('The role name %name already exists. Please choose another role name.', array('%name' => $form_state['values']['name'])));
}
@@ -682,7 +682,7 @@ function user_admin_role_submit($form, &$form_state) {
db_query("UPDATE {role} SET name = '%s' WHERE rid = %d", $form_state['values']['name'], $form_state['values']['rid']);
drupal_set_message(t('The role has been renamed.'));
}
- else if ($form_state['values']['op'] == t('Delete role')) {
+ elseif ($form_state['values']['op'] == t('Delete role')) {
db_query('DELETE FROM {role} WHERE rid = %d', $form_state['values']['rid']);
db_query('DELETE FROM {role_permission} WHERE rid = %d', $form_state['values']['rid']);
// Update the users who have this role set:
@@ -690,7 +690,7 @@ function user_admin_role_submit($form, &$form_state) {
drupal_set_message(t('The role has been deleted.'));
}
- else if ($form_state['values']['op'] == t('Add role')) {
+ elseif ($form_state['values']['op'] == t('Add role')) {
db_query("INSERT INTO {role} (name) VALUES ('%s')", $form_state['values']['name']);
drupal_set_message(t('The role has been added.'));
}
diff --git a/modules/user/user.module b/modules/user/user.module
index ee189ff58..8b666cf1b 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -162,7 +162,7 @@ function user_load($array = array()) {
$query[] = "$key = %d";
$params[] = $value;
}
- else if ($key == 'pass') {
+ elseif ($key == 'pass') {
$query[] = "pass = '%s'";
$params[] = $value;
}
@@ -757,7 +757,7 @@ function user_block($op = 'list', $delta = '', $edit = array()) {
$blocks['online']['cache'] = BLOCK_NO_CACHE;
return $blocks;
}
- else if ($op == 'configure' && $delta == 'new') {
+ elseif ($op == 'configure' && $delta == 'new') {
$form['user_block_whois_new_count'] = array(
'#type' => 'select',
'#title' => t('Number of users to display'),
@@ -766,21 +766,21 @@ function user_block($op = 'list', $delta = '', $edit = array()) {
);
return $form;
}
- else if ($op == 'configure' && $delta == 'online') {
+ elseif ($op == 'configure' && $delta == 'online') {
$period = drupal_map_assoc(array(30, 60, 120, 180, 300, 600, 900, 1800, 2700, 3600, 5400, 7200, 10800, 21600, 43200, 86400), 'format_interval');
$form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online', 900), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.'));
$form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count', 10), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.'));
return $form;
}
- else if ($op == 'save' && $delta == 'new') {
+ elseif ($op == 'save' && $delta == 'new') {
variable_set('user_block_whois_new_count', $edit['user_block_whois_new_count']);
}
- else if ($op == 'save' && $delta == 'online') {
+ elseif ($op == 'save' && $delta == 'online') {
variable_set('user_block_seconds_online', $edit['user_block_seconds_online']);
variable_set('user_block_max_list_count', $edit['user_block_max_list_count']);
}
- else if ($op == 'view') {
+ elseif ($op == 'view') {
$block = array();
switch ($delta) {
@@ -871,7 +871,7 @@ function template_preprocess_user_picture(&$variables) {
if (!empty($account->picture) && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
- else if (variable_get('user_picture_default', '')) {
+ elseif (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
@@ -1551,7 +1551,7 @@ function _user_edit_validate($uid, &$edit) {
if ($error = user_validate_name($edit['name'])) {
form_set_error('name', $error);
}
- else if (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $uid, $edit['name'])) > 0) {
+ elseif (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE uid != %d AND LOWER(name) = LOWER('%s')", $uid, $edit['name'])) > 0) {
form_set_error('name', t('The name %name is already taken.', array('%name' => $edit['name'])));
}
}
@@ -1560,7 +1560,7 @@ function _user_edit_validate($uid, &$edit) {
if ($error = user_validate_mail($edit['mail'])) {
form_set_error('mail', $error);
}
- else if (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE uid != %d AND LOWER(mail) = LOWER('%s')", $uid, $edit['mail'])) > 0) {
+ elseif (db_result(db_query("SELECT COUNT(*) FROM {users} WHERE uid != %d AND LOWER(mail) = LOWER('%s')", $uid, $edit['mail'])) > 0) {
form_set_error('mail', t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>', array('%email' => $edit['mail'], '@password' => url('user/password'))));
}
}
@@ -2317,7 +2317,7 @@ function user_register_submit($form, &$form_state) {
if ($admin && !$notify) {
drupal_set_message(t('Created a new user account for <a href="@url">%name</a>. No e-mail has been sent.', array('@url' => url("user/$account->uid"), '%name' => $account->name)));
}
- else if (!variable_get('user_email_verification', TRUE) && $account->status && !$admin) {
+ elseif (!variable_get('user_email_verification', TRUE) && $account->status && !$admin) {
// No e-mail verification is required, create new user account, and login
// user immediately.
_user_mail_notify('register_no_approval_required', $account);
@@ -2327,7 +2327,7 @@ function user_register_submit($form, &$form_state) {
$form_state['redirect'] = '';
return;
}
- else if ($account->status || $notify) {
+ elseif ($account->status || $notify) {
// Create new user account, no administrator approval required.
$op = $notify ? 'register_admin_created' : 'register_no_approval_required';
_user_mail_notify($op, $account);
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 24eb3d6c5..ada98b6fb 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -92,7 +92,7 @@ function user_pass_reset(&$form_state, $uid, $timestamp, $hashed_pass, $action =
drupal_set_message(t('You have tried to use a one-time login link that has expired. Please request a new one using the form below.'));
drupal_goto('user/password');
}
- else if ($account->uid && $timestamp > $account->login && $timestamp < $current && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->login)) {
+ elseif ($account->uid && $timestamp > $account->login && $timestamp < $current && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->login)) {
// First stage is a confirmation form, then login
if ($action == 'login') {
watchdog('user', 'User %name used one-time login link at time %timestamp.', array('%name' => $account->name, '%timestamp' => $timestamp));