diff -cr false_account/false_account.info false_account-new/false_account.info
*** false_account/false_account.info	Thu Jan 10 18:35:05 2008
--- false_account-new/false_account.info	Fri Feb 29 23:30:15 2008
***************
*** 2,8 ****
  description = "Detect false accounts."
  
  ; Information added by drupal.org packaging script on 2008-01-10
! version = "5.x-1.3"
  project = "false_account"
  datestamp = "1200008105"
  
--- 2,9 ----
  description = "Detect false accounts."
  
  ; Information added by drupal.org packaging script on 2008-01-10
! version = "6.x-1.x"
! core = "6.x"
  project = "false_account"
  datestamp = "1200008105"
  
diff -cr false_account/false_account.module false_account-new/false_account.module
*** false_account/false_account.module	Thu Jan 10 18:26:05 2008
--- false_account-new/false_account.module	Fri Feb 29 23:39:33 2008
***************
*** 11,42 ****
  function false_account_user($op, &$edit, &$account, $category = NULL) {
    switch ($op) {
      case 'insert':
!       if (isset($_COOKIE['fad'])){
          $cdata = explode(',', $_COOKIE['fad']);
          $cid = $cdata[0];
          $result = db_query("SELECT cid,status FROM {false_accounts} WHERE cid = '%s' and status = '%d'", $cid, FALSE_ACCOUNT_BLOCKED);
!         if (db_num_rows($result)>0) {
!           watchdog('false account', 'Blocked: ' . $cid, WATCHDOG_NOTICE);
!           drupal_goto(variable_get('false_account_redirect','/'));
          }
        }
      case 'login':
        if (!isset($_COOKIE['fad'])) {
!         $uniqueId = md5('gsmi789' . uniqid(rand(), TRUE));
!         setcookie('fad', $uniqueId.','.$account->uid, time() + 31536000, "/");
        } 
        else{
          $cdata = explode(',', $_COOKIE['fad']);
          $cid = $cdata[0];
!         if (in_array($account->uid, $cdata )){
            break;
          }
          else{
!           $new_cdata = $_COOKIE['fad'].','.$account->uid;
!           $new_uids = substr($new_cdata, strpos($new_cdata,',')+1);
            setcookie('fad', $new_cdata, time() + 31536000, "/" );
            $result = db_query("SELECT cid,status FROM {false_accounts} WHERE cid = '%s'", $cid);
!           if (db_num_rows($result)>0) {
              db_query("UPDATE {false_accounts} SET uids = '%s', updated = %d, status = %d WHERE cid = '%s'", $new_uids, time(), FALSE_ACCOUNT_DEFAULT, $cid);
            }
            else{
--- 11,42 ----
  function false_account_user($op, &$edit, &$account, $category = NULL) {
    switch ($op) {
      case 'insert':
!       if (isset($_COOKIE['fad'])) {
          $cdata = explode(',', $_COOKIE['fad']);
          $cid = $cdata[0];
          $result = db_query("SELECT cid,status FROM {false_accounts} WHERE cid = '%s' and status = '%d'", $cid, FALSE_ACCOUNT_BLOCKED);
!         if (db_result($result) > 0) {
!           watchdog('false account', 'Blocked: '. $cid, WATCHDOG_NOTICE);
!           drupal_goto(variable_get('false_account_redirect', '/'));
          }
        }
      case 'login':
        if (!isset($_COOKIE['fad'])) {
!         $unique_id = md5('gsmi789'. uniqid(rand(), TRUE));
!         setcookie('fad', $unique_id .', '. $account->uid, time() + 31536000, "/");
        } 
        else{
          $cdata = explode(',', $_COOKIE['fad']);
          $cid = $cdata[0];
!         if (in_array($account->uid, $cdata )) {
            break;
          }
          else{
!           $new_cdata = $_COOKIE['fad'] .','. $account->uid;
!           $new_uids = substr($new_cdata, strpos($new_cdata, ',')+1);
            setcookie('fad', $new_cdata, time() + 31536000, "/" );
            $result = db_query("SELECT cid,status FROM {false_accounts} WHERE cid = '%s'", $cid);
!           if (db_result($result) > 0) {
              db_query("UPDATE {false_accounts} SET uids = '%s', updated = %d, status = %d WHERE cid = '%s'", $new_uids, time(), FALSE_ACCOUNT_DEFAULT, $cid);
            }
            else{
***************
*** 120,129 ****
  
    return system_settings_form($form);
  }
! function false_account_page($op = FALSE_ACCOUNT_DEFAULT){
    
    $content = t('<p>User accounts marked with an * are bloqued</p>');
!   $sql = 'SELECT * FROM {false_accounts} WHERE status = ' . $op;
    $header = array(
      array('data' => t('Cookie ID')),
      array('data' => t('User Accounts')),
--- 120,130 ----
  
    return system_settings_form($form);
  }
! 
! function false_account_page($op = FALSE_ACCOUNT_DEFAULT) {
    
    $content = t('<p>User accounts marked with an * are bloqued</p>');
!   $sql = 'SELECT * FROM {false_accounts} WHERE status = '. $op;
    $header = array(
      array('data' => t('Cookie ID')),
      array('data' => t('User Accounts')),
***************
*** 131,155 ****
      array('data' => t('Actions'))
    );
    $result= pager_query($sql . tablesort_sql($header), 50);
!   $count = db_num_rows($result);
    $rows = array();
  
!   while($cookies = db_fetch_object($result)){
      $users = explode(',', $cookies->uids);
!     foreach ($users as $user){
        $status = user_load(array('uid' => $user));
!       $account[] = l(($status->status == 0)?$user.'*': $user, 'user/'.$user);
      }
      $accounts = implode(', ', $account);
!     switch ($op){
        case FALSE_ACCOUNT_DEFAULT:
!         $actions = l(t('withelist'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_WHITELISTED . '/' . $cookies->cid) . '&nbsp' . l(t('block'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_BLOCKED . '/' . $cookies->cid);
          break;
        case FALSE_ACCOUNT_WHITELISTED:
!         $actions = l(t('default'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_DEFAULT . '/' . $cookies->cid) . '&nbsp' . l(t('block'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_BLOCKED . '/' . $cookies->cid);
          break;
        case FALSE_ACCOUNT_BLOCKED:
!         $actions = l(t('default'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_DEFAULT . '/' . $cookies->cid) . '&nbsp' . l(t('withelist'), 'admin/user/false_account/op/' . FALSE_ACCOUNT_WHITELISTED . '/' . $cookies->cid);
        break;
      }
      $rows[]= array(
--- 132,156 ----
      array('data' => t('Actions'))
    );
    $result= pager_query($sql . tablesort_sql($header), 50);
!   $count = db_result($result);
    $rows = array();
  
!   while ($cookies = db_fetch_object($result)) {
      $users = explode(',', $cookies->uids);
!     foreach ($users as $user) {
        $status = user_load(array('uid' => $user));
!       $account[] = l(($status->status == 0) ? $user .'*' : $user, 'user/'. $user);
      }
      $accounts = implode(', ', $account);
!     switch ($op) {
        case FALSE_ACCOUNT_DEFAULT:
!         $actions = l(t('withelist'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_WHITELISTED .'/'. $cookies->cid) .'&nbsp'. l(t('block'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_BLOCKED .'/'. $cookies->cid);
          break;
        case FALSE_ACCOUNT_WHITELISTED:
!         $actions = l(t('default'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_DEFAULT .'/'. $cookies->cid) .'&nbsp'. l(t('block'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_BLOCKED .'/'. $cookies->cid);
          break;
        case FALSE_ACCOUNT_BLOCKED:
!         $actions = l(t('default'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_DEFAULT .'/'. $cookies->cid) .'&nbsp'. l(t('withelist'), 'admin/user/false_account/op/'. FALSE_ACCOUNT_WHITELISTED .'/'. $cookies->cid);
        break;
      }
      $rows[]= array(
***************
*** 172,181 ****
   return $content;
  }
  
! function false_account_operations($op, $cid){
    $sql = "UPDATE {false_accounts} SET status ='%d' WHERE cid = '%s'";
    db_query($sql, $op, $cid);
    drupal_goto('admin/user/false_account');  
  }
  
- ?>
\ No newline at end of file
--- 173,181 ----
   return $content;
  }
  
! function false_account_operations($op, $cid) {
    $sql = "UPDATE {false_accounts} SET status ='%d' WHERE cid = '%s'";
    db_query($sql, $op, $cid);
    drupal_goto('admin/user/false_account');  
  }
  
