From de44072172b7f56345041358a0be275b482e474c Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 17 Oct 2011 16:53:59 +0200 Subject: works on login form --- boot.php | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 9f382b302..e7cd06504 100644 --- a/boot.php +++ b/boot.php @@ -636,29 +636,16 @@ function get_guid($size=16) { if(! function_exists('login')) { function login($register = false) { $o = ""; - $register_tpl = (($register) ? get_markup_template("register-link.tpl") : ""); - - $register_html = replace_macros($register_tpl,array( - '$title' => t('Create a New Account'), - '$desc' => t('Register') - )); - - $noid = get_config('system','no_openid'); - if($noid) { - $classname = 'no-openid'; - $namelabel = t('Nickname or Email address: '); - $passlabel = t('Password: '); - $login = t('Login'); - } - else { - $classname = 'openid'; - $namelabel = t('Nickname/Email/OpenID: '); - $passlabel = t("Password \x28if not OpenID\x29: "); - $login = t('Login'); + $reg = false; + if ($register) { + $reg = array( + 'title' => t('Create a New Account'), + 'desc' => t('Register') + ); } - $lostpass = t('Forgot your password?'); - $lostlink = t('Password Reset'); + $noid = get_config('system','no_openid'); + if(local_user()) { $tpl = get_markup_template("logout.tpl"); } @@ -667,17 +654,22 @@ function login($register = false) { } - $o = ''; $o .= replace_macros($tpl,array( '$logout' => t('Logout'), - '$register_html' => $register_html, - '$classname' => $classname, - '$namelabel' => $namelabel, - '$passlabel' => $passlabel, - '$login' => $login, - '$lostpass' => $lostpass, - '$lostlink' => $lostlink + '$login' => t('Login'), + + '$lname' => array('username', t('Nickname or Email address: ') , '', ''), + '$lpassword' => array('password', t('Password: '), '', ''), + + '$openid' => !$noid, + '$lopenid' => array('openid_url', t('OpenID: '),'',''), + + + '$register' => $reg, + + '$lostpass' => t('Forgot your password?'), + '$lostlink' => t('Password Reset'), )); call_hooks('login_hook',$o); -- cgit v1.2.3