예제 #1
0
function SynCcontact($employeeNumber)
{
    $ct = new contacts(null, $employeeNumber);
    $obmex = new obm_export(1);
    if ($ct->uidNumber == null) {
        write_syslog("Checking {$employeeNumber} uidNumber is null aborting, failed to import to OBM database", __FILE__);
        die;
    }
    if (preg_match("#ou=(.+?),ou=People,#", $ct->dn, $re)) {
        $uidMaster = $re[1];
        $contact = new user($uidMaster);
        if (preg_match("#(.+?)@(.+)#", $contact->mail, $re)) {
            $DomainId = GetobmDomainId($re[2]);
            write_syslog("From {$uidMaster} ({$contact->mail}) DomainId={$DomainId}", __FILE__);
        }
    }
    if (!IsUserExists($ct->uidNumber)) {
        write_syslog("Checking {$employeeNumber} ({$ct->uidNumber}) does not exists", __FILE__);
        addContact($ct, $DomainId);
    }
    editContact($ct, $DomainId);
    die;
}
예제 #2
0
<?php

include_once '../BLL/userBll.php';
include_once '../validate.php';
if (isset($_POST["Submit"]) && $_POST["Submit"] == "注册") {
    $user = $_POST["username"];
    $psw = $_POST["password"];
    $psw_confirm = $_POST["confirm"];
    if ($user == "" || $psw == "" || $psw_confirm == "") {
        echo "<script>alert('请检查输入的信息!'); history.go(-1);</script>";
    } else {
        if (pass_validate($psw) && pass_validate($psw_confirm)) {
            if ($psw == $psw_confirm) {
                if (IsUserExists($user)) {
                    echo "<script>alert('该用户已存在'); history.go(-1);</script>";
                } else {
                    $userName = $user;
                    $idNum = '';
                    $authority = 0;
                    if (Insert($psw, $user, $userName, $idNum, $authority)) {
                        session_start();
                        $_SESSION["user"] = $user;
                        echo "<script>window.location.href = 'http://2.whoisyourdaddy.sinaapp.com/index.php?s=/addon/WeiSite/WeiSite/index/publicid/154.html';</script>";
                        // echo "<a href=''>返回</a>";
                    } else {
                        echo "<script>alert('System Busy'); history.go(-1);</script>";
                    }
                }
            } else {
                echo "<script>alert('两次输入的密码不同'); history.go(-1);</script>";
            }
                     }
                 }
             } else {
                 echo "<script>alert('Different password'); history.go(-1);</script>";
             }
         } else {
             echo "<script>alert('password must be 6~20 bytes!'); history.go(-1);</script>";
         }
     }
 } else {
     if ($psw == "" || $psw_confirm == "" || $realname == "") {
         echo "<script>alert('please check the information!'); history.go(-1);</script>";
     } else {
         if (pass_validate($psw) && pass_validate($psw_confirm)) {
             if ($psw == $psw_confirm) {
                 if (IsUserExists($realname)) {
                     if (ModifyPassword($realname, $psw)) {
                         session_start();
                         $_SESSION['user'] = $realname;
                         $result = FindbyUserId($realname);
                         $identify = $result[0][4];
                         if ($identify == '') {
                             echo "<script>alert('Success,go to the index!');window.location.href = 'http://2.whoisyourdaddy.sinaapp.com/index.php?s=/addon/WeiSite/WeiSite/index/publicid/154.html';</script>";
                         } else {
                             echo "<script>alert('Success,go to the index!');window.location.href = 'http://2.whoisyourdaddy.sinaapp.com/index.php?s=/addon/WeiSite/WeiSite/index/publicid/154.html';</script>";
                         }
                         // echo "<a href=''>返回</a>";
                     } else {
                         echo "<script>alert('System Busy'); history.go(-1);</script>";
                     }
                 } else {