hook_user

Checkmember_user

  1. <?php
  2. function checkmember_user ($op, &$edit, &$user, $category=null)
  3. {
  4.   if ($op == "insert" || $op == "update")
  5.   {
  6.     // clear first
  7.     db_query( 'DELETE FROM {users_roles} WHERE uid = %d',

CiviCRM hook_user to not set an empty $_SESSION["civicrm"] for anonymous users - needed for Pressflow

  1. function civicrm_user( $type, &$edit, &$user, $category = NULL )
  2. {
  3.     $current_user = $_GLOBALS["user"];
  4.                
  5.                 if($current_user->uid == 0 && (arg(0) == "user" && is_numeric(arg(1)))) {
  6.                   retur

Fix for CiviCRM hook_user to not set an empty $_SESSION["civicrm"] for anonymous users - needed for Pressflow

  1. function civicrm_user( $type, &$edit, &$user, $category = NULL )
  2. {
  3.     $current_user = $_GLOBALS["user"];
  4.                
  5.                 if($current_user->uid == 0 && (arg(0) == "user" && is_numeric(arg(1)))) {
  6.                   retur

Insert Form Values not Object Ones

  1. /**
  2.  * Implementation of hook_user()
  3.  */
  4. function profile_edit_stats_user($op, &$edit, &$account, $category = NULL) {
  5.   switch ($op) {
  6.  
  7.   case 'insert':
  8.   $timestamp = time(); //get timestamp

This is simplemodule.module . It only has 3 lines of code. not working :(

  1. <?php # vim: set filetype=php expandtab tabstop=2 shiftwidth=2 autoindent smartindent:
  2.  
  3. function simplemodule_user($op, &$edit, &$account, $category = NULL) {
Syndicate content