コード例 #1
0
 /**
  *retourne un membre si le login et le mot de passe passé en paramètre est connu de la base de donnée
  * @param $login
  * @param $pass
  * @return Member
  * @throws Exception
  */
 public function connection($login, $pass)
 {
     try {
         $req = "SELECT * FROM Member WHERE login = :login AND password = :pass ";
         $parameters = array('login' => array($login, PDO::PARAM_STR), 'pass' => array($pass, PDO::PARAM_STR));
         $this->conn->executeQuery($req, $parameters);
         $result = $this->conn->getResult();
         $member = new Member(null, null, null, null);
         if ($result != null) {
             foreach ($result as $r) {
                 $member->setLogin($r['login']);
                 $member->setPass($r['password']);
                 $member->setRole($r['role']);
                 $member->setEmail($r['email']);
             }
             return $member;
         } else {
             throw new Exception("Vous n'etes pas inscrit");
         }
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
 }
コード例 #2
0
ファイル: memberMapper.php プロジェクト: Wooddu/MMNZ
 public static function map(Member $member, array $properties)
 {
     if (array_key_exists('user_id', $properties)) {
         $member->setUser_id($properties['user_id']);
     }
     if (array_key_exists('username', $properties)) {
         $member->setUsername($properties['username']);
     }
     if (array_key_exists('password', $properties)) {
         $member->setPassword($properties['password']);
     }
     if (array_key_exists('first_name', $properties)) {
         $member->setFirst_name($properties['first_name']);
     }
     if (array_key_exists('last_name', $properties)) {
         $member->setLast_name($properties['last_name']);
     }
     if (array_key_exists('email', $properties)) {
         $member->setEmail($properties['email']);
     }
     if (array_key_exists('role', $properties)) {
         $member->setRole($properties['role']);
     }
 }
コード例 #3
0
ファイル: Krco.php プロジェクト: jeffhorus/sepatuku
 static function _createFakeMemberFromEmail($email)
 {
     $member = new Member();
     $member->setFirstName('Customer');
     $member->setEmail($email);
     return $member;
 }
コード例 #4
0
ファイル: setget.php プロジェクト: miyamoto-shinji/php_01
    public function regist()
    {
    }
    // 登録完了メールの送信
    public function registMail()
    {
    }
    // 会員情報の編集
    public function edit()
    {
    }
    // パスワードの再発行
    public function resendPassword()
    {
    }
    // 退会処理
    public function delete()
    {
    }
}
$member = new Member();
$member->setID("1");
$member->setLastname('あなたの姓');
$member->setFirstname('あなたの名');
$member->setEmail('あなたのメールアドレス');
$member->setPassword('パスワード');
print $member->getID() . "<BR>";
print $member->getLastname() . "<BR>";
print $member->getFirstname() . "<BR>";
print $member->getEmail() . "<BR>";
print $member->getPassword() . "<BR>";
コード例 #5
0
$mbr->setBarcodeNmbr($_POST["barcodeNmbr"]);
$_POST["barcodeNmbr"] = $mbr->getBarcodeNmbr();
$mbr->setLastChangeUserid($_SESSION["userid"]);
$mbr->setLastName($_POST["lastName"]);
$_POST["lastName"] = $mbr->getLastName();
$mbr->setFirstName($_POST["firstName"]);
$_POST["firstName"] = $mbr->getFirstName();
$mbr->setAddress($_POST["address"]);
$_POST["address"] = $mbr->getAddress();
$mbr->setHomePhone($_POST["homePhone"]);
$_POST["homePhone"] = $mbr->getHomePhone();
$mbr->setWorkPhone($_POST["workPhone"]);
$_POST["workPhone"] = $mbr->getWorkPhone();
$mbr->setCel($_POST["cel"]);
$_POST["cel"] = $mbr->getCel();
$mbr->setEmail($_POST["email"]);
$_POST["email"] = $mbr->getEmail();
$mbr->setFoto($_POST["foto"]);
$_POST["foto"] = $mbr->getFoto();
$mbr->setPassUser($_POST["passUser"]);
$_POST["passUser"] = $mbr->getPassUser();
$mbr->setBornDt($_POST["bornDt"]);
$_POST["bornDt"] = $mbr->getBornDt();
$mbr->setOther($_POST["other"]);
$_POST["other"] = $mbr->getOther();
$mbr->setClassification($_POST["classification"]);
$mbr->setStatus($_POST["status"]);
$dmQ = new DmQuery();
$dmQ->connect();
$customFields = $dmQ->getAssoc('member_fields_dm');
$dmQ->close();
コード例 #6
0
 function _mkObj($array)
 {
     $mbr = new Member();
     $mbr->setMbrid($array["mbrid"]);
     $mbr->setBarcodeNmbr($array["barcode_nmbr"]);
     $mbr->setLastChangeDt($array["last_change_dt"]);
     $mbr->setLastChangeUserid($array["last_change_userid"]);
     if (isset($array["username"])) {
         $mbr->setLastChangeUsername($array["username"]);
     }
     $mbr->setLastName($array["last_name"]);
     $mbr->setFirstName($array["first_name"]);
     $mbr->setAddress($array["address"]);
     $mbr->setHomePhone($array["home_phone"]);
     $mbr->setWorkPhone($array["work_phone"]);
     $mbr->setCel($array["cel"]);
     $mbr->setEmail($array["email"]);
     $mbr->setFoto($array["foto"]);
     //jalg foto member
     $mbr->setPassUser($array["pass_user"]);
     $mbr->setBornDt($array["born_dt"]);
     $mbr->setOther($array["other"]);
     $mbr->setClassification($array["classification"]);
     $mbr->setStatus($array["is_active"]);
     $mbr->setLastActDate($array["last_activity_dt"]);
     $mbr->_custom = $this->getCustomFields($array['mbrid']);
     return $mbr;
 }
