[diem-users] Find User id In Diem

19 views
Skip to first unread message

Md Mostafizur Rahman milon

unread,
Apr 21, 2010, 1:53:50 AM4/21/10
to diem-users
hello
i am try to show user id but i can do its. if i write
echo _tag('p', __('You are authenticated as %username%',
array('%username%' => $sf_user->getUsername())));


then i can show username but if i write

echo _tag('p', __('You are authenticated as %id%', array('%id%' =>
$sf_user->getId())));

then show error.

help me


--
Subscription settings: http://groups.google.com/group/diem-users/subscribe?hl=en

thibault

unread,
Apr 21, 2010, 3:41:01 AM4/21/10
to diem-...@googlegroups.com
Help us by showing the error, then.

Erik Van Kelst

unread,
Apr 21, 2010, 3:50:59 AM4/21/10
to diem-...@googlegroups.com
Hi

You can find the answer in the Diem and symfony documentation about the user handling. To get you started: the $sf_user variable in the template (or the $this->getUser() object in actions/components) is a proxy object. To get the actual DmUser you need to call it as follows: $sf_user->getDmUser().

This is elementary symfony stuff, I suggest you make yourself familiar with it as Diem is built on symfony.

Greets

----- Oorspronkelijk bericht -----
Van: Md Mostafizur Rahman milon <cse...@gmail.com>
Verzonden: woensdag 21 april 2010 7:53
Aan: diem-users <diem-...@googlegroups.com>
Onderwerp: [diem-users] Find User id In Diem

Vitaly Alyokhin

unread,
Apr 21, 2010, 9:42:47 AM4/21/10
to diem-...@googlegroups.com
front/modules/dmUser/_signin.php


if ($sf_user->isAuthenticated())
{
  echo _tag('h4', __('welcome') . ' '.$sf_user->getGuardUser()->getUsername().'!');
  echo _tag('ul.elements',
    _tag('li', _link('+/dmUser/signout')->text('signout') ) 
    // uncomment if you have profile edit
    //.  _tag('li', _link('main/profile')->text(__('profile')) )
  );
} else {
  echo _tag('h4', 'login');
  
  echo $form->open('.dm_signin_form');

  echo _tag('ul.elements',

    _tag('li', $form['username']->label()->error()->field()) .

    _tag('li', $form['password']->label()->error()->field()) .

    _tag('li.inline', $form['remember']->error()->field()->label()) .
            
    _tag('li',  
            $form->submit('Signin') .
            _link('main/register')
    )

  );

  echo $form->renderHiddenFields();

  

  echo $form->close();
}

Isaac Hernández Cabrera

unread,
Mar 22, 2016, 12:31:50 PM3/22/16
to diem-users, 228...@gmail.com
Hi, it really help me a lot. But i have an other question. Do u know where can i change the css of the login because in this moment i have the one by default and i want to customize it. 
Reply all
Reply to author
Forward
0 new messages