IMAP Login for Question2Answer
Imap-login is an IMAP authentication mechanism for Question2Answer. In it's current form, it is intended to replace the existing Q2A login form. The script will first check user credentials through an IMAP request and fall back to the login form again if that fails. When the user exists in the email server, the script will create a new user account for the individual in the Q2A database.
To install the plugin:
Add the imap-login directory with plugin files to the qa-plugin directory for your Q2A install.
Edit imap-config.php to match your IMAP server settings. You may configure the login for more than a server, but then you should modify imap-process-login.php as appropiate.
Insert the following line of code above the if statement near line 59 of qa-include/qa-page-login.php
Insert the following line of code above the if statement near line 36 of qa-include/qa-page-logout.php
In qa-include/qa-page-account.php, make all these changes:
$inhandle=qa_post_text('handle'); ... in line 70 to ... $inhandle=$useraccount['handle'];
$inemail=qa_post_text('email'); ... in line 71 to ... $inemail=$useraccount['email'];
'handle' => array( 'handle' => array( ... ... ... in line 228 to ... 'type' => 'static', ), ),
'handle' => array( 'handle' => array( ... ... in line 231 to ... 'type' => 'static', ), ... ),
If you also want to avoid the registration of a new user, insert the following sentence in the line 31 of qa-include/qa-page-register.php
- Initial release which supports logging in through an IMAP request to an email server.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Question2Answer is a free and open source platform for Q&A sites. For more information, visit http://www.question2answer.org/