Esempio n. 1
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
if (defined('LIGHTWEIGHT_MODE')) {
    header('Location: index.php');
}
// required file
require LIB_DIR . 'admin_logon.inc.php';
// https connection (if enabled)
if ($sysconf['https_enable']) {
    simbio_security::doCheckHttps($sysconf['https_port']);
}
// check if session browser cookie already exists
if (isset($_COOKIE['admin_logged_in'])) {
    header('location: admin/index.php');
}
// start the output buffering for main content
ob_start();
// if there is login action
if (isset($_POST['logMeIn'])) {
    $username = trim(strip_tags($_POST['userName']));
    $password = trim(strip_tags($_POST['passWord']));
    if (!$username or !$password) {
        echo '<script type="text/javascript">alert(\'' . __('Please supply valid username and password') . '\');</script>';
    } else {
        // destroy previous session set in OPAC