aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-03-11 14:43:39 +0100
committerDaniel Lange <DLange@git.local>2016-03-11 14:47:28 +0100
commit90cb364f9c7282e00afc05435fab7e62bc190d86 (patch)
tree6f89618fa7c377ad65024b90b4b02b7a4089c40f
parent7be7fcc52771e7e504c5a896a7f6cb4b630a4f23 (diff)
downloaddrupal_htpasswdsync-90cb364f9c7282e00afc05435fab7e62bc190d86.tar.gz
drupal_htpasswdsync-90cb364f9c7282e00afc05435fab7e62bc190d86.tar.bz2
drupal_htpasswdsync-90cb364f9c7282e00afc05435fab7e62bc190d86.zip
Fix php warnings, e.g. https://www.drupal.org/node/1559628, thanks Justin Morant (1point21)
-rw-r--r--HTPasswdSync.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/HTPasswdSync.module b/HTPasswdSync.module
index 00fc9b7..85e835f 100644
--- a/HTPasswdSync.module
+++ b/HTPasswdSync.module
@@ -218,7 +218,8 @@ function _htpasswdsync_updategroup() {
}
foreach(_htpasswdsync_roles() as $rid) {
- $role = _htpasswdsync_sanitize_name(reset(db_query('SELECT name FROM {role} WHERE rid = :rid', array(':rid' => $rid))->fetchCol()));
+ $result = db_query('SELECT name FROM {role} WHERE rid = :rid', array(':rid' => $rid))->fetchCol();
+ $role = _htpasswdsync_sanitize_name(reset($result));
if(!empty($role)) {
$users = db_query('SELECT u.name, u.mail FROM {users} AS u, {users_roles} AS ur WHERE ur.rid = :rid AND ur.uid = u.uid AND status = 1', array(':rid' => $rid));
$groups[$role] = array();
@@ -396,7 +397,8 @@ function htpasswdsync_user_delete($account) {
function htpasswdsync_field_attach_submit($entity_type, $entity, $form, &$form_state) {
if($entity_type != 'user') return;
if(!empty($entity->name) && !empty($entity->pass)) {
- $r = reset(db_query('SELECT pass FROM {users} WHERE uid=:uid', array(':uid' => $entity->uid))->fetchCol());
+ $result = db_query('SELECT pass FROM {users} WHERE uid=:uid', array(':uid' => $entity->uid))->fetchCol();
+ $r = reset($result);
if($r != $entity->pass) {
_htpasswdsync_update($entity);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy