Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Elxis 5.5 Calypso supports 2 factor authentication login with e-mail or SMS.
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
User Registration on Locked Site - [SOLVED]
« previous
next »
Print
Pages: [
1
]
Author
Topic: User Registration on Locked Site - [SOLVED] (Read 16438 times)
rentasite
Elxis Community
Hero Member
Posts: 3282
Web Services
User Registration on Locked Site - [SOLVED]
«
on:
November 23, 2017, 00:36:45 »
Hi. I'm developing a site that will work as locked (Website status: Online for users). I have set "User Registration: Yes" and the "Account activation: Manual by Administrator".
The purpose is the visitor to face the offline page, but to be able to Register for a user account on the site. And the admin to manually approve the registration.
How can this be done? Am i missing something? The offline page just shows the username/password fields. No ability to register.
*
I'm using IOSX - Extra pages pack for Elxis Templates
«
Last Edit: November 27, 2017, 22:03:13 by rentasite
»
Logged
Rent a Site
|
Lelevose
datahell
Elxis Team
Hero Member
Posts: 10356
Re: User Registration on Locked Site
«
Reply #1 on:
November 23, 2017, 20:24:56 »
This is opposite to the idea of the "Users only" site. However you can do it!
Here are 2 solutions:
1.
(the hard solution) Develop a special exit page that will include user registration feature. (I have developed a similar - not as you want- solution for LDAP/Gmail registration on locked sites - See
IOSX exit pages
2.
(the easy solution) Make your site available to public! Open your template's index.php and set up a redirection to component user for non logged-in users.
if ($elxis->user()->uid == 0) {
if (eFactory::getURI()->getComponent() != 'user') {
$link = $elxis->makeURL('user:register.html', '', true, false);
$elxis->redirect($link);
}
}
Explanation:
If visitor is not an Elxis user and he doesn't see component user pages then redirect him to registration page.
Tip:
As your site will be opened to visitors (even if they will only see component user) they will be able to see your menus, modules, etc. You can change the access level of these items to users only (level 2 or greater) so visitors will see almost nothing except the registration form.
«
Last Edit: November 23, 2017, 20:30:37 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
rentasite
Elxis Community
Hero Member
Posts: 3282
Web Services
Re: User Registration on Locked Site
«
Reply #2 on:
November 23, 2017, 20:49:57 »
Yes i have seen the LDAP/Gmail registration on locked sites solution.
I will proceed with the 2nd solution.
Thanks
Logged
Rent a Site
|
Lelevose
rentasite
Elxis Community
Hero Member
Posts: 3282
Web Services
Re: User Registration on Locked Site
«
Reply #3 on:
November 27, 2017, 22:02:55 »
Getting back to say that the 2nd solution works perfect!
Thanks Yianni
Logged
Rent a Site
|
Lelevose
datahell
Elxis Team
Hero Member
Posts: 10356
Re: User Registration on Locked Site - [SOLVED]
«
Reply #4 on:
November 27, 2017, 22:06:34 »
Good!
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: User Registration on Locked Site - [SOLVED]
«
Reply #5 on:
February 12, 2018, 03:12:36 »
Hi Datahell,
Can I use the code at a specific page? For example, if non-register users visit this page (
https://finteku.com/fintek-app/
) so they will be redirected to register page.
if ($elxis->user()->uid == 0) {
if (eFactory::getURI()->getComponent() != 'user') {
$link = $elxis->makeURL('user:register.html', '', true, false);
$elxis->redirect($link);
}
}
Thank you
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: User Registration on Locked Site - [SOLVED]
«
Reply #6 on:
February 12, 2018, 23:02:56 »
Wrap the code I already wrote with a check for the desired category ID.
if (defined('ELXIS_CATID') && (ELXIS_CATID ==
X
)) {
...code here...
}
Replace
X
with the id of the category you want.
To do it for article use
ELXIS_ARTID
instead.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: User Registration on Locked Site - [SOLVED]
«
Reply #7 on:
February 13, 2018, 11:27:36 »
Hi Datahell,
It works! Anyway, does it work for a component as well? For example:
https://finteku.com/topik-baru/
this link is menu to MyContent Component, I want to redirect non-register users who access that page to register page.
Thanks in advance
Regards
Komang
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: User Registration on Locked Site - [SOLVED]
«
Reply #8 on:
February 13, 2018, 14:53:58 »
Yes, it works for a component too
In this case wrap the code with this :
if (eFactory::getURI()->getComponent() == '
X
') {
... code here ...
}
Where
X
lowercase component name without "com_" prefix. In your case
mycontent
if (eFactory::getURI()->getComponent() == 'mycontent') {
... code here ...
}
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: User Registration on Locked Site - [SOLVED]
«
Reply #9 on:
February 13, 2018, 17:31:14 »
Thank you so much Datahell..it works.
You know, I tried to guess the code to do this. On your previous post, you said ELXIS_CATID for category and ELXIS_ARTID for articles, so I tried ELXIS_COMID for components... lol
«
Last Edit: February 13, 2018, 23:54:56 by komang
»
Logged
ksmtour.com
datahell
Elxis Team
Hero Member
Posts: 10356
Re: User Registration on Locked Site - [SOLVED]
«
Reply #10 on:
February 13, 2018, 19:00:17 »
It was a good guess but, unfortunately, does not work like this
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
komang
Newbie
Posts: 34
Re: User Registration on Locked Site - [SOLVED]
«
Reply #11 on:
February 14, 2018, 00:02:15 »
again, thank you Datahell
Logged
ksmtour.com
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
General
(Moderators:
Ivan Trebješanin
,
Farhad Sakhaei
) »
User Registration on Locked Site - [SOLVED]