コード例 #7
0
ファイル: MemberQuery.php プロジェクト: aimakun/odlib
 function _mkObj($array)
 {
     $mbr = new Member();
     $mbr->setMbrid($array["mbrid"]);
     $mbr->setBarcodeNmbr($array["barcode_nmbr"]);
     $mbr->setLastChangeDt($array["last_change_dt"]);
     $mbr->setLastChangeUserid($array["last_change_userid"]);
     if (isset($array["username"])) {
         $mbr->setLastChangeUsername($array["username"]);
     }
     $mbr->setLastName($array["last_name"]);
     $mbr->setFirstName($array["first_name"]);
     $mbr->setAddress($array["address"]);
     $mbr->setHomePhone($array["home_phone"]);
     $mbr->setWorkPhone($array["work_phone"]);
     $mbr->setEmail($array["email"]);
     $mbr->setClassification($array["classification"]);
     $mbr->_custom = $this->getCustomFields($array['mbrid']);
     return $mbr;
 }
コード例 #8
0
ファイル: MemberQuery.php プロジェクト: vishnu35/Granthalay
 function _mkObj($array)
 {
     $mbr = new Member();
     $mbr->setMbrid($array["mbrid"]);
     $mbr->setBarcodeNmbr($array["barcode_nmbr"]);
     $mbr->setLastChangeDt($array["last_change_dt"]);
     $mbr->setLastChangeUserid($array["last_change_userid"]);
     if (isset($array["username"])) {
         $mbr->setLastChangeUsername($array["username"]);
     }
     $mbr->setGender($array["gender"]);
     $mbr->setSchoolId($array["schoolid"]);
     $mbr->setParentName($array["parent_name"]);
     $mbr->setParentOccupation($array["parent_occupation"]);
     $mbr->setMotherTongue($array["mother_tongue"]);
     $mbr->setStandard($array["standard"]);
     $mbr->setSchoolTeacher($array["school_teacher"]);
     $mbr->setGrade($array["grade"]);
     $mbr->setLastName($array["last_name"]);
     $mbr->setFirstName($array["first_name"]);
     $mbr->setAddress($array["address"]);
     $mbr->setHomePhone($array["home_phone"]);
     $mbr->setWorkPhone($array["work_phone"]);
     $mbr->setEmail($array["email"]);
     $mbr->setClassification($array["classification"]);
     $mbr->_custom = $this->getCustomFields($array['mbrid']);
     return $mbr;
 }
