Posted By

danworx on 10/03/10


Tagged

joomla virtuemart


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

bobbym245


Layout voor members login


 / Published in: PHP
 

URL: /httpdocs/modules/mod_virtuemart_login/mod_virtuemart_login.php

Hier bepaal je de layout voor de members login

  1. <?php
  2. if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
  3. /**
  4. * @version $Id: mod_virtuemart_login.php 1824 2009-06-24 20:08:11Z soeren_nb $
  5. * @package VirtueMart
  6. * @subpackage modules
  7. * @copyright Copyright (C) 2007 Greg Perkins. All rights reserved.
  8. * @license GNU/GPL, http://www.gnu.org/copyleft/gpl.html
  9. *
  10. * VirtueMart is free software. This version may have been modified pursuant
  11. * to the GNU General Public License, and as distributed it includes or
  12. * is derivative of works licensed under the GNU General Public License or
  13. * other free or open source software licenses.
  14. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
  15. *
  16. * http://virtuemart.net
  17. */
  18.  
  19. // TODO: Joomla! 1.5 compatibility - do these global vars depend on the legacy plugin?
  20. global $mosConfig_absolute_path, $mosConfig_allowUserRegistration;
  21.  
  22. // Load the virtuemart main parse code
  23. if( file_exists(dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' )) {
  24. require_once( dirname(__FILE__).'/../../components/com_virtuemart/virtuemart_parser.php' );
  25. } else {
  26. require_once( dirname(__FILE__).'/../components/com_virtuemart/virtuemart_parser.php' );
  27. }
  28.  
  29. global $mm_action_url, $sess, $VM_LANG;
  30.  
  31. // Show login or logout?
  32. if( vmIsJoomla(1.5) ) {
  33. $user = & JFactory::getUser();
  34. $type = (!$user->get('guest')) ? 'logout' : 'login';
  35. } else {
  36. $type = ($my->id) ? 'logout' : 'login';
  37. }
  38.  
  39. // Determine settings based on CMS version
  40. if( vmIsJoomla('1.5') ) {
  41. // Joomla 1.5
  42.  
  43. if( $type == 'login' ) {
  44. // Redirect type
  45. $redirect = $params->get('login');
  46.  
  47. // Lost password
  48. $reset_url = JRoute::_( 'index.php?option=com_user&amp;view=reset' );
  49.  
  50. // User name reminder (Joomla 1.5 only)
  51. $remind_url = JRoute::_( 'index.php?option=com_user&amp;view=remind' );
  52.  
  53. // Set the validation value
  54. $validate = JUtility::getToken();
  55. } else {
  56. // Redirect type
  57. $redirect = $params->get('logout');
  58.  
  59. // Return URL
  60. $uri = JFactory::getURI();
  61. $url = $uri->toString(array('path', 'query', 'fragment'));
  62. $return_url = base64_encode( $url );
  63.  
  64. // Set the greeting name
  65. $user =& JFactory::getUser();
  66. $name = ( $params->get( 'name') ) ? $user->name : $user->username;
  67. }
  68.  
  69. // Post action
  70. $action = $mm_action_url. 'index.php?option=com_user&amp;task='.$type;
  71.  
  72. // Set the redirection URL
  73. if( $redirect == 'home' ) {
  74. // The Joomla! home page
  75. $menu = &JSite::getMenu();
  76. $default = $menu->getDefault();
  77. $uri = JFactory::getURI( $default->link.'&Itemid='.$default->id );
  78. $url = $uri->toString(array('path', 'query', 'fragment'));
  79. } elseif( $redirect == 'vmhome' ) {
  80. // The VirtueMart home page
  81. $url = JRoute::_( 'index.php?option=com_virtuemart&amp;page='.HOMEPAGE.'&amp;Itemid='.$sess->getShopItemid(), false );
  82. } else {
  83. // The same page
  84. $uri = JFactory::getURI();
  85. $url = $uri->toString(array('path', 'query', 'fragment'));
  86. }
  87.  
  88. $return_url = base64_encode( $url );
  89.  
  90. } else {
  91. // Not Joomla 1.5
  92.  
  93. if( $type == 'login' ) {
  94. // Redirect type
  95. $redirect = $params->get('login');
  96.  
  97. // Lost password url
  98. $reset_url = sefRelToAbs( 'index.php?option=com_registration&amp;task=lostPassword&amp;Itemid='.(int)mosGetParam($_REQUEST, 'Itemid', 0) );
  99.  
  100. // Set user name reminder to nothing
  101. $remind_url = '';
  102.  
  103. // Set the validation value
  104. if( function_exists( 'josspoofvalue' ) ) {
  105. $validate = josSpoofValue(1);
  106. } else {
  107. $validate = vmSpoofValue(1);
  108. }
  109. } else {
  110. // Redirect type
  111. $redirect = $params->get('logout');
  112.  
  113. // Set the greeting name
  114. $name = ( $params->get( 'name') ) ? $my->name : $my->username;
  115. }
  116.  
  117. // Post action
  118. $action = sefRelToAbs( $mm_action_url . 'index.php?option='.$type );
  119.  
  120. // Set the redirection URL
  121. if( $redirect == 'home' ) {
  122. $url = sefRelToAbs( 'index.php' );
  123. } elseif( $redirect == 'vmhome' ) {
  124. // The VirtueMart home page
  125. $url = $sess->url( URL.'index.php?option=com_virtuemart&amp;page='.HOMEPAGE );
  126. } else {
  127. // The same page
  128. $url = $sess->url( basename($_SERVER['PHP_SELF']).'?'.mosGetParam($_SERVER,'QUERY_STRING'), true, false );
  129. }
  130.  
  131. $return_url = sefRelToAbs( $url );
  132.  
  133. }
  134.  
  135. // Registration URL
  136. $registration_url = $sess->url( SECUREURL.'index.php?option=com_virtuemart&amp;page=shop.registration' );
  137.  
  138. ?>
  139. <?php if( $type == 'logout' ) : ?>
  140. <div>
  141. <form action="<?php echo $action ?>" method="post" name="login" id="login">
  142. <?php if( $params->get('greeting') ) : ?>
  143. <div><?php echo $VM_LANG->_('HI') . ' ' . $name ?></div>
  144. <?php endif; ?>
  145. <?php if( $params->get('accountlink') || ENABLE_DOWNLOADS == '1' ) : ?>
  146. <ul>
  147. <?php if( $params->get('accountlink') ) : ?>
  148. <li><a href="<?php echo $sess->url(SECUREURL . "index.php?page=account.index");?>"><?php echo $VM_LANG->_('PHPSHOP_ACCOUNT_TITLE') ?></a></li>
  149. <?php endif; ?>
  150. <?php if( ENABLE_DOWNLOADS == '1' ) : ?>
  151. <li><a href="<?php $sess->purl(SECUREURL . "index.php?page=shop.downloads");?>"><?php echo $VM_LANG->_('PHPSHOP_DOWNLOADS_TITLE') ?></a></li>
  152. <?php endif; ?>
  153. </ul>
  154. <?php endif; ?>
  155. <input type="submit" name="Submit" class="button" value="<?php echo $VM_LANG->_('BUTTON_LOGOUT') ?>" />
  156. <br /><br />
  157. <input type="hidden" name="op2" value="logout" />
  158. <input type="hidden" name="return" value="<?php echo $return_url ?>" />
  159. <input type="hidden" name="lang" value="english" />
  160. <input type="hidden" name="message" value="0" />
  161. </form>
  162. </div>
  163. <?php else : ?>
  164. <div>
  165. <form action="<?php echo $action ?>" method="post" name="login" id="login">
  166. <?php if( $params->get('pretext') ) : ?>
  167. <?php echo $params->get('pretext'); ?>
  168. <br />
  169. <?php endif; ?>
  170. <label for="username_vmlogin"><?php echo $VM_LANG->_('USERNAME') ?></label><br/>
  171. <input class="inputbox" type="text" id="username_vmlogin" size="20" name="username" />
  172. <br />
  173. <label for="password_vmlogin"><?php echo $VM_LANG->_('PASSWORD') ?></label><br/>
  174. <input type="password" class="inputbox" id="password_vmlogin" size="20" name="passwd" />
  175. <?php if( @VM_SHOW_REMEMBER_ME_BOX == '1' ) {
  176. $remember_me_checked = $params->get('remember_me_default', 1) ? 'checked="checked"' : '';
  177. ?>
  178. <br />
  179. <label for="remember_vmlogin"><?php echo $VM_LANG->_('REMEMBER_ME') ?></label>
  180. <input type="checkbox" name="remember" id="remember_vmlogin" value="yes" <?php echo $remember_me_checked ?> />
  181. <?php } else { ?>
  182. <br />
  183. <input type="hidden" name="remember" value="yes" />
  184. <?php } ?>
  185.  
  186. <input type="submit" value="<?php echo $VM_LANG->_('BUTTON_LOGIN') ?>" class="button" name="Login" />
  187. <ul>
  188. <li><a href="<?php echo $reset_url ?>"><?php echo $VM_LANG->_('LOST_PASSWORD') ?></a></li>
  189. <?php if( $remind_url ) : ?>
  190. <?php endif; ?>
  191. <?php if( $mosConfig_allowUserRegistration == '0' ) : ?>
  192. <li><?php echo $VM_LANG->_('NO_ACCOUNT') ?> <a href="<?php echo $registration_url ?>"><?php echo $VM_LANG->_('CREATE_ACCOUNT') ?></a></li>
  193. <?php endif; ?>
  194. </ul>
  195. <input type="hidden" value="login" name="op2" />
  196. <input type="hidden" value="<?php echo $return_url ?>" name="return" />
  197. <input type="hidden" name="<?php echo $validate; ?>" value="1" />
  198. <?php echo $params->get('posttext'); ?>
  199. </form>
  200. </div>
  201. <?php endif; ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: danworx on October 3, 2010

03-10-2010: Deze is zoals toegepast op Querino.nl Optie tot registratie ontbreekt inmiddels.

You need to login to post a comment.