1
|
//:Puts a Login / Logout box on your page.
|
2
|
//:Use: [[LoginBox]]. Remember to enable frontend login in your website settings.
|
3
|
global $wb, $TEXT, $MENU;
|
4
|
$return_value = " ";
|
5
|
if(FRONTEND_LOGIN == 'enabled' && VISIBILITY != 'private' && $wb->get_session('USER_ID') == '') {
|
6
|
$return_value = '<form name="login" action="'.LOGIN_URL.'" method="post" class="login_table">';
|
7
|
$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
|
8
|
$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
|
9
|
$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
|
10
|
$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
|
11
|
$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
|
12
|
if(is_numeric(FRONTEND_SIGNUP))
|
13
|
$return_value .= '<a href="'.SIGNUP_URL.'">'.$TEXT['SIGNUP'].'</a>';
|
14
|
$return_value .= '</form>';
|
15
|
} elseif(FRONTEND_LOGIN == 'enabled' && is_numeric($wb->get_session('USER_ID'))) {
|
16
|
$return_value = '<form name="logout" action="'.LOGOUT_URL.'" method="post" class="login_table">';
|
17
|
$return_value .= '<h2>'.$TEXT['LOGGED_IN'].'</h2>';
|
18
|
$return_value .= $TEXT['WELCOME_BACK'].', '.$wb->get_display_name().'<br />';
|
19
|
$return_value .= '<input type="submit" name="submit" value="'.$MENU['LOGOUT'].'" class="dbutton" /><br />';
|
20
|
$return_value .= '<a href="'.PREFERENCES_URL.'">'.$MENU['PREFERENCES'].'</a><br />';
|
21
|
$return_value .= '<a href="'.ADMIN_URL.'/index.php" target="_blank">'.$TEXT['ADMINISTRATION'].'</a>';
|
22
|
$return_value .= '</form>';
|
23
|
}
|
24
|
return $return_value;
|