コード例 #9
0
 fclose($handle);
 // Save to the database
 foreach ($rows as $row) {
     $member = new Member();
     $member->setMbrid($row['mbrid']);
     $member->setBarcodeNmbr($row['barcode_nmbr']);
     $member->setCreateDt($row['create_dt']);
     $member->setLastChangeDt($row['last_change_dt']);
     $member->setLastChangeUserid($row['last_change_userid']);
     $member->setLastName($row['last_name']);
     $member->setFirstName($row['first_name']);
     $member->setAddress($row['address']);
     $member->setHomePhone($row['home_phone']);
     $member->setWorkPhone($row['work_phone']);
     $member->setCel($row['cel']);
     $member->setEmail($row['email']);
     $member->setFoto($row['foto']);
     $member->setPassUser($row['pass_user']);
     $member->setBornDt($row['born_dt']);
     $member->setOther($row['other']);
     $member->setClassification($row['classification']);
     $member->setStatus($row['is_active']);
     $member->setLastActDate($row['last_activity_dt']);
     $mbrQ = new MemberQuery();
     $mbrQ->connect();
     $dupBarcode = $mbrQ->DupBarcode($row['barcode_nmbr']);
     if (!$dupBarcode) {
         $mbrid = $mbrQ->insert($member);
         $mbrQ->updateActivity($mbrid);
         $mbrQ->close();
     }
コード例 #10
0
 /**
  * Get Share Info - get the share info of a folder
  *
  * @param folderId - required -
  * 		Id of the folder.
  * @return The Share object containing the share folder info or the error status of the operation.
  */
 public function getShareInfo($folderId)
 {
     $urld = 'dpi/v1/folder/' . $folderId . '/share';
     $parameters = array();
     $this->response = $this->restTransportInstance->sendRequest($urld, $parameters, self::HTTP_GET, $this->authToken);
     $responseBody = simplexml_load_string($this->response);
     $returnObject = new Share();
     if ($responseBody === false) {
         $errorCode = 'N/A';
         $errorMessage = 'The server has encountered an error, please try again.';
         $errorObject = new ErrorStatus($errorCode, $errorMessage);
         $returnObject->setErrorStatus($errorObject);
     } else {
         $errorStatus = $responseBody->errorStatus;
         if (empty($errorStatus)) {
             if ($responseBody->count() > 0) {
                 $members = array();
                 foreach ($responseBody->children() as $child) {
                     $member = new Member();
                     $member->setStatus((string) $child->status);
                     $member->setCanInvite((string) $child->canInvite);
                     $member->setCanRead((string) $child->canRead);
                     $member->setCanWrite((string) $child->canWrite);
                     $member->setEmail((string) $child->email);
                     $member->setInvitationKey((string) $child->invitationKey);
                     array_push($members, $member);
                 }
                 $returnObject->setMembers($members);
             }
         } else {
             $errorCode = (string) $responseBody->errorStatus->code;
             $errorMessage = (string) $responseBody->errorStatus->message;
             $errorObject = new ErrorStatus($errorCode, $errorMessage);
             $returnObject->setErrorStatus($errorObject);
         }
     }
     return $returnObject;
 }
コード例 #11
0
ファイル: members.php プロジェクト: GiGis971/evoyage
 public function resetPassword()
 {
     $msg = '';
     $errors = array();
     $tempPass = filter_input(INPUT_GET, 'pass', FILTER_SANITIZE_URL);
     if ($tempPass == NULL || $tempPass == false) {
         $errors[] = 'Vous n\'avez pas le droit d\'accéder à cette page.';
     }
     // SI LA PREMIERE ETAPE EST PASSEE
     if (count($errors) == 0) {
         // VERIFIER QUE LE PASSE TEMPORAIRE EXISTE EN BASE
         $member = new Member();
         $member->setMdp($tempPass);
         $resultArray = $member->checkMdp();
         $msgError = "";
         for ($i = 0; $i < count($resultArray); $i++) {
             if (!$resultArray[$i]->getPassed()) {
                 $msgError .= $resultArray[$i]->getErrorMessage();
                 $msgError .= "<br/>";
             }
         }
         // SI LE PASSE TEMPORAIRE EST BIEN EN BASE
         if ($msgError == '') {
             if (filter_has_var(INPUT_POST, 'send')) {
                 $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
                 if ($email == NULL) {
                     $errors[] = 'Vous devez renseigner votre adresse email.';
                 } elseif ($email == false) {
                     $errors[] = 'L\'adresse email n\'est pas valide.';
                     $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
                 }
                 $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_SANITIZE_STRING);
                 if ($password == NULL || $password == false || empty($password)) {
                     $errors[] = 'Vous devez entrer un mot de passe.';
                 }
                 if (count($errors) == 0) {
                     $member->setMdp(md5($password));
                     $member->setEmail($email);
                     $member->replacePassword();
                     $msg .= '<div class="alert alert-success">';
                     $msg .= 'Votre mot de passe a bien été réinitialisé.';
                     $msg .= '</div>';
                     //ALLER A LA PAGE CONNEXION OU ACCUEIL
                     $msg .= '<a class="btn btn-success btnAccueil" href="index.php" title="Accueil">Accueil</a>';
                     $msg .= '<a class="btn btn-success btnAccueil" href="index.php?controller=members&action=connect" title="Connexion">Se connecter</a>';
                 } else {
                     $errors[] = 'Votre mot de passe n\'est pas réinitalisé.';
                 }
             }
         } else {
             $msg .= $msgError;
         }
     } else {
         $errors[] = '';
     }
     include 'views/members/resetPassword.php';
 }
