External Login Form

The following is a PHP code snippet that displays a login form which provides feedback without showing the Web File Share login screen. This can be used if you would like to have a custom login form integrated into your website and bypass the Web File Share login screen.

<?php
if ($_GET[['feedback']]) {
     echo base64_decode($_GET[['feedback']]);
}
?>
<form method="post" action="URL-OF-WebFileShare/?action=login&nonajax=1">
	<input type="hidden" name="redirectAfterLogin" value="<?php echo base64_encode("URL-OF-FILERUN-OR-WELCOME-PAGE") ?>">
	<input type="hidden" name="redirectOnFailure" value="<?php echo base64_encode("URL-OF-PAGE-HOSTING-THIS-FORM?") ?>">
	<label for="usr">Username:</label>
	<input type="text" name="username" value="" id="usr"/>
	<label for="pass">Password:</label>
	<input type="password" name="password" value="" id="pass" />
	<input type="submit" value="Login">
</form>

You will need to replace the following placeholders: URL-OF-WebFileShare, URL-OF-PAGE-HOSTING-THIS-FORM (leave the question mark at its end) and URL-OF-WebFileShare-OR-WELCOME-PAGE.

You can also make the login Ajax-based, in which case the HTTP request is identical, but the target URL should not contain the “&nonajax=1” part. The server response will then be in JSON format.

Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
Forcing certain file types to download
Viewed 2710 times since Thu, Mar 6, 2014
Adding links to the menu
Viewed 2502 times since Thu, Mar 6, 2014
Custom even scripts
Viewed 2548 times since Wed, Nov 22, 2017
Custom CSS
Viewed 1945 times since Wed, Nov 22, 2017
Automatic Login
Viewed 2323 times since Wed, Nov 22, 2017
Calculating MD5 Checksums
Viewed 2641 times since Thu, Mar 6, 2014
Running custom scripts when users perform various actions
Viewed 3324 times since Thu, Mar 6, 2014
Translating Web File Share
Viewed 20065 times since Wed, Mar 5, 2014
The API
Viewed 4302 times since Wed, Nov 22, 2017
Hiding options from the "Open with..." menu
Viewed 2268 times since Thu, Mar 6, 2014
MENU