? .git
? nbproject
? user_signature_format.patch
? user_signature_format2.patch
? user_signature_format3.patch
? sites/d7p
? sites/d7s
? sites/all/modules
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.829
diff -u -p -r1.829 comment.module
--- modules/comment/comment.module	10 Jan 2010 00:41:28 -0000	1.829
+++ modules/comment/comment.module	10 Jan 2010 14:18:57 -0000
@@ -1570,7 +1570,7 @@ class CommentController extends DrupalDe
     $this->query->addField('n', 'type', 'node_type');
     $this->query->innerJoin('users', 'u', 'base.uid = u.uid');
     $this->query->addField('u', 'name', 'registered_name');
-    $this->query->fields('u', array('uid', 'signature', 'picture', 'data'));
+    $this->query->fields('u', array('uid', 'signature', 'signature_format', 'picture', 'data'));
   }
 
   protected function attachLoad(&$comments) {
Index: modules/comment/comment.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v
retrieving revision 1.35
diff -u -p -r1.35 comment.pages.inc
--- modules/comment/comment.pages.inc	9 Jan 2010 21:54:00 -0000	1.35
+++ modules/comment/comment.pages.inc	10 Jan 2010 14:18:57 -0000
@@ -48,7 +48,7 @@ function comment_reply($node, $pid = NUL
       // $pid indicates that this is a reply to a comment.
       if ($pid) {
         // Load the comment whose cid = $pid
-        $comment = db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.picture, u.data FROM {comment} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = :cid AND c.status = :status', array(
+        $comment = db_query('SELECT c.*, u.uid, u.name AS registered_name, u.signature, u.signature_format, u.picture, u.data FROM {comment} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = :cid AND c.status = :status', array(
           ':cid' => $pid,
           ':status' => COMMENT_PUBLISHED,
         ))->fetchObject();
Index: modules/user/user.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.install,v
retrieving revision 1.35
diff -u -p -r1.35 user.install
--- modules/user/user.install	9 Jan 2010 22:07:57 -0000	1.35
+++ modules/user/user.install	10 Jan 2010 14:19:01 -0000
@@ -143,6 +143,13 @@ function user_schema() {
         'default' => '',
         'description' => "User's signature.",
       ),
+      'signature_format' => array(
+        'type' => 'int',
+        'size' => 'small',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {filter_formats}.format of the signature.',
+      ),
       'created' => array(
         'type' => 'int',
         'not null' => TRUE,
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1100
diff -u -p -r1.1100 user.module
--- modules/user/user.module	9 Jan 2010 23:03:21 -0000	1.1100
+++ modules/user/user.module	10 Jan 2010 14:19:02 -0000
@@ -1000,11 +1000,20 @@ function user_account_form(&$form, &$for
     '#weight' => 1,
     '#access' => (!$register && variable_get('user_signatures', 0)),
   );
+
+  // Prevent a "validation error" message when the user attempts to save with a
+  // default value they do not have access to.
+  if (!filter_access($account->signature_format) && empty($_POST)) {
+    drupal_set_message(t("The signature input format has been set to a format you don't have access to. It will be changed to a format you have access to when you save this page."));
+    $account->signature_format = filter_default_format();
+  }
+
   $form['signature_settings']['signature'] = array(
     '#type' => 'textarea',
     '#title' => t('Signature'),
     '#default_value' => isset($account->signature) ? $account->signature : '',
     '#description' => t('Your signature will be publicly displayed at the end of your comments.'),
+    '#text_format' => isset($account->signature_format) ? $account->signature_format : filter_default_format(),
   );
 
   // Picture/avatar.
@@ -2867,7 +2876,7 @@ function user_forms() {
  */
 function user_comment_view($comment) {
   if (variable_get('user_signatures', 0) && !empty($comment->signature)) {
-    $comment->signature = check_markup($comment->signature, $comment->format, '', TRUE);
+    $comment->signature = check_markup($comment->signature, $comment->signature_format, '', TRUE);
   }
   else {
     $comment->signature = '';
