Elgg,定制第一页?
今天我创建了一个自定义索引页面。此自定义索引页面包含用于登录 elgg 的代码。
在 index.php 中,我输入了以下代码:
<div class="elgg-page-messages">
<?php echo elgg_view('page/elements/messages', array('object' => $_SESSION['msg'])); ?>
</div>
用于索引页的打印消息错误。
我的问题是,当我在凭据中输入错误的登录名时,系统消息是重复的。
例如,我第一次登录,我选择:
需要用户名和密码。
然后我第二次登录并选择:
需要用户名和密码。
需要用户名和密码。
然后我第三次登录时得到:
需要用户名和密码。
需要用户名和密码。
Loggarsi con email solamente
end 等等。
怎么了?
似乎在显示错误消息后,会话没有被清除。
你能帮我吗?
Today I create a custom index page. This custom index page contain code for login in elgg.
Into index.php I put into this code:
<div class="elgg-page-messages">
<?php echo elgg_view('page/elements/messages', array('object' => $_SESSION['msg'])); ?>
</div>
for print message error for my index page.
My problem is that when I type wrong login in credentials, the system message is duplicate.
Example, I login in the first time and I optain:
Username and password are required.
then I login in second time and I optain:
Username and password are required.
Username and password are required.
then I login in third time I obtain:
Username and password are required.
Username and password are required.
Loggarsi con email solamente
end so on.
What's wrong?
Seems that after is displayed error message, the session isn't cleared.
Can you help me please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不需要打印系统消息...它们是由系统自动完成的,只需使用添加消息的功能即可。
成功消息:
错误消息:
You don't need to print the system messages... they are done by system automatically, Just use the functions for adding messages.
Success messages:
Error messages:
您需要做的就是清除这些消息。您可以通过调用以下系统函数来完成此操作:
系统消息(空,“”);
或者,由于看起来您正在直接访问消息数组,因此您可以直接执行此操作:
$_SESSION['msg'] = array();
What you need to do is clear out the messages. You can do this by calling the following system function:
system_messages(null, "");
Or, since it looks like you're directly accessing the messages array, you could do it directly:
$_SESSION['msg'] = array();