添加到 trunk

+YUCHENG HU+

git-svn-id: https://svn.code.sf.net/p/hawebs/svn@263 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-06-13 22:10:15 +00:00
parent 67258fb738
commit c0eab34dba
50 changed files with 2189 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,109 @@
<?php
/**
* @version $Id: remind.php 10752 2008-08-23 01:53:31Z eddieajau $
* @package Joomla
* @subpackage User
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.model');
/**
* User Component Remind Model
*
* @package Joomla
* @subpackage User
* @since 1.5
*/
class UserModelRemind extends JModel
{
/**
* Registry namespace prefix
*
* @var string
*/
var $_namespace = 'com_user.remind.';
/**
* Takes a user supplied e-mail address, looks
* it up in the database to find the username
* and then e-mails the username to the e-mail
* address given.
*
* @since 1.5
* @param string E-mail address
* @return bool True on success/false on failure
*/
function remindUsername($email)
{
jimport('joomla.mail.helper');
global $mainframe;
// Validate the e-mail address
if (!JMailHelper::isEmailAddress($email))
{
$this->setError(JText::_('INVALID_EMAIL_ADDRESS'));
return false;
}
$db = &JFactory::getDBO();
$db->setQuery('SELECT username FROM #__users WHERE email = '.$db->Quote($email), 0, 1);
// Get the username
if (!($username = $db->loadResult()))
{
$this->setError(JText::_('COULD_NOT_FIND_EMAIL'));
return false;
}
// Push the email address into the session
$mainframe->setUserState($this->_namespace.'email', $email);
// Send the reminder email
if (!$this->_sendReminderMail($email, $username))
{
return false;
}
return true;
}
/**
* Sends a username reminder to the e-mail address
* specified containing the specified username.
*
* @since 1.5
* @param string A user's e-mail address
* @param string A user's username
* @return bool True on success/false on failure
*/
function _sendReminderMail($email, $username)
{
$config = &JFactory::getConfig();
$uri = &JFactory::getURI();
$url = $uri->toString( array('scheme', 'host', 'port')).JRoute::_('index.php?option=com_user&view=login', false);
$from = $config->getValue('mailfrom');
$fromname = $config->getValue('fromname');
$subject = JText::sprintf('USERNAME_REMINDER_EMAIL_TITLE', $config->getValue('sitename'));
$body = JText::sprintf('USERNAME_REMINDER_EMAIL_TEXT', $config->getValue('sitename'), $username, $url);
if (!JUtility::sendMail($from, $fromname, $email, $subject, $body))
{
$this->setError('ERROR_SENDING_REMINDER_EMAIL');
return false;
}
return true;
}
}
@@ -0,0 +1,245 @@
<?php
/**
* @version $Id: reset.php 10919 2008-09-09 20:50:29Z willebil $
* @package Joomla
* @subpackage User
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.model');
/**
* User Component Reset Model
*
* @package Joomla
* @subpackage User
* @since 1.5
*/
class UserModelReset extends JModel
{
/**
* Registry namespace prefix
*
* @var string
*/
var $_namespace = 'com_user.reset.';
/**
* Verifies the validity of a username/e-mail address
* combination and creates a token to verify the request
* was initiated by the account owner. The token is
* sent to the account owner by e-mail
*
* @since 1.5
* @param string Username string
* @param string E-mail address
* @return bool True on success/false on failure
*/
function requestReset($email)
{
jimport('joomla.mail.helper');
jimport('joomla.user.helper');
$db = &JFactory::getDBO();
// Make sure the e-mail address is valid
if (!JMailHelper::isEmailAddress($email))
{
$this->setError(JText::_('INVALID_EMAIL_ADDRESS'));
return false;
}
// Build a query to find the user
$query = 'SELECT id FROM #__users'
. ' WHERE email = '.$db->Quote($email)
. ' AND block = 0';
$db->setQuery($query);
// Check the results
if (!($id = $db->loadResult()))
{
$this->setError(JText::_('COULD_NOT_FIND_USER'));
return false;
}
// Generate a new token
$token = JUtility::getHash(JUserHelper::genRandomPassword());
$query = 'UPDATE #__users'
. ' SET activation = '.$db->Quote($token)
. ' WHERE id = '.(int) $id
. ' AND block = 0';
$db->setQuery($query);
// Save the token
if (!$db->query())
{
$this->setError(JText::_('DATABASE_ERROR'));
return false;
}
// Send the token to the user via e-mail
if (!$this->_sendConfirmationMail($email, $token))
{
return false;
}
return true;
}
/**
* Checks a user supplied token for validity
* If the token is valid, it pushes the token
* and user id into the session for security checks.
*
* @since 1.5
* @param token An md5 hashed randomly generated string
* @return bool True on success/false on failure
*/
function confirmReset($token)
{
global $mainframe;
if(strlen($token) != 32) {
$this->setError(JText::_('INVALID_TOKEN'));
return false;
}
$db = &JFactory::getDBO();
$db->setQuery('SELECT id FROM #__users WHERE block = 0 AND activation = '.$db->Quote($token));
// Verify the token
if (!($id = $db->loadResult()))
{
$this->setError(JText::_('INVALID_TOKEN'));
return false;
}
// Push the token and user id into the session
$mainframe->setUserState($this->_namespace.'token', $token);
$mainframe->setUserState($this->_namespace.'id', $id);
return true;
}
/**
* Takes the new password and saves it to the database.
* It will only save the password if the user has the
* correct user id and token stored in her session.
*
* @since 1.5
* @param string New Password
* @param string New Password
* @return bool True on success/false on failure
*/
function completeReset($password1, $password2)
{
jimport('joomla.user.helper');
global $mainframe;
// Make sure that we have a pasword
if ( ! $password1 )
{
$this->setError(JText::_('MUST_SUPPLY_PASSWORD'));
return false;
}
// Verify that the passwords match
if ($password1 != $password2)
{
$this->setError(JText::_('PASSWORDS_DO_NOT_MATCH_LOW'));
return false;
}
// Get the necessary variables
$db = &JFactory::getDBO();
$id = $mainframe->getUserState($this->_namespace.'id');
$token = $mainframe->getUserState($this->_namespace.'token');
$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($password1, $salt);
$password = $crypt.':'.$salt;
// Get the user object
$user = new JUser($id);
// Fire the onBeforeStoreUser trigger
JPluginHelper::importPlugin('user');
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger('onBeforeStoreUser', array($user->getProperties(), false));
// Build the query
$query = 'UPDATE #__users'
. ' SET password = '.$db->Quote($password)
. ' , activation = ""'
. ' WHERE id = '.(int) $id
. ' AND activation = '.$db->Quote($token)
. ' AND block = 0';
$db->setQuery($query);
// Save the password
if (!$result = $db->query())
{
$this->setError(JText::_('DATABASE_ERROR'));
return false;
}
// Update the user object with the new values.
$user->password = $password;
$user->activation = '';
$user->password_clear = $password1;
// Fire the onAfterStoreUser trigger
$dispatcher->trigger('onAfterStoreUser', array($user->getProperties(), false, $result, $this->getError()));
// Flush the variables from the session
$mainframe->setUserState($this->_namespace.'id', null);
$mainframe->setUserState($this->_namespace.'token', null);
return true;
}
/**
* Sends a password reset request confirmation to the
* specified e-mail address with the specified token.
*
* @since 1.5
* @param string An e-mail address
* @param string An md5 hashed randomly generated string
* @return bool True on success/false on failure
*/
function _sendConfirmationMail($email, $token)
{
$config = &JFactory::getConfig();
$uri = &JFactory::getURI();
$url = JURI::base().'index.php?option=com_user&view=reset&layout=confirm';
$sitename = $config->getValue('sitename');
// Set the e-mail parameters
$from = $config->getValue('mailfrom');
$fromname = $config->getValue('fromname');
$subject = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TITLE', $sitename);
$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url);
// Send the e-mail
if (!JUtility::sendMail($from, $fromname, $email, $subject, $body))
{
$this->setError('ERROR_SENDING_CONFIRMATION_EMAIL');
return false;
}
return true;
}
}
@@ -0,0 +1,142 @@
<?php
/**
* @version $Id: user.php 10704 2008-08-21 09:38:40Z eddieajau $
* @package Joomla
* @subpackage User
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.model');
/**
* User Component User Model
*
* @package Joomla
* @subpackage User
* @since 1.5
*/
class UserModelUser extends JModel
{
/**
* User id
*
* @var int
*/
var $_id = null;
/**
* User data
*
* @var array
*/
var $_data = null;
/**
* Constructor
*
* @since 1.5
*/
function __construct()
{
parent::__construct();
$id = JRequest::getVar('id', 0, '', 'int');
$this->setId($id);
}
/**
* Method to set the weblink identifier
*
* @access public
* @param int Weblink identifier
*/
function setId($id)
{
// Set weblink id and wipe data
$this->_id = $id;
$this->_data = null;
}
/**
* Method to get a user
*
* @since 1.5
*/
function &getData()
{
// Load the weblink data
if ($this->_loadData()) {
//do nothing
}
return $this->_data;
}
/**
* Method to store the user data
*
* @access public
* @return boolean True on success
* @since 1.5
*/
function store($data)
{
$user = JFactory::getUser();
$username = $user->get('username');
// Bind the form fields to the user table
if (!$user->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store the web link table to the database
if (!$user->save()) {
$this->setError( $user->getError() );
return false;
}
$session =& JFactory::getSession();
$session->set('user', $user);
// check if username has been changed
if ( $username != $user->get('username') )
{
$table = $this->getTable('session', 'JTable');
$table->load($session->getId());
$table->username = $user->get('username');
$table->store();
}
return true;
}
/**
* Method to load user data
*
* @access private
* @return boolean True on success
* @since 1.5
*/
function _loadData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$this->_data =& JFactory::getUser();
return (boolean) $this->_data;
}
return true;
}
}
?>
@@ -0,0 +1,48 @@
<?php
/**
* @version $Id: router.php 10752 2008-08-23 01:53:31Z eddieajau $
* @package Joomla
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
function UserBuildRoute(&$query)
{
$segments = array();
if(isset($query['view']))
{
if(empty($query['Itemid'])) {
$segments[] = $query['view'];
} else {
$menu = &JSite::getMenu();
$menuItem = &$menu->getItem( $query['Itemid'] );
if(!isset($menuItem->query['view']) || $menuItem->query['view'] != $query['view']) {
$segments[] = $query['view'];
}
}
unset($query['view']);
}
return $segments;
}
function UserParseRoute($segments)
{
$vars = array();
$count = count($segments);
if(!empty($count)) {
$vars['view'] = $segments[0];
}
if($count > 1) {
$vars['id'] = $segments[$count - 1];
}
return $vars;
}
@@ -0,0 +1,28 @@
<?php
/**
* @version $Id: user.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @subpackage Users
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');
// Create the controller
$controller = new UserController();
// Perform the Request task
$controller->execute( JRequest::getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.0.0">
<name>User</name>
<author>Joomla! Project</author>
<creationDate>2006</creationDate>
<copyright>Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>1.5.0</version>
<description>User Self-Management</description>
</install>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Login">
<message><![CDATA[TYPELOGINDESC]]></message>
</view>
</metadata>
@@ -0,0 +1,8 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php if ($this->params->get( 'show_page_title', 1)) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate($this->type); ?>
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="DEFAULT LOGIN LAYOUT">
<message>
<![CDATA[DEFAULT LOGIN LAYOUT DESC]]>
</message>
</layout>
<state>
<name>Default Login Layout</name>
<description>DEFAULT LOGIN LAYOUT DESC</description>
<params>
<param name="show_login_title" type="radio" default="1" label="Show Login Page Title" description="Show/Hide the Login Page Title">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="header_login" type="text" size="30" default="" label="Login Page Title" description="PARAMPAGETITLE" />
<param name="login" type="text" size="30" default="" label="Login Redirection URL" description="PARAMLOGINURL" />
<param name="login_message" type="radio" default="0" label="Login JS Message" description="PARAMLOGINJSMESSAGE">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="description_login" type="radio" default="0" label="Login Description" description="Show/Hide the Login Description below">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="description_login_text" type="textarea" cols="30" rows="5" default="" label="Login Description Text" description="PARAMLOGINDESCTEXT" />
<param name="image_login" type="imagelist" directory="/images/stories" default="" label="Login Image" description="Image for the Login Page" />
<param name="image_login_align" type="radio" default="right" label="Login Image Align" description="Alignment for Login Image">
<option value="left">Left</option>
<option value="right">Right</option>
</param>
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="show_logout_title" type="radio" default="1" label="Show Logout Page Title" description="Show/Hide the Logout Page Title">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="header_logout" type="text" size="30" default="" label="Logout Page Title" description="PARAMLOGOUTPAGETITLE" />
<param name="logout" type="text" size="30" default="" label="Logout Redirection URL" description="PARAMLOGOUTURL" />
<param name="logout_message" type="radio" default="1" label="Logout JS Message" description="PARAMLOGOUTJSMESSAGE">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="description_logout" type="radio" default="1" label="Logout Description" description="Show/Hide the Logout Description below">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="description_logout_text" type="textarea" cols="30" rows="5" default="" label="Logout Description Text" description="PARAMLOGOUTDESCTEXT" />
<param name="image_logout" type="imagelist" directory="/images/stories" default="" label="Logout Image" description="Image for the Logout Page" />
<param name="image_logout_align" type="radio" default="1" label="Logout Image Align" description="Alignment for Logout Image">
<option value="left">Left</option>
<option value="right">Right</option>
</param>
</params>
</state>
</metadata>
@@ -0,0 +1,74 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php if(JPluginHelper::isEnabled('authentication', 'openid')) :
$lang = &JFactory::getLanguage();
$lang->load( 'plg_authentication_openid', JPATH_ADMINISTRATOR );
$langScript = 'var JLanguage = {};'.
' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'.
' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'.
' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'.
' var comlogin = 1;';
$document = &JFactory::getDocument();
$document->addScriptDeclaration( $langScript );
JHTML::_('script', 'openid.js');
endif; ?>
<form action="<?php echo JRoute::_( 'index.php', true, $this->params->get('usesecure')); ?>" method="post" name="com-login" id="com-form-login">
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="contentpane<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<tr>
<td colspan="2">
<?php if ( $this->params->get( 'show_login_title' ) ) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->params->get( 'header_login' ); ?>
</div>
<?php endif; ?>
<div>
<?php echo $this->image; ?>
<?php if ( $this->params->get( 'description_login' ) ) : ?>
<?php echo $this->params->get( 'description_login_text' ); ?>
<br /><br />
<?php endif; ?>
</div>
</td>
</tr>
</table>
<fieldset class="input">
<p id="com-form-login-username">
<label for="username"><?php echo JText::_('Username') ?></label><br />
<input name="username" id="username" type="text" class="inputbox" alt="username" size="18" />
</p>
<p id="com-form-login-password">
<label for="passwd"><?php echo JText::_('Password') ?></label><br />
<input type="password" id="passwd" name="passwd" class="inputbox" size="18" alt="password" />
</p>
<?php if(JPluginHelper::isEnabled('system', 'remember')) : ?>
<p id="com-form-login-remember">
<label for="remember"><?php echo JText::_('Remember me') ?></label>
<input type="checkbox" id="remember" name="remember" class="inputbox" value="yes" alt="Remember Me" />
</p>
<?php endif; ?>
<input type="submit" name="Submit" class="button" value="<?php echo JText::_('LOGIN') ?>" />
</fieldset>
<ul>
<li>
<a href="<?php echo JRoute::_( 'index.php?option=com_user&view=reset' ); ?>">
<?php echo JText::_('FORGOT_YOUR_PASSWORD'); ?></a>
</li>
<li>
<a href="<?php echo JRoute::_( 'index.php?option=com_user&view=remind' ); ?>">
<?php echo JText::_('FORGOT_YOUR_USERNAME'); ?></a>
</li>
<?php
$usersConfig = &JComponentHelper::getParams( 'com_users' );
if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_( 'index.php?option=com_user&view=register' ); ?>">
<?php echo JText::_('REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
<input type="hidden" name="option" value="com_user" />
<input type="hidden" name="task" value="login" />
<input type="hidden" name="return" value="<?php echo $this->return; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1,36 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php /** @todo Should this be routed */ ?>
<form action="<?php echo JRoute::_( 'index.php' ); ?>" method="post" name="login" id="login">
<?php if ( $this->params->get( 'show_logout_title' ) ) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get( 'header_logout' )); ?>
</div>
<?php endif; ?>
<table border="0" align="center" cellpadding="4" cellspacing="0" class="contentpane<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="100%">
<tr>
<td valign="top">
<div>
<?php echo $this->image; ?>
<?php
if ($this->params->get('description_logout')) :
echo $this->escape($this->params->get('description_logout_text'));
endif;
?>
</div>
</td>
</tr>
<tr>
<td align="center">
<div align="center">
<input type="submit" name="Submit" class="button" value="<?php echo JText::_( 'Logout' ); ?>" />
</div>
</td>
</tr>
</table>
<br /><br />
<input type="hidden" name="option" value="com_user" />
<input type="hidden" name="task" value="logout" />
<input type="hidden" name="return" value="<?php echo $this->return; ?>" />
</form>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="DEFAULT LAYOUT">
<message>
<![CDATA[DEFAULT LAYOUT DESC]]>
</message>
</view>
</metadata>
@@ -0,0 +1,116 @@
<?php
/**
* @version $Id: view.html.php 12352 2009-06-24 13:52:57Z ian $
* @package Joomla
* @subpackage Login
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* User component login view class
*
* @package Joomla
* @subpackage Users
* @since 1.0
*/
class UserViewLogin extends JView
{
function display($tpl = null)
{
global $mainframe, $option;
// Initialize variables
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
$pathway =& $mainframe->getPathway();
$image = '';
$menu =& JSite::getMenu();
$item = $menu->getActive();
if($item)
$params =& $menu->getParams($item->id);
else
$params =& $menu->getParams(null);
$type = (!$user->get('guest')) ? 'logout' : 'login';
// Set some default page parameters if not set
$params->def( 'show_page_title', 1 );
if (!$params->get( 'page_title')) {
$params->set('page_title', JText::_( 'Login' ));
}
if(!$item)
{
$params->def( 'header_login', '' );
$params->def( 'header_logout', '' );
}
$params->def( 'pageclass_sfx', '' );
$params->def( 'login', 'index.php' );
$params->def( 'logout', 'index.php' );
$params->def( 'description_login', 1 );
$params->def( 'description_logout', 1 );
$params->def( 'description_login_text', JText::_( 'LOGIN_DESCRIPTION' ) );
$params->def( 'description_logout_text', JText::_( 'LOGOUT_DESCRIPTION' ) );
$params->def( 'image_login', 'key.jpg' );
$params->def( 'image_logout', 'key.jpg' );
$params->def( 'image_login_align', 'right' );
$params->def( 'image_logout_align', 'right' );
$usersConfig = &JComponentHelper::getParams( 'com_users' );
$params->def( 'registration', $usersConfig->get( 'allowUserRegistration' ) );
if ( !$user->get('guest') )
{
$title = JText::_( 'Logout');
// pathway item
$pathway->addItem($title, '' );
// Set page title
$document->setTitle( $title );
}
else
{
$title = JText::_( 'Login');
// pathway item
$pathway->addItem($title, '' );
// Set page title
$document->setTitle( $title );
}
// Build login image if enabled
if ( $params->get( 'image_'.$type ) != -1 ) {
$image = 'images/stories/'.$params->get( 'image_'.$type );
$image = '<img src="'. $image .'" align="'. $params->get( 'image_'.$type.'_align' ) .'" hspace="10" alt="" />';
}
// Get the return URL
if (!$url = JRequest::getVar('return', '', 'method', 'base64')) {
$url = base64_encode($params->get($type));
}
$errors =& JError::getErrors();
$this->assign('image' , $image);
$this->assign('type' , $type);
$this->assign('return', $url);
$this->assignRef('params', $params);
parent::display($tpl);
}
}
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Register">
<message><![CDATA[TYPEREGISTERDESC]]></message>
</view>
</metadata>
@@ -0,0 +1,85 @@
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<script type="text/javascript">
<!--
Window.onDomReady(function(){
document.formvalidator.setHandler('passverify', function (value) { return ($('password').value == value); } );
});
// -->
</script>
<?php
if(isset($this->message)){
$this->display('message');
}
?>
<form action="<?php echo JRoute::_( 'index.php?option=com_user' ); ?>" method="post" id="josForm" name="josForm" class="form-validate">
<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
<?php endif; ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td width="30%" height="40">
<label id="namemsg" for="name">
<?php echo JText::_( 'Name' ); ?>:
</label>
</td>
<td>
<input type="text" name="name" id="name" size="40" value="<?php echo $this->escape($this->user->get( 'name' ));?>" class="inputbox required" maxlength="50" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="usernamemsg" for="username">
<?php echo JText::_( 'User name' ); ?>:
</label>
</td>
<td>
<input type="text" id="username" name="username" size="40" value="<?php echo $this->escape($this->user->get( 'username' ));?>" class="inputbox required validate-username" maxlength="25" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="emailmsg" for="email">
<?php echo JText::_( 'Email' ); ?>:
</label>
</td>
<td>
<input type="text" id="email" name="email" size="40" value="<?php echo $this->escape($this->user->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pwmsg" for="password">
<?php echo JText::_( 'Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-password" type="password" id="password" name="password" size="40" value="" /> *
</td>
</tr>
<tr>
<td height="40">
<label id="pw2msg" for="password2">
<?php echo JText::_( 'Verify Password' ); ?>:
</label>
</td>
<td>
<input class="inputbox required validate-passverify" type="password" id="password2" name="password2" size="40" value="" /> *
</td>
</tr>
<tr>
<td colspan="2" height="40">
<?php echo JText::_( 'REGISTER_REQUIRED' ); ?>
</td>
</tr>
</table>
<button class="button validate" type="submit"><?php echo JText::_('Register'); ?></button>
<input type="hidden" name="task" value="register_save" />
<input type="hidden" name="id" value="0" />
<input type="hidden" name="gid" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="DEFAULT REGISTER LAYOUT">
<message>
<![CDATA[DEFAULT REGISTER LAYOUT DESC]]>
</message>
</layout>
<state>
<name>DEFAULT REGISTER LAYOUT</name>
<description>DEFAULT REGISTER LAYOUT DESC</description>
</state>
</metadata>
@@ -0,0 +1,9 @@
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<div class="componentheading">
<?php echo $this->escape($this->message->title) ; ?>
</div>
<div class="message">
<?php echo $this->escape($this->message->text) ; ?>
</div>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,70 @@
<?php
/**
* @version $Id: view.html.php 11673 2009-03-08 20:41:00Z willebil $
* @package Joomla
* @subpackage Registration
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Registration component
*
* @package Joomla
* @subpackage Registration
* @since 1.0
*/
class UserViewRegister extends JView
{
function display($tpl = null)
{
global $mainframe;
// Check if registration is allowed
$usersConfig = &JComponentHelper::getParams( 'com_users' );
if (!$usersConfig->get( 'allowUserRegistration' )) {
JError::raiseError( 403, JText::_( 'Access Forbidden' ));
return;
}
$pathway =& $mainframe->getPathway();
$document =& JFactory::getDocument();
$params = &$mainframe->getParams();
// Page Title
$menus = &JSite::getMenu();
$menu = $menus->getActive();
// because the application sets a default page title, we need to get it
// right from the menu item itself
if (is_object( $menu )) {
$menu_params = new JParameter( $menu->params );
if (!$menu_params->get( 'page_title')) {
$params->set('page_title', JText::_( 'Registration' ));
}
} else {
$params->set('page_title', JText::_( 'Registration' ));
}
$document->setTitle( $params->get( 'page_title' ) );
$pathway->addItem( JText::_( 'New' ));
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
$user =& JFactory::getUser();
$this->assignRef('user', $user);
$this->assignRef('params', $params);
parent::display($tpl);
}
}
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Remind">
<message><![CDATA[TYPEREMINDDESC]]></message>
</view>
</metadata>
@@ -0,0 +1,28 @@
<?php defined('_JEXEC') or die; ?>
<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_( 'index.php?option=com_user&task=remindusername' ); ?>" method="post" class="josForm form-validate">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td colspan="2" height="40">
<p><?php echo JText::_('REMIND_USERNAME_DESCRIPTION'); ?></p>
</td>
</tr>
<tr>
<td height="40">
<label for="email" class="hasTip" title="<?php echo JText::_('REMIND_USERNAME_EMAIL_TIP_TITLE'); ?>::<?php echo JText::_('REMIND_USERNAME_EMAIL_TIP_TEXT'); ?>"><?php echo JText::_('Email Address'); ?>:</label>
</td>
<td>
<input id="email" name="email" type="text" class="required validate-email" />
</td>
</tr>
</table>
<button type="submit" class="validate"><?php echo JText::_('Submit'); ?></button>
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="DEFAULT REMIND LAYOUT">
<message>
<![CDATA[DEFAULT REMIND LAYOUT DESC]]>
</message>
</layout>
<state>
<name>DEFAULT REMIND LAYOUT</name>
<description>DEFAULT REMIND LAYOUT DESC</description>
</state>
</metadata>

Some files were not shown because too many files have changed in this diff Show More