开发者

Elgg, customizing the first page?

开发者 https://www.devze.com 2023-04-13 06:18 出处:网络
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:

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 firs开发者_开发技巧t 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?


You don't need to print the system messages... they are done by system automatically, Just use the functions for adding messages.

Success messages:

system_message

Error messages:

register_error


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();

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号