コード例 #12
0
ファイル: create.php プロジェクト: 7373Lacym/OrgWeb
require_once './resource/config/connectDB.php';
require_once './resource/models/member.php';
if ($_POST) {
    $member = new Member($conn);
    if ($_POST["fname"] != "") {
        $member->setFname($_POST["fname"]);
    }
    if ($_POST["lname"] != "") {
        $member->setLname($_POST["lname"]);
    }
    if ($_POST["uwmemail"] != "") {
        $member->setUwmemail($_POST["uwmemail"]);
    }
    if ($_POST["email"] != "") {
        $member->setEmail($_POST["email"]);
    }
    if ($_POST["phone"] != "") {
        $member->setPhone($_POST["phone"]);
    }
    if ($_POST["major"] != "") {
        $member->setMajor($_POST["major"]);
    }
    $result = $member->create();
    if ($result) {
        $message = "<p class=\"message success\"><i class=\"material-icons\">done</i>Member created!</p>";
    } else {
        $message = "<p class=\"message error\"><i class=\"material-icons\">error</i>Error: Member was not created</p>";
    }
} else {
    $message("<p class=\"warning\"><i class=\"material-icons\">warning</i>WARNING: Cannot create member without data from POST request</p>");
コード例 #13
0
<?php

defined("_nova_district_token_") or die('');
// formulaire d'inscription
if (isset($_POST['inscription']) and isset($_POST['email']) and isset($_POST['pass'])) {
    if (Tools::checkEmail($_POST['email']) and Tools::checkPassword($_POST['pass']) and $_POST['pass'] == $_POST['pass2']) {
        $mb = new Member();
        $mb->setEmail(Tools::secure($_POST['email']));
        $mb->setPassword(Tools::secure(Tools::hash($_POST['pass'])));
        $result = UsersManager::instance()->add($mb);
        if (Tools::getParentClass($result) == "User") {
            $_SESSION['user'] = $result;
            die('<meta http-equiv="refresh" content="0;URL=app/index.php?p=welcome">');
        } else {
            if (Tools::getClass($result) == "Error") {
                $errors["inscription"] = $result;
            } else {
                $errors['inscription'] = new Error();
            }
        }
    } else {
        $errors['inscription'] = new Error("Votre email est invalide ou vos mots de passes ne sont pas identiques !");
    }
}
//On inclut la vue
include dirname(__FILE__) . '/../views/inscription.php';