Created
January 3, 2009 22:42
-
-
Save tedkulp/42944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LoginController extends SilkControllerBase | |
{ | |
function index($params) | |
{ | |
$user_session = new SilkUserSession($params['login']); | |
if ($user_session->login()) | |
{ | |
//redirect('') | |
var_dump('login successful'); | |
} | |
$this->set_by_ref('user_session', $user_session); | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{validation_errors for=$user_session} | |
{form} | |
<div id="regular" {if $params.login.openid ne '' or $smarty.request.openid_mode ne ''}style="display: none;"{/if}> | |
{label for="login[username]"}Username:{/label}{textbox name="login[username]" value=$params.login.username}<br /> | |
{label for="login[password]"}Password:{/label}{password name="login[password]" value=$params.login.password}<br /> | |
<a href="#" onclick="$('#regular').hide();$('#openid').show();return false;">Use OpenID</a> | |
</div> | |
<div id="openid" {if $params.login.openid eq '' and $smarty.request.openid_mode eq ''}style="display: none;"{/if}> | |
{label for="login[openid]"}Open ID:{/label}{textbox name="login[openid]" value=$params.login.openid}<br /> | |
<a href="#" onclick="$('#regular').show();$('#openid').hide();return false;">Use Username/Password</a> | |
</div> | |
{submit value="Submit"} | |
{/form} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment