<?php
/**
 * @file
 * Module file for diy_comments.
 */


function diy_comments_preprocess_page(&$vars) {
  drupal_add_css(drupal_get_path('module', 'diy_comments') . '/css/diy_comments.css');
}

function diy_comments_form_alter(&$form, &$form_state, $form_id) { // form override
  if (!preg_match('#comment_node_[a-zA-Z0-9_]+_form#', $form_id)) { // add field to comment content type
   return;
  }

  if (user_is_logged_in()) {
    return;
  }

  // check if loginradius sent a token to authenticate the user
  socialloginandsocialshare_user_register_submit($form, $form_state);

  if (user_is_logged_in()) {
    return;
  }

  // if user is still not logged in, add the login-buttons to the form

  socialloginandsocialshare_user_login_form_alter($form, $form_state);
}
