Check out the LimeSurvey source code on GitHub!

skip log in page

More
3 years 1 month ago #102498 by Fabian
Hi!

is it possible to skip the log in page / the admin module? I use LS on a tablet offline and I´m the only user, so the log in process is not necessary. Is there a simple way to achieve this (I´m not a developer)?

cheers,
Fabian

Please Log in to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #102499 by Ben_V
Hello,

1) Create an "myaccess.php" file
2) Copy the following code and edit the 3 first variables (username, password & path)
3) Place the file somewhere on your server and access the file via your browser
<?php 
$username = 'admin';
$password = 'password';
$where = 'example.org/limesurvey';  /* yourdomain.tld/your_folder   */
?>
 
<head><title>Skip LS Login</title>
<meta charset="utf-8"><meta name="robots" content="none" />
<!--  Change for your correct path to jquery file -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
</head>
 
<form id="loginform" name="loginform" action="http://<?php echo $where ?>/index.php/admin/authentication/sa/login" method="post">
<div class='messagebox ui-corner-all'>
        <div class='header ui-widget-header'>Please log in first.</div>
        <br />
        <ul style='width: 500px; margin-left: auto; margin-right: auto'>
            <li><label for='user'>Username</label>
                <input name='user' id='user' type='text' size='40' maxlength='40' value=<?php echo $username ?>  /></li>
            <li><label for='password'>Password</label>
                <input name='password' id='password' type='password' size='40' maxlength='40' value=<?php echo $password ?> /></li>
            <li><label for='loginlang'>Language</label>
<select id='loginlang' name='loginlang' >
<option value='en' selected>English</option>
</select>
            </li>
        </ul>
    <p><input type='hidden' name='action' value='login' />
        <input class='action' type='submit' value='Login' /><br />&nbsp;
        <br/>
                    <a href='http://<?php echo $where ?>/index.php/admin/authentication/sa/forgotpassword'>Forgot your password?</a><br />&nbsp;
                </p><br />
    </div>
</form>
 
<script  type="text/javascript" >
jQuery(document).ready(function($) {
document.loginform.submit();});
</script>
 

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 3 years 1 month ago by Ben_V.

Please Log in to join the conversation.

More
3 years 1 month ago #102501 by Fabian
Hi,

thanks for your quick response!
I created the "myaccess.php" as described. When I open the file via my browser the Skip LS Login page appears. So is it still necessary to log in? The only convenience would be not entering username and password... However, when I try to log in the error message "server not found" shows up (the tablet works offline with a local webserver).

thats what I changed in the php file:
<?php
$username = 'admin';
$password = '12345';
$where = 'http://localhost:8080/bef1/limesurvey'; /* yourdomain.tld/your_folder */
?>
...

Please Log in to join the conversation.

More
3 years 1 month ago #102502 by Ben_V
replace
$where = 'http://localhost:8080/bef1/limesurvey';

with
$where = 'localhost:8080/bef1/limesurvey';

Note:
1) for jquery (only necesary for autosubmission) you can try to link to your local file:
<script type="text/javascript" src=http://<?php echo $where ?>/scripts/jquery/jquery.js></script>

2) this code normally works for ≥2.00 LS versions and must be adapted for previous releases (eg. 1.92)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: Fabian

Please Log in to join the conversation.

More
3 years 1 month ago #102503 by Fabian
works! thanks!

Please Log in to join the conversation.

More
3 years 1 month ago #102504 by Ben_V
you're welcome :)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form