after login redirect other page+drupal 7


that function use in user module  function user_login_submit(

we can use condition other page

 

 

function user_login_submit($form, &$form_state) {
global $user;

if(!empty($_SESSION[‘map’]))
{
$user = user_load($form_state[‘uid’]);
$form_state[‘redirect’] = ‘mapsearch/’;
$_SESSION[‘map’]=’ ‘;
}

 

 

page.tpl

 

use condition for admin

<?php
if($node->nid==’119’)
{
if ($user->uid == 0)
{
$_SESSION[‘map’]=1;
header(‘Location: http://demo.matrixm.info/user&#8217;);

}
else
{
$user = user_load($form_state[‘uid’]);
$form_state[‘redirect’] = ‘user/’ . $user->uid;
}
user_login_finalize($form_state);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s