Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

How to remove "Stay Logged In For" Prompt

Aloittaja jdev, kesäkuu 23, 2011, 08:32:58 AP

« edellinen - seuraava »

jdev

I've looked everywhere for this option to remove it. I don't like this feature and would like to remove it. I want my users to be log in and remain logged in until they choose to log out. I don't want them to have to specify a time to stay logged in. There's got to be an option I've overlooked to make this log in field disappear! Will someone please help me? I've gone cross-eyed trying to figure it out.

Sincerely,
jdev

Sir Osis of Liver


You can do a simple code edit to remove the input option and set the session length to Forever.  IIRC, it's in Register.template.php - would have to look for it.  Which version are you running?

When in Emor, do as the Snamors.
                              - D. Lister

jdev

I'm running 1.1.14, I believe. Whichever one is available from GoDaddy. Sorry just now seeing your reply, I forgot to hit "notify". What you said in your response was Greek to me. I know nothing of php, code, nothing.

Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister

jdev

Thank you so much for your help, but I don't even know what that is or where to find it. I was just hoping there was a check box somewhere I could check to make that go away. I don't want to go to any trouble (or you to any trouble) doing this. I really and truly appreciate your offer to help! :)

Sir Osis of Liver

AFAIK, you can't remove the option without doing a code edit in Register.template.php.  You can go to Admin -> Server Settings -> Feature Configuration and set Default login cookies length (in minutes) to a high number, which will keep your users logged in, but won't eliminate the option. 
When in Emor, do as the Snamors.
                              - D. Lister

jdev

Okay, Krash, I found the template. What do I change?? This blind squirrel just found his nut! LOL

Sir Osis of Liver


Speaking of blind squirrels , the correct file is Login.template.php.

Find this:



// Now just get the basic information - username, password, etc.
echo '
</tr><tr class="windowbg">
<td width="50%" align="right"><b>', $txt[35], ':</b></td>
<td><input type="text" name="user" size="20" value="', $context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[36], ':</b></td>
<td><input type="password" name="passwrd" value="', $context['default_password'], '" size="20" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[497], ':</b></td>
<td><input type="text" name="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '"', $context['never_expire'] ? ' disabled="disabled"' : '', ' /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[508], ':</b></td>
<td><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked="checked"' : '', ' class="check" onclick="this.form.cookielength.disabled = this.checked;" /></td>
</tr><tr class="windowbg">';
// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<td align="right"><b style="color: red;">', $txt['undelete_account'], ':</b></td>
<td><input type="checkbox" name="undelete" class="check" /></td>
</tr><tr class="windowbg">';
echo '
<td align="center" colspan="2"><input type="submit" value="', $txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr class="windowbg">
<td align="center" colspan="2" class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt[315], '</a><br /><br /></td>
</tr>
</table>

<input type="hidden" name="hash_passwrd" value="" />
</form>';




Change to this:



// Now just get the basic information - username, password, etc.
/// Remove session length options - set 'cookielength' to '-1' in hidden input to login Forever

echo '
</tr><tr class="windowbg">
<td style="padding-top:20px;" width="40%" align="right"><b>', $txt[35], ':</b></td>
<td style="padding-top:20px;"><input type="text" name="user" size="20" value="', $context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[36], ':</b></td>
<td><input type="password" name="passwrd" value="', $context['default_password'], '" size="20" /></td>
</tr>
<tr class="windowbg">';

// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<td align="right"><b style="color: red;">', $txt['undelete_account'], ':</b></td>
<td><input type="checkbox" name="undelete" class="check" /></td>
</tr><tr class="windowbg">';
echo '
<td align="center" colspan="2"><input type="submit" value="', $txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr class="windowbg">
<td align="center" colspan="2" class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt[315], '</a><br /><br /></td>
</tr>
</table>
<input type="hidden" name="cookielength" value="-1" />
<input type="hidden" name="hash_passwrd" value="" />
</form>';




This is from 1.1.13, but should be the same in .14.  It eliminates both session length prompts, sets the session length to forever, and reformats the login window.

Make a backup before you change it.
When in Emor, do as the Snamors.
                              - D. Lister

jdev

Thanks so much. It shouldn't interfere with my captcha or logic tests should it?

Sir Osis of Liver


No, it has no effect on anything but the login session length.
When in Emor, do as the Snamors.
                              - D. Lister

jdev

Okay, dang, I'm in godaddy in the files and can't find the page you said to find. So much for my nut.

jdev

Best I can find is LogInOut.php in the Sources folder.

Sir Osis of Liver


Login.template.php is in /Themes/default/, same directory where you found Register.template.php.

When in Emor, do as the Snamors.
                              - D. Lister

jdev

I actually didn't find it, I was just being hopeful.

Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister

jdev

Your quote is poppycock. Poppycock, I say.

Krash, I've looked in all my files at godaddy. Also in all the files in the actual admin section of the forum. I can't find it.

mashby

LogInOut.php is indeed in the Sources folder, so go up a folder, find Themes and then default. Do you see a Login.template.php file?
Always be a little kinder than necessary.
- James M. Barrie

jdev

All I see is LoginOut.php in godaddy. In my forum there is nothing like that.

mashby

Can you define the interface of godaddy? The file you are referencing is in the Sources folder of SMF. If you went up one level (which would be the root of wherever you have SMF installed), you should see a Themes folders and in there a default folder where the Login.template.php file should be. Could you possibly provide a screen shot of what you're looking at?
Always be a little kinder than necessary.
- James M. Barrie

Sir Osis of Liver


Do you have an FTP client?  GoDaddy's website is a nightmare, but you can access your account directly via FTP.

When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: