Hi all!
As asked by gostram, I revised the user component I'm using to do this hack. What I did, I got a fresh copy of the com_auser and mod_alogin from Alikonweb and ran a diff with the latest J!1.5.10 from SVN. Then I applied the hack explained in this thread plus added a parameter to the component to set wether it should use or not the activation by an administrator.
I'm attaching the component and the module here so everybody may benefit from it.
There are some considerations though. Since there were some security issues tackled in the user component forked by Alikonweb, and since there are a lot of redirects hard coded in the core, it is still necessary to patch some core file to make the component work as expected. Nevertheless, the patches are a lot smaller than hacking the hole core user component, so it's easier to keep track of modifications in case of an upgrade of Joomla!.
The files that need to be patched are:
- /components/com_contact/views/contact/view.html.php ==> line 63
- /components/com_content/views/article/view.html.php ==> line 86
- /components/com_content/views/article/view.pdf.php ==> line 53
- /components/com_content/views/category/view.html.php ==> line 246
- /components/com_content/views/category/tmpl/default_items.php ==> line83
- /components/com_content/views/frontpage/view.html.php ==> line 147
- /components/com_content/views/section/view.html.php ==> line 163
- /modules/mod_latestnews/helper.php ==> line 111
- /modules/mod_mostread/helper.php ==> line 81
- /modules/mod_newsflash/helper.php ==> line 44
In those files, change the reference from
Code:
index.php?option=com_user&view=login
to
Code:
index.php?option=com_auser&view=login
Also, the file /libraries/joomla/user/authorization.php must be changed in the following way:
Copy lines 61 to 69 and paste right bellow them, then change the pasted lines from com_user to com_auser. Bellow is the patched code:
Code:
// special ACl with return value to edit user
$this->addACL( 'com_user', 'edit', 'users', 'super administrator', null, null, '' );
$this->addACL( 'com_user', 'edit', 'users', 'administrator', null, null, '' );
$this->addACL( 'com_user', 'edit', 'users', 'manager', null, null, '' );
// return value defines xml setup file variant
$this->addACL( 'com_user', 'edit', 'users', 'author', null, null, 'author' );
$this->addACL( 'com_user', 'edit', 'users', 'editor', null, null, 'author' );
$this->addACL( 'com_user', 'edit', 'users', 'publisher', null, null, 'author' );
$this->addACL( 'com_user', 'edit', 'users', 'registered', null, null, 'registered' );
// special ACL with return value to edit auser
$this->addACL( 'com_auser', 'edit', 'users', 'super administrator', null, null, '' );
$this->addACL( 'com_auser', 'edit', 'users', 'administrator', null, null, '' );
$this->addACL( 'com_auser', 'edit', 'users', 'manager', null, null, '' );
// return value defines xml setup file variant
$this->addACL( 'com_auser', 'edit', 'users', 'author', null, null, 'author' );
$this->addACL( 'com_auser', 'edit', 'users', 'editor', null, null, 'author' );
$this->addACL( 'com_auser', 'edit', 'users', 'publisher', null, null, 'author' );
$this->addACL( 'com_auser', 'edit', 'users', 'registered', null, null, 'registered' );
That's all.
Don't forget to set the administration activation in the component's preferences right after installing.
Enjoy!
Attachment:
ausermanager.zip
Attachment:
mod_alogin_154.zip