Add a sign up link to the log in page, specified by a delegate function #33

Closed
wants to merge 1 commit into
from
View
@@ -10,6 +10,7 @@ Legend:
WF_LOG_DEPRECATED && WFLog::deprecated("MyObj::foo() is deprecated. Use MyObj::bar().");
Version 0.4.1 - ??
+- [new] Log in module now supports WFAuthorization signUpURL() delegate function to provide a WFURL to a module that the end user can sign up on.
Version 0.4.0 - 4/26/2011
- [improved] Refactored WFErrorArray and WFErrorsException to implement a new interface WFErrorCollection.
@@ -83,12 +83,17 @@ function promptLogin_PageDidLoad($page, $params)
$this->gotoURL($continueURL);
}
+ $signUpURL = NULL;
+ if (method_exists($ac->delegate(), 'signUpURL')) $signUpURL = $ac->delegate()->signUpURL();
+
// continue to normal promptLogin setup
$page->assign('loginMessage', $ac->loginMessage());
$page->assign('usernameLabel', $ac->usernameLabel());
$page->outlet('rememberMe')->setHidden( !$ac->shouldEnableRememberMe() );
$page->outlet('forgottenPasswordLink')->setHidden( !$ac->shouldEnableForgottenPasswordReset() );
$page->outlet('forgottenPasswordLink')->setValue( WFRequestController::WFURL('login', 'doForgotPassword') . '/' . $page->outlet('username')->value());
+ $page->outlet('signUpLink')->setHidden($signUpURL === NULL);
+ $page->outlet('signUpLink')->setValue($signUpURL);
if (!$page->hasSubmittedForm())
{
@@ -19,7 +19,12 @@
</tr>
{/WFViewHiddenHelper}
<tr>
- <td colspan="2" align="center">{WFSubmit id="login"}</td>
+ <td colspan="2" align="center">
+ {WFSubmit id="login"}
+ {WFViewHiddenHelper id="signUpLink"}
+ <span>or {WFLink id="signUpLink}</span>
+ {/WFViewHiddenHelper}
+ </td>
</tr>
</table>
{/WFForm}
@@ -14,8 +14,12 @@ loginForm:
class: 'WFSubmit'
properties:
action: 'doLogin'
- label: 'Login'
+ label: 'Log In'
forgottenPasswordLink:
class: 'WFLink'
properties:
label: 'Forgot your password?'
+signUpLink:
+ class: 'WFLink'
+ properties:
+ label: 'Sign Up'