Bij installatie krijg ik de volgende boodschap
Code:
IMPORTANT NOTES
To complete the installation you need to change your <root_dir>/includes/mambo.php, <root_dir>/modules/mod_login.php and <root_dir>/components/com_registration/com_registration.php files.
Please, MAKE A BACKUP OF THESE FILES BEFORE ANY CHANGES!!!
On mod_login.php you need to change the call when users click on "Create one" link for create a new account on your site.
You just need to change this file if you want to use integration with payment systems and for default expiration setting work properly.
Look on the file for the piece of code below and edit the line in red font, from "option=com_registration" to "option=com_acctexp".
if ( $registration_enabled ) {
?>
<tr>
<td>
<?php echo _NO_ACCOUNT; ?>
<a href="<?php echo sefRelToAbs( 'index.php?option=com_acctexp&task=register' ); ?>">
<</a>
</td>
</tr>
<?php
}
On mambo.php, first look in the begining of the file for a series of require_once instructions.
Between the last instruction and the comments stating "Class to support ..." insert (only) the lines in red, as I show below:
require_once( $mosConfig_absolute_path . "/includes/mamboxml.php" );
if (file_exists( $mosConfig_absolute_path . "/administrator/components/com_acctexp/includes/login.validate.php" ) ) {
include_once( $mosConfig_absolute_path . "/administrator/components/com_acctexp/includes/login.validate.php" );
}
/**
* Class to support function caching
Next, look for the function login, on the same file, and change it according to the code below. Remember, code that must be inserted are in RED - just a few lines including comments.
function login() {
global $acl;
$usercookie = mosGetParam( $_COOKIE, 'usercookie', '' );
$sessioncookie = mosGetParam( $_COOKIE, 'sessioncookie', '' );
$username = trim( mosGetParam( $_POST, 'username', '' ) );
$passwd = trim( mosGetParam( $_POST, 'passwd', '' ) );
if (!$username || !$passwd) {
echo "<script> alert(\""._LOGIN_INCOMPLETE."\"); window.history.go(-1); </script>\n";
exit();
} else {
$passwd = md5( $passwd );
$this->_db->setQuery( "SELECT id, gid, block, usertype"
. "\nFROM #__users"
. "\nWHERE username='$username' AND password='$passwd' AND block='0'"
);
$row = null;
if ($this->_db->loadObject( $row )) {
if ($row->block == 1) {
echo "<script>alert(\""._LOGIN_BLOCKED."\"); window.history.go(-1); </script>\n";
exit();
}
// Hack for integration with Account Expiration Component
// check if the user account has not been expired
// IMPORTANT: Remove this line BEFORE uninstall the component
loginValidate($username);
// End of code for Account Expiration Control Component
// fudge the group stuff
$grp = $acl->getAroGroup( $row->id );
$row->gid = 1;
if ($acl->is_group_child_of( $grp->name, 'Registered', 'ARO' )) {
// fudge Authors, Editors and Publishers into the Special Group
$row->gid = 2;
}
$row->usertype = $grp->name;
$session =& $this->_session;
$session->guest = 0;
$session->username = $username;
$session->userid = intval( $row->id );
$session->usertype = $row->usertype;
$session->gid = intval( $row->gid );
$session->update();
$lifetime = time() + intval( $this->getCfg( 'lifetime' ) );
setcookie( "usercookie", $session->getCookie(), $lifetime, "/" );
} else {
echo "<script>alert(\""._LOGIN_INCORRECT."\"); window.history.go(-1); </script>\n";
exit();
}
}
}
On com_registration.php, you need to disable the user link to it through browser's address bar.
Insert (only) the lines in red, as I show below:
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// // Hack for integration with Account Expiration Component - Disabling direct registration
echo "Hacking attempt.";
return;
// End of code for Account Expiration Control Component
Ik hou jullie op de hoogte