password protect page
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
password protect page
hello everybody,
is it possible -in a simple way- to password protect a page but without using -any- plugin(s)?
(I read the articols about "members area", but that solution -unfortunatelly- did not fit my needs).
thank you in advance for your help.
is it possible -in a simple way- to password protect a page but without using -any- plugin(s)?
(I read the articols about "members area", but that solution -unfortunatelly- did not fit my needs).
thank you in advance for your help.
Re: password protect page
what else do you need? what do you mean by pasword protect page?
Members area and/or register plugin are the best solution written for CMSimple of all versions.
Members are may not work correctly with CMSimple-XH.1.6.6
Members area and/or register plugin are the best solution written for CMSimple of all versions.
Members are may not work correctly with CMSimple-XH.1.6.6
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: password protect page
hi Tata,
thank you for your answer.
as I already wrote 'members area' did not suit my needs.
I wish to password protect <h1>Test</h1> page. that's all.
can anybody help, is it any possibility to do it?
thanks.
thank you for your answer.
as I already wrote 'members area' did not suit my needs.
I wish to password protect <h1>Test</h1> page. that's all.
can anybody help, is it any possibility to do it?
thanks.
Re: password protect page
It seems to be noteworthy that you're probably looking for a solution for classic CMSimple (CMSimpe 3.2?)stargazer96 wrote:as I already wrote 'members area' did not suit my needs.
Well, a simple solution not suited for strong security requirements and somewhat inconvenient seems to be possible. Just add the following code to cmsimple/functions.php:stargazer96 wrote:I wish to password protect <h1>Test</h1> page. that's all.
can anybody help, is it any possibility to do it?
Code: Select all
$temp = 'test'; // enter real password here
if (!$adm && $su == 'Test' // enter real page URL here
&& (!isset($_GET['userpass']) || $_GET['userpass'] != $temp)
) {
$c[$s] = <<<EOS
<script type="text/javascript">
var pass = prompt("Enter password");
if (pass == "$temp") {
location = location + "&userpass=$temp";
}
</script>
EOS;
}
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: password protect page
dear Christoph,
your guess is correct
thank you very much for this simple but valuable solution!
your guess is correct
thank you very much for this simple but valuable solution!
Re: password protect page
Password cleartyped in the sourcecode?? This is an invitation.
Why not just hide the page in the menu set by page params, and publish the link of the page to the people allowed to? This protection is at least as strong and doesn't need any core hack.
Why not just hide the page in the menu set by page params, and publish the link of the page to the people allowed to? This protection is at least as strong and doesn't need any core hack.
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: password protect page
hi manu,
thank you for the observation, but it is just a simple short 'test page' (which is hided in the content file) and accesible from a -couple of- links, with not so relevant information, but not need it and not available for everybody.
I just tried to ask a simple solution for it, which Christoph -generously- resolve it.
I will check it periodically, and I will feed-back if I observe any 'strange issues'...
thanks.
thank you for the observation, but it is just a simple short 'test page' (which is hided in the content file) and accesible from a -couple of- links, with not so relevant information, but not need it and not available for everybody.
I just tried to ask a simple solution for it, which Christoph -generously- resolve it.
I will check it periodically, and I will feed-back if I observe any 'strange issues'...
thanks.
Re: password protect page
Certainly, that is bad. However, it is the same with classic CMSimple (cleartext password in config.php).manu wrote:Password cleartyped in the sourcecode?? This is an invitation.
Anyhow, I'm more concerned that the password is propagated via the URL, so it could inadvertently be posted somewhere else or maybe bookmarked. A solution similar to CMSimple's JavaScript login would be a bit better, but that requires more code, and it is still not really safe.
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 28
- Joined: Sat Jul 07, 2012 6:16 pm
- Location: Budapest, Hungary
Re: password protect page
hi Christoph,
thanks for the reply, I will not use it then, try to do something else, perhaps just hide the page as h3 title, and gave the link only to related persons.
thank you again for all of you for the observations and for the help.
thanks for the reply, I will not use it then, try to do something else, perhaps just hide the page as h3 title, and gave the link only to related persons.
thank you again for all of you for the observations and for the help.