WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Authenticator for Exchange Server LDAP
Categories : PHP, Authentication, LDAP, Security, Sessions Click here to Update Your Picture
David Perez
Date : Mar 17th 2004
Grade : 3 of 5 (graded 10 times)
Viewed : 11708
File : 3811.zip
Images : No Images for this code example.
Search : More code by David Perez
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Hi, to use this simple authenticator you only need to do this:
1.- Configure your PHP to work with register_globals Off
2.- Create a folder in your root web with name secure
3.- modify the config.php file to yours needs
4.- On every page that you need security use this ..
include ("secure/lock.php") make any changue to the path as needed
5.- go to login pague and go in...

Your exchange server must have LDAP protocol running, the
main script is this..

<?php
include ("config.php");
session_start();
{
 
$strforIMAP = "{" . $authServer . ":143}";
 
//here we can chenge to other autentications methods
 
$mbox = @imap_open($strforIMAP, $_POST['login'], $_POST['password']);
  if (
$mbox=="") $UsuarioValido = false;
  else
$UsuarioValido = true;
  @
imap_close($mbox);
  if (
$UsuarioValido==true)
    {
     
$secreto= $_SERVER['REMOTE_ADDR'] . $_POST['login'] . session_id();
     
$_SESSION['login'] = $_POST['login'];
     
$_SESSION['secreto'] = $secreto;
      if (
$_POST['urlToGo']=="") $_POST['urlToGo'] = $DefaultInURL;
     
header ("Location: HTTP://" .$ServidorName . $_POST['urlToGo']);
      exit (
0);
     }
    elseif ((
$_POST['login']=="") || ($_POST['password']==""))
     {
     
header("Location: HTTP://$ServidorName/secure/login.php?error=A0003");
      exit (
0);
     }
    else
     {
     
header("Location: HTTP://$ServidorName/secure/login.php?error=A0002");
      exit (
0);
     }
   
$cnx->close();
  }
?>


i hope this can be usefull.
David Perez



A simple PHP login script that you can modify to suite your needs. It use a session to store data in a session file submited by the page.
Categories : PHP, Sessions, Security, Authentication
Form Security - Match A Value For Success
Categories : PHP, Authentication, HTML and PHP, Sessions, Security
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Authentication script to authenticate users in Active Directory through LDAP.
Categories : LDAP, Authentication, Cookies, PHP
Simple Password example
Categories : PHP, Authentication, Security, HTTP
PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character.
Categories : PHP, Algorithms, Security, Authentication, Encryption
MD5 secured login
Categories : PHP, Java Script, Authentication, Security
A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
Session Validation Methods (Security Checks)
Categories : PHP, Sessions, Security
Password using php, Javascript, and html form
Categories : Security, PHP, Authentication, Java Script
CAPTCHA[Image verification]
Categories : PHP, Security, GD image library, Graphics, Sessions
phpSecurePages is a PHP module to secures pages with a loginname and password. It handles multiple user groups (each has own viewing rights), store data in a MySQL database or a configuration file, and can be used to identify Web site viewers.
Categories : PHP, Security, Authentication
Use of bitmasks to represent permissions
Categories : PHP, Authentication, Bitwise Operators, Security, PHP Classes
session out Timer
Categories : PHP, Sessions, Security, Beginner Guides
Password protection for Phorum 3.1.x with userlevels and log.
Categories : PHP, MySQL, Authentication, Security
 Jose Santos wrote :1060
This is very useful to security in the Web.
I`ve develloped an security system based in database, and this use XML. 
It`s very secure and improve administration, audit, autentication and another proceeds for best security. I`m used php sessions.
But LDAP, is usualy the more useful !!