Would any of you guys mind posting a snippet you've created for login/registration?
# WebLogin 1.0
# Created By Raymond Irving 2004
#::::::::::::::::::::::::::::::::::::::::
# Usage:
# Allows a web user to login to the website
#
# Params:
# &loginhomeid - (Optional)
# redirects the user to first authorized page in the list.
# If no id was specified then the login home page id or
# the current document id will be used
#
# &logouthomeid - (Optional)
# document id to load when user logs out
#
# &pwdreqid - (Optional)
# document id to load after the user has submited
# a request for a new password
#
# &pwdactid - (Optional)
# document id to load when the after the user has activated
# their new password
#
# &logintext - (Optional)
# Text to be displayed inside login button (for built-in form)
#
# &logouttext - (Optional)
# Text to be displayed inside logout link (for built-in form)
#
# &tpl - (Optional)
# Chunk name or document id to as a template
#
# Note: Templats design:
# section 1: login template
# section 2: logout template
# section 3: password reminder template
#
# See weblogin.tpl for more information
#
# Examples:
#
# [[WebLogin? &loginhomeid=`8` &logouthomeid=`1`]]
#
# [[WebLogin? &loginhomeid=`8,18,7,5` &tpl=`Login`]]
# Set Snippet Paths
$snipPath = (($modx->insideManager())? "../":"");
$snipPath .= "assets/snippets/";
# check if inside manager
if ($m = $modx->insideManager()) {
return ''; # don't go any further when inside manager
}
# deprecated params - only for backward compatibility
if($loginid) $loginhomeid=$loginid;
if($logoutid) $logouthomeid = $logoutid;
if($template) $tpl = $template;
# Snippet customize settings
$liHomeId = isset($loginhomeid)? explode(",",$loginhomeid):array($modx->config['login_home'],$modx->documentIdentifier);
$loHomeId = isset($logouthomeid)? $logouthomeid:$modx->documentIdentifier;
$pwdReqId = isset($pwdreqid)? $pwdreqid:0;
$pwdActId = isset($pwdactid)? $pwdactid:0;
$loginText = isset($logintext)? $logintext:'Login';
$logoutText = isset($logouttext)? $logouttext:'Logout';
$tpl = isset($tpl)? $tpl:"";
# System settings
$isLogOut = $_REQUEST['webloginmode']=='lo' ? 1:0;
$isPWDActivate = $_REQUEST['webloginmode']=='actp' ? 1:0;
$isPostBack = count($_POST) && isset($_POST['cmdweblogin']);
$isPWDReminder = $isPostBack && $_REQUEST['txtpwdrem']=='1' ? 1:0;
$cookieKey = substr(md5($site_id."Web-User"),0,15);
# Start processing
include_once $snipPath."weblogin/weblogin.common.inc.php";
include_once ("manager/includes/crypt.class.inc.php");
if ($isPWDActivate || $isPWDReminder || $isLogOut || $isPostBack) {
# include the logger class
include_once "manager/includes/log.class.inc.php";
include_once $snipPath."weblogin/weblogin.processor.inc.php";
}
include_once $snipPath."weblogin/weblogin.inc.php";
# Return
return $output;
# WebSignup 1.0
# Created By Raymond Irving April, 2005
#::::::::::::::::::::::::::::::::::::::::
# Usage:
# Allows a web user to signup for a new web account from the website
# This snippet provides a basic set of form fields for the signup form
# You can customize this snippet to create your own signup form
#
# Params:
#
# &tpl - (Optional)
# Chunk name or document id to use as a template
#
# Note: Templats design:
# section 1: signup template
# section 2: notification template
#
# Examples:
#
# [[WebSignup? &tpl=`SignupForm`]]
# Set Snippet Paths
$snipPath = (($modx->insideManager())? "../":"");
$snipPath .= "assets/snippets/";
# check if inside manager
if ($m = $modx->insideManager()) {
return ''; # don't go any further when inside manager
}
# Snippet customize settings
$tpl = isset($tpl)? $tpl:"";
# System settings
$isPostBack = count($_POST) && isset($_POST['cmdwebsignup']);
# Start processing
include_once $snipPath."weblogin/weblogin.common.inc.php";
include_once $snipPath."weblogin/websignup.inc.php";
# Return
return $output;
# WebChangePwd 1.0
# Created By Raymond Irving April, 2005
#::::::::::::::::::::::::::::::::::::::::
# Usage:
# Allows a web user to change his/her password from the website
#
# Params:
#
# &tpl - (Optional)
# Chunk name or document id to use as a template
#
# Note: Templats design:
# section 1: change pwd template
# section 2: notification template
#
# Examples:
#
# [[WebChangePwd? &tpl=`ChangePwd`]]
# Set Snippet Paths
$snipPath = (($modx->insideManager())? "../":"");
$snipPath .= "assets/snippets/";
# check if inside manager
if ($m = $modx->insideManager()) {
return ''; # don't go any further when inside manager
}
# Snippet customize settings
$tpl = isset($tpl)? $tpl:"";
# System settings
$isPostBack = count($_POST) && isset($_POST['cmdwebchngpwd']);
# Start processing
include_once $snipPath."weblogin/weblogin.common.inc.php";
include_once $snipPath."weblogin/webchangepwd.inc.php";
# Return
return $output;
<!-- #declare:separator <hr> --> <!-- login form section--> <form method="post" name="loginfrm" action="[+action+]" style="margin: 0px; padding: 0px;"> <input type="hidden" value="[+rememberme+]" name="rememberme"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><b>User:</b></td> <td><input type="text" name="username" tabindex="1" onkeypress="return webLoginEnter(document.loginfrm.password);" size="5" style="width: 100px;" value="[+username+]" /></td> </tr> <tr> <td><b>Password:</b></td> <td><input type="password" name="password" tabindex="2" onkeypress="return webLoginEnter(document.loginfrm.cmdweblogin);" size="5" style="width: 100px;" value="" /></td> </tr> <tr> <td><label for="chkbox" style="cursor:pointer">Remember me: </label></td> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><input type="checkbox" id="chkbox" name="chkbox" tabindex="4" size="1" value="" [+checkbox+] onClick="webLoginCheckRemember()" /></td> <td align="right"> <input type="submit" value="[+logintext+]" name="cmdweblogin" /></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><a href="#" onclick="webLoginShowForm(2);return false;">Forget Password?</a></td> </tr> </table> </td> </tr> </table> </form> <hr> <!-- log out hyperlink section --> <a href='[+action+]'>[+logouttext+]</a> <hr> <!-- Password reminder form section --> <form name="loginreminder" method="post" action="[+action+]" style="margin: 0px; padding: 0px;"> <input type="hidden" name="txtpwdrem" value="0" /> <table border="0"> <tr> <td>Enter the email address of your account <br />below to receive your password:</td> </tr> <tr> <td><input type="text" name="txtwebemail" size="24" /></td> </tr> <tr> <td align="right"><input type="submit" value="Submit" name="cmdweblogin" /> <input type="reset" value="Cancel" name="cmdcancel" onclick="webLoginShowForm(1);" /></td> </tr> </table> </form>
, but as Ryan said above, these snippets are packaged with the Tech Preview 1 files, and can be had from http://vertexworks.com/forums/viewtopic.php?t=196.
Thanks so much, Zi. My bad for not seeing those files in the package. Such nice people around here.... :wink: