Liferay5.2.2中,带了一个 Current Users的Portlet,其可以用某个用户的身份登录Portal。这个功能,可以用于从其他系统登录到Portal的需求。
<form action="http://localhost:8080/web/guest/home" method="post" name="loginmichelle"> <input type="hidden" name="p_p_id" value="58"> <input type="hidden" name="p_p_lifecycle" value="1"> <input type="hidden" name="p_p_mode" value="view"> <input type="hidden" name="p_p_state" value="maximized"> <input type="hidden" name="_58_struts_action" value="/login/login"> <input type="hidden" name="_58_login" value="michelle@7cogs.com"> <input type="hidden" name="_58_password" value="michelle"> <div class="loginuser" title="Login: michelle@7cogs.com, Password: michelle"> <div class="user-profile-image" style="float: left; padding-right: 4px;"> <img width="80" alt="" class="avatar" src="/image/user_portrait?screenName=michelle&companyId=1&t=1228845375823"></div><h2>Michelle Editor</h2> <div>Michelle has control over the staging and layout of all articles as well as publishing rights for workflow and the content management system. <a class="public_pages" href="/web/michelle">View michelle's public page</a> <a class="express_login" href="#" οnclick="document.loginmichelle.submit();return false;">Login as michelle</a></div></div></form>
http://localhost:8080/web/guest/home为登录Portlet所在的页面地址
还需要将在portal-ext.properties文件中加入,否则若浏览器从未访问过Portal的情况下,会提示Cookie错误
session.test.cookie.support=false
绝对定位。
<div stypel="position:absolute; right:5%; top:5px">
hello!
</div>