Index: aes/aes.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- aes/aes.module	(revision ce656c5fdb9b57bcad9a54a69221fae0ce2dea91)
+++ aes/aes.module	(revision )
@@ -126,7 +126,7 @@
   $form['aes']['aes_convert'] = array(
     '#type' => 'checkbox',
     '#title' => t('Create AES passwords'),
-    '#default_value' => (variable_get("aes_convert", "false") == "true") ? TRUE : FALSE,
+    '#default_value' => variable_get("aes_convert", FALSE),
     '#description' => t('Check this box if you would like for AES to start encrypting user passwords (and make them viewable to the roles with permission to do so). This is a process which normally will make more and more passwords AES-encrypted/readable over time since the AES module only can get an existing users password in plain text at certain moments, one such moment being when the user logs in. So you won\'t be able to view an existing users password until that user has logged in at least once after you checked this box. You may test this on yourself by logging out and in again, which should make your password appear on your user page.'),
   );
 
@@ -260,14 +260,14 @@
 
 function aes_config_submit($form, &$form_state) {
   if ($form_state['values']['aes_convert']) {
-    if (variable_get("aes_convert", "false") == "false") {
-      variable_set("aes_convert", "true");
+    if (!variable_get("aes_convert", FALSE)) {
+      variable_set("aes_convert", TRUE);
       drupal_set_message(t("Creation of encrypted passwords enabled."));
     }
   }
   else {
-    if (variable_get("aes_convert", "false") == "true") {
-      variable_set("aes_convert", "false");
+    if (variable_get("aes_convert", FALSE)) {
+      variable_set("aes_convert", FALSE);
       drupal_set_message(t("Creation of encrypted passwords disabled."));
     }
   }
@@ -400,7 +400,7 @@
  * Implements hook_user_view().
  */
 function aes_user_view($account, $view_mode, $langcode) {
-  if (user_access('view passwords') && (variable_get("aes_viewing_method", "page") == "collapsible" || variable_get("aes_viewing_method", "page") == "both") && variable_get("aes_convert", "false") != "false") {
+  if (user_access('view passwords') && (variable_get("aes_viewing_method", "page") == "collapsible" || variable_get("aes_viewing_method", "page") == "both") && variable_get("aes_convert", FALSE)) {
 
     if (aes_password_exists($account->uid)) {
       $password_form = drupal_get_form('aes_view_password_form', aes_get_password($account->uid, TRUE));
@@ -425,7 +425,7 @@
  * Implements hook_user_login().
  */
 function aes_user_login(&$edit, $account) {
-  if (variable_get("aes_convert", "false") == "true" && aes_password_exists($account->uid) == FALSE && isset($edit['input']) && isset($edit['input']['pass'])) {
+  if (variable_get("aes_convert", FALSE) && aes_password_exists($account->uid) == FALSE && isset($edit['input']) && isset($edit['input']['pass'])) {
     db_insert('aes_passwords')
       ->fields(array(
         'uid' => $account->uid,
@@ -482,7 +482,7 @@
     else {
       // If this user doesn't have a password and creation of encrypted passwords is enabled, insert one now.
       if (aes_password_exists($account->uid) == FALSE) {
-        if (variable_get("aes_convert", "false") == "true") {
+        if (variable_get("aes_convert", FALSE)) {
           db_insert('aes_passwords')
             ->fields(array(
               'uid' => $account->uid,
Index: aes/aes.install
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- aes/aes.install	(revision ce656c5fdb9b57bcad9a54a69221fae0ce2dea91)
+++ aes/aes.install	(revision )
@@ -76,7 +76,7 @@
 
   variable_set("aes_key_storage_method", "Database");
   variable_set("aes_cipher", "rijndael-128");
-  variable_set("aes_convert", "false");
+  variable_set("aes_convert", FALSE);
   variable_set("aes_viewing_method", "collapsible");
 
   $aes_implementations = aes_get_available_aes_implementations();
@@ -137,4 +137,19 @@
   variable_del("aes_implementation");
 
   drupal_set_message(t("AES uninstalled."));
+}
+
+/**
+ * Convert old setting for aes_convert from string to boolean.
+ */
+function aes_update_7100(&$sandbox) {
+  $old_value = variable_get("aes_convert", FALSE);
+  if (is_string($old_value)) {
+    $old_value = strtolower($old_value);
+    $new_value = ($old_value === 'true');
+  }
+  else {
+    $new_value = (bool) $old_value;
+  }
+  variable_set("aes_convert", $new_value);
